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 #ifndef _SWFLDVAR_HXX 24 #define _SWFLDVAR_HXX 25 26 #include <sfx2/tabdlg.hxx> 27 #include <vcl/fixed.hxx> 28 #include <vcl/lstbox.hxx> 29 #ifndef _SV_BUTTON_HXX //autogen 30 #include <vcl/button.hxx> 31 #endif 32 #include <vcl/group.hxx> 33 #include <vcl/toolbox.hxx> 34 #include <vcl/edit.hxx> 35 36 #include "fldpage.hxx" 37 #include "condedit.hxx" 38 #include "numfmtlb.hxx" 39 40 class SwFldVarPage; 41 42 /*-------------------------------------------------------------------- 43 Beschreibung: 44 --------------------------------------------------------------------*/ 45 46 class SelectionListBox : public ListBox 47 { 48 SwFldVarPage* pDlg; 49 sal_Bool bCallAddSelection; 50 51 virtual long PreNotify( NotifyEvent& rNEvt ); 52 53 public: 54 SelectionListBox( SwFldVarPage* pDialog, const ResId& rResId ); 55 56 // Selektieren per Ctrl oder Alt erkennen und mit SelectHdl auswerten IsCallAddSelection() const57 sal_Bool IsCallAddSelection() const {return bCallAddSelection;} ResetCallAddSelection()58 void ResetCallAddSelection() {bCallAddSelection = sal_False;} 59 }; 60 61 /*-------------------------------------------------------------------- 62 Beschreibung: 63 --------------------------------------------------------------------*/ 64 65 class SwFldVarPage : public SwFldPage 66 { 67 friend class SelectionListBox; 68 69 FixedText aTypeFT; 70 ListBox aTypeLB; 71 FixedText aSelectionFT; 72 SelectionListBox aSelectionLB; 73 FixedText aNameFT; 74 Edit aNameED; 75 FixedText aValueFT; 76 ConditionEdit aValueED; 77 FixedText aFormatFT; 78 NumFormatListBox aNumFormatLB; 79 ListBox aFormatLB; 80 FixedText aChapterHeaderFT; 81 FixedText aChapterLevelFT; 82 ListBox aChapterLevelLB; 83 CheckBox aInvisibleCB; 84 FixedText aSeparatorFT; 85 Edit aSeparatorED; 86 ToolBox aNewDelTBX; 87 88 String sOldValueFT; 89 String sOldNameFT; 90 91 sal_uLong nOldFormat; 92 sal_Bool bInit; 93 94 DECL_LINK( TypeHdl, ListBox* pLB = 0 ); 95 DECL_LINK( SubTypeHdl, ListBox* pLB = 0 ); 96 DECL_LINK( ModifyHdl, Edit *pED = 0 ); 97 DECL_LINK( TBClickHdl, ToolBox *pTB = 0); 98 DECL_LINK( ChapterHdl, ListBox *pLB = 0); 99 DECL_LINK( SeparatorHdl, Edit *pED = 0 ); 100 101 void UpdateSubType(); 102 sal_uInt16 FillFormatLB(sal_uInt16 nTypeId); 103 104 protected: 105 virtual sal_uInt16 GetGroup(); 106 107 public: 108 SwFldVarPage(Window* pParent, const SfxItemSet& rSet); 109 110 ~SwFldVarPage(); 111 112 static SfxTabPage* Create(Window* pParent, const SfxItemSet& rAttrSet); 113 114 virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 115 virtual void Reset( const SfxItemSet& rSet ); 116 117 virtual void FillUserData(); 118 }; 119 120 121 #endif 122 123