Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef SC_TPHFEDIT_HXX
30 : : #define SC_TPHFEDIT_HXX
31 : :
32 : : #include <sfx2/tabdlg.hxx>
33 : : #include <svx/pageitem.hxx>
34 : : #include <svtools/stdctrl.hxx>
35 : : #include <vcl/group.hxx>
36 : : #include <vcl/lstbox.hxx>
37 : : #include <vcl/timer.hxx>
38 : : #include <vcl/virdev.hxx>
39 : : #include "scdllapi.h"
40 : : #include "scitems.hxx" // due to enum SvxNumType
41 : : #include "popmenu.hxx"
42 : : #include <com/sun/star/accessibility/XAccessible.hpp>
43 : : #include <cppuhelper/weakref.hxx>
44 : :
45 : : //===================================================================
46 : :
47 : : class ScHeaderEditEngine;
48 : : class ScPatternAttr;
49 : : class EditView;
50 : : class EditTextObject;
51 : : class SvxFieldItem;
52 : : class ScAccessibleEditObject;
53 : : class ScEditWindow;
54 : :
55 : : SC_DLLPUBLIC ScEditWindow* GetScEditWindow ();
56 : :
57 : : enum ScEditWindowLocation
58 : : {
59 : : Left,
60 : : Center,
61 : : Right
62 : : };
63 : :
64 : : class SC_DLLPUBLIC ScEditWindow : public Control
65 : : {
66 : : public:
67 : : ScEditWindow( Window* pParent, const ResId& rResId, ScEditWindowLocation eLoc );
68 : : ~ScEditWindow();
69 : :
70 : : using Control::SetFont;
71 : : void SetFont( const ScPatternAttr& rPattern );
72 : : using Control::SetText;
73 : : void SetText( const EditTextObject& rTextObject );
74 : : EditTextObject* CreateTextObject();
75 : : void SetCharAttriutes();
76 : :
77 : : void InsertField( const SvxFieldItem& rFld );
78 : :
79 : : void SetNumType(SvxNumType eNumType);
80 : :
81 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible();
82 : :
83 : 0 : inline ScHeaderEditEngine* GetEditEngine() const {return pEdEngine;}
84 : : protected:
85 : : virtual void Paint( const Rectangle& rRec );
86 : : virtual void MouseMove( const MouseEvent& rMEvt );
87 : : virtual void MouseButtonDown( const MouseEvent& rMEvt );
88 : : virtual void MouseButtonUp( const MouseEvent& rMEvt );
89 : : virtual void KeyInput( const KeyEvent& rKEvt );
90 : : virtual void Command( const CommandEvent& rCEvt );
91 : : virtual void GetFocus();
92 : : virtual void LoseFocus();
93 : :
94 : : private:
95 : : ScHeaderEditEngine* pEdEngine;
96 : : EditView* pEdView;
97 : : ScEditWindowLocation eLocation;
98 : : bool mbRTL;
99 : :
100 : : com::sun::star::uno::WeakReference< ::com::sun::star::accessibility::XAccessible > xAcc;
101 : : ScAccessibleEditObject* pAcc;
102 : : };
103 : :
104 : : //===================================================================
105 [ # # ][ # # ]: 0 : class SC_DLLPUBLIC ScExtIButton : public ImageButton
106 : : {
107 : : private:
108 : :
109 : : Timer aTimer;
110 : : ScPopupMenu* pPopupMenu;
111 : : Link aMLink;
112 : : sal_uInt16 nSelected;
113 : :
114 : : SC_DLLPRIVATE DECL_LINK( TimerHdl, void*);
115 : :
116 : : protected:
117 : :
118 : : virtual void MouseButtonDown( const MouseEvent& rMEvt );
119 : : virtual void MouseButtonUp( const MouseEvent& rMEvt);
120 : : virtual void Click();
121 : :
122 : : virtual void StartPopup();
123 : :
124 : : public:
125 : :
126 : : ScExtIButton(Window* pParent, const ResId& rResId );
127 : :
128 : : void SetPopupMenu(ScPopupMenu* pPopUp);
129 : :
130 : : sal_uInt16 GetSelected();
131 : :
132 : 0 : void SetMenuHdl( const Link& rLink ) { aMLink = rLink; }
133 : : const Link& GetMenuHdl() const { return aMLink; }
134 : :
135 : : virtual long PreNotify( NotifyEvent& rNEvt );
136 : : };
137 : :
138 : : #endif // SC_TPHFEDIT_HXX
139 : :
140 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|