bump product version to 4.1.6.2
[LibreOffice.git] / toolkit / source / awt / vclxtabpagemodel.cxx
blob3f0e0d241f6193f228e3b55c58d739e40dd03853
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 // ----------------------------------------------------
28 // class VCLXDialog
29 // ----------------------------------------------------
31 VCLXTabPageModel::VCLXTabPageModel()
35 VCLXTabPageModel::~VCLXTabPageModel()
37 #ifndef __SUNPRO_CC
38 OSL_TRACE ("%s", __FUNCTION__);
39 #endif
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();
47 if ( pWindow )
49 OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() );
50 if ( !pDev )
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();
63 return aInfo;
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();
75 if ( pTabPage )
77 VCLXWindow::setProperty( PropertyName, Value );
78 }*/
80 //XTabPageModel
81 ::sal_Int16 SAL_CALL VCLXTabPageModel::getTabPageID() throw (::com::sun::star::uno::RuntimeException)
83 return 0;
85 ::sal_Bool SAL_CALL VCLXTabPageModel::getEnabled() throw (::com::sun::star::uno::RuntimeException)
87 return false;
89 void SAL_CALL VCLXTabPageModel::setEnabled( ::sal_Bool _enabled ) throw (::com::sun::star::uno::RuntimeException)
91 //TabControl* pTabControl = (TabControl*)GetWindow();
92 //if ( pTabControl )
93 // pTabControl->EnablePage(0, true);
95 OUString SAL_CALL VCLXTabPageModel::getTitle() throw (::com::sun::star::uno::RuntimeException)
97 //TabControl* pTabControl = (TabControl*)GetWindow();
98 //if ( pTabControl )
99 // return pTabControl->GetPageText(0);
100 //else
101 return OUString();
103 void SAL_CALL VCLXTabPageModel::setTitle( const OUString& _title ) throw (::com::sun::star::uno::RuntimeException)
105 //TabControl* pTabControl = (TabControl*)GetWindow();
106 //if ( pTabControl )
107 // pTabControl->SetPageText(0, _title);
110 OUString SAL_CALL VCLXTabPageModel::getImageURL() throw (::com::sun::star::uno::RuntimeException)
112 return OUString();
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)
120 //return m_sTooltip;
121 return OUString();
123 void SAL_CALL VCLXTabPageModel::setToolTip( const OUString& _tooltip ) throw (::com::sun::star::uno::RuntimeException)
125 (void)_tooltip;
127 ::cppu::IPropertyArrayHelper& VCLXTabPageModel::getInfoHelper()
129 static UnoPropertyArrayHelper* pHelper = NULL;
130 if ( !pHelper )
132 com::sun::star::uno::Sequence<sal_Int32> aIDs = ImplGetPropertyIds();
133 pHelper = new UnoPropertyArrayHelper( aIDs );
135 return *pHelper;
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() ) );
140 return xInfo;
143 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */