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 DBAUI_TABLEFIELDDESCRIPTION_HXX 24 #define DBAUI_TABLEFIELDDESCRIPTION_HXX 25 26 #ifndef _SV_TABPAGE_HXX 27 #include <vcl/tabpage.hxx> 28 #endif 29 #ifndef DBAUI_TABLEFIELDDESCGENPAGE_HXX 30 #include "FieldDescGenWin.hxx" 31 #endif 32 #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX 33 #include "IClipBoardTest.hxx" 34 #endif 35 36 class FixedText; 37 namespace dbaui 38 { 39 class OFieldDescGenWin; 40 class OTableDesignHelpBar; 41 class OFieldDescription; 42 //================================================================== 43 // Ableitung von TabPage ist ein Trick von TH, 44 // um Aenderungen der Systemfarben zu bemerken (Bug #53905) 45 class OTableFieldDescWin : public TabPage 46 ,public IClipboardTest 47 { 48 enum ChildFocusState 49 { 50 DESCRIPTION, 51 HELP, 52 NONE 53 }; 54 private: 55 OTableDesignHelpBar* m_pHelpBar; 56 OFieldDescGenWin* m_pGenPage; 57 FixedText* m_pHeader; 58 ChildFocusState m_eChildFocus; 59 60 IClipboardTest* getActiveChild() const; 61 62 protected: 63 virtual void Resize(); 64 virtual void Paint( const Rectangle& rRect ); 65 66 public: 67 OTableFieldDescWin( Window* pParent); 68 virtual ~OTableFieldDescWin(); 69 70 virtual void Init(); 71 72 void DisplayData( OFieldDescription* pFieldDescr ); 73 void SaveData( OFieldDescription* pFieldDescr ); 74 void SetReadOnly( sal_Bool bReadOnly ); 75 76 // window overloads 77 virtual long PreNotify( NotifyEvent& rNEvt ); 78 virtual void GetFocus(); 79 virtual void LoseFocus(); 80 SetControlText(sal_uInt16 nControlId,const String & rText)81 void SetControlText( sal_uInt16 nControlId, const String& rText ) 82 { m_pGenPage->SetControlText(nControlId,rText); } GetControlText(sal_uInt16 nControlId)83 String GetControlText( sal_uInt16 nControlId ) 84 { return m_pGenPage->GetControlText(nControlId); } 85 86 // short GetFormatCategory(OFieldDescription* pFieldDescr) { return m_pGenPage ? m_pGenPage->GetFormatCategory(pFieldDescr) : -1; } 87 // liefert zum am Feld eingestellten Format einen der CAT_xxx-Werte (CAT_NUMBER, CAT_DATE ...) 88 BoolStringPersistent(const String & rUIString) const89 String BoolStringPersistent(const String& rUIString) const { return m_pGenPage->BoolStringPersistent(rUIString); } BoolStringUI(const String & rPersistentString) const90 String BoolStringUI(const String& rPersistentString) const { return m_pGenPage->BoolStringUI(rPersistentString); } 91 92 // IClipboardTest 93 virtual sal_Bool isCutAllowed(); 94 virtual sal_Bool isCopyAllowed(); 95 virtual sal_Bool isPasteAllowed(); hasChildPathFocus()96 virtual sal_Bool hasChildPathFocus() { return HasChildPathFocus(); } 97 98 virtual void copy(); 99 virtual void cut(); 100 virtual void paste(); 101 getGenPage() const102 inline OFieldDescGenWin* getGenPage() const { return m_pGenPage; } getHelpBar() const103 inline OTableDesignHelpBar* getHelpBar() const { return m_pHelpBar; } 104 105 }; 106 } 107 #endif // DBAUI_TABLEFIELDDESCRIPTION_HXX 108 109 110 111 112