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: */
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>
25 #include "nsEmbedString.h"
27 /* Project includes */
28 #include <abstract/base/aaIFlow.h>
29 #include <abstract/base/aaIObject.h>
30 #include <abstract/base/aaITimeframe.h>
31 #include <abstract/base/aaIFact.h>
32 #include <abstract/base/aaIQuery.h>
43 NS_IMPL_ISUPPORTS2(aaFact
,
49 aaFact::GetId(PRInt64
*aId
)
51 NS_ENSURE_ARG_POINTER(aId
);
56 aaFact::SetId(PRInt64 aId
)
63 aaFact::Accept(aaIQuery
* aQuery
)
65 NS_ENSURE_ARG_POINTER(aQuery
);
66 return aQuery
->QueryFact(this);
70 aaFact::GetEdited(PRBool
* aEdited
)
72 NS_ENSURE_ARG_POINTER(aEdited
);
80 aaFact::GetTakeFrom(aaIFlow
* *aTakeFrom
)
82 NS_ENSURE_ARG_POINTER( aTakeFrom
);
83 NS_IF_ADDREF( *aTakeFrom
= mTakeFrom
);
87 aaFact::SetTakeFrom(aaIFlow
*aTakeFrom
)
89 mTakeFrom
= aTakeFrom
;
94 aaFact::GetGiveTo(aaIFlow
* *aGiveTo
)
96 NS_ENSURE_ARG_POINTER( aGiveTo
);
97 NS_IF_ADDREF( *aGiveTo
= mGiveTo
);
101 aaFact::SetGiveTo(aaIFlow
*aGiveTo
)
108 aaFact::GetTimeframe(aaITimeframe
* *aTimeframe
)
110 NS_ENSURE_ARG_POINTER( aTimeframe
);
111 NS_IF_ADDREF( *aTimeframe
= mTimeframe
);
116 aaFact::SetTimeframe(aaITimeframe
*aTimeframe
)
118 mTimeframe
= aTimeframe
;
123 aaFact::GetAmount(double *aAmount
)
125 NS_ENSURE_ARG_POINTER( aAmount
);
131 aaFact::SetAmount(double aAmount
)