summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-01-23 12:03:34 +0100
committerMatúš Kukan <matus.kukan@collabora.com>2014-01-23 23:38:58 +0100
commit574f963fad514031190ae2a838f1d11a9fa8449f (patch)
tree3e03b7d477427dd1870d62bba8aaad1b48c079a5 /toolkit
parent20b7476142f75b49d10a75e48429a94cff0cec32 (diff)
tk: Constructor feature for SpinningProgressControlModel.
Change-Id: I137cebba9743f6d703412d6d6f8a39d47d01738d
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/controls/spinningprogress.cxx78
-rw-r--r--toolkit/source/helper/registerservices.cxx3
-rw-r--r--toolkit/source/helper/servicenames.cxx1
-rw-r--r--toolkit/util/tk.component3
4 files changed, 44 insertions, 41 deletions
diff --git a/toolkit/source/controls/spinningprogress.cxx b/toolkit/source/controls/spinningprogress.cxx
index a4d402f9b682..a9d207d8c9b1 100644
--- a/toolkit/source/controls/spinningprogress.cxx
+++ b/toolkit/source/controls/spinningprogress.cxx
@@ -17,39 +17,39 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
-#include "toolkit/controls/spinningprogress.hxx"
-#include "toolkit/helper/servicenames.hxx"
-#include "toolkit/helper/unopropertyarrayhelper.hxx"
-
-
#include <rtl/ustrbuf.hxx>
+#include <toolkit/controls/animatedimages.hxx>
#include <tools/diagnose_ex.h>
#include <vcl/throbber.hxx>
-//......................................................................................................................
-namespace toolkit
+using namespace css;
+using namespace css::uno;
+
+namespace {
+
+typedef toolkit::AnimatedImagesControlModel SpinningProgressControlModel_Base;
+class SpinningProgressControlModel : public SpinningProgressControlModel_Base
{
-//......................................................................................................................
-
- using ::com::sun::star::uno::Reference;
- using ::com::sun::star::uno::XInterface;
- using ::com::sun::star::uno::UNO_QUERY;
- using ::com::sun::star::uno::UNO_QUERY_THROW;
- using ::com::sun::star::uno::UNO_SET_THROW;
- using ::com::sun::star::uno::Exception;
- using ::com::sun::star::uno::RuntimeException;
- using ::com::sun::star::uno::Any;
- using ::com::sun::star::uno::makeAny;
- using ::com::sun::star::uno::Sequence;
- using ::com::sun::star::uno::Type;
- using ::com::sun::star::beans::XPropertySetInfo;
- using ::com::sun::star::uno::XComponentContext;
-
- //==================================================================================================================
- //= SpinningProgressControlModel
- //==================================================================================================================
- //------------------------------------------------------------------------------------------------------------------
+public:
+ SpinningProgressControlModel( css::uno::Reference< css::uno::XComponentContext > const & i_factory );
+ SpinningProgressControlModel( const SpinningProgressControlModel& i_copySource );
+
+ virtual UnoControlModel* Clone() const;
+
+ // XPropertySet
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(css::uno::RuntimeException);
+
+ // XPersistObject
+ OUString SAL_CALL getServiceName() throw(css::uno::RuntimeException);
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) throw(css::uno::RuntimeException);
+ css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(css::uno::RuntimeException);
+
+protected:
+ ~SpinningProgressControlModel();
+};
+
SpinningProgressControlModel::SpinningProgressControlModel( Reference< XComponentContext > const & i_factory )
:SpinningProgressControlModel_Base( i_factory )
{
@@ -95,16 +95,16 @@ namespace toolkit
}
//------------------------------------------------------------------------------------------------------------------
- Reference< XPropertySetInfo > SAL_CALL SpinningProgressControlModel::getPropertySetInfo( ) throw(RuntimeException)
+ Reference< beans::XPropertySetInfo > SAL_CALL SpinningProgressControlModel::getPropertySetInfo( ) throw(RuntimeException)
{
- static Reference< XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
+ static Reference< beans::XPropertySetInfo > xInfo( createPropertySetInfo( getInfoHelper() ) );
return xInfo;
}
//------------------------------------------------------------------------------------------------------------------
OUString SAL_CALL SpinningProgressControlModel::getServiceName() throw(RuntimeException)
{
- return OUString::createFromAscii( szServiceName_SpinningProgressControlModel );
+ return OUString("com.sun.star.awt.SpinningProgressControlModel");
}
//------------------------------------------------------------------------------------------------------------------
@@ -117,14 +117,20 @@ namespace toolkit
Sequence< OUString > SAL_CALL SpinningProgressControlModel::getSupportedServiceNames() throw(RuntimeException)
{
Sequence< OUString > aServiceNames(3);
- aServiceNames[0] = OUString::createFromAscii( szServiceName_SpinningProgressControlModel );
- aServiceNames[1] = OUString::createFromAscii( szServiceName_AnimatedImagesControlModel );
+ aServiceNames[0] = "com.sun.star.awt.SpinningProgressControlModel";
+ aServiceNames[1] = "com.sun.star.awt.AnimatedImagesControlModel";
aServiceNames[2] = "com.sun.star.awt.UnoControlModel";
return aServiceNames;
}
-//......................................................................................................................
-} // namespace toolkit
-//......................................................................................................................
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+org_openoffice_comp_toolkit_SpinningProgressControlModel_get_implementation(
+ css::uno::XComponentContext *context,
+ css::uno::Sequence<css::uno::Any> const &)
+{
+ return cppu::acquire(new SpinningProgressControlModel(context));
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/source/helper/registerservices.cxx b/toolkit/source/helper/registerservices.cxx
index 93eacbf6160b..125c6682e3c8 100644
--- a/toolkit/source/helper/registerservices.cxx
+++ b/toolkit/source/helper/registerservices.cxx
@@ -42,7 +42,6 @@
#include <toolkit/controls/tkscrollbar.hxx>
#include "toolkit/controls/tkspinbutton.hxx"
#include <toolkit/controls/animatedimages.hxx>
-#include <toolkit/controls/spinningprogress.hxx>
#include <toolkit/controls/tabpagemodel.hxx>
#include <toolkit/controls/tabpagecontainer.hxx>
#include "toolkit/dllapi.h"
@@ -178,7 +177,6 @@ IMPL_CREATEINSTANCE_CTX( UnoControlTabPageContainer )
IMPL_CREATEINSTANCE_CTX( UnoControlTabPageContainerModel )
IMPL_CREATEINSTANCE( AnimatedImagesControl )
IMPL_CREATEINSTANCE_CTX( AnimatedImagesControlModel )
-IMPL_CREATEINSTANCE_CTX( SpinningProgressControlModel )
IMPL_CREATE_INSTANCE_WITH_GEOMETRY( UnoControlDialogModel )
@@ -284,7 +282,6 @@ TOOLKIT_DLLPUBLIC void* SAL_CALL tk_component_getFactory( const sal_Char* sImple
GET_FACTORY( UnoControlTabPageContainer, szServiceName_UnoControlTabPageContainer, NULL )
GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControl, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControl, NULL )
GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControlModel, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControlModel, NULL )
- GET_FACTORY_WITH_IMPL_PREFIX( SpinningProgressControlModel, "org.openoffice.comp.toolkit", szServiceName_SpinningProgressControlModel, NULL )
if ( rtl_str_compare( sImplementationName, "com.sun.star.awt.comp.AsyncCallback" ) == 0 )
return comp_AsyncCallback_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
diff --git a/toolkit/source/helper/servicenames.cxx b/toolkit/source/helper/servicenames.cxx
index 0cec6c911e96..5e896ab451d5 100644
--- a/toolkit/source/helper/servicenames.cxx
+++ b/toolkit/source/helper/servicenames.cxx
@@ -85,7 +85,6 @@ const sal_Char szServiceName_UnoPageModel[] = "com.sun.star.awt.UnoPageModel";
const sal_Char szServiceName_UnoFrameControl[] = "com.sun.star.awt.UnoControlFrame";
const sal_Char szServiceName_AnimatedImagesControl[] = "com.sun.star.awt.AnimatedImagesControl";
const sal_Char szServiceName_AnimatedImagesControlModel[] = "com.sun.star.awt.AnimatedImagesControlModel";
-const sal_Char szServiceName_SpinningProgressControlModel[] = "com.sun.star.awt.SpinningProgressControlModel";
const sal_Char szServiceName_UnoFrameModel[] = "com.sun.star.awt.UnoFrameModel";
const sal_Char szServiceName_TreeControl[] = "com.sun.star.awt.tree.TreeControl";
const sal_Char szServiceName_TreeControlModel[] = "com.sun.star.awt.tree.TreeControlModel";
diff --git a/toolkit/util/tk.component b/toolkit/util/tk.component
index f1aee155a63a..1a758303988c 100644
--- a/toolkit/util/tk.component
+++ b/toolkit/util/tk.component
@@ -255,7 +255,8 @@
<service name="com.sun.star.awt.UnoControlScrollBar"/>
<service name="stardiv.vcl.control.ScrollBar"/>
</implementation>
- <implementation name="org.openoffice.comp.toolkit.SpinningProgressControlModel">
+ <implementation name="org.openoffice.comp.toolkit.SpinningProgressControlModel"
+ constructor="org_openoffice_comp_toolkit_SpinningProgressControlModel_get_implementation">
<service name="com.sun.star.awt.SpinningProgressControlModel"/>
</implementation>
<implementation name="org.openoffice.comp.toolkit.AnimatedImagesControlModel">