[app] Display 'transaction.value' after completion (bug #25)
[abstract.git] / base / aaIncomeFlow.cpp
blob670dd6c9e4aee14be4ed778f884a8939c920f689
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 <abstract/aacore.h>
24 #include "nsCOMPtr.h"
25 #include "nsStringAPI.h"
26 #include "nsEmbedString.h"
27 #include "nsServiceManagerUtils.h"
29 /* Unfrozen API */
30 #include "unstable/nsIStringBundle.h"
32 /* Project includes */
33 #include <abstract/base/aaIEntity.h>
34 #include <abstract/base/aaIResource.h>
35 #include <abstract/base/aaIFlow.h>
36 #include <abstract/base/aaIHandler.h>
37 #include "aaIncomeFlow.h"
39 aaIncomeFlow::aaIncomeFlow()
43 aaIncomeFlow::~aaIncomeFlow()
47 NS_IMPL_ISUPPORTS2(aaIncomeFlow,
48 aaIDataNode,
49 aaIFlow)
50 /* aaIDataNode */
51 NS_IMETHODIMP
52 aaIncomeFlow::GetId(PRInt64 *aId)
54 NS_ENSURE_ARG_POINTER(aId);
55 *aId = 0;
56 return NS_OK;
58 NS_IMETHODIMP
59 aaIncomeFlow::SetId(PRInt64 aId)
61 return NS_ERROR_NOT_IMPLEMENTED;
64 NS_IMETHODIMP
65 aaIncomeFlow::Accept(aaIHandler* aQuery)
67 NS_ENSURE_ARG_POINTER(aQuery);
68 return aQuery->HandleFlow(this);
71 NS_IMETHODIMP
72 aaIncomeFlow::GetEdited(PRBool* aEdited)
74 NS_ENSURE_ARG_POINTER(aEdited);
75 *aEdited = PR_FALSE;
76 return NS_OK;
79 /* aaIFlow */
80 PRInt64
81 aaIncomeFlow::PickId()
83 return 0;
86 NS_IMETHODIMP
87 aaIncomeFlow::GetTag(nsAString & aTag)
89 nsresult rv;
90 nsCOMPtr<nsIStringBundleService> heap = do_GetService(
91 NS_STRINGBUNDLE_CONTRACTID, &rv);
92 NS_ENSURE_SUCCESS(rv, rv);
94 nsCOMPtr<nsIStringBundle> bundle;
95 rv = heap->CreateBundle("chrome://abstract/locale/abstract.properties",
96 getter_AddRefs( bundle ));
97 NS_ENSURE_SUCCESS(rv, rv);
99 PRUnichar *w;
100 rv = bundle->GetStringFromName(NS_LITERAL_STRING("terms.profits").get(), &w);
101 NS_ENSURE_SUCCESS(rv, rv);
103 aTag.Assign(w);
104 return NS_OK;
106 NS_IMETHODIMP
107 aaIncomeFlow::SetTag(const nsAString & aTag)
109 return NS_ERROR_NOT_IMPLEMENTED;
112 NS_IMETHODIMP
113 aaIncomeFlow::GetEntity(aaIEntity ** aEntity)
115 NS_ENSURE_ARG_POINTER(aEntity);
116 *aEntity = nsnull;
117 return NS_OK;
119 NS_IMETHODIMP
120 aaIncomeFlow::SetEntity(aaIEntity * aEntity)
122 return NS_ERROR_NOT_IMPLEMENTED;
125 NS_IMETHODIMP
126 aaIncomeFlow::GetGiveResource(aaIResource ** aGiveResource)
128 NS_ENSURE_ARG_POINTER(aGiveResource);
129 *aGiveResource = nsnull;
130 return NS_OK;
132 NS_IMETHODIMP
133 aaIncomeFlow::SetGiveResource(aaIResource * aGiveResource)
135 return NS_ERROR_NOT_IMPLEMENTED;
138 NS_IMETHODIMP
139 aaIncomeFlow::GetTakeResource(aaIResource ** aTakeResource)
141 NS_ENSURE_ARG_POINTER(aTakeResource);
142 *aTakeResource = nsnull;
143 return NS_OK;
145 NS_IMETHODIMP
146 aaIncomeFlow::SetTakeResource(aaIResource * aTakeResource)
148 return NS_ERROR_NOT_IMPLEMENTED;
151 NS_IMETHODIMP
152 aaIncomeFlow::GetRate(double *aRate)
154 return NS_ERROR_NOT_IMPLEMENTED;
156 NS_IMETHODIMP
157 aaIncomeFlow::SetRate(double aRate)
159 return NS_ERROR_NOT_IMPLEMENTED;
162 NS_IMETHODIMP
163 aaIncomeFlow::GetLimit(double *aLimit)
165 return NS_ERROR_NOT_IMPLEMENTED;
167 NS_IMETHODIMP
168 aaIncomeFlow::SetLimit(double aLimit)
170 return NS_ERROR_NOT_IMPLEMENTED;