transport: sqlite channel load group attribute
[abstract.git] / base / aaIncomeFlow.cpp
blob2e321abafa871fea0c8acc4b3156b097bbac7a78
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent tw=79 ft=cpp: */
3 /*
4 * Copyright (C) 2007 Sergey Yanovich <ynvich@gmail.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #include "xpcom-config.h"
24 #include "nsCOMPtr.h"
25 #include "nsStringAPI.h"
26 #include "nsServiceManagerUtils.h"
28 /* Unfrozen API */
29 #include "nsIStringBundle.h"
31 /* Project includes */
32 #include "aaIEntity.h"
33 #include "aaIResource.h"
34 #include "aaIHandler.h"
35 #include "aaIncomeFlow.h"
37 aaIncomeFlow::aaIncomeFlow()
41 aaIncomeFlow::~aaIncomeFlow()
45 NS_IMPL_ISUPPORTS3(aaIncomeFlow,
46 aaIDataNode,
47 aaIListNode,
48 aaIFlow)
49 /* aaIDataNode */
50 NS_IMETHODIMP
51 aaIncomeFlow::GetId(PRInt64 *aId)
53 NS_ENSURE_ARG_POINTER(aId);
54 *aId = 0;
55 return NS_OK;
57 NS_IMETHODIMP
58 aaIncomeFlow::SetId(PRInt64 aId)
60 return NS_ERROR_NOT_IMPLEMENTED;
63 NS_IMETHODIMP
64 aaIncomeFlow::Accept(aaIHandler* aQuery)
66 NS_ENSURE_ARG_POINTER(aQuery);
67 return aQuery->HandleFlow(this);
70 NS_IMETHODIMP
71 aaIncomeFlow::GetEdited(PRBool* aEdited)
73 NS_ENSURE_ARG_POINTER(aEdited);
74 *aEdited = PR_FALSE;
75 return NS_OK;
78 NS_IMETHODIMP
79 aaIncomeFlow::Sync(aaIStorager *aStorager, aaISqliteChannel *aChannel)
81 return NS_ERROR_NOT_IMPLEMENTED;
84 /* aaIFlow */
85 PRInt64
86 aaIncomeFlow::PickId()
88 return 0;
91 NS_IMETHODIMP
92 aaIncomeFlow::GetTag(nsAString & aTag)
94 nsresult rv;
95 nsCOMPtr<nsIStringBundleService> heap = do_GetService(
96 NS_STRINGBUNDLE_CONTRACTID, &rv);
97 NS_ENSURE_SUCCESS(rv, rv);
99 nsCOMPtr<nsIStringBundle> bundle;
100 rv = heap->CreateBundle("chrome://abstract/locale/abstract.properties",
101 getter_AddRefs( bundle ));
102 NS_ENSURE_SUCCESS(rv, rv);
104 nsAutoString w;
105 rv = bundle->GetStringFromName(NS_LITERAL_STRING("terms.profits").get(),
106 getter_Copies(w));
107 NS_ENSURE_SUCCESS(rv, rv);
109 aTag.Assign(w);
110 return NS_OK;
112 NS_IMETHODIMP
113 aaIncomeFlow::SetTag(const nsAString & aTag)
115 return NS_ERROR_NOT_IMPLEMENTED;
118 NS_IMETHODIMP
119 aaIncomeFlow::GetEntity(aaIEntity ** aEntity)
121 NS_ENSURE_ARG_POINTER(aEntity);
122 *aEntity = nsnull;
123 return NS_OK;
125 NS_IMETHODIMP
126 aaIncomeFlow::SetEntity(aaIEntity * aEntity)
128 return NS_ERROR_NOT_IMPLEMENTED;
131 NS_IMETHODIMP
132 aaIncomeFlow::GetGiveResource(aaIResource ** aGiveResource)
134 NS_ENSURE_ARG_POINTER(aGiveResource);
135 *aGiveResource = nsnull;
136 return NS_OK;
138 NS_IMETHODIMP
139 aaIncomeFlow::SetGiveResource(aaIResource * aGiveResource)
141 return NS_ERROR_NOT_IMPLEMENTED;
143 aaIResource*
144 aaIncomeFlow::PickGiveResource()
146 return nsnull;
149 NS_IMETHODIMP
150 aaIncomeFlow::GetTakeResource(aaIResource ** aTakeResource)
152 NS_ENSURE_ARG_POINTER(aTakeResource);
153 *aTakeResource = nsnull;
154 return NS_OK;
156 NS_IMETHODIMP
157 aaIncomeFlow::SetTakeResource(aaIResource * aTakeResource)
159 return NS_ERROR_NOT_IMPLEMENTED;
161 aaIResource*
162 aaIncomeFlow::PickTakeResource()
164 return nsnull;
167 NS_IMETHODIMP
168 aaIncomeFlow::GetRate(double *aRate)
170 NS_ENSURE_ARG_POINTER(aRate);
171 *aRate = 1.0;
172 return NS_OK;
174 NS_IMETHODIMP
175 aaIncomeFlow::SetRate(double aRate)
177 return NS_ERROR_NOT_IMPLEMENTED;
180 NS_IMETHODIMP
181 aaIncomeFlow::GetLimit(double *aLimit)
183 return NS_ERROR_NOT_IMPLEMENTED;
185 NS_IMETHODIMP
186 aaIncomeFlow::SetLimit(double aLimit)
188 return NS_ERROR_NOT_IMPLEMENTED;
191 NS_IMETHODIMP
192 aaIncomeFlow::GetIsOffBalance(PRBool *aIsOffBalance)
194 return NS_ERROR_NOT_IMPLEMENTED;
196 NS_IMETHODIMP
197 aaIncomeFlow::SetIsOffBalance(PRBool aIsOffBalance)
199 return NS_ERROR_NOT_IMPLEMENTED;
201 PRBool
202 aaIncomeFlow::PickIsOffBalance()
204 return PR_TRUE;
207 NS_IMETHODIMP
208 aaIncomeFlow::StoreRule(aaIRule *aRule)
210 return NS_ERROR_NOT_IMPLEMENTED;