[accounting] Add 'load chart' query (bug 86)
[abstract.git] / base / aaIncomeFlow.cpp
blobb8fc88e51d46f0e3a22d796ee301b28fe88377a7
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 "nsEmbedString.h"
27 #include "nsServiceManagerUtils.h"
29 /* Unfrozen API */
30 #include "nsIStringBundle.h"
32 /* Project includes */
33 #include "aaIEntity.h"
34 #include "aaIResource.h"
35 #include "aaIHandler.h"
36 #include "aaIncomeFlow.h"
38 aaIncomeFlow::aaIncomeFlow()
42 aaIncomeFlow::~aaIncomeFlow()
46 NS_IMPL_ISUPPORTS2(aaIncomeFlow,
47 aaIDataNode,
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 /* aaIFlow */
79 PRInt64
80 aaIncomeFlow::PickId()
82 return 0;
85 NS_IMETHODIMP
86 aaIncomeFlow::GetTag(nsAString & aTag)
88 nsresult rv;
89 nsCOMPtr<nsIStringBundleService> heap = do_GetService(
90 NS_STRINGBUNDLE_CONTRACTID, &rv);
91 NS_ENSURE_SUCCESS(rv, rv);
93 nsCOMPtr<nsIStringBundle> bundle;
94 rv = heap->CreateBundle("chrome://abstract/locale/abstract.properties",
95 getter_AddRefs( bundle ));
96 NS_ENSURE_SUCCESS(rv, rv);
98 PRUnichar *w;
99 rv = bundle->GetStringFromName(NS_LITERAL_STRING("terms.profits").get(), &w);
100 NS_ENSURE_SUCCESS(rv, rv);
102 aTag.Assign(w);
103 return NS_OK;
105 NS_IMETHODIMP
106 aaIncomeFlow::SetTag(const nsAString & aTag)
108 return NS_ERROR_NOT_IMPLEMENTED;
111 NS_IMETHODIMP
112 aaIncomeFlow::GetEntity(aaIEntity ** aEntity)
114 NS_ENSURE_ARG_POINTER(aEntity);
115 *aEntity = nsnull;
116 return NS_OK;
118 NS_IMETHODIMP
119 aaIncomeFlow::SetEntity(aaIEntity * aEntity)
121 return NS_ERROR_NOT_IMPLEMENTED;
124 NS_IMETHODIMP
125 aaIncomeFlow::GetGiveResource(aaIResource ** aGiveResource)
127 NS_ENSURE_ARG_POINTER(aGiveResource);
128 *aGiveResource = nsnull;
129 return NS_OK;
131 NS_IMETHODIMP
132 aaIncomeFlow::SetGiveResource(aaIResource * aGiveResource)
134 return NS_ERROR_NOT_IMPLEMENTED;
137 NS_IMETHODIMP
138 aaIncomeFlow::GetTakeResource(aaIResource ** aTakeResource)
140 NS_ENSURE_ARG_POINTER(aTakeResource);
141 *aTakeResource = nsnull;
142 return NS_OK;
144 NS_IMETHODIMP
145 aaIncomeFlow::SetTakeResource(aaIResource * aTakeResource)
147 return NS_ERROR_NOT_IMPLEMENTED;
150 NS_IMETHODIMP
151 aaIncomeFlow::GetRate(double *aRate)
153 NS_ENSURE_ARG_POINTER(aRate);
154 *aRate = 1.0;
155 return NS_OK;
157 NS_IMETHODIMP
158 aaIncomeFlow::SetRate(double aRate)
160 return NS_ERROR_NOT_IMPLEMENTED;
163 NS_IMETHODIMP
164 aaIncomeFlow::GetLimit(double *aLimit)
166 return NS_ERROR_NOT_IMPLEMENTED;
168 NS_IMETHODIMP
169 aaIncomeFlow::SetLimit(double aLimit)
171 return NS_ERROR_NOT_IMPLEMENTED;