summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-03-12 12:23:38 +0000
committerRüdiger Timm <rt@openoffice.org>2008-03-12 12:23:38 +0000
commit66b0f154bee81750dadd3e27fe8faa1d54a74d48 (patch)
treee8695cce7f952e4fb0fa4584f32a06ee37d5699c /comphelper
parent54e083c197e7b5f2d5cd4f3894c0cb6666614f57 (diff)
INTEGRATION: CWS impresstables2 (1.1.2); FILE ADDED
2008/02/15 12:50:54 cl 1.1.2.2: #i68103# added c'tor and d'tor 2007/07/26 16:43:06 cl 1.1.2.1: #i68103# added implementation helper that supports XWeak and XTypeProvider
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/inc/comphelper/weak.hxx71
1 files changed, 71 insertions, 0 deletions
diff --git a/comphelper/inc/comphelper/weak.hxx b/comphelper/inc/comphelper/weak.hxx
new file mode 100644
index 000000000000..e50da2b735d0
--- /dev/null
+++ b/comphelper/inc/comphelper/weak.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: weak.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: rt $ $Date: 2008-03-12 13:23:38 $
+ *
+ * The Contents of this file are made available subject to
+ * the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2005 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ ************************************************************************/
+#ifndef _COMPHELPER_WEAK_HXX_
+#define _COMPHELPER_WEAK_HXX_
+
+#include "comphelper/comphelperdllapi.h"
+
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weak.hxx>
+
+namespace comphelper
+{
+/** Base class to implement an UNO object supporting types and weak references, i.e. the object can be held
+ weakly (by a ::com::sun::star::uno::WeakReference).
+ This implementation copes with reference counting. Upon last release(), the virtual dtor
+ is called.
+
+ In addition to the features from cppu::OWeakObject, derivations from this class can
+ also used as a base class for ::cppu::ImplInheritanceHelper?
+*/
+class COMPHELPER_DLLPUBLIC OWeakTypeObject : public ::cppu::OWeakObject, public ::com::sun::star::lang::XTypeProvider
+{
+public:
+ OWeakTypeObject();
+ virtual ~OWeakTypeObject();
+
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface(const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL acquire() throw ();
+ virtual void SAL_CALL release() throw ();
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException);
+
+};
+
+}
+
+#endif
+
+