Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _OUTLINE_HXX
20 : #define _OUTLINE_HXX
21 :
22 : #include <sfx2/tabdlg.hxx>
23 :
24 :
25 : #include <vcl/menu.hxx>
26 :
27 : #include <vcl/button.hxx>
28 : #include <svtools/stdctrl.hxx>
29 :
30 : #include <vcl/fixed.hxx>
31 :
32 : #include <vcl/lstbox.hxx>
33 :
34 : #include <vcl/edit.hxx>
35 :
36 : #include <vcl/field.hxx>
37 :
38 : #include "swtypes.hxx" //for MAXLEVEL
39 : #include <numprevw.hxx>
40 : #include <numberingtypelistbox.hxx>
41 :
42 : class SwWrtShell;
43 : class SwNumRule;
44 : class SwChapterNumRules;
45 :
46 : class SwOutlineTabDialog : public SfxTabDialog
47 : {
48 : static sal_uInt16 nNumLevel;
49 :
50 : String aNullStr;
51 : String aCollNames[MAXLEVEL];
52 : PopupMenu aFormMenu;
53 :
54 : SwWrtShell& rWrtSh;
55 : SwNumRule* pNumRule;
56 : SwChapterNumRules* pChapterNumRules;
57 :
58 : sal_Bool bModified : 1;
59 :
60 : protected:
61 : DECL_LINK(CancelHdl, void *);
62 : DECL_LINK( FormHdl, Button * );
63 : DECL_LINK( MenuSelectHdl, Menu * );
64 :
65 : virtual void PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage);
66 : virtual short Ok();
67 :
68 : public:
69 : SwOutlineTabDialog(Window* pParent,
70 : const SfxItemSet* pSwItemSet,
71 : SwWrtShell &);
72 : ~SwOutlineTabDialog();
73 :
74 0 : SwNumRule* GetNumRule() {return pNumRule;}
75 : sal_uInt16 GetLevel(const String &rFmtName) const;
76 0 : String* GetCollNames() {return aCollNames;}
77 :
78 0 : static sal_uInt16 GetActNumLevel() {return nNumLevel;}
79 0 : static void SetActNumLevel(sal_uInt16 nSet) {nNumLevel = nSet;}
80 : };
81 :
82 : class SwOutlineSettingsTabPage : public SfxTabPage
83 : {
84 : ListBox* m_pLevelLB;
85 :
86 : ListBox* m_pCollBox;
87 : SwNumberingTypeListBox* m_pNumberBox;
88 : ListBox* m_pCharFmtLB;
89 : FixedText* m_pAllLevelFT;
90 : NumericField* m_pAllLevelNF;
91 : Edit* m_pPrefixED;
92 : Edit* m_pSuffixED;
93 : NumericField* m_pStartEdit;
94 : NumberingPreview* m_pPreviewWIN;
95 :
96 : String aNoFmtName;
97 : String aSaveCollNames[MAXLEVEL];
98 : SwWrtShell* pSh;
99 : SwNumRule* pNumRule;
100 : String* pCollNames;
101 : sal_uInt16 nActLevel;
102 :
103 : DECL_LINK( LevelHdl, ListBox * );
104 : DECL_LINK( ToggleComplete, NumericField * );
105 : DECL_LINK( CollSelect, ListBox * );
106 : DECL_LINK(CollSelectGetFocus, void *);
107 : DECL_LINK( NumberSelect, SwNumberingTypeListBox * );
108 : DECL_LINK(DelimModify, void *);
109 : DECL_LINK( StartModified, NumericField * );
110 : DECL_LINK(CharFmtHdl, void *);
111 :
112 : void Update();
113 :
114 0 : void SetModified(){m_pPreviewWIN->Invalidate();}
115 : void CheckForStartValue_Impl(sal_uInt16 nNumberingType);
116 :
117 : using SfxTabPage::ActivatePage;
118 : using SfxTabPage::DeactivatePage;
119 :
120 : public:
121 : SwOutlineSettingsTabPage(Window* pParent, const SfxItemSet& rSet);
122 : ~SwOutlineSettingsTabPage();
123 :
124 : void SetWrtShell(SwWrtShell* pShell);
125 :
126 : virtual void ActivatePage(const SfxItemSet& rSet);
127 : virtual int DeactivatePage(SfxItemSet *pSet);
128 :
129 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
130 : virtual void Reset( const SfxItemSet& rSet );
131 : static SfxTabPage* Create( Window* pParent,
132 : const SfxItemSet& rAttrSet);
133 : };
134 :
135 : #endif
136 :
137 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|