Update ooo320-m1
[ooovba.git] / toolkit / inc / layout / layout.hxx
blob19179507b294d32c5cfd024234ce5e88316faa3d
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: layout.hxx,v $
11 * $Revision: 1.3 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef _LAYOUT_HXX
33 #define _LAYOUT_HXX
35 #include <com/sun/star/awt/XLayoutContainer.hpp>
36 #include <com/sun/star/uno/XInterface.hpp>
37 #include <com/sun/star/util/Color.hpp>
38 #include <i18npool/lang.h>
39 #include <toolkit/dllapi.h>
40 #include <tools/gen.hxx>
41 #include <tools/link.hxx>
42 #include <tools/string.hxx>
43 #include <vcl/bitmap.hxx>
44 #include <vcl/combobox.h>
45 #include <vcl/fldunit.hxx>
46 #include <vcl/lstbox.h>
47 #include <vcl/smartid.hxx>
48 #include <vcl/wintypes.hxx>
50 class Button;
51 class ComboBox;
52 class Color;
53 class Control;
54 class Dialog;
55 class Edit;
56 class Font;
57 class Image;
58 class ListBox;
59 class MapMode;
60 class MultiListBox;
61 class NotifyEvent;
62 class Pointer;
63 class PushButton;
64 class RadioButton;
65 class ResId;
66 struct SfxChildWinInfo;
67 //class SvxFontListBox;
68 //class SvxLanguageBox;
69 class TabControl;
70 class TabPage;
71 class VCLXRadioButton;
72 class VCLXWindow;
73 class Window;
75 namespace layoutimpl
77 class VCLXTabControl;
80 class VCLXTabControl;
82 namespace com { namespace sun { namespace star { namespace awt { class XWindow; } } } }
84 namespace layout
87 namespace css = ::com::sun::star;
89 typedef css::uno::Reference< css::uno::XInterface > PeerHandle;
90 class ContextImpl;
91 class TOOLKIT_DLLPUBLIC Context
93 ContextImpl *pImpl;
94 public:
95 Context( char const* pPath );
96 virtual ~Context();
97 PeerHandle GetPeerHandle( char const* id, sal_uInt32 nId = 0 ) const;
98 void setToplevel( PeerHandle xToplevel );
99 PeerHandle getToplevel();
100 PeerHandle getRoot();
103 // make declaring wrappers easier ...
104 #define DECL_CONSTRUCTORS(t,par,defaultWinBit) \
105 protected: \
106 explicit t( WindowImpl *pImpl ) : \
107 par( pImpl ) {} \
108 char const* GetUnoName() const; \
109 public: \
110 t( Context *context, char const* id, sal_uInt32 nId = 0 ); \
111 t( Window *parent, WinBits nStyle = defaultWinBit ); \
112 t (Window *parent, ResId const &res)
113 #define DECL_GET_IMPL(t) \
114 inline t##Impl &getImpl() const
116 #define DECL_GET_WINDOW( cls ) ::cls* Get##cls() const
117 #define IMPL_GET_WINDOW( cls ) ::cls* cls::Get##cls() const { return dynamic_cast< ::cls*>( GetWindow() ); }
119 #define DECL_GET_VCLXWINDOW( cls ) ::VCLX##cls* GetVCLX##cls() const
120 #define IMPL_GET_VCLXWINDOW( cls ) ::VCLX##cls* cls::Get##VCLX##cls() const { return dynamic_cast< ::VCLX##cls*>( GetVCLXWindow() ); }
122 #define DECL_GET_LAYOUT_VCLXWINDOW( cls ) ::layoutimpl::VCLX##cls* GetVCLX##cls() const
123 #define IMPL_GET_LAYOUT_VCLXWINDOW( cls ) ::layoutimpl::VCLX##cls* cls::Get##VCLX##cls() const { return dynamic_cast< ::layoutimpl::VCLX##cls*>( GetVCLXWindow() ); }
125 // follows the VCL inheritance hierarchy ...
127 class WindowImpl;
128 class TOOLKIT_DLLPUBLIC Window
130 protected:
131 friend class WindowImpl;
132 WindowImpl *mpImpl;
133 static PeerHandle CreatePeer( Window *parent, WinBits nStyle,
134 char const* pName);
136 virtual void setRes (ResId const& res);
138 public:
139 DECL_GET_IMPL( Window );
140 explicit Window( WindowImpl *pImpl );
141 virtual ~Window();
143 PeerHandle GetPeer() const;
144 Context *getContext();
146 void Enable( bool bEnable = true );
147 inline void Disable() { Enable( false ); }
148 void Show( bool bVisible = true );
149 inline void Hide() { Show( false ); }
150 void GrabFocus();
151 void FreeResource() {}
153 void SetParent( ::Window *parent );
154 virtual void ParentSet (Window *window);
155 void SetParent( Window *parent );
157 css::uno::Reference<css::awt::XWindow> GetRef() const;
158 VCLXWindow* GetVCLXWindow() const;
159 ::Window* GetWindow() const;
160 ::Window* GetParent() const;
162 void SetPointer( Pointer const& pointer );
163 Pointer const& GetPointer() const;
164 WinBits GetStyle();
165 void SetText( rtl::OUString const& str );
166 String GetText() const;
167 void SetStyle( WinBits style );
168 void SetUpdateMode( bool mode );
169 void SetHelpId( sal_uIntPtr id );
170 sal_uIntPtr GetHelpId() const;
171 void SetSmartHelpId( SmartId const&, SmartIdUpdateMode mode=SMART_SET_SMART );
172 SmartId GetSmartHelpId() const;
173 void EnterWait ();
174 void LeaveWait ();
175 bool IsWait () const;
176 //void Enable (bool enable=true, bool child=true);
177 //void Disable (bool child=true);
178 bool IsEnabled () const;
179 void EnableInput (bool enable=true, bool child=true);
180 bool IsInputEnabled () const;
182 bool IsVisible () const;
183 bool HasChildPathFocus (bool systemWindow=false) const;
184 void SetPosPixel (Point const&);
185 Point GetPosPixel () const;
186 void SetSizePixel (Size const&);
187 Size GetSizePixel () const;
188 void SetPosSizePixel (Point const&, Size const&);
189 sal_Int32 GetCtrlTextWidth (rtl::OUString const& str) const;
190 sal_Int32 GetTextHeight () const;
192 Size LogicToPixel( Size const& size ) const;
193 Size LogicToPixel( Size const& size, MapMode const& mapMode ) const;
195 bool HasFocus () const;
196 Font& GetFont () const;
197 void SetFont (Font const& font);
198 virtual void Invalidate (sal_uInt8 flags=0);
201 class ControlImpl;
202 class TOOLKIT_DLLPUBLIC Control : public Window
204 DECL_GET_IMPL( Control );
205 DECL_CONSTRUCTORS( Control, Window, 0 );
207 public:
208 ~Control ();
209 void SetGetFocusHdl (Link const& link);
210 Link& GetGetFocusHdl ();
211 void SetLoseFocusHdl (Link const& link);
212 Link& GetLoseFocusHdl ();
215 class FixedLineImpl;
216 class TOOLKIT_DLLPUBLIC FixedLine : public Control
218 DECL_GET_IMPL( FixedLine );
219 DECL_CONSTRUCTORS( FixedLine, Control, WB_HORZ );
221 public:
222 bool IsEnabled() const;
225 class FixedTextImpl;
226 class TOOLKIT_DLLPUBLIC FixedText : public Control
228 DECL_GET_IMPL( FixedText );
229 DECL_CONSTRUCTORS( FixedText, Control, 0 );
231 public:
232 ~FixedText ();
233 void SetText( rtl::OUString const& rStr );
236 class FixedImageImpl;
237 class TOOLKIT_DLLPUBLIC FixedImage : public Control
239 DECL_GET_IMPL( FixedImage );
240 DECL_CONSTRUCTORS( FixedImage, Control, 0 );
241 public:
242 void setImage( ::Image const& );
245 class FixedInfoImpl;
246 class TOOLKIT_DLLPUBLIC FixedInfo : public FixedText
248 DECL_GET_IMPL( FixedInfo );
249 DECL_CONSTRUCTORS( FixedInfo, FixedText, 0 );
252 class ImageImpl;
253 class TOOLKIT_DLLPUBLIC Image
255 ImageImpl *pImpl;
256 public:
257 Image( char const* pName );
258 ~Image();
259 ImageImpl &getImpl() const { return *pImpl; }
262 class ButtonImpl;
263 class TOOLKIT_DLLPUBLIC Button : public Control
265 DECL_GET_IMPL( Button );
266 DECL_CONSTRUCTORS( Button, Control, 0 );
267 DECL_GET_WINDOW (Button);
269 public:
270 ~Button ();
271 static String GetStandardText (sal_uInt16 button_type);
272 void SetText( rtl::OUString const& rStr );
273 bool SetModeImage (Image const& image);
274 bool SetModeImage (::Image const& image, BmpColorMode mode=BMP_COLOR_NORMAL);
275 void SetImageAlign( ImageAlign eAlign );
277 void SetClickHdl( Link const& rLink );
278 virtual void Click() /* pure virtual? */;
279 Link& GetClickHdl ();
282 class PushButtonImpl;
283 class TOOLKIT_DLLPUBLIC PushButton : public Button
285 DECL_GET_IMPL( PushButton );
286 DECL_CONSTRUCTORS( PushButton, Button, 0 );
287 DECL_GET_WINDOW (PushButton);
289 public:
290 ~PushButton ();
291 void Check( bool bCheck=true );
292 bool IsChecked() const;
294 void Toggle();
295 void SetToggleHdl( Link const& rLink );
298 class TOOLKIT_DLLPUBLIC OKButton : public PushButton
300 DECL_CONSTRUCTORS( OKButton, PushButton, WB_DEFBUTTON );
302 class TOOLKIT_DLLPUBLIC CancelButton : public PushButton
304 DECL_CONSTRUCTORS( CancelButton, PushButton, 0 );
306 class TOOLKIT_DLLPUBLIC YesButton : public PushButton
308 DECL_CONSTRUCTORS( YesButton, PushButton, WB_DEFBUTTON );
310 class TOOLKIT_DLLPUBLIC NoButton : public PushButton
312 DECL_CONSTRUCTORS( NoButton, PushButton, 0 );
314 class TOOLKIT_DLLPUBLIC RetryButton : public PushButton
316 DECL_CONSTRUCTORS( RetryButton, PushButton, 0 );
318 class TOOLKIT_DLLPUBLIC IgnoreButton : public PushButton
320 DECL_CONSTRUCTORS( IgnoreButton, PushButton, 0 );
322 class TOOLKIT_DLLPUBLIC ResetButton : public PushButton
324 DECL_CONSTRUCTORS( ResetButton, PushButton, 0 );
326 class TOOLKIT_DLLPUBLIC ApplyButton : public PushButton
328 DECL_CONSTRUCTORS( ApplyButton, PushButton, 0 );
330 class TOOLKIT_DLLPUBLIC HelpButton : public PushButton
332 DECL_CONSTRUCTORS( HelpButton, PushButton, 0 );
334 class TOOLKIT_DLLPUBLIC ImageButton : public PushButton
336 DECL_CONSTRUCTORS( ImageButton, PushButton, 0 );
339 class AdvancedButtonImpl;
340 class TOOLKIT_DLLPUBLIC AdvancedButton : public PushButton
342 DECL_CONSTRUCTORS( AdvancedButton, PushButton, 0 );
343 DECL_GET_IMPL( AdvancedButton );
345 void AddAdvanced( Window* w );
346 void AddSimple( Window* w );
347 void RemoveAdvanced( Window* w );
348 void RemoveSimple( Window* w );
350 void SetAdvancedText (rtl::OUString const& text);
351 void SetSimpleText (rtl::OUString const& text);
352 rtl::OUString GetAdvancedText () const;
353 rtl::OUString GetSimpleText () const;
354 void SetDelta (int);
357 class MoreButtonImpl;
358 class TOOLKIT_DLLPUBLIC MoreButton : public AdvancedButton
360 DECL_CONSTRUCTORS( MoreButton, AdvancedButton, 0 );
361 DECL_GET_IMPL( MoreButton );
362 void AddWindow( Window* w );
363 void RemoveWindow( Window* w );
365 void SetMoreText (rtl::OUString const& text);
366 void SetLessText (rtl::OUString const& text);
367 rtl::OUString GetMoreText () const;
368 rtl::OUString GetLessText () const;
371 class RadioButtonImpl;
372 class TOOLKIT_DLLPUBLIC RadioButton : public Button
374 DECL_GET_IMPL( RadioButton );
375 DECL_CONSTRUCTORS( RadioButton, Button, 0 );
376 DECL_GET_WINDOW( RadioButton );
377 DECL_GET_VCLXWINDOW( RadioButton );
378 public:
379 ~RadioButton ();
380 void Check( bool bCheck=true );
381 bool IsChecked() const;
383 void Toggle();
384 void SetToggleHdl( Link const& rLink );
387 class CheckBoxImpl;
388 class TOOLKIT_DLLPUBLIC CheckBox : public Button
390 DECL_GET_IMPL( CheckBox );
391 DECL_CONSTRUCTORS( CheckBox, Button, 0 );
393 public:
394 ~CheckBox ();
395 void Check( bool bCheck=true );
396 bool IsChecked() const;
398 void Toggle();
399 void SetToggleHdl( Link const& rLink );
402 class EditImpl;
403 class TOOLKIT_DLLPUBLIC Edit : public Control
405 DECL_GET_IMPL( Edit );
406 DECL_CONSTRUCTORS( Edit, Control, WB_BORDER );
407 DECL_GET_WINDOW (Edit);
409 public:
410 ~Edit ();
411 void SetText( rtl::OUString const& rStr );
412 String GetText() const;
413 void SetModifyHdl( Link const& rLink );
414 void SetSelection( Selection const& rSelection );
417 class MultiLineEditImpl;
418 class TOOLKIT_DLLPUBLIC MultiLineEdit : public Edit
420 DECL_GET_IMPL( MultiLineEdit );
421 DECL_CONSTRUCTORS( MultiLineEdit, Edit, WB_LEFT|WB_BORDER );
424 class SpinFieldImpl;
425 class TOOLKIT_DLLPUBLIC SpinField : public Edit
427 DECL_GET_IMPL( SpinField );
428 DECL_CONSTRUCTORS( SpinField, Edit, 0 );
431 class FormatterBaseImpl;
432 class TOOLKIT_DLLPUBLIC FormatterBase
434 protected:
435 FormatterBaseImpl *mpFormatImpl;
436 FormatterBase( FormatterBaseImpl *pFormatImpl );
439 class NumericFormatterImpl;
440 class TOOLKIT_DLLPUBLIC NumericFormatter : public FormatterBase
442 protected:
443 explicit NumericFormatter( FormatterBaseImpl *pImpl );
444 NumericFormatterImpl &getFormatImpl() const;
445 public:
446 void SetMin( sal_Int64 nNewMin );
447 void SetMax( sal_Int64 nNewMax );
448 void SetFirst( sal_Int64 nNewFirst );
449 void SetLast( sal_Int64 nNewLast );
450 void SetSpinSize( sal_Int64 nNewSize );
452 void SetValue( sal_Int64 nNewValue );
453 sal_Int64 GetValue() const;
456 class NumericFieldImpl;
457 class TOOLKIT_DLLPUBLIC NumericField : public SpinField, public NumericFormatter
459 DECL_GET_IMPL( NumericField );
460 public:
461 NumericField( Context *context, char const* id, sal_uInt32 nId=0 );
462 NumericField( Window *parent, WinBits nStyle );
465 class MetricFormatterImpl;
466 // Different inheritance to save code
467 class TOOLKIT_DLLPUBLIC MetricFormatter : public FormatterBase
469 protected:
470 explicit MetricFormatter( FormatterBaseImpl *pImpl );
471 MetricFormatterImpl &getFormatImpl() const;
472 public:
473 void SetMin( sal_Int64 nNewMin, FieldUnit nUnit=FUNIT_NONE );
474 void SetMax( sal_Int64 nNewMax, FieldUnit nUnit=FUNIT_NONE );
475 void SetFirst( sal_Int64 nNewFirst, FieldUnit nUnit=FUNIT_NONE );
476 void SetLast( sal_Int64 nNewLast, FieldUnit nUnit=FUNIT_NONE );
477 void SetValue( sal_Int64 nNewValue, FieldUnit nUnit=FUNIT_NONE );
478 sal_Int64 GetValue( FieldUnit nUnit=FUNIT_NONE ) const;
480 void SetSpinSize( sal_Int64 nNewSize );
483 class MetricFieldImpl;
484 class TOOLKIT_DLLPUBLIC MetricField : public SpinField, public MetricFormatter
486 DECL_GET_IMPL( MetricField );
487 public:
488 MetricField( Context *context, char const* id, sal_uInt32 nId=0 );
489 MetricField( Window *parent, WinBits nStyle );
492 class ComboBoxImpl;
493 class TOOLKIT_DLLPUBLIC ComboBox : public Edit
495 DECL_GET_IMPL( ComboBox );
496 DECL_GET_WINDOW (ComboBox );
497 DECL_CONSTRUCTORS( ComboBox, Edit, 0 );
499 public:
500 ~ComboBox ();
501 sal_uInt16 InsertEntry( String const& rStr, sal_uInt16 nPos=COMBOBOX_APPEND );
502 void RemoveEntry( String const& rStr );
503 void RemoveEntry( sal_uInt16 nPos );
504 void Clear();
506 sal_uInt16 GetEntryPos( String const& rStr ) const;
507 String GetEntry( sal_uInt16 nPos ) const;
508 sal_uInt16 GetEntryCount() const;
510 void SetClickHdl( Link const& rLink );
511 void SetSelectHdl( Link const& rLink );
512 void EnableAutocomplete (bool enable, bool matchCase=false );
515 class ListBoxImpl;
516 class TOOLKIT_DLLPUBLIC ListBox : public Control
518 DECL_GET_IMPL( ListBox );
519 DECL_CONSTRUCTORS( ListBox, Control, WB_BORDER );
520 DECL_GET_WINDOW (ListBox);
522 public:
523 ~ListBox ();
524 sal_uInt16 InsertEntry( String const& rStr, sal_uInt16 nPos=LISTBOX_APPEND );
526 void RemoveEntry( String const& rStr );
527 void RemoveEntry( sal_uInt16 nPos );
528 void Clear();
530 sal_uInt16 GetEntryPos( String const& rStr ) const;
531 String GetEntry( sal_uInt16 nPos ) const;
532 sal_uInt16 GetEntryCount() const;
534 void SelectEntry( String const& rStr, bool bSelect=true );
535 void SelectEntryPos( sal_uInt16 nPos, bool bSelect=true );
537 sal_uInt16 GetSelectEntryCount() const;
538 String GetSelectEntry( sal_uInt16 nSelIndex=0 ) const;
539 sal_uInt16 GetSelectEntryPos( sal_uInt16 nSelIndex=0 ) const;
541 void SetSelectHdl (Link const& link);
542 Link& GetSelectHdl ();
544 void SetClickHdl (Link const& link);
545 Link& GetClickHdl ();
547 void SetDoubleClickHdl (Link const& link);
548 Link& GetDoubleClickHdl ();
550 void SetEntryData (sal_uInt16 pos, void* data);
551 void* GetEntryData (sal_uInt16 pos) const;
553 virtual void SetNoSelection ();
556 class MultiListBoxImpl;
557 class TOOLKIT_DLLPUBLIC MultiListBox : public ListBox
559 DECL_GET_IMPL( MultiListBox );
560 DECL_CONSTRUCTORS( MultiListBox, ListBox, 0 );
561 DECL_GET_WINDOW( MultiListBox );
564 class DialogImpl;
565 class TOOLKIT_DLLPUBLIC Dialog : public Context, public Window
567 DECL_GET_WINDOW (Dialog);
569 public:
570 DECL_GET_IMPL (Dialog);
571 Dialog( Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 );
572 Dialog( ::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 );
573 ~Dialog ();
574 virtual short Execute();
575 void EndDialog( long nResult=0 );
576 void SetText( rtl::OUString const& rStr );
577 void SetTitle (rtl::OUString const& rStr );
578 bool Close ();
579 long Notify (NotifyEvent & event);
581 // Sxf*Dialog
582 bool bConstruct;
583 void Initialize (SfxChildWinInfo*);
586 #define DECL_MESSAGE_BOX_CTORS(Name)\
587 public:\
588 Name##Box (::Window *parent, char const* message,\
589 char const* yes=0, char const* no=0, sal_uIntPtr help_id=0,\
590 char const* xml_file="message-box.xml", char const* id="message-box");\
591 Name##Box (::Window *parent, rtl::OUString const& message,\
592 rtl::OUString yes=String (),\
593 rtl::OUString no=String (),\
594 sal_uIntPtr help_id=0,\
595 char const* xml_file="message-box.xml", char const* id="message-box");\
596 Name##Box (::Window *parent, WinBits, char const* message,\
597 char const* yes=0, char const* no=0, sal_uIntPtr help_id=0,\
598 char const* xml_file="message-box.xml", char const* id="message-box");\
599 Name##Box (::Window *parent, WinBits, rtl::OUString const& message,\
600 rtl::OUString yes=String (),\
601 rtl::OUString no=String (),\
602 sal_uIntPtr help_id=0,\
603 char const* xml_file="message-box.xml", char const* id="message-box")\
605 class TOOLKIT_DLLPUBLIC MessageBox : public Dialog
607 DECL_MESSAGE_BOX_CTORS(Message);
609 protected:
610 FixedImage imageError;
611 FixedImage imageInfo;
612 FixedImage imageQuery;
613 FixedImage imageWarning;
614 FixedText messageText;
615 CancelButton cancelButton;
616 HelpButton helpButton;
617 IgnoreButton ignoreButton;
618 NoButton noButton;
619 RetryButton retryButton;
620 YesButton yesButton;
622 void bits_init (WinBits bits, rtl::OUString const& message,
623 rtl::OUString yes, rtl::OUString, sal_uIntPtr help_id);
624 void init (rtl::OUString const& message,
625 rtl::OUString const& yes, rtl::OUString const& no, sal_uIntPtr help_id);
626 void init (char const* message, char const* yes, char const* no, sal_uIntPtr help_id);
629 #define CLASS_MESSAGE_BOX(Name)\
630 class TOOLKIT_DLLPUBLIC Name##Box : public MessageBox\
632 DECL_MESSAGE_BOX_CTORS (Name);\
635 //CLASS_MESSAGE_BOX (Mess);
636 typedef MessageBox MessBox;
637 CLASS_MESSAGE_BOX (Error);
638 CLASS_MESSAGE_BOX (Info);
639 CLASS_MESSAGE_BOX (Query);
640 CLASS_MESSAGE_BOX (Warning);
642 #undef CLASS_MESSAGE_BOX
644 #undef TAB_APPEND
646 class TabControlImpl;
647 class TOOLKIT_DLLPUBLIC TabControl : public Control
649 //#ifndef TAB_APPEND
650 #define TAB_APPEND 0xFFFF
651 //#endif /* !TAB_APPEND */
653 DECL_GET_IMPL (TabControl);
654 DECL_CONSTRUCTORS (TabControl, Control, 0);
655 DECL_GET_WINDOW (TabControl);
656 DECL_GET_LAYOUT_VCLXWINDOW (TabControl);
658 public:
659 ~TabControl ();
660 void InsertPage (sal_uInt16 id, rtl::OUString const& title, sal_uInt16 pos=TAB_APPEND);
661 void RemovePage (sal_uInt16 id);
662 sal_uInt16 GetPageCount () const;
663 sal_uInt16 GetPageId (sal_uInt16 pos) const;
664 sal_uInt16 GetPagePos (sal_uInt16 id) const;
665 void SetCurPageId (sal_uInt16 id);
666 sal_uInt16 GetCurPageId () const;
667 void SetTabPage (sal_uInt16 id, ::TabPage* page);
668 ::TabPage* GetTabPage (sal_uInt16 id) const;
669 void SetActivatePageHdl (Link const& link);
670 Link& GetActivatePageHdl () const;
671 void SetDeactivatePageHdl (Link const& link);
672 Link& GetDeactivatePageHdl () const;
673 void SetTabPageSizePixel (Size const& size);
674 Size GetTabPageSizePixel () const;
677 class TabPageImpl;
678 class TOOLKIT_DLLPUBLIC TabPage : public Context, public Window
680 DECL_GET_IMPL( TabPage );
681 public:
682 static ::Window* global_parent;
683 static TabControl* global_tabcontrol;
685 TabPage( Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 );
686 TabPage( ::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0 );
687 ~TabPage();
688 DECL_GET_WINDOW( TabPage );
689 virtual void ActivatePage();
690 virtual void DeactivatePage();
693 class ProgressBarImpl;
694 class TOOLKIT_DLLPUBLIC ProgressBar : public Control
696 DECL_GET_IMPL( ProgressBar );
697 DECL_CONSTRUCTORS( ProgressBar, Control, WB_BORDER );
698 public:
699 void SetForegroundColor( css::util::Color color );
700 void SetBackgroundColor( css::util::Color color );
701 void SetValue( sal_Int32 i );
702 void SetRange( sal_Int32 min, sal_Int32 max );
703 sal_Int32 GetValue();
706 // -----------------------------------------------------------------
707 // layout container / helper wrappers
708 // -----------------------------------------------------------------
710 class TOOLKIT_DLLPUBLIC Container
712 protected:
713 css::uno::Reference< css::awt::XLayoutContainer > mxContainer;
714 Container( rtl::OUString const& rName, sal_Int32 nBorder );
715 public:
716 Container( Context const* context, char const* id );
718 void Add( Window *pWindow );
719 void Add( Container *pContainer );
721 void Remove( Window *pWindow );
722 void Remove( Container *pContainer );
723 void Clear();
724 // we can't really do a GetChildren() as they don't have a common class,
725 // besides we would need to keep track of children, uh
727 void ShowAll( bool bVisible );
728 void Show();
729 void Hide();
731 css::uno::Reference< css::awt::XLayoutContainer > getImpl()
732 { return mxContainer; }
735 class TOOLKIT_DLLPUBLIC Table : public Container
737 protected:
738 Table( sal_Int32 nBorder, sal_Int32 nColumns );
739 public:
740 Table( Context const* context, char const* id );
741 void Add( Window *pWindow, bool bXExpand, bool bYExpand,
742 sal_Int32 nXSpan=1, sal_Int32 nYSpan=1 );
743 void Add( Container *pContainer, bool bXExpand, bool bYExpand,
744 sal_Int32 nXSpan=1, sal_Int32 nYSpan=1 );
746 private:
747 void setProps( css::uno::Reference< css::awt::XLayoutConstrains > xChild,
748 bool bXExpand, bool bYExpand, sal_Int32 nXSpan, sal_Int32 nYSpan );
751 class TOOLKIT_DLLPUBLIC Box : public Container
753 protected:
754 Box( rtl::OUString const& rName, sal_Int32 nBorder, bool bHomogeneous );
755 public:
756 Box( Context const* context, char const* id );
757 void Add( Window *pWindow, bool bExpand, bool bFill, sal_Int32 nPadding);
758 void Add( Container *pContainer, bool bExpand, bool bFill, sal_Int32 nPadding);
760 private:
761 void setProps( css::uno::Reference< css::awt::XLayoutConstrains > xChild,
762 bool bXExpand, bool bYExpand, sal_Int32 nPadding );
765 class TOOLKIT_DLLPUBLIC HBox : public Box
767 public:
768 HBox( Context const* context, char const* id );
769 HBox( sal_Int32 nBorder, bool bHomogeneous );
771 class TOOLKIT_DLLPUBLIC VBox : public Box
773 public:
774 VBox( Context const* context, char const* id );
775 VBox( sal_Int32 nBorder, bool bHomogeneous );
778 class PluginImpl;
779 class TOOLKIT_DLLPUBLIC Plugin : public Control
781 DECL_GET_IMPL( Plugin );
782 //DECL_CONSTRUCTORS( Plugin, Control, 0 );
783 public:
784 ::Control *mpPlugin;
785 Plugin( Context *context, char const* id, ::Control *plugin );
788 class LocalizedStringImpl;
789 class TOOLKIT_DLLPUBLIC LocalizedString : public Window
791 DECL_GET_IMPL( LocalizedString );
793 public:
794 LocalizedString( Context *context, char const* id );
796 rtl::OUString operator= (rtl::OUString const&);
797 rtl::OUString operator+= (sal_Unicode );
798 rtl::OUString operator+= (rtl::OUString const&);
800 operator rtl::OUString ();
801 operator rtl::OUString const& ();
802 operator String();
803 String getString ();
804 rtl::OUString getOUString ();
805 String GetToken (USHORT i, sal_Char c);
808 class InPlugImpl;
809 class TOOLKIT_DLLPUBLIC InPlug : public Context, public Window
811 DECL_GET_IMPL (InPlug);
813 public:
814 InPlug ( Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0);
815 InPlug ( ::Window *parent, char const* xml_file, char const* id, sal_uInt32 nId=0);
817 void ParentSet (Window *window);
820 } // end namespace layout
822 #if ENABLE_LAYOUT
823 #define LAYOUT_NS layout::
824 #define LAYOUT_DIALOG_PARENT\
825 VCLXWindow::GetImplementation( uno::Reference <awt::XWindow> ( GetPeer(), uno::UNO_QUERY ) )->GetWindow()
826 #define LAYOUT_THIS_WINDOW( this ) this->GetWindow ()
827 #else /* !ENABLE_LAYOUT */
828 #define LAYOUT_NS
829 #define LAYOUT_DIALOG_PARENT this
830 #define LAYOUT_THIS_WINDOW( this ) this
831 #endif /* !ENABLE_LAYOUT */
833 #endif /* _LAYOUT_HXX */