diff options
Diffstat (limited to 'sw/source/ui/inc')
-rw-r--r-- | sw/source/ui/inc/FrameControl.hxx | 55 | ||||
-rw-r--r-- | sw/source/ui/inc/HeaderFooterWin.hxx | 7 |
2 files changed, 58 insertions, 4 deletions
diff --git a/sw/source/ui/inc/FrameControl.hxx b/sw/source/ui/inc/FrameControl.hxx new file mode 100644 index 000000000000..01bbb6b84510 --- /dev/null +++ b/sw/source/ui/inc/FrameControl.hxx @@ -0,0 +1,55 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License or as specified alternatively below. You may obtain a copy of + * the License at http://www.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * Major Contributor(s): + * [ Copyright (C) 2011 SUSE <cbosdonnat@suse.com> (initial developer) ] + * + * All Rights Reserved. + * + * For minor contributions see the git repository. + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ +#ifndef _FRAMECONTROL_HXX +#define _FRAMECONTROL_HXX + +#include <edtwin.hxx> +#include <frame.hxx> + +/** Class representing a control linked to a SwFrm. + */ +class SwFrameControl +{ + SwEditWin* m_pEditWin; + const SwFrm* m_pFrm; + +public: + SwFrameControl( SwEditWin* pEditWin, const SwFrm* pFrm ) : + m_pEditWin( pEditWin ), m_pFrm( pFrm ) {}; + ~SwFrameControl( ) {}; + + const SwFrm* GetFrame( ) { return m_pFrm; } + SwEditWin* GetEditWin( ) { return m_pEditWin; } + + virtual void SetReadonly( bool bReadonly ) = 0; + virtual void ShowAll( bool bShow ) = 0; +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/inc/HeaderFooterWin.hxx b/sw/source/ui/inc/HeaderFooterWin.hxx index c59211da6558..bbb93b209172 100644 --- a/sw/source/ui/inc/HeaderFooterWin.hxx +++ b/sw/source/ui/inc/HeaderFooterWin.hxx @@ -28,6 +28,7 @@ #ifndef _HEADERFOOTERWINDOW_HXX #define _HEADERFOOTERWINDOW_HXX +#include <FrameControl.hxx> #include <pagedesc.hxx> #include <vcl/menubtn.hxx> @@ -37,11 +38,9 @@ This control is showing the header / footer style name and provides a few useful actions to the user. */ -class SwHeaderFooterWin : public MenuButton +class SwHeaderFooterWin : public MenuButton, public SwFrameControl { - SwEditWin* m_pEditWin; rtl::OUString m_sLabel; - const SwPageFrm* m_pPageFrm; bool m_bIsHeader; bool m_bReadonly; PopupMenu* m_pPopupMenu; @@ -61,7 +60,7 @@ public: bool IsHeader() { return m_bIsHeader; }; bool IsEmptyHeaderFooter( ); - const SwPageFrm* GetPageFrame( ) { return m_pPageFrm; }; + const SwPageFrm* GetPageFrame( ); void ExecuteCommand(sal_uInt16 nSlot); |