You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2013/02/24 12:53:51 UTC

svn commit: r1449463 - in /openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener: ./ src/ src/description/ src/images/ src/registry/ src/registry/data/ src/registry/data/org/ src/registry/data/org/openoffice/ src/registry/data/org/openoff...

Author: arielch
Date: Sun Feb 24 11:53:50 2013
New Revision: 1449463

URL: http://svn.apache.org/r1449463
Log:
Add css::view::XPrintJobListener example

With the original purpose to test bugs 114817 and 121810.

Added:
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.cxx
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.hxx
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/LICENSE   (with props)
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.cxx
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.hxx
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Makefile   (with props)
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/compfactory.cxx
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/description/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/description/description_en-US.txt   (with props)
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/images/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/images/icon.png   (with props)
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/images/icon_hc.png   (with props)
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/macros.hxx
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/project.mk
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/data/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/data/org/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/data/org/openoffice/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/data/org/openoffice/Office/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/data/org/openoffice/Office/Jobs.xcu
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/components.xml   (with props)
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/description.xml   (with props)
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/manifest.xml   (with props)
    openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/update.xml   (with props)

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.cxx
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.cxx?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.cxx (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.cxx Sun Feb 24 11:53:50 2013
@@ -0,0 +1,199 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "macros.hxx"
+#include "Job.hxx"
+#include "Listener.hxx"
+
+#include <rtl/instance.hxx>
+
+#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
+#include <com/sun/star/document/XEventBroadcaster.hpp>
+#include <com/sun/star/frame/XModel2.hpp>
+#include <com/sun/star/view/XPrintJobBroadcaster.hpp>
+#include <com/sun/star/view/XPrintable.hpp>
+
+using namespace ::com::sun::star;
+using namespace sdk_job_print_listener;
+
+namespace
+{
+    struct StaticImplementationName :
+        public rtl::StaticWithInit <
+            const rtl::OUString,
+            StaticImplementationName >
+    {
+        const rtl::OUString &operator()() const
+        {
+            static rtl::OUString aName(
+                RTL_CONSTASCII_USTRINGPARAM(
+                    JOB_IMPLEMENTATION_NAME ) );
+
+            return aName;
+        }
+    };
+
+    struct StaticSupportedServices :
+        public rtl::StaticWithInit <
+            const css::uno::Sequence< rtl::OUString >,
+            StaticSupportedServices >
+    {
+        const css::uno::Sequence< rtl::OUString > &
+        operator()() const
+        {
+            static css::uno::Sequence< rtl::OUString > aSeq( 1 );
+            aSeq[0] = rtl::OUString(
+                          RTL_CONSTASCII_USTRINGPARAM(
+                              "com.sun.star.task.Job" ) );
+            return aSeq;
+        }
+    };
+}
+
+
+Job::Job ( uno::Reference< uno::XComponentContext > const &rxContext )
+    : m_xContext ( rxContext )
+{
+    OSL_TRACE ( "Job::Job" );
+}
+
+Job::~Job()
+{
+    OSL_TRACE ( "Job::~Job" );
+}
+
+// ::com::sun::star::task::XJob:
+uno::Any SAL_CALL Job::execute (
+    const uno::Sequence< beans::NamedValue > &aArguments )
+throw ( lang::IllegalArgumentException,
+        uno::Exception, uno::RuntimeException )
+{
+    OSL_TRACE ( "Job::execute" );
+
+    ::sal_Int32 i = 0;
+    ::sal_Int32 nLength = aArguments.getLength();
+    const beans::NamedValue *pArray = aArguments.getConstArray();
+    uno::Sequence< beans::NamedValue > lEnv;
+
+    for ( i = 0; i < nLength; ++i )
+    {
+        if ( pArray[i].Name.equalsAscii ( "Environment" ) )
+        {
+            pArray[i].Value >>= lEnv;
+            break;
+        }
+    }
+
+    uno::Reference< frame::XModel2 > xModel;
+    nLength = lEnv.getLength();
+    pArray = lEnv.getConstArray();
+
+    for ( i = 0; i < nLength; ++i )
+    {
+        if ( pArray[i].Name.equalsAscii ( "Model" ) )
+        {
+            pArray[i].Value >>= xModel;
+            break;
+        }
+    }
+
+    // only listen for documents that can be printed
+    uno::Reference< view::XPrintable > xPrintable ( xModel, uno::UNO_QUERY );
+    if ( !xPrintable.is() )
+        return uno::Any();
+
+    PrintListener *pListener = new PrintListener ( m_xContext );
+
+    // the XDocumentEventBroadcaster notifies only "OnPrint" events
+    // that is, *only* css::view::PrintableState_JOB_STARTED
+    uno::Reference< document::XDocumentEventBroadcaster > xBroadcaster(
+        xModel, uno::UNO_QUERY );
+    if ( xBroadcaster.is() )
+    {
+        xBroadcaster->addDocumentEventListener ( pListener );
+    }
+    else
+    {
+        uno::Reference< document::XEventBroadcaster > xOldBroadcaster(
+            xModel, uno::UNO_QUERY );
+        if ( xOldBroadcaster.is() )
+        {
+            xOldBroadcaster->addEventListener ( pListener );
+        }
+    }
+
+    // the XPrintJobBroadcaster gives more detailed notification
+    uno::Reference< view::XPrintJobBroadcaster > xPrintBroadcaster(
+        xModel, uno::UNO_QUERY );
+    if ( xPrintBroadcaster.is() )
+        xPrintBroadcaster->addPrintJobListener( pListener );
+
+    return uno::Any();
+}
+
+
+// com.sun.star.uno.XServiceInfo:
+::rtl::OUString SAL_CALL Job::getImplementationName()
+throw ( uno::RuntimeException )
+{
+    return StaticImplementationName::get();
+}
+
+::sal_Bool SAL_CALL Job::supportsService ( ::rtl::OUString const &serviceName )
+throw ( uno::RuntimeException )
+{
+    const uno::Sequence< ::rtl::OUString > &sServiceNames = StaticSupportedServices::get();
+    const rtl::OUString *pStr = sServiceNames.getConstArray();
+    const rtl::OUString *pEnd; pStr + sServiceNames.getLength();
+    for ( ; pStr != pEnd; pStr++ )
+    {
+        if ( pStr && *pStr == serviceName )
+            break;
+    }
+
+    return pStr != pEnd;
+}
+
+uno::Sequence< ::rtl::OUString > SAL_CALL Job::getSupportedServiceNames()
+throw ( uno::RuntimeException )
+{
+    return StaticSupportedServices::get();
+}
+
+
+uno::Reference< uno::XInterface > Job::Create (
+    const uno::Reference< uno::XComponentContext > &rxContext )
+throw ( uno::Exception )
+{
+    return static_cast< ::cppu::OWeakObject * > ( new Job ( rxContext ) );
+}
+
+::rtl::OUString Job::getImplementationName_static()
+{
+    return StaticImplementationName::get();
+}
+
+uno::Sequence< ::rtl::OUString > Job::getSupportedServiceNames_static()
+{
+    return StaticSupportedServices::get();
+}
+
+

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.hxx
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.hxx?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.hxx (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Job.hxx Sun Feb 24 11:53:50 2013
@@ -0,0 +1,69 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef OOO_SDK_PRINT_JOB_HXX
+#define OOO_SDK_PRINT_JOB_HXX
+
+#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include <com/sun/star/task/XJob.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+namespace css = com::sun::star;
+
+namespace sdk_job_print_listener
+{
+
+    namespace
+    {
+        typedef ::cppu::WeakImplHelper2 <
+            css::task::XJob,
+            css::lang::XServiceInfo > Job_Base;
+    }
+
+    class Job :
+        protected ::cppu::BaseMutex,
+        public Job_Base
+    {
+        private:
+            css::uno::Reference< css::uno::XComponentContext > m_xContext;
+
+        public:
+            explicit Job( const css::uno::Reference< css::uno::XComponentContext > &rxContext );
+            virtual ~Job();
+
+            static css::uno::Reference< css::uno::XInterface > Create( const css::uno::Reference< css::uno::XComponentContext > &rxContext ) throw( css::uno::Exception );
+            static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static();
+            static ::rtl::OUString getImplementationName_static();
+
+            // ::com::sun::star::task::XJob
+            virtual css::uno::Any SAL_CALL execute( const css::uno::Sequence< css::beans::NamedValue > &Arguments ) throw ( css::lang::IllegalArgumentException, css::uno::Exception, css::uno::RuntimeException );
+
+            // ::com::sun::star::lang::XServiceInfo:
+            virtual ::rtl::OUString SAL_CALL getImplementationName() throw ( css::uno::RuntimeException );
+            virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString &ServiceName ) throw ( css::uno::RuntimeException );
+            virtual css::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw ( css::uno::RuntimeException );
+    };
+}
+
+#endif

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/LICENSE
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/LICENSE?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/LICENSE (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/LICENSE Sun Feb 24 11:53:50 2013
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright 2011, 2012 Apache Software Foundation
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Propchange: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/LICENSE
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.cxx
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.cxx?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.cxx (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.cxx Sun Feb 24 11:53:50 2013
@@ -0,0 +1,104 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "macros.hxx"
+#include "Listener.hxx"
+
+using namespace ::com::sun::star;
+using namespace sdk_job_print_listener;
+
+PrintListener::PrintListener ( uno::Reference< uno::XComponentContext > const &rxContext )
+    : m_xContext ( rxContext )
+{
+    OSL_TRACE ( "PrintListener::PrintListener" );
+}
+
+PrintListener::~PrintListener()
+{
+    OSL_TRACE ( "PrintListener::~PrintListener" );
+}
+
+// ::com::sun::star::view::XPrintJobListener
+void SAL_CALL PrintListener::printJobEvent(
+    const css::view::PrintJobEvent &aPrintJobEvent )
+throw ( css::uno::RuntimeException )
+{
+    OSL_TRACE( "PrintListener::printJobEvent" );
+
+#if OSL_DEBUG_LEVEL > 0
+    switch ( aPrintJobEvent.State )
+    {
+        case css::view::PrintableState_JOB_STARTED:
+            OSL_TRACE( "PrintListener::printJobEvent - JOB_STARTED" );
+            break;
+        case css::view::PrintableState_JOB_COMPLETED:
+            OSL_TRACE( "PrintListener::printJobEvent - JOB_COMPLETED" );
+            break;
+        case css::view::PrintableState_JOB_SPOOLED:
+            OSL_TRACE( "PrintListener::printJobEvent - JOB_SPOOLED" );
+            break;
+        case css::view::PrintableState_JOB_ABORTED:
+            OSL_TRACE( "PrintListener::printJobEvent - JOB_ABORTED" );
+            break;
+        case css::view::PrintableState_JOB_FAILED:
+            OSL_TRACE( "PrintListener::printJobEvent - JOB_FAILED" );
+            break;
+        case css::view::PrintableState_JOB_SPOOLING_FAILED:
+            OSL_TRACE( "PrintListener::printJobEvent - JOB_SPOOLING_FAILED" );
+            break;
+    }
+#else
+    (void) aPrintJobEvent;
+#endif
+}
+
+
+// ::com::sun::star::document::XDocumentEventListener:
+void SAL_CALL PrintListener::documentEventOccured( const document::DocumentEvent &rEvent )
+throw ( uno::RuntimeException )
+{
+    OSL_TRACE( "PrintListener::documentEventOccured - EventName = %s", U2C( rEvent.EventName ) );
+
+    if ( rEvent.EventName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM ( "OnPrint" ) ) )
+    {
+        // Do something...
+    }
+}
+
+
+// ::com::sun::star::document::XEventListener:
+void SAL_CALL PrintListener::notifyEvent( const document::EventObject   &rEvent )
+throw ( uno::RuntimeException )
+{
+    OSL_TRACE ( "PrintListener::notifyEvent - EventName = %s", U2C ( rEvent.EventName ) );
+
+    document::DocumentEvent aDocEvent;
+    aDocEvent.EventName = rEvent.EventName;
+    aDocEvent.Source = rEvent.Source;
+    documentEventOccured ( aDocEvent );
+}
+
+// ::com::sun::star::lang::XEventListener:
+void SAL_CALL PrintListener::disposing( const lang::EventObject &/*Source*/ )
+throw ( uno::RuntimeException )
+{
+    OSL_TRACE ( "PrintListener::disposing" );
+}

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.hxx
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.hxx?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.hxx (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Listener.hxx Sun Feb 24 11:53:50 2013
@@ -0,0 +1,67 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef OOO_SDK_PRINT_LISTENER_HXX
+#define OOO_SDK_PRINT_LISTENER_HXX
+
+#include <cppuhelper/implbase3.hxx>
+
+#include <com/sun/star/document/XDocumentEventListener.hpp>
+#include <com/sun/star/document/XEventListener.hpp>
+#include <com/sun/star/view/XPrintJobListener.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+namespace css = com::sun::star;
+
+namespace sdk_job_print_listener
+{
+    namespace
+    {
+        typedef ::cppu::WeakImplHelper3 <
+            css::view::XPrintJobListener,
+            css::document::XDocumentEventListener,
+            css::document::XEventListener > PrintListener_Base;
+    }
+
+    class PrintListener : public PrintListener_Base
+    {
+        private:
+            css::uno::Reference< css::uno::XComponentContext >  m_xContext;
+
+        public:
+            PrintListener ( const css::uno::Reference< css::uno::XComponentContext > &rxContext );
+            virtual ~PrintListener();
+
+            // ::com::sun::star::view::XPrintJobListener
+            virtual void SAL_CALL printJobEvent( const css::view::PrintJobEvent &Event ) throw ( css::uno::RuntimeException );
+
+            // ::com::sun::star::document::XDocumentEventListener:
+            virtual void SAL_CALL documentEventOccured ( const css::document::DocumentEvent &Event ) throw ( css::uno::RuntimeException );
+
+            // ::com::sun::star::document::XEventListener:
+            virtual void SAL_CALL notifyEvent ( const css::document::EventObject   &Event ) throw ( css::uno::RuntimeException );
+
+            // ::com::sun::star::lang::XEventListener:
+            virtual void SAL_CALL disposing ( const css::lang::EventObject &Source ) throw ( css::uno::RuntimeException );
+    };
+}
+
+#endif

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Makefile
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Makefile?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Makefile (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Makefile Sun Feb 24 11:53:50 2013
@@ -0,0 +1,217 @@
+#**************************************************************
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+#**************************************************************
+
+PRJ=../../../../..
+SETTINGS=$(PRJ)/settings
+
+include $(SETTINGS)/settings.mk
+include $(SETTINGS)/std.mk
+include $(SETTINGS)/dk.mk
+include $(SETTINGS)/platform.mk
+
+include project.mk
+
+COMP_NAME=PrintListener
+
+OUT_COMP_INC=$(OUT_INC)/$(COMP_NAME)
+OUT_COMP_GEN=$(OUT_MISC)/$(COMP_NAME)
+OUT_COMP_SLO=$(OUT_SLO)/$(COMP_NAME)
+OUT_COMP_LIB=$(SHAREDLIB_OUT)/$(COMP_NAME)
+OUT_COMP_BIN=$(OUT_BIN)/$(COMP_NAME)
+OUT_COMP_DEPLOY=$(OUT_DEPLOY)/$(COMP_NAME)
+
+COMP_IMPL_NAME=$(COMP_NAME).uno.$(SHAREDLIB_EXT)
+COMP_PACKAGE_FILENAME=$(COMP_NAME)-$(EXTENSION_VERSION)-$(subst _,-,$(EXTENSION_PLATFORM)).$(UNOOXT_EXT)
+COMP_PACKAGE = $(OUT_COMP_BIN)/$(COMP_PACKAGE_FILENAME)
+COMP_PACKAGE_URL = $(subst \\,\,"$(COMP_PACKAGE)")
+COMP_UNOPKG_MANIFEST    = $(OUT_COMP_GEN)/$(COMPONENT_NAME)/META-INF/manifest.xml
+COMP_UNOPKG_DESCRIPTION = $(OUT_COMP_GEN)/$(COMPONENT_NAME)/description.xml
+COMP_MAPFILE = $(OUT_COMP_GEN)/$(COMP_NAME).uno.map
+COMP_COMPONENTS = $(OUT_COMP_GEN)/$(COMP_NAME).components
+
+# xcu
+COMP_CFG=\
+	registry/data/org/openoffice/Office/Jobs.xcu
+COMP_CFG_FILES = $(foreach cfgfile,$(COMP_CFG),$(OUT_COMP_GEN)/$(cfgfile))
+
+DESCRIPTION_IDENTIFIER=$(EXTENSION_ID)
+DESCRIPTION_PLATFORM=$(TARGET_PLATFORM)
+DESCRIPTION_UPDATE_FILENAME=$(EXTENSION_PLATFORM)-update.xml
+
+# Allow deploying the extension when running it
+ENV_USER_INSTALL=-env:"UserInstallation=$(URLPREFIX)$(OUT_COMP_DEPLOY)"
+OFFICE_START_OPTIONS=-nologo -nofirststartwizard -norestore -quickstart=no -writer
+OXT_DEPLOYEDFLAG=$(OUT_COMP_GEN)/so_deployed_$(COMP_NAME).flag
+
+# Files
+COMP_CXXFILES = \
+	Job.cxx \
+	Listener.cxx \
+	compfactory.cxx
+
+COMP_SLOFILES = $(patsubst %.cxx,$(OUT_COMP_SLO)/%.$(OBJ_EXT),$(COMP_CXXFILES))
+
+CC_DEFINES+= \
+	-DJOB_IMPLEMENTATION_NAME=\"$(JOB_IMPLEMENTATION_NAME)\"
+
+# Targets and rules
+.PHONY: ALL update-desc PrintListener PrintListener.run
+ALL : \
+	update-desc \
+	PrintListener
+
+include $(SETTINGS)/stdtarget.mk
+
+$(OUT_COMP_SLO)/%.$(OBJ_EXT) : %.cxx $(SDKTYPEFLAG)
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(CC) $(CC_FLAGS) $(STL_INCLUDES) $(CC_INCLUDES) -I$(OUT_COMP_INC) $(CC_DEFINES) $(CC_OUTPUT_SWITCH)$(subst /,$(PS),$@) $<
+
+
+ifeq "$(OS)" "WIN"
+$(OUT_COMP_LIB)/%.$(SHAREDLIB_EXT) : $(COMP_SLOFILES)
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN))
+	$(LINK) \
+		$(COMP_LINK_FLAGS) \
+		/OUT:$@ \
+		/MAP:$(OUT_COMP_GEN)/$(subst $(SHAREDLIB_EXT),map,$(@F)) \
+		$(COMP_SLOFILES) \
+		$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) $(STLPORTLIB) \
+		msvcrt.lib kernel32.lib
+	$(LINK_MANIFEST)
+else
+$(OUT_COMP_LIB)/%.$(SHAREDLIB_EXT) : $(COMP_SLOFILES)
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(LINK) $(COMP_LINK_FLAGS) $(LINK_LIBS) -o $@ $(COMP_SLOFILES) \
+		$(CPPUHELPERLIB) $(CPPULIB) $(SALLIB) \
+		$(STLPORTLIB) $(STC++LIB) $(CPPUHELPERDYLIB) $(CPPUDYLIB) $(SALDYLIB)
+ifeq "$(OS)" "MACOSX"
+	$(INSTALL_NAME_URELIBS)  $@
+endif
+endif
+
+$(OUT_COMP_GEN)/%.xcu : %.xcu
+	-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(SDK_CAT) $< | $(SDK_SED) \
+		-e "s/#JOB_IMPLEMENTATION_NAME#/$(JOB_IMPLEMENTATION_NAME)/" > $@
+
+$(OUT_COMP_GEN)/%.xcs: %.xcs
+	-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(SDK_CAT) $<  > $@
+
+# rule for extension description.xml
+$(COMP_UNOPKG_DESCRIPTION) :  xml/description.xml
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(SDK_CAT) $< | $(SDK_SED) \
+	-e "s/#EXTENSION_VERSION#/$(EXTENSION_VERSION)/" \
+	-e "s/#DESCRIPTION_IDENTIFIER#/$(DESCRIPTION_IDENTIFIER)/" \
+	-e "s/#EXTENSION_PLATFORM#/$(EXTENSION_PLATFORM)/" \
+	-e "s/#DESCRIPTION_OOO_MIN_VER#/$(DESCRIPTION_OOO_MIN_VER)/" \
+	-e "s/#DESCRIPTION_OOO_MAX_VER#/$(DESCRIPTION_OOO_MAX_VER)/" \
+	-e "s/#DESCRIPTION_DEP_NAME#/$(DESCRIPTION_DEP_NAME)/" \
+	-e "s/#DESCRIPTION_PUBLISHER_URL#/$(subst /,\/,$(DESCRIPTION_PUBLISHER_URL))/" \
+	-e "s/#DESCRIPTION_PUBLISHER_NAME#/$(DESCRIPTION_PUBLISHER_NAME)/" \
+	-e "s/#DESCRIPTION_DISPLAY_NAME#/$(DESCRIPTION_DISPLAY_NAME)/" \
+	-e "s/#DESCRIPTION_UPDATE#/$(subst /,\/,$(DESCRIPTION_UPDATE_BASEURL)$(DESCRIPTION_UPDATE_FILENAME))/"  > $@
+
+
+# rule for update description
+$(OUT_COMP_BIN)/$(DESCRIPTION_UPDATE_FILENAME) : xml/update.xml
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(SDK_CAT) $< | $(SDK_SED) \
+		-e "s/#DESCRIPTION_IDENTIFIER#/$(DESCRIPTION_IDENTIFIER)/" \
+		-e "s/#EXTENSION_VERSION#/$(EXTENSION_VERSION)/" \
+		-e "s/#DESCRIPTION_PUBLISHER_URL#/$(subst /,\/,$(DESCRIPTION_PUBLISHER_URL))/" \
+		-e "s/#DESCRIPTION_PUBLISHER_NAME#/$(DESCRIPTION_PUBLISHER_NAME)/" \
+		-e "s/#UPDATE_DOWNLOAD#/$(subst /,\/,$(UPDATE_DOWNLOAD_BASE)$(COMP_PACKAGE_FILENAME))/" \
+		-e "s/#RELEASE_NOTES#/$(subst /,\/,$(RELEASE_NOTES))/" > $@
+
+# rule for component package manifest
+$(COMP_UNOPKG_MANIFEST) : xml/manifest.xml
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(SDK_CAT) $< | $(SDK_SED) \
+		-e "s/#COMP_NAME#/$(COMP_NAME)/" \
+		-e "s/#UNOPKG_PLATFORM#/$(UNOPKG_PLATFORM)/" > $@
+
+# rule for component pasive registration
+$(COMP_COMPONENTS) : xml/components.xml
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(SDK_CAT) $< | $(SDK_SED) \
+		-e "s/#JOB_IMPLEMENTATION_NAME#/$(JOB_IMPLEMENTATION_NAME)/"  \
+		-e "s/#UNOPKG_PLATFORM#/$(UNOPKG_PLATFORM)/" \
+		-e "s/#COMP_IMPL_NAME#/$(COMP_IMPL_NAME)/" > $@
+
+$(OUT_COMP_GEN)/images/%.png : images/%.png
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$@)
+
+$(OUT_COMP_GEN)/description/%.txt : description/%.txt
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$@)
+
+# rule for component package file
+$(COMP_PACKAGE) : $(OUT_COMP_LIB)/$(COMP_IMPL_NAME) \
+			$(COMP_CFG_FILES) \
+			$(COMP_UNOPKG_MANIFEST) \
+			$(COMP_COMPONENTS)  \
+			$(COMP_UNOPKG_DESCRIPTION) \
+			LICENSE \
+			$(OUT_COMP_GEN)/images/icon.png \
+			$(OUT_COMP_GEN)/images/icon_hc.png \
+			$(OUT_COMP_GEN)/description/description_en-US.txt
+	-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
+	-$(MKDIR) $(subst /,$(PS),$(@D))
+	-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
+	$(COPY) $(subst /,$(PS),$<) $(subst /,$(PS),$(OUT_COMP_GEN)/$(UNOPKG_PLATFORM))
+	-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_GEN)/LICENSE)
+	$(COPY) $(subst /,$(PS),LICENSE) $(subst /,$(PS),$(OUT_COMP_GEN)/LICENSE/)
+	cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -u $(COMP_PACKAGE) $(COMP_NAME).components description.xml
+	cd $(subst /,$(PS),$(OUT_COMP_GEN)) && $(SDK_ZIP) -ur $(COMP_PACKAGE) $(UNOPKG_PLATFORM)/ LICENSE/ META-INF/  registry/ images/ description/
+
+update-desc : $(OUT_COMP_BIN)/$(DESCRIPTION_UPDATE_FILENAME)
+
+PrintListener : $(COMP_PACKAGE)
+	@echo --------------------------------------------------------------------------------
+	@echo Please use the following command to deploy the example!
+	@echo -
+	@echo $(MAKE) PrintListener.run
+	@echo -
+	@echo --------------------------------------------------------------------------------
+
+PrintListener.run: $(OXT_DEPLOYEDFLAG)
+	"$(OFFICE_PROGRAM_PATH)$(PS)soffice" $(OFFICE_START_OPTIONS)  $(ENV_USER_INSTALL)
+
+$(OXT_DEPLOYEDFLAG) : $(COMP_PACKAGE)
+	-$(DEL) $(subst \\,\,$(subst /,$(PS),$@))
+	-$(MKDIR) $(subst /,$(PS),$(OUT_COMP_DEPLOY))
+	$(DEPLOYTOOL) $(COMP_PACKAGE_URL) $(ENV_USER_INSTALL)
+	@echo flagged > $(subst /,$(PS),$@)
+
+.PHONY: clean
+clean :
+	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_INC))
+	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_GEN))
+	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_SLO))
+	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_LIB))
+	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_BIN))
+	-$(DELRECURSIVE) $(subst /,$(PS),$(OUT_COMP_DEPLOY))

Propchange: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/Makefile
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/compfactory.cxx
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/compfactory.cxx?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/compfactory.cxx (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/compfactory.cxx Sun Feb 24 11:53:50 2013
@@ -0,0 +1,60 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include <cppuhelper/factory.hxx>
+#include <cppuhelper/implementationentry.hxx>
+
+#include "Job.hxx"
+
+namespace sdk_job_print_listener
+{
+    static ::cppu::ImplementationEntry const s_impl_entries[] =
+    {
+        {
+            Job::Create,
+            Job::getImplementationName_static,
+            Job::getSupportedServiceNames_static,
+            ::cppu::createSingleComponentFactory,
+            0,
+            0
+        },
+        { 0, 0, 0, 0, 0, 0 }
+    };
+}
+
+extern "C"
+{
+    SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
+        const sal_Char **ppEnvTypeName, uno_Environment ** )
+    {
+        *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+    }
+
+    SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory(
+        const sal_Char *implName, void *xServiceManager, void *xRegistryKey )
+    {
+        return ::cppu::component_getFactoryHelper(
+                   implName,
+                   xServiceManager,
+                   xRegistryKey,
+                   sdk_job_print_listener::s_impl_entries );
+    }
+}

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/description/description_en-US.txt
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/description/description_en-US.txt?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/description/description_en-US.txt (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/description/description_en-US.txt Sun Feb 24 11:53:50 2013
@@ -0,0 +1 @@
+This extension implements a component that listens for printing events.
\ No newline at end of file

Propchange: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/description/description_en-US.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/images/icon.png
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/images/icon.png?rev=1449463&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/images/icon.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/images/icon_hc.png
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/images/icon_hc.png?rev=1449463&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/images/icon_hc.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/macros.hxx
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/macros.hxx?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/macros.hxx (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/macros.hxx Sun Feb 24 11:53:50 2013
@@ -0,0 +1,35 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#ifndef OOO_SDK__MACROS_HXX
+#define OOO_SDK__MACROS_HXX
+
+#ifndef JOB_IMPLEMENTATION_NAME
+#error  You must define JOB_IMPLEMENTATION_NAME
+#endif
+
+#define C2U( constAsciiStr ) \
+    ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( constAsciiStr ) ) )
+
+#define U2C( ouString ) \
+    ( ::rtl::OUStringToOString( ouString, RTL_TEXTENCODING_ASCII_US ).getStr() )
+
+#endif

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/project.mk
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/project.mk?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/project.mk (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/project.mk Sun Feb 24 11:53:50 2013
@@ -0,0 +1,38 @@
+#**************************************************************
+#
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#
+#**************************************************************
+
+DESCRIPTION_OOO_MIN_VER=4.0
+DESCRIPTION_OOO_MAX_VER=4.9
+DESCRIPTION_DEP_NAME=Apache OpenOffice
+
+EXTENSION_ID=org.apache.openoffice.framework.jobs.PrintListener
+EXTENSION_VERSION=0.0.1
+
+DESCRIPTION_PUBLISHER_URL=http://www.openoffice.org/api
+DESCRIPTION_PUBLISHER_NAME=Apache OpenOffice
+DESCRIPTION_DISPLAY_NAME=Print Listener
+
+DESCRIPTION_UPDATE_BASEURL=http://www.openoffice.org/api/dummyupdate
+DESCRIPTION_UPDATE_URL=http://www.openoffice.org/api/dummyupdate/update.xml
+UPDATE_DOWNLOAD_BASE=http://www.openoffice.org/api/dummydownload/
+RELEASE_NOTES=http://www.openoffice.org/api/dummy_release_notes
+
+JOB_IMPLEMENTATION_NAME=org.apache.openoffice.framework.jobs.PrintListener

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/data/org/openoffice/Office/Jobs.xcu
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/data/org/openoffice/Office/Jobs.xcu?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/data/org/openoffice/Office/Jobs.xcu (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/registry/data/org/openoffice/Office/Jobs.xcu Sun Feb 24 11:53:50 2013
@@ -0,0 +1,41 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--***********************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ ***********************************************************-->
+<oor:component-data
+xmlns:oor="http://openoffice.org/2001/registry"
+xmlns:xs="http://www.w3.org/2001/XMLSchema"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+oor:package="org.openoffice.Office" oor:name="Jobs" >
+    <node oor:name="Jobs">
+        <node oor:name="org.openoffice.sdk.job.UpdateOnPrintJob" oor:op="replace">
+            <prop oor:name="Service">
+                <value>#JOB_IMPLEMENTATION_NAME#</value>
+            </prop>
+        </node>
+    </node>
+    <node oor:name="Events">
+        <node oor:name="onDocumentOpened" oor:op="fuse">
+            <node oor:name="JobList">
+                <node oor:name="org.openoffice.sdk.job.UpdateOnPrintJob" oor:op="replace"/>
+            </node>
+        </node>
+    </node>
+</oor:component-data>

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/components.xml
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/components.xml?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/components.xml (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/components.xml Sun Feb 24 11:53:50 2013
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ ***********************************************************-->
+<components xmlns="http://openoffice.org/2010/uno-components">
+  <component loader="com.sun.star.loader.SharedLibrary" uri="#UNOPKG_PLATFORM#/#COMP_IMPL_NAME#">
+    <implementation name="#JOB_IMPLEMENTATION_NAME#">
+      <service name="com.sun.star.task.Job"/>
+    </implementation>
+  </component>
+</components>

Propchange: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/description.xml
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/description.xml?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/description.xml (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/description.xml Sun Feb 24 11:53:50 2013
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ ***********************************************************-->
+<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <version value="#EXTENSION_VERSION#"/>
+    <identifier value="#DESCRIPTION_IDENTIFIER#"/>
+    <platform value="#EXTENSION_PLATFORM#"/>
+    <dependencies>
+        <OpenOffice.org-minimal-version value="#DESCRIPTION_OOO_MIN_VER#" d:name="#DESCRIPTION_DEP_NAME#"/>
+        <OpenOffice.org-maximal-version value="#DESCRIPTION_OOO_MAX_VER#" d:name="#DESCRIPTION_DEP_NAME#"/>
+    </dependencies>
+    <publisher>
+        <name xlink:href="#DESCRIPTION_PUBLISHER_URL#" lang="en">#DESCRIPTION_PUBLISHER_NAME#</name>
+    </publisher>
+    <display-name>
+        <name lang="en-US">#DESCRIPTION_DISPLAY_NAME#</name>
+    </display-name>
+    <icon>
+        <default xlink:href="images/icon.png"/>
+        <high-contrast xlink:href="images/icon_hc.png"/>
+    </icon>
+    <registration>
+        <simple-license accept-by="admin" default-license-id="lic-en-US" suppress-if-required="true" >
+             <license-text xlink:href="LICENSE/LICENSE" lang="en-US" license-id="lic-en-US"/>
+        </simple-license>
+    </registration>
+    <extension-description>
+        <src xlink:href="description/description_en-US.txt" lang="en-US"/>
+    </extension-description>
+    <update-information>
+        <src xlink:href="#DESCRIPTION_UPDATE#" />
+    </update-information>
+</description>

Propchange: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/description.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/manifest.xml
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/manifest.xml?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/manifest.xml (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/manifest.xml Sun Feb 24 11:53:50 2013
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ ***********************************************************-->
+<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
+<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
+  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+                       manifest:full-path="registry/data/org/openoffice/Office/Jobs.xcu"/>
+  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+                       manifest:full-path="registry/data/org/openoffice/sdk/DemoExtension/OnPrintUpdater.xcu"/>
+  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-schema"
+                       manifest:full-path="registry/schema/org/openoffice/sdk/DemoExtension/OnPrintUpdater.xcs"/>
+  <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-components;platform=#UNOPKG_PLATFORM#"
+                       manifest:full-path="#COMP_NAME#.components"/>
+</manifest:manifest>

Propchange: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/manifest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/update.xml
URL: http://svn.apache.org/viewvc/openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/update.xml?rev=1449463&view=auto
==============================================================================
--- openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/update.xml (added)
+++ openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/update.xml Sun Feb 24 11:53:50 2013
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--***********************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ ***********************************************************-->
+<description xmlns="http://openoffice.org/extensions/description/2006" xmlns:d="http://openoffice.org/extensions/description/2006" xmlns:xlink="http://www.w3.org/1999/xlink">
+    <identifier value="#DESCRIPTION_IDENTIFIER#"/>
+    <version value="#EXTENSION_VERSION#"/>
+    <publisher>
+        <name xlink:href="#DESCRIPTION_PUBLISHER_URL#" lang="en">#DESCRIPTION_PUBLISHER_NAME#</name>
+    </publisher>
+    <update-download>
+        <src xlink:href="#UPDATE_DOWNLOAD#"/>
+    </update-download>
+    <release-notes>
+        <src xlink:href="#RELEASE_NOTES#" lang="en"/>
+    </release-notes>
+</description>

Propchange: openoffice/devtools/sdk-examples/trunk/cpp/components/PrintListener/src/xml/update.xml
------------------------------------------------------------------------------
    svn:eol-style = native