xref: /trunk/main/dbaccess/source/ui/inc/sqledit.hxx (revision 2e2212a7)
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_SQLEDIT_HXX
24 #define DBAUI_SQLEDIT_HXX
25 
26 #include <svtools/editsyntaxhighlighter.hxx>
27 #include <svl/lstner.hxx>
28 #include <svtools/colorcfg.hxx>
29 #include <unotools/sourceviewconfig.hxx>
30 
31 namespace dbaui
32 {
33 	class OQueryTextView;
34     class OSqlEdit : public MultiLineEditSyntaxHighlight, utl::ConfigurationListener
35 	{
36 	private:
37 		Timer					m_timerInvalidate;
38 		Timer					m_timerUndoActionCreation;
39 		Link					m_lnkTextModifyHdl;
40 		String					m_strOrigText;		// wird beim Undo wiederhergestellt
41 		OQueryTextView*			m_pView;
42 		sal_Bool					m_bAccelAction;		// Wird bei Cut, Copy, Paste gesetzt
43 		sal_Bool					m_bStopTimer;
44         utl::SourceViewConfig   m_SourceViewConfig;
45 		svtools::ColorConfig	m_ColorConfig;
46 
47 		DECL_LINK(OnUndoActionTimer, void*);
48 		DECL_LINK(OnInvalidateTimer, void*);
49 
50 	private:
51 		void			ImplSetFont();
52 
53 	protected:
54 		virtual void KeyInput( const KeyEvent& rKEvt );
55 		virtual void GetFocus();
56 
57 		DECL_LINK(ModifyHdl, void*);
58 
59 	public:
60 		OSqlEdit( OQueryTextView* pParent,  WinBits nWinStyle = WB_LEFT | WB_VSCROLL |WB_BORDER);
61 		virtual ~OSqlEdit();
62 
63         // Edit overridables
64 		virtual void SetText(const String& rNewText);
65         using MultiLineEditSyntaxHighlight::SetText;
66 
67         // own functionality
68 		sal_Bool IsInAccelAct();
69 
SetTextModifyHdl(const Link & lnk)70 		void SetTextModifyHdl(const Link& lnk) { m_lnkTextModifyHdl = lnk; }
71 			// bitte nicht SetModifyHdl benutzen, den brauche ich selber, der hier wird von dem damit gesetzten Handler
72 			// gerufen
73 			// der Link bekommt einen Pointer-to-string, der nach dem Link nicht mehr gueltig ist
74 
75 		void stopTimer();
76 		void startTimer();
77 
78         virtual void    ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 );
79 		using MultiLineEditSyntaxHighlight::Notify;
80 	};
81 }
82 
83 #endif // DBAUI_SQLEDIT_HXX
84 
85 
86