Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / formula / source / ui / dlg / ControlHelper.hxx
blob6bed4c71c856b49f3858b188875b5eb66658e1f5
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef FORMULA_CONTROL_HELPER_HXX_INCLUDED
20 #define FORMULA_CONTROL_HELPER_HXX_INCLUDED
22 #include "formula/funcutl.hxx"
23 #include <svtools/svmedit.hxx>
24 namespace formula
27 //============================================================================
28 // class ValWnd
29 class ValWnd : public Window
31 public:
32 ValWnd( Window* pParent, const ResId& rId );
34 void SetValue( const String& rStrVal );
36 protected:
37 virtual void Paint( const Rectangle& rRect );
39 private:
40 String aStrValue;
41 Rectangle aRectOut;
44 //============================================================================
45 // class EditBox
46 class EditBox : public Control
48 private:
50 MultiLineEdit* pMEdit;
51 Link aSelChangedLink;
52 Selection aOldSel;
53 sal_Bool bMouseFlag;
54 DECL_LINK(ChangedHdl, void *);
56 protected:
58 virtual long PreNotify( NotifyEvent& rNEvt );
59 virtual void SelectionChanged();
60 virtual void Resize();
61 virtual void GetFocus();
64 public:
65 EditBox( Window* pParent, const ResId& rResId );
67 virtual ~EditBox();
69 MultiLineEdit* GetEdit() {return pMEdit;}
71 void SetSelChangedHdl( const Link& rLink ) { aSelChangedLink = rLink; }
72 const Link& GetSelChangedHdl() const { return aSelChangedLink; }
74 void UpdateOldSel();
77 //============================================================================
78 // class ArgEdit
80 class ArgEdit : public RefEdit
82 public:
83 ArgEdit( Window* pParent, const ResId& rResId );
85 void Init( ArgEdit* pPrevEdit, ArgEdit* pNextEdit,
86 ScrollBar& rArgSlider, sal_uInt16 nArgCount );
88 protected:
89 virtual void KeyInput( const KeyEvent& rKEvt );
91 private:
92 ArgEdit* pEdPrev;
93 ArgEdit* pEdNext;
94 ScrollBar* pSlider;
95 sal_uInt16 nArgs;
99 //============================================================================
100 // class ArgInput
102 class ArgInput
104 private:
106 Link aFxClickLink;
107 Link aRefClickLink;
108 Link aFxFocusLink;
109 Link aRefFocusLink;
110 Link aEdFocusLink;
111 Link aEdModifyLink;
113 FixedText* pFtArg;
114 ImageButton* pBtnFx;
115 ArgEdit* pEdArg;
116 RefButton* pRefBtn;
118 DECL_LINK( FxBtnClickHdl, ImageButton* );
119 DECL_LINK( RefBtnClickHdl,RefButton* );
120 DECL_LINK( FxBtnFocusHdl, ImageButton* );
121 DECL_LINK( RefBtnFocusHdl,RefButton* );
122 DECL_LINK( EdFocusHdl, ArgEdit* );
123 DECL_LINK( EdModifyHdl,ArgEdit* );
125 protected:
127 virtual void FxClick();
128 virtual void RefClick();
129 virtual void FxFocus();
130 virtual void RefFocus();
131 virtual void EdFocus();
132 virtual void EdModify();
134 public:
136 ArgInput();
138 virtual ~ArgInput() {}
140 void InitArgInput ( FixedText* pftArg,
141 ImageButton* pbtnFx,
142 ArgEdit* pedArg,
143 RefButton* prefBtn);
145 void SetArgName(const String &aArg);
146 String GetArgName();
147 void SetArgNameFont(const Font&);
149 void SetArgVal(const String &aVal);
150 String GetArgVal();
152 void SetArgSelection (const Selection& rSel );
153 void ReplaceSelOfArg (const String& rStr );
155 ArgEdit* GetArgEdPtr() {return pEdArg;}
158 void SetFxClickHdl( const Link& rLink ) { aFxClickLink = rLink; }
159 const Link& GetFxClickHdl() const { return aFxClickLink; }
161 void SetRefClickHdl( const Link& rLink ) { aRefClickLink = rLink; }
162 const Link& GetRefClickHdl() const { return aRefClickLink; }
164 void SetFxFocusHdl( const Link& rLink ) { aFxFocusLink = rLink; }
165 const Link& GetFxFocusHdl() const { return aFxFocusLink; }
167 void SetRefFocusHdl( const Link& rLink ) { aRefFocusLink = rLink; }
168 const Link& GetRefFocusHdl() const { return aRefFocusLink; }
170 void SetEdFocusHdl( const Link& rLink ) { aEdFocusLink = rLink; }
171 const Link& GetEdFocusHdl() const { return aEdFocusLink; }
173 void SetEdModifyHdl( const Link& rLink ) { aEdModifyLink = rLink; }
174 const Link& GetEdModifyHdl() const { return aEdModifyLink; }
176 void Hide();
177 void Show();
182 #endif // FORMULA_FORMULA_HELPER_HXX_INCLUDED
184 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */