1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
20 #ifndef SC_TPHFEDIT_HXX
21 #define SC_TPHFEDIT_HXX
23 #include <sfx2/tabdlg.hxx>
24 #include <svx/pageitem.hxx>
25 #include <svtools/stdctrl.hxx>
26 #include <vcl/group.hxx>
27 #include <vcl/lstbox.hxx>
28 #include <vcl/timer.hxx>
29 #include <vcl/virdev.hxx>
31 #include "scitems.hxx" // due to enum SvxNumType
32 #include "popmenu.hxx"
33 #include <com/sun/star/accessibility/XAccessible.hpp>
34 #include <cppuhelper/weakref.hxx>
36 //===================================================================
38 class ScHeaderEditEngine
;
43 class ScAccessibleEditObject
;
46 SC_DLLPUBLIC ScEditWindow
* GetScEditWindow ();
48 enum ScEditWindowLocation
55 class SC_DLLPUBLIC ScEditWindow
: public Control
58 ScEditWindow( Window
* pParent
, const ResId
& rResId
, ScEditWindowLocation eLoc
);
59 ScEditWindow( Window
* pParent
, WinBits nBits
, ScEditWindowLocation eLoc
);
62 using Control::SetFont
;
63 void SetFont( const ScPatternAttr
& rPattern
);
64 using Control::SetText
;
65 void SetText( const EditTextObject
& rTextObject
);
66 EditTextObject
* CreateTextObject();
67 void SetCharAttriutes();
69 void InsertField( const SvxFieldItem
& rFld
);
71 void SetNumType(SvxNumType eNumType
);
73 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible();
75 inline ScHeaderEditEngine
* GetEditEngine() const {return pEdEngine
;}
77 void SetLocation(ScEditWindowLocation eLoc
) { eLocation
= eLoc
; }
79 virtual void Paint( const Rectangle
& rRect
);
80 virtual void MouseMove( const MouseEvent
& rMEvt
);
81 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
82 virtual void MouseButtonUp( const MouseEvent
& rMEvt
);
83 virtual void KeyInput( const KeyEvent
& rKEvt
);
84 virtual void Command( const CommandEvent
& rCEvt
);
85 virtual void GetFocus();
86 virtual void LoseFocus();
87 virtual void Resize();
90 ScHeaderEditEngine
* pEdEngine
;
92 ScEditWindowLocation eLocation
;
95 com::sun::star::uno::WeakReference
< ::com::sun::star::accessibility::XAccessible
> xAcc
;
96 ScAccessibleEditObject
* pAcc
;
99 //===================================================================
100 class SC_DLLPUBLIC ScExtIButton
: public ImageButton
105 PopupMenu
* pPopupMenu
;
107 sal_uInt16 nSelected
;
108 OString aSelectedIdent
;
110 SC_DLLPRIVATE
DECL_LINK( TimerHdl
, void*);
114 virtual void MouseButtonDown( const MouseEvent
& rMEvt
);
115 virtual void MouseButtonUp( const MouseEvent
& rMEvt
);
116 virtual void Click();
118 virtual void StartPopup();
122 ScExtIButton(Window
* pParent
, const ResId
& rResId
);
123 ScExtIButton(Window
* pParent
, WinBits nBits
);
125 void SetPopupMenu(PopupMenu
* pPopUp
);
127 sal_uInt16
GetSelected() const;
128 OString
GetSelectedIdent() const;
130 void SetMenuHdl( const Link
& rLink
) { aMLink
= rLink
; }
131 const Link
& GetMenuHdl() const { return aMLink
; }
133 virtual long PreNotify( NotifyEvent
& rNEvt
);
136 #endif // SC_TPHFEDIT_HXX
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */