Update ooo320-m1
[ooovba.git] / svtools / qa / complex / ConfigItems / helper / HistoryOptTest.hxx
blob176aa591e9fa2dcb5fd30f45e6bd0c077a970da1
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile: HistoryOptTest.hxx,v $
7 * $Revision: 1.1.4.2 $
9 * last change: $Author: as $ $Date: 2008/03/19 11:09:24 $
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 * MA 02111-1307 USA
34 ************************************************************************/
36 #ifndef SVTOOLS_HISTORYOPTTEST_HXX
37 #define SVTOOLS_HISTORYOPTTEST_HXX
39 #include <com/sun/star/container/XNameAccess.hpp>
40 #include <svtools/historyoptions.hxx>
42 namespace css = ::com::sun::star;
44 class HistoryOptTest
46 public:
48 HistoryOptTest();
49 virtual ~HistoryOptTest();
51 //---------------------------------------------------------------------
52 /** unit test of picklist */
53 void checkPicklist();
55 //---------------------------------------------------------------------
56 /** unit test of URL list */
57 void checkURLHistory();
59 //---------------------------------------------------------------------
60 /** unit test of Help bookmarks */
61 void checkHelpBookmarks();
63 private:
65 //---------------------------------------------------------------------
66 /** test every well known history list in the same way.
67 * Only the count of created and tested items can be defined from outside
68 * e.g. usefull for stress tests.
70 * @param eHistory
71 * specify the history list for testing.
73 * @param nMaxItems
74 * max count of new created and tested history items.
76 void impl_testHistory(EHistoryType eHistory ,
77 ::sal_Int32 nMaxItems);
79 //---------------------------------------------------------------------
80 /** try to clear the whole list and check the results.
81 * If list could not be cleared successfully an exception is thrown.
83 void impl_clearList();
85 //---------------------------------------------------------------------
86 /** define a new size for the current list and check the results.
87 * Note: The given size must match against the defined constraints.
88 * That must be checked before this method is called.
90 * @param nSize
91 * the new size.
93 void impl_setSize(::sal_Int32 nSize);
95 //---------------------------------------------------------------------
96 /** create a new item (means it's properties using a special schema using the
97 * item id).
99 * Note: This method does not check if creation was successfully.
100 * Therefore exists more specialized method impl_existsItem()
101 * and impl_existsItemAtPosition().
103 * @param nItem
104 * id of the item
106 void impl_appendItem(::sal_Int32 nItem);
108 //---------------------------------------------------------------------
109 /** check if an entry for given item id realy exists (in memory and xcu file).
111 * @param nItem
112 * id of the item
114 * @return true if item exists - false otherwise.
116 ::sal_Bool impl_existsItem(::sal_Int32 nItem);
118 //---------------------------------------------------------------------
119 /** check if an entry for given item id realy exists (in memory and xcu file).
120 * Further it checks if the requested item is placed at the also specified
121 * position inside history list.
123 * @param nItem
124 * id of the item
126 * @param nIndex
127 * expected position of item inside history list.
129 * @return true if item exists at right position - false otherwise.
131 ::sal_Bool impl_existsItemAtIndex(::sal_Int32 nItem ,
132 ::sal_Int32 nIndex);
134 //---------------------------------------------------------------------
135 /** create an URL suitable for the given item id.
137 * @param nItem
138 * id of the item
140 * @return the new created URL.
142 ::rtl::OUString impl_createItemURL(::sal_Int32 nItem);
144 //---------------------------------------------------------------------
145 /** create a title suitable for the given item id.
147 * @param nItem
148 * id of the item
150 * @return the new created title.
152 ::rtl::OUString impl_createItemTitle(::sal_Int32 nItem);
154 //---------------------------------------------------------------------
155 /** create a password suitable for the given item id.
157 * @param nItem
158 * id of the item
160 * @return the new created password.
162 ::rtl::OUString impl_createItemPassword(::sal_Int32 nItem);
164 //---------------------------------------------------------------------
165 /** returns direct access to the item list inside histories.xcu
166 * suitable for the current defined list type (m_eList).
168 * @return reference to the item list configuration
170 css::uno::Reference< css::container::XNameAccess > impl_getItemList();
172 //---------------------------------------------------------------------
173 /** returns direct access to the order list inside histories.xcu
174 * suitable for the current defined list type (m_eList).
176 * @return reference to the order list configuration
178 css::uno::Reference< css::container::XNameAccess > impl_getOrderList();
180 //---------------------------------------------------------------------
181 /** returns direct access to the history list inside histories.xcu
182 * suitable for the current defined list type (m_eList).
184 * @return reference to the history list configuration
186 css::uno::Reference< css::container::XNameAccess > impl_getNewHistory();
188 //---------------------------------------------------------------------
189 /** returns direct access to the history config inside common.xcu
190 * suitable for the current defined list type (m_eList).
192 * @return reference to the history configuration
194 css::uno::Reference< css::container::XNameAccess > impl_getOldHistory();
196 private:
198 // the config item which should be tested here
199 SvtHistoryOptions m_aConfigItem;
201 // defines the special list for testing (picklist, history or url list)
202 EHistoryType m_eList;
204 // underlying configuration of the tested config items for cross over checks
205 css::uno::Reference< css::container::XNameAccess > m_xHistoriesXCU;
207 // underlying configuration of the tested config items for cross over checks
208 css::uno::Reference< css::container::XNameAccess > m_xCommonXCU;
211 #endif // #ifndef SVTOOLS_HISTORYOPTTEST_HXX