xref: /aoo41x/main/sw/source/ui/inc/gloslst.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _GLOSLST_HXX
25 #define _GLOSLST_HXX
26 
27 
28 #include <tools/datetime.hxx>
29 #include <tools/string.hxx>
30 #include <vcl/timer.hxx>
31 #include <svl/svarray.hxx>
32 
33 class SwGlossaries;
34 class SvStringsISortDtor;
35 
36 struct AutoTextGroup
37 {
38 	sal_uInt16 		nCount;
39 	String 		sName;
40 	String  	sTitle;
41 	String		sLongNames;   // durch 0x0A getrennte Langnamen
42 	String 		sShortNames;  // durch 0x0A getrennte Kurznamen
43 	DateTime	aDateModified;
44 };
45 
46 
47 typedef AutoTextGroup* AutoTextGroupPtr;
48 SV_DECL_PTRARR(AutoTextGroups, AutoTextGroupPtr, 4, 4)
49 
50 class SwGlossaryList : public AutoTimer
51 {
52 	AutoTextGroups	aGroupArr;
53 	String			sPath;
54 	sal_Bool 			bFilled;
55 
56 	AutoTextGroup*	FindGroup(const String& rGroupName);
57 	void			FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGloss);
58 
59 public:
60 		SwGlossaryList();
61 		~SwGlossaryList();
62 
63 	sal_Bool			HasLongName(const String& rBegin, SvStringsISortDtor* pLongNames );
64 	sal_Bool			GetShortName(const String& rLongName,
65 										String& rShortName, String& rGroupName );
66 
67 	sal_uInt16 			GetGroupCount();
68 	String			GetGroupName(sal_uInt16 nPos, sal_Bool bNoPath = sal_True, String* pTitle = 0);
69 	sal_uInt16 			GetBlockCount(sal_uInt16 nGroup);
70 	String			GetBlockName(sal_uInt16 nGroup, sal_uInt16 nBlock, String& rShortName);
71 
72 	void			Update();
73 
74 	virtual void	Timeout();
75 
76 	void			ClearGroups();
77 };
78 
79 #endif
80 
81 
82 
83 
84 
85 
86