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 #include <toolkit/awt/vclxtabpagemodel.hxx>
21 #include <vcl/tabpage.hxx>
22 #include <vcl/tabctrl.hxx>
23 #include <toolkit/helper/property.hxx>
24 #include <toolkit/helper/vclunohelper.hxx>
25 #include <toolkit/helper/unopropertyarrayhelper.hxx>
26 #include <cppuhelper/typeprovider.hxx>
27 // ----------------------------------------------------
29 // ----------------------------------------------------
31 VCLXTabPageModel::VCLXTabPageModel()
35 VCLXTabPageModel::~VCLXTabPageModel()
38 OSL_TRACE ("%s", __FUNCTION__
);
42 void SAL_CALL
VCLXTabPageModel::draw( sal_Int32 nX
, sal_Int32 nY
) throw(::com::sun::star::uno::RuntimeException
)
44 ::osl::MutexGuard
aGuard( GetMutex() );
45 Window
* pWindow
= GetWindow();
49 OutputDevice
* pDev
= VCLUnoHelper::GetOutputDevice( getGraphics() );
51 pDev
= pWindow
->GetParent();
53 Size aSize
= pDev
->PixelToLogic( pWindow
->GetSizePixel() );
54 Point aPos
= pDev
->PixelToLogic( Point( nX
, nY
) );
56 pWindow
->Draw( pDev
, aPos
, aSize
, WINDOW_DRAW_NOCONTROLS
);
60 ::com::sun::star::awt::DeviceInfo
VCLXTabPageModel::getInfo() throw(::com::sun::star::uno::RuntimeException
)
62 ::com::sun::star::awt::DeviceInfo aInfo
;// = VCLXDevice::getInfo();
67 void SAL_CALL
VCLXTabPageModel::setProperty(
68 const OUString
& /*PropertyName*/,
69 const ::com::sun::star::uno::Any
& /*Value*/ )
70 throw(::com::sun::star::uno::RuntimeException
)
72 ::osl::MutexGuard
aGuard( GetMutex() );
74 /*TabPage* pTabPage = (TabPage*)GetWindow();
77 VCLXWindow::setProperty( PropertyName, Value );
81 ::sal_Int16 SAL_CALL
VCLXTabPageModel::getTabPageID() throw (::com::sun::star::uno::RuntimeException
)
85 ::sal_Bool SAL_CALL
VCLXTabPageModel::getEnabled() throw (::com::sun::star::uno::RuntimeException
)
89 void SAL_CALL
VCLXTabPageModel::setEnabled( ::sal_Bool _enabled
) throw (::com::sun::star::uno::RuntimeException
)
91 //TabControl* pTabControl = (TabControl*)GetWindow();
93 // pTabControl->EnablePage(0, true);
95 OUString SAL_CALL
VCLXTabPageModel::getTitle() throw (::com::sun::star::uno::RuntimeException
)
97 //TabControl* pTabControl = (TabControl*)GetWindow();
99 // return pTabControl->GetPageText(0);
103 void SAL_CALL
VCLXTabPageModel::setTitle( const OUString
& _title
) throw (::com::sun::star::uno::RuntimeException
)
105 //TabControl* pTabControl = (TabControl*)GetWindow();
107 // pTabControl->SetPageText(0, _title);
110 OUString SAL_CALL
VCLXTabPageModel::getImageURL() throw (::com::sun::star::uno::RuntimeException
)
114 void SAL_CALL
VCLXTabPageModel::setImageURL( const OUString
& /*_imageurl*/ ) throw (::com::sun::star::uno::RuntimeException
)
116 //m_sImageURL = _imageurl;
118 OUString SAL_CALL
VCLXTabPageModel::getToolTip() throw (::com::sun::star::uno::RuntimeException
)
123 void SAL_CALL
VCLXTabPageModel::setToolTip( const OUString
& _tooltip
) throw (::com::sun::star::uno::RuntimeException
)
127 ::cppu::IPropertyArrayHelper
& VCLXTabPageModel::getInfoHelper()
129 static UnoPropertyArrayHelper
* pHelper
= NULL
;
132 com::sun::star::uno::Sequence
<sal_Int32
> aIDs
= ImplGetPropertyIds();
133 pHelper
= new UnoPropertyArrayHelper( aIDs
);
137 ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> VCLXTabPageModel::getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
)
139 static ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */