1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef DBAUI_TABLEFIELDDESCRIPTION_HXX
28 #define DBAUI_TABLEFIELDDESCRIPTION_HXX
29 
30 #ifndef _SV_TABPAGE_HXX
31 #include <vcl/tabpage.hxx>
32 #endif
33 #ifndef DBAUI_TABLEFIELDDESCGENPAGE_HXX
34 #include "FieldDescGenWin.hxx"
35 #endif
36 #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX
37 #include "IClipBoardTest.hxx"
38 #endif
39 
40 class FixedText;
41 namespace dbaui
42 {
43 	class OFieldDescGenWin;
44 	class OTableDesignHelpBar;
45 	class OFieldDescription;
46 	//==================================================================
47 	// Ableitung von TabPage ist ein Trick von TH,
48 	// um Aenderungen der Systemfarben zu bemerken (Bug #53905)
49 	class OTableFieldDescWin : public TabPage
50 								,public IClipboardTest
51 	{
52 		enum ChildFocusState
53 		{
54 			DESCRIPTION,
55 			HELP,
56 			NONE
57 		};
58 	private:
59 		OTableDesignHelpBar*	m_pHelpBar;
60 		OFieldDescGenWin*		m_pGenPage;
61 		FixedText*				m_pHeader;
62 		ChildFocusState			m_eChildFocus;
63 
64 		IClipboardTest* getActiveChild() const;
65 
66 	protected:
67 		virtual void Resize();
68 		virtual void Paint( const Rectangle& rRect );
69 
70 	public:
71 		OTableFieldDescWin( Window* pParent);
72 		virtual ~OTableFieldDescWin();
73 
74 		virtual void Init();
75 
76 		void DisplayData( OFieldDescription* pFieldDescr );
77 		void SaveData( OFieldDescription* pFieldDescr );
78 		void SetReadOnly( sal_Bool bReadOnly );
79 
80 		// window overloads
81 		virtual long PreNotify( NotifyEvent& rNEvt );
82 		virtual void GetFocus();
83 		virtual void LoseFocus();
84 
85 		void SetControlText( sal_uInt16 nControlId, const String& rText )
86 				{ m_pGenPage->SetControlText(nControlId,rText); }
87 		String GetControlText( sal_uInt16 nControlId )
88 				{ return m_pGenPage->GetControlText(nControlId); }
89 
90 		//	short GetFormatCategory(OFieldDescription* pFieldDescr) { return m_pGenPage ? m_pGenPage->GetFormatCategory(pFieldDescr) : -1; }
91 			// liefert zum am Feld eingestellten Format einen der CAT_xxx-Werte (CAT_NUMBER, CAT_DATE ...)
92 
93 		String	BoolStringPersistent(const String& rUIString) const { return m_pGenPage->BoolStringPersistent(rUIString); }
94 		String	BoolStringUI(const String& rPersistentString) const { return m_pGenPage->BoolStringUI(rPersistentString); }
95 
96 		// IClipboardTest
97 		virtual sal_Bool isCutAllowed();
98 		virtual sal_Bool isCopyAllowed();
99 		virtual sal_Bool isPasteAllowed();
100 		virtual sal_Bool hasChildPathFocus() { return HasChildPathFocus(); }
101 
102 		virtual void copy();
103 		virtual void cut();
104 		virtual void paste();
105 
106 		inline OFieldDescGenWin* getGenPage() const { return m_pGenPage; }
107 		inline OTableDesignHelpBar*	getHelpBar() const { return m_pHelpBar; }
108 
109 	};
110 }
111 #endif // DBAUI_TABLEFIELDDESCRIPTION_HXX
112 
113 
114 
115 
116