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 "nsComponentManagerUtils.h"
28 #include "unstable/nsISHEntry.h"
29 #include "unstable/nsISHContainer.h"
31 /* Project includes */
32 #include <abstract/base/aaIDataNode.h>
33 #include <abstract/view/aaIPageView.h>
34 #include "aaPageView.h"
36 aaPageView::aaPageView(nsISupports
*aOuter
)
37 :mIndex(-1), mChoosingSet(PR_FALSE
), mChoosing(PR_FALSE
)
39 mSHE
= do_QueryInterface(aOuter
);
40 mSHC
= do_QueryInterface(aOuter
);
43 aaPageView::~aaPageView()
47 NS_IMPL_ISUPPORTS4(aaPageView
,
54 aaPageView::GetBuffer(aaIDataNode
* *aBuffer
)
56 NS_ENSURE_ARG_POINTER(aBuffer
);
57 NS_IF_ADDREF(*aBuffer
= mBuffer
);
61 aaPageView::SetBuffer(aaIDataNode
*aBuffer
)
68 aaPageView::GetIndex(PRInt32
*aIndex
)
70 NS_ENSURE_ARG_POINTER( aIndex
);
75 aaPageView::SetIndex(PRInt32 aIndex
)
82 aaPageView::GetQueryChoice(nsISupports
* *aQueryChoice
)
84 NS_ENSURE_ARG_POINTER(aQueryChoice
);
85 NS_IF_ADDREF(*aQueryChoice
= mQueryChoice
);
89 aaPageView::SetQueryChoice(nsISupports
*aQueryChoice
)
91 mQueryChoice
= aQueryChoice
;
96 aaPageView::GetChoosing(PRBool
*aChoosing
)
98 NS_ENSURE_ARG_POINTER( aChoosing
);
99 *aChoosing
= mChoosing
;
103 aaPageView::SetChoosing(PRBool aChoosing
)
106 return NS_ERROR_ALREADY_INITIALIZED
;
107 mChoosingSet
= PR_TRUE
;
108 mChoosing
= aChoosing
;