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) 2008 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 #ifndef AATREEVIEWLEDGER_H
23 #define AATREEVIEWLEDGER_H 1
25 #define AA_TREEVIEWLEDGER_CID \
26 {0xe4baa3c6, 0xf605, 0x48e4, {0xb2, 0xbc, 0x2c, 0x04, 0x2e, 0x99, 0x37, 0xd2}}
27 #define AA_TREEVIEWLEDGER_CONTRACT "@aasii.org/view/tree-general-ledger;1"
29 #include "aaTreeView.h"
34 class aaTreeViewLedger
: public aaTreeView
38 NS_DECL_ISUPPORTS_INHERITED
40 NS_IMETHOD
GetRowCount(PRInt32
*aRowCount
);
43 NS_IMETHOD
convertSortColumnToString(nsITreeColumn
* col
, nsACString
& name
) {
44 return NS_ERROR_NOT_IMPLEMENTED
;
47 virtual ~aaTreeViewLedger();
48 friend class aaViewTest
;
50 static nsresult (*const colFuncs
[])(aaITransaction
*, PRUint32 flags
,
52 static nsresult
getColumn0(aaITransaction
*transaction
, PRUint32 flags
,
54 static nsresult
getColumn1(aaITransaction
*transaction
, PRUint32 flags
,
56 static nsresult
getColumn2(aaITransaction
*transaction
, PRUint32 flags
,
58 static nsresult
getColumn3(aaITransaction
*transaction
, PRUint32 flags
,
60 static nsresult
getColumn4(aaITransaction
*transaction
, PRUint32 flags
,
62 static nsresult
getColumn5(aaITransaction
*transaction
, PRUint32 flags
,
64 static nsresult
getColumn6(aaITransaction
*transaction
, PRUint32 flags
,
66 static nsresult
getColumn7(aaITransaction
*transaction
, PRUint32 flags
,
69 virtual nsresult
doGetCellText(PRInt32 row
, nsITreeColumn
*col
,
71 PRInt32
getIndexFromRow(PRInt32 row
) const { return row
/ 2; }
72 PRInt32
getRowFromIndex(PRInt32 row
) const { return row
* 2; }
73 PRInt32
getOffsetFromRow(PRInt32 row
) const {
74 return row
- getRowFromIndex(getIndexFromRow(row
)); }
77 #endif /* AATREEVIEWLEDGER_H */