openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arie...@apache.org
Subject svn commit: r1417873 [2/2] - in /openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController: ./ description/ images/ registry/ registry/data/ registry/data/org/ registry/data/org/openoffice/ registry/data/org/openoffice/Off...
Date Thu, 06 Dec 2012 13:33:47 GMT
Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/StatusbarController.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/StatusbarController.hxx?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/StatusbarController.hxx (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/StatusbarController.hxx Thu Dec  6 13:33:40 2012
@@ -0,0 +1,124 @@
+/**************************************************************
+ *
+ * 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 STATUSBARCONTROLLER_HXX
+#define STATUSBARCONTROLLER_HXX
+
+#include <cppuhelper/compbase1.hxx>
+#include <cppuhelper/basemutex.hxx>
+
+#include <com/sun/star/ui/XStatusbarItem.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XStatusbarController.hpp>
+#include <com/sun/star/frame/XStatusListener.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/util/XUpdatable.hpp>
+#include <com/sun/star/util/XURLTransformer.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <map>
+
+namespace framework
+{
+    namespace statusbar_controller_wordcount
+    {
+        typedef cppu::WeakComponentImplHelper1 < com::sun::star::frame::XStatusbarController > StatusbarController_Base;
+
+        class StatusbarController : protected cppu::BaseMutex,
+            public StatusbarController_Base
+        {
+            public:
+                explicit StatusbarController();
+                virtual ~StatusbarController();
+
+                virtual void SAL_CALL dispose() throw ( ::com::sun::star::uno::RuntimeException );
+
+                // com::sun::star::frame::XStatusbarController Methods
+                virtual ::sal_Bool SAL_CALL mouseButtonDown( const ::com::sun::star::awt::MouseEvent &aMouseEvent ) throw ( ::com::sun::star::uno::RuntimeException );
+                virtual ::sal_Bool SAL_CALL mouseMove( const ::com::sun::star::awt::MouseEvent &aMouseEvent ) throw ( ::com::sun::star::uno::RuntimeException );
+                virtual ::sal_Bool SAL_CALL mouseButtonUp( const ::com::sun::star::awt::MouseEvent &aMouseEvent ) throw ( ::com::sun::star::uno::RuntimeException );
+                virtual void SAL_CALL command( const ::com::sun::star::awt::Point &aPos, ::sal_Int32 nCommand, ::sal_Bool bMouseEvent, const ::com::sun::star::uno::Any &aData ) throw ( ::com::sun::star::uno::RuntimeException );
+                virtual void SAL_CALL paint( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > &xGraphics, const ::com::sun::star::awt::Rectangle &rOutputRectangle, ::sal_Int32 nStyle ) throw ( ::com::sun::star::uno::RuntimeException );
+                virtual void SAL_CALL click( const ::com::sun::star::awt::Point &aPos ) throw ( ::com::sun::star::uno::RuntimeException );
+                virtual void SAL_CALL doubleClick( const ::com::sun::star::awt::Point &aPos ) throw ( ::com::sun::star::uno::RuntimeException );
+
+                // com::sun::star::frame::XStatusListener Methods
+                virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent &State ) throw ( ::com::sun::star::uno::RuntimeException );
+
+                // com::sun::star::lang::XEventListener Methods
+                virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject &Source ) throw ( ::com::sun::star::uno::RuntimeException );
+
+                // com::sun::star::util::XUpdatable Methods
+                virtual void SAL_CALL update() throw ( ::com::sun::star::uno::RuntimeException );
+
+                // com::sun::star::lang::XInitialization Methods
+                virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > &aArguments ) throw ( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
+
+            protected:
+
+                struct Listener
+                {
+
+                    explicit Listener(
+                        const ::com::sun::star::util::URL &rURL,
+                        const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > &rDispatch )
+                        : aURL( rURL )
+                        , xDispatch( rDispatch )
+                    {
+                    }
+
+                    ::com::sun::star::util::URL aURL;
+                    ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > xDispatch;
+                };
+
+                typedef ::std::map< ::rtl::OUString, com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > > URLToDispatchMap;
+
+                void ThrowIfDisposed() throw ( com::sun::star::uno::RuntimeException );
+                void BindListeners();
+                void UnbindListeners();
+                bool IsBound() const;
+                ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > GetURLTransformer();
+                // execute methods
+                void Execute( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > &aArgs );
+                void Execute( const rtl::OUString &rCommand, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > &aArgs );
+                void UpdateStatus();
+                void UpdateStatus( const rtl::OUString &rCommand );
+
+                bool m_bInitialized;
+                bool m_bOwnerDraw;
+                rtl::OUString m_sModuleIdentifier;
+                rtl::OUString m_sCommandURL;
+                ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > m_xFrame;
+                ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > m_xStatusbarWindow;
+                ::com::sun::star::uno::Reference< ::com::sun::star::ui::XStatusbarItem > m_xStatusbarItem;
+                ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer;
+                ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
+
+                URLToDispatchMap m_aListenerMap;
+        };
+    }
+}
+
+#endif  /* STATUSBARCONTROLLER_HXX */
+

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountDispatch.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountDispatch.cxx?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountDispatch.cxx (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountDispatch.cxx Thu Dec  6 13:33:40 2012
@@ -0,0 +1,497 @@
+/**************************************************************
+ *
+ * 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 "WordCountDispatch.hxx"
+#include "defines.hxx"
+
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/Pair.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XDispatchProvider.hpp>
+#include <com/sun/star/lang/XMultiComponentFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/text/XTextRangeCompare.hpp>
+#include <com/sun/star/util/XRefreshable.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/i18n/WordType.hpp>
+
+#include <rtl/ustrbuf.hxx>
+#include <rtl/instance.hxx>
+#include <rtl/ref.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include <vector>
+#include <map>
+#include <algorithm>
+#include <set>
+
+using namespace framework::statusbar_controller_wordcount;
+
+using namespace com::sun::star::awt;
+using namespace com::sun::star::i18n;
+using namespace com::sun::star::container;
+using namespace com::sun::star::lang;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::text;
+using namespace com::sun::star::util;
+using namespace com::sun::star::view;
+using namespace com::sun::star::frame;
+
+using rtl::OUString;
+using rtl::OUStringBuffer;
+
+namespace
+{
+    static OUString st_OwnCommand = OUSTR_COMMAND_STATUSWORDCOUNT;
+
+    class AsyncDispatcher : public cppu::WeakImplHelper1< XCallback >
+    {
+        public:
+            AsyncDispatcher() {}
+            ~AsyncDispatcher() {}
+
+            virtual void SAL_CALL notify( const Any &aData )
+            throw ( RuntimeException )
+            {
+                Pair< URL, Reference< XDispatch > > aDispatchInfo;
+                if ( ( aData >>= aDispatchInfo ) && aDispatchInfo.Second.is() )
+                {
+                    try
+                    {
+                        aDispatchInfo.Second->dispatch( aDispatchInfo.First,
+                                                        Sequence<PropertyValue>( 0 ) );
+                    }
+                    catch ( ... )
+                    {}
+                }
+            }
+    };
+
+    struct StaticAsyncDispatcher
+            : public rtl::StaticWithInit< rtl::Reference< AsyncDispatcher >, StaticAsyncDispatcher>
+    {
+        rtl::Reference< AsyncDispatcher >
+        operator()()
+        {
+            OSL_TRACE( "sbctlwc: Initializing static AsyncDispatcher" );
+            return rtl::Reference< AsyncDispatcher >( new AsyncDispatcher() );
+        }
+    };
+
+    template < class REF >
+    void lcl_DisposeAndClear( REF &rUnoRef )
+    {
+        Reference< XComponent > xComp( rUnoRef, UNO_QUERY );
+        if ( xComp.is() )
+        {
+            try
+            {
+                xComp->dispose();
+            }
+            catch ( ... )
+            {
+            }
+        }
+        rUnoRef.clear();
+    }
+
+    struct DefaultFeatureState
+            : public rtl::StaticWithInit< FeatureStateEvent, DefaultFeatureState >
+    {
+        FeatureStateEvent
+        operator()()
+        {
+            FeatureStateEvent aFeatureState;
+            aFeatureState.IsEnabled = sal_False;
+            aFeatureState.Requery = sal_False;
+
+            URL aURL;
+            aURL.Complete = st_OwnCommand;
+            aFeatureState.FeatureURL = aURL;
+
+            Any aVal;
+            aVal <<= sal_uInt32( 0 );
+            Sequence< NamedValue > aArgs( 2 );
+            aArgs[0].Name = C2U( "WordCount" );
+            aArgs[0].Value = aVal;
+            aArgs[1].Name = C2U( "Selection" );
+            aArgs[1].Value = aVal;
+            aFeatureState.State <<= aArgs;
+
+            return aFeatureState;
+        }
+    };
+
+    typedef std::set< OUString > SupportedModulesSet;
+
+    struct SupportedModulesInit
+    {
+            SupportedModulesSet *
+            operator()()
+            {
+                static SupportedModulesSet aSupportedModules;
+                lcl_InitSet( aSupportedModules );
+                return &aSupportedModules;
+            }
+        private:
+            void lcl_InitSet( SupportedModulesSet &aSet )
+            {
+                // TODO add all text document services
+                aSet.insert( C2U( STR_MODULE_TEXTDOCUMENT ) );
+            }
+    };
+
+    struct SupportedModules
+            : public rtl::StaticAggregate< SupportedModulesSet, SupportedModulesInit > {};
+}
+
+WordCountDispatch::WordCountDispatch(
+    const Reference< XComponentContext > &rxContext,
+    const Reference< XFrame > &rxFrame,
+    const OUString &rModuleIdentifier )
+    : BaseDispatch( rxContext, rxFrame, rModuleIdentifier )
+    , m_aCommand( st_OwnCommand )
+    , m_bIsModified( false )
+    , m_bInGetStatus( false )
+    , m_xBreakIterator()
+    , m_xRequestCallback()
+{
+    OSL_TRACE( "sbctlwc::WordCountDispatch::WordCountDispatch" );
+    try
+    {
+        m_xURLTransformer.set(
+            m_xContext->getServiceManager()->createInstanceWithContext(
+                OUSTR_SERVICENAME_URLTRANSFORMER, m_xContext ),
+            UNO_QUERY_THROW );
+
+        m_xBreakIterator.set(
+            m_xContext->getServiceManager()->createInstanceWithContext(
+                OUSTR_SERVICENAME_BREAKITERATOR, m_xContext ),
+            UNO_QUERY_THROW );
+
+        m_xRequestCallback.set(
+            m_xContext->getServiceManager()->createInstanceWithContext(
+                OUSTR_SERVICENAME_CALLBACK, m_xContext ),
+            UNO_QUERY_THROW );
+
+        Reference< XController > xController( m_xFrame->getController() );
+        m_xSelectionSupplier.set( xController, UNO_QUERY_THROW );
+        if ( m_xSelectionSupplier.is() )
+            m_xSelectionSupplier->addSelectionChangeListener( this );
+
+        m_xModifiable.set( xController->getModel(), UNO_QUERY_THROW );
+        Reference< XModifyBroadcaster > xBroadcaster( m_xModifiable, UNO_QUERY_THROW );
+        if ( xBroadcaster.is() )
+            xBroadcaster->addModifyListener( this );
+
+        static bool bURLParsed = false;
+        if ( !bURLParsed )
+        {
+            FeatureStateEvent &aFeatureState = DefaultFeatureState::get();
+            m_xURLTransformer->parseStrict( aFeatureState.FeatureURL );
+            bURLParsed = true;
+        }
+    }
+    catch ( ... )
+    {
+    }
+}
+
+WordCountDispatch::~WordCountDispatch( )
+{
+    OSL_TRACE( "sbctlwc::WordCountDispatch::~WordCountDispatch" );
+}
+
+Reference< XDispatch >
+WordCountDispatch::Create(
+    const Reference< XComponentContext > &rxContext,
+    const Reference< XFrame > &rxFrame,
+    const OUString &rModuleIdentifier )
+{
+    OSL_TRACE( "sbctlwc::WordCountDispatch::Create" );
+    return Reference< XDispatch > (
+               static_cast< cppu::OWeakObject * >(
+                   new WordCountDispatch( rxContext, rxFrame, rModuleIdentifier ) ),
+               UNO_QUERY );
+}
+
+bool WordCountDispatch::SupportsURL(
+    const URL &aURL,
+    const OUString &rModuleIdentifier )
+{
+    const SupportedModulesSet &aModules = *SupportedModules::get();
+    return aModules.find( rModuleIdentifier ) != aModules.end()
+           && aURL.Complete.equals( st_OwnCommand );
+}
+
+void SAL_CALL
+WordCountDispatch::disposing( )
+{
+    OSL_TRACE( "sbctlwc::WordCountDispatch::disposing" );
+    osl::ClearableMutexGuard aGuard( m_aMutex );
+    // When the dispatch pool disposes us, stop listening
+    // otherwise the model will keep us alive
+    if ( m_xModifiable.is() )
+    {
+        m_xModifiable->removeModifyListener( this );
+        m_xModifiable.clear();
+    }
+
+    if ( m_xSelectionSupplier.is() )
+    {
+        m_xSelectionSupplier->removeSelectionChangeListener( this );
+        m_xModifiable.clear();
+    }
+
+    m_xBreakIterator.clear();
+    m_xFrame.clear();
+    lcl_DisposeAndClear( m_xRequestCallback );
+    lcl_DisposeAndClear( m_xURLTransformer );
+
+    aGuard.clear();
+
+    BaseDispatch::disposing( );
+}
+
+
+void SAL_CALL WordCountDispatch::modified(
+    const EventObject &aEvent )
+throw ( RuntimeException )
+{
+    OSL_TRACE( "sbctlwc::WordCountDispatch::modified" );
+    // prevent endless loop:
+    // getting the document word count triggers a document modified event
+    if ( m_bInGetStatus )
+        return;
+
+    Reference< XModifiable > xModifiable( aEvent.Source, UNO_QUERY );
+    if ( xModifiable.is() )
+    {
+        bool bModified;
+        osl::ClearableMutexGuard aLock( m_aMutex );
+        m_bIsModified = bModified = xModifiable->isModified();
+        aLock.clear( );
+
+        if ( bModified )
+            BaseDispatch::modified( aEvent );
+    }
+}
+
+
+void SAL_CALL WordCountDispatch::selectionChanged(
+    const EventObject &aEvent )
+throw ( RuntimeException )
+{
+    OSL_TRACE( "sbctlwc::WordCountDispatch::selectionChanged" );
+    if ( m_bInGetStatus )
+        return;
+
+    BaseDispatch::selectionChanged( aEvent );
+}
+
+
+void SAL_CALL WordCountDispatch::disposing(
+    const EventObject &aEvent )
+throw ( RuntimeException )
+{
+    OSL_TRACE( "sbctlwc::WordCountDispatch::disposing(aEvent)" );
+    Reference< XModifiable > xModifiable( aEvent.Source, UNO_QUERY );
+    if ( xModifiable.is() && xModifiable == m_xModifiable )
+    {
+        OSL_TRACE( "disposing XModel" );
+        m_xModifiable->removeModifyListener( this );
+        m_xModifiable.clear();
+        return;
+    }
+
+    Reference< XSelectionSupplier > xSelectionSupplier( aEvent.Source, UNO_QUERY );
+    if ( xSelectionSupplier.is() && xSelectionSupplier == m_xSelectionSupplier )
+    {
+        OSL_TRACE( "disposing XController" );
+        m_xSelectionSupplier->removeSelectionChangeListener( this );
+        m_xSelectionSupplier.clear();
+    }
+}
+
+
+void
+WordCountDispatch::ExecuteCommand(
+    const URL &rURL,
+    const Sequence< PropertyValue > &/*lArguments*/ )
+{
+    OSL_TRACE( "sbctlwc::WordCountDispatch::ExecuteCommand" );
+    if ( rURL.Complete.equals( st_OwnCommand ) )
+        ShowWordCountDialog();
+}
+
+FeatureStateEvent
+WordCountDispatch::GetState( const URL &rURL )
+{
+    OSL_TRACE( "sbctlwc::WordCountDispatch::GetState" );
+    FeatureStateEvent aEvent = DefaultFeatureState::get();
+    aEvent.Source = Reference<XDispatch > ( this );
+
+    osl::MutexGuard aGuard( m_aMutex );
+
+    // prevent endless loop:
+    // getting the document word count triggers a document modified event
+    m_bInGetStatus = true;
+    try
+    {
+        if ( rURL.Complete.equals( GetCommand() ) )
+        {
+            sal_Int32 nWordCount( 0 );
+            sal_Int32 nSelWords( 0 );
+
+            Reference< XController> xController = m_xFrame->getController( );
+            Reference<XSelectionSupplier> xSelSuppl( xController, UNO_QUERY );
+            Any aSelection;
+            const bool bHasSelection = xSelSuppl.is() && ( aSelection = xSelSuppl->getSelection() ).hasValue();
+
+            Reference< XModel > xModel( xController->getModel( ) );
+            Reference< XPropertySet> xDocPropSet( xModel, UNO_QUERY );
+            Reference< XModifiable > xModifiable( xModel, UNO_QUERY );
+
+            // WARNING: this will trigger a document modified event
+            xDocPropSet->getPropertyValue( C2U( "WordCount" ) ) >>= nWordCount;
+
+            if ( bHasSelection )
+            {
+                Reference< XServiceInfo > xServiceInfo( aSelection, UNO_QUERY );
+                if ( xServiceInfo.is( ) && xServiceInfo->supportsService( C2U( "com.sun.star.text.TextRanges" ) ) )
+                {
+                    Reference< XIndexAccess > xIndexAccess( xServiceInfo, UNO_QUERY );
+                    for ( sal_Int32 n = 0; n < xIndexAccess->getCount( ); n++ )
+                    {
+                        try
+                        {
+                            OUString sText;
+                            Reference< XTextRange > xTextRange( xIndexAccess->getByIndex( n ), UNO_QUERY );
+                            Reference< XTextRangeCompare > xRangeCompare( xTextRange->getText(), UNO_QUERY );
+                            if ( xRangeCompare->compareRegionStarts( xTextRange->getStart(), xTextRange->getEnd() ) == 0
+                                    || ( sText = xTextRange->getString() ).getLength() == 0 )
+                                continue;
+                            // TODO the text range has a Locale in CharLocale
+                            // *if* all the text range has the same Locale, of course
+                            // Use this Locale with the BreakIterator
+                            nSelWords += CountWords( sText );
+                        }
+                        catch ( ... )
+                        {}
+                    }
+                }
+            }
+
+            Sequence< NamedValue > aArgs;
+            aEvent.State >>= aArgs;
+            aArgs[0].Value <<= sal_uInt32( nWordCount );
+            aArgs[1].Value <<= sal_uInt32( nSelWords );
+            aEvent.State <<= aArgs;
+
+            aEvent.IsEnabled = sal_True;
+
+            // needed because the controller may die
+            // for example, switching to Preview creates a new view/controller
+            if ( !m_xSelectionSupplier.is( ) )
+            {
+                m_xSelectionSupplier.set( xSelSuppl );
+                if ( m_xSelectionSupplier.is( ) )
+                    m_xSelectionSupplier->addSelectionChangeListener( this );
+            }
+
+            // this seems not really needed: we live as the model lives
+            if ( !m_xModifiable.is( ) )
+            {
+                m_xModifiable.set( xModifiable );
+                Reference< XModifyBroadcaster > xBroadcaster( m_xModifiable, UNO_QUERY );
+                if ( xBroadcaster.is( ) )
+                    xBroadcaster->addModifyListener( this );
+            }
+        }
+    }
+    catch ( ... )
+    {
+    }
+
+    m_bInGetStatus = false;
+
+    return aEvent;
+}
+
+sal_Int32
+WordCountDispatch::CountWords( const OUString &sText )
+{
+    sal_Int32 nWords( 1 );
+    sal_Int32 nStartPos( 1 );
+    Locale aLocale;
+
+    Boundary aNext = m_xBreakIterator->nextWord(
+                         sText,
+                         nStartPos,
+                         aLocale,
+                         WordType::WORD_COUNT );
+    while ( aNext.startPos != aNext.endPos )
+    {
+        nWords++;
+        nStartPos = aNext.startPos;
+        aNext = m_xBreakIterator->nextWord( sText,
+                                            nStartPos,
+                                            aLocale,
+                                            WordType::WORD_COUNT );
+    }
+    return nWords;
+}
+
+void
+WordCountDispatch::ShowWordCountDialog() const
+{
+    Reference< XURLTransformer > xURLParser;
+    Reference< XFrame > xFrame;
+    Reference< XRequestCallback > xRequestCallback;
+
+    osl::ClearableMutexGuard aLock( m_aMutex );
+    xURLParser = m_xURLTransformer;
+    xFrame = m_xFrame;
+    xRequestCallback = m_xRequestCallback;
+    aLock.clear( );
+
+    try
+    {
+        URL aCommand;
+        aCommand.Complete = OUSTR_COMMAND_UNO_WORDCOUNTDLG;
+        xURLParser->parseStrict( aCommand );
+
+        Reference< XDispatchProvider > xProvider( xFrame, UNO_QUERY );
+        Reference< XDispatch > xDispatch = xProvider->queryDispatch( aCommand, C2U( "_self" ), 0 );
+        if ( xRequestCallback.is() && xDispatch.is() )
+        {
+            xRequestCallback->addCallback(
+                StaticAsyncDispatcher::get().get(),
+                makeAny( Pair< URL, Reference< XDispatch > >( aCommand, xDispatch ) ) );
+        }
+    }
+    catch ( ... )
+    {
+    }
+}

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountDispatch.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountDispatch.hxx?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountDispatch.hxx (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountDispatch.hxx Thu Dec  6 13:33:40 2012
@@ -0,0 +1,86 @@
+/**************************************************************
+ *
+ * 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 STATUS_WORD_COUNT_DISPATCH_HXX
+#define STATUS_WORD_COUNT_DISPATCH_HXX
+
+#include "BaseDispatch.hxx"
+
+#include <com/sun/star/awt/XRequestCallback.hpp>
+#include <com/sun/star/util/XModifiable.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/i18n/XBreakIterator.hpp>
+
+namespace framework
+{
+    namespace statusbar_controller_wordcount
+    {
+        class WordCountDispatch : public BaseDispatch
+        {
+            public:
+                static com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >
+                Create(
+                    const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > &rxContext,
+                    const com::sun::star::uno::Reference< com::sun::star::frame::XFrame > &rxFrame,
+                    const rtl::OUString &rModuleIdentifier );
+                static bool SupportsURL( const com::sun::star::util::URL &aURL, const rtl::OUString &rModuleIdentifier );
+
+                virtual void SAL_CALL disposing();
+
+                // com::sun::star::util::XModifyListener Methods
+                virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject &aEvent ) throw ( ::com::sun::star::uno::RuntimeException );
+
+                // com::sun::star::view::XSelectionChangeListener Methods
+                virtual void SAL_CALL selectionChanged( const ::com::sun::star::lang::EventObject &aEvent ) throw ( ::com::sun::star::uno::RuntimeException );
+
+                // com::sun::star::lang::XEventListener Methods
+                virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject &aEvent ) throw ( ::com::sun::star::uno::RuntimeException );
+
+
+            protected:
+                virtual com::sun::star::frame::FeatureStateEvent GetState( const com::sun::star::util::URL &rURL );
+                virtual rtl::OUString GetCommand()
+                {
+                    return m_aCommand;
+                }
+                virtual void ExecuteCommand( const com::sun::star::util::URL &aURL, const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > &lArguments );
+
+            private:
+                WordCountDispatch( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > &rxContext,
+                                   const com::sun::star::uno::Reference< com::sun::star::frame::XFrame > &rxFrame,
+                                   const rtl::OUString &rModuleIdentifier );
+                ~WordCountDispatch();
+
+                void ShowWordCountDialog() const;
+                sal_Int32 CountWords( const rtl::OUString &sText );
+
+                rtl::OUString m_aCommand;
+                bool m_bIsModified;
+                bool m_bInGetStatus;
+                com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator >     m_xBreakIterator;
+                com::sun::star::uno::Reference< com::sun::star::awt::XRequestCallback >    m_xRequestCallback;
+                com::sun::star::uno::Reference< com::sun::star::util::XModifiable >        m_xModifiable;
+                com::sun::star::uno::Reference< com::sun::star::view::XSelectionSupplier > m_xSelectionSupplier;
+        };
+    }
+}
+
+#endif

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountStatusbarController.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountStatusbarController.cxx?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountStatusbarController.cxx (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountStatusbarController.cxx Thu Dec  6 13:33:40 2012
@@ -0,0 +1,209 @@
+/**************************************************************
+ *
+ * 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 "WordCountStatusbarController.hxx"
+#include "macros.hxx"
+#include "defines.hxx"
+
+#include <rtl/ustrbuf.hxx>
+#include <com/sun/star/beans/NamedValue.hpp>
+
+using namespace framework::statusbar_controller_wordcount;
+
+using namespace com::sun::star::uno;
+using namespace com::sun::star::awt;
+using namespace com::sun::star::frame;
+using namespace com::sun::star::beans;
+
+using rtl::OUString;
+
+namespace
+{
+    static OUString st_WordCountDlgCmd = OUSTR_COMMAND_UNO_WORDCOUNTDLG;
+
+    struct StaticSupportedServices
+            : public rtl::StaticWithInit< Sequence< OUString >, StaticSupportedServices >
+    {
+        Sequence< OUString >
+        operator()()
+        {
+            Sequence< OUString > aServices( 2 );
+            aServices[0] = C2U( STATUSBAR_CONTROLLER_SERVICE_NAME );
+            aServices[1] = C2U( "com.sun.star.frame.StatusbarController" );
+            return aServices;
+        }
+    };
+}
+
+WordCountStatusbarController::WordCountStatusbarController(
+    const Reference< XComponentContext> &rxContext )
+    : WordCountStatusbarController_Base()
+    , m_bEnabled( false )
+    , m_bWordCountDlgEnabled( false )
+{
+    OSL_TRACE( "sbctlwc::WordCountStatusbarController::WordCountStatusbarController" );
+    m_xContext = rxContext;
+}
+
+WordCountStatusbarController::~WordCountStatusbarController( )
+{
+    OSL_TRACE( "sbctlwc::WordCountStatusbarController::~WordCountStatusbarController" );
+}
+
+void SAL_CALL
+WordCountStatusbarController::statusChanged(
+    const FeatureStateEvent &aFeatureState )
+throw ( RuntimeException )
+{
+    OSL_TRACE( "sbctlwc::WordCountStatusbarController::statusChanged" );
+    osl::ResettableMutexGuard aGuard( m_aMutex );
+
+    if ( aFeatureState.FeatureURL.Complete.equals( m_sCommandURL ) )
+    {
+        OUString aStateValue;
+        m_bEnabled = aFeatureState.IsEnabled;
+        if ( m_bEnabled )
+        {
+            Sequence< NamedValue > aArgs;
+            sal_uInt32 nWordCount( 0 );
+            sal_uInt32 nSelection( 0 );
+            if ( aFeatureState.State >>= aArgs )
+            {
+                for ( const NamedValue *pNamedValue = aArgs.getConstArray(),
+                        *pEnd = pNamedValue + aArgs.getLength();
+                        pNamedValue != pEnd;
+                        pNamedValue++ )
+                {
+                    if ( pNamedValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "WordCount" ) ) )
+                        pNamedValue->Value >>= nWordCount;
+                    else if ( pNamedValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Selection" ) ) )
+                        pNamedValue->Value >>= nSelection;
+                }
+            }
+
+            rtl::OUStringBuffer aBuff;
+            // TODO: localize me!
+            aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Words: " ) );
+            if ( nSelection )
+            {
+                aBuff.append( sal_Int32( nSelection ) );
+                aBuff.append( sal_Unicode( '/' ) );
+            }
+            aBuff.append( sal_Int32( nWordCount ) );
+            aStateValue = aBuff.makeStringAndClear();
+        }
+
+        m_xStatusbarItem->setText( aStateValue );
+    }
+    else if ( aFeatureState.FeatureURL.Complete.equals( st_WordCountDlgCmd ) )
+    {
+        rtl::OUStringBuffer aBuff;
+        // TODO: localize me!
+        aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( "Word count" ) );
+        m_bWordCountDlgEnabled = aFeatureState.IsEnabled;
+        if ( m_bWordCountDlgEnabled )
+            aBuff.appendAscii( RTL_CONSTASCII_STRINGPARAM( ". Double-click to open the Word Count dialog" ) );
+
+        OUString aTip = aBuff.makeStringAndClear();
+        m_xStatusbarItem->setQuickHelpText( aTip );
+        m_xStatusbarItem->setAccessibleName( aTip );
+    }
+}
+void SAL_CALL
+WordCountStatusbarController::initialize(
+    const Sequence< Any > &aArguments )
+throw ( Exception, RuntimeException )
+{
+    WordCountStatusbarController_Base::initialize( aArguments );
+
+    osl::MutexGuard aGuard( m_aMutex );
+    m_aListenerMap.insert( URLToDispatchMap::value_type( st_WordCountDlgCmd, Reference< XDispatch >() ) );
+}
+
+void SAL_CALL
+WordCountStatusbarController::doubleClick()
+throw ( RuntimeException )
+{
+    OSL_TRACE( "sbctlwc::WordCountStatusbarController::doubleClick" );
+
+    osl::ClearableMutexGuard aGuard( m_aMutex );
+    if ( !m_bWordCountDlgEnabled )
+        return;
+    aGuard.clear();
+
+    static const Sequence< PropertyValue > aDummy;
+    Execute( st_WordCountDlgCmd, aDummy );
+}
+
+OUString SAL_CALL
+WordCountStatusbarController::getImplementationName( )
+throw ( RuntimeException )
+{
+    return getImplementationName_static();
+}
+
+::sal_Bool SAL_CALL
+WordCountStatusbarController::supportsService(
+    const OUString &ServiceName )
+throw ( RuntimeException )
+{
+    const Sequence< OUString > &aServices = StaticSupportedServices::get();
+
+    for ( const OUString *pService = aServices.getConstArray(),
+            *pEnd = pService + aServices.getLength();
+            pService != pEnd; pService++ )
+    {
+        if ( pService->equals( ServiceName ) )
+            return sal_True;
+    }
+
+    return sal_False;
+}
+
+Sequence< OUString > SAL_CALL
+WordCountStatusbarController::getSupportedServiceNames( )
+throw ( RuntimeException )
+{
+    return getSupportedServiceNames_static();
+}
+
+Reference< XInterface >
+WordCountStatusbarController::Create(
+    const Reference< XComponentContext > &rxContext )
+throw ( Exception )
+{
+    OSL_TRACE( "sbctlwc::WordCountStatusbarController::Create" );
+    return Reference< XInterface >( static_cast< cppu::OWeakObject *>( new WordCountStatusbarController( rxContext ) ) );
+}
+
+Sequence< OUString >
+WordCountStatusbarController::getSupportedServiceNames_static( )
+{
+    return StaticSupportedServices::get();
+}
+
+OUString
+WordCountStatusbarController::getImplementationName_static( )
+{
+    static OUString st_ImplName( RTL_CONSTASCII_USTRINGPARAM( STATUSBAR_CONTROLLER_IMPL_NAME ) );
+    return st_ImplName;
+}
+

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountStatusbarController.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountStatusbarController.hxx?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountStatusbarController.hxx (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/WordCountStatusbarController.hxx Thu Dec  6 13:33:40 2012
@@ -0,0 +1,66 @@
+/**************************************************************
+ *
+ * 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 WORDCOUNTSTATUSBARCONTROLLER_HXX
+#define WORDCOUNTSTATUSBARCONTROLLER_HXX
+
+#include "StatusbarController.hxx"
+
+#include <cppuhelper/implbase1.hxx>
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+namespace framework
+{
+    namespace statusbar_controller_wordcount
+    {
+
+        typedef cppu::ImplInheritanceHelper1< StatusbarController, com::sun::star::lang::XServiceInfo >
+        WordCountStatusbarController_Base;
+
+        class WordCountStatusbarController : public WordCountStatusbarController_Base
+        {
+            public:
+                explicit WordCountStatusbarController( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext> &rxContext );
+                ~WordCountStatusbarController();
+
+                virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent &aFeatureState ) throw ( ::com::sun::star::uno::RuntimeException );
+                virtual void SAL_CALL doubleClick() throw ( ::com::sun::star::uno::RuntimeException );
+                virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > &aArguments ) throw ( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
+
+                virtual ::rtl::OUString SAL_CALL getImplementationName() throw ( ::com::sun::star::uno::RuntimeException );
+                virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString &ServiceName ) throw ( ::com::sun::star::uno::RuntimeException );
+                virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw ( ::com::sun::star::uno::RuntimeException );
+
+                static com::sun::star::uno::Reference< com::sun::star::uno::XInterface > Create( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > &rxContext ) throw ( com::sun::star::uno::Exception );
+                static com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static();
+                static ::rtl::OUString getImplementationName_static();
+
+            private:
+                bool m_bEnabled;
+                bool m_bWordCountDlgEnabled;
+
+        };
+    }
+}
+
+#endif  /* WORDCOUNTSTATUSBARCONTROLLER_HXX */
+

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/compfactory.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/compfactory.cxx?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/compfactory.cxx (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/compfactory.cxx Thu Dec  6 13:33:40 2012
@@ -0,0 +1,71 @@
+/**************************************************************
+ *
+ * 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 "WordCountStatusbarController.hxx"
+#include "ProtocolHandler.hxx"
+
+#include <cppuhelper/factory.hxx>
+#include <cppuhelper/implementationentry.hxx>
+
+namespace framework
+{
+    namespace statusbar_controller_wordcount
+    {
+        static ::cppu::ImplementationEntry const s_impl_entries[] =
+        {
+            {
+                WordCountStatusbarController::Create,
+                WordCountStatusbarController::getImplementationName_static,
+                WordCountStatusbarController::getSupportedServiceNames_static,
+                ::cppu::createSingleComponentFactory,
+                0,
+                0
+            },
+            {
+                ProtocolHandler::Create,
+                ProtocolHandler::getImplementationName_static,
+                ProtocolHandler::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 *pImplName, void *pServiceManager, void *pRegistryKey )
+    {
+        return ::cppu::component_getFactoryHelper( pImplName,
+                pServiceManager,
+                pRegistryKey ,
+                framework::statusbar_controller_wordcount::s_impl_entries );
+    }
+}

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/defines.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/defines.hxx?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/defines.hxx (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/defines.hxx Thu Dec  6 13:33:40 2012
@@ -0,0 +1,81 @@
+/**************************************************************
+ *
+ * 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 GENERAL_DEFINES_HXX
+#define GENERAL_DEFINES_HXX
+
+#include "macros.hxx"
+
+#ifndef STATUSBAR_CONTROLLER_IMPL_NAME
+#error  You must define STATUSBAR_CONTROLLER_IMPL_NAME
+#endif
+
+#ifndef STATUSBAR_CONTROLLER_SERVICE_NAME
+#error  You must define STATUSBAR_CONTROLLER_SERVICE_NAME
+#endif
+
+#ifndef PROTOCOL_HANDLER_IMPL_NAME
+#error  You must define PROTOCOL_HANDLER_IMPL_NAME
+#endif
+
+#ifndef PROTOCOL_HANDLER_SERVICE_NAME
+#error  You must define PROTOCOL_HANDLER_SERVICE_NAME
+#endif
+
+#ifndef PROTOCOL_HANDLER_URL_PROTOCOL
+#error  You must define PROTOCOL_HANDLER_URL_PROTOCOL
+#endif
+
+#define OUSTR_COMMAND_UNO_WORDCOUNTDLG  C2U(".uno:WordCountDialog")
+#define OUSTR_COMMAND_STATUSWORDCOUNT   C2U(PROTOCOL_HANDLER_URL_PROTOCOL ":StatusWordCount" )
+
+
+#define OUSTR_SERVICENAME_BREAKITERATOR             C2U("com.sun.star.i18n.BreakIterator")
+#define OUSTR_SERVICENAME_URLTRANSFORMER            C2U("com.sun.star.util.URLTransformer")
+#define OUSTR_SERVICENAME_PROTOCOLHANDLER           C2U("com.sun.star.frame.ProtocolHandler")
+#define OUSTR_SERVICENAME_MODULEMANAGER             C2U("com.sun.star.frame.ModuleManager")
+#define OUSTR_SERVICENAME_CALLBACK                  C2U("com.sun.star.awt.AsyncCallback")
+
+// OpenOffice.org Modules
+#define STR_MODULE_CHARTDOCUMENT            "com.sun.star.chart2.ChartDocument"
+#define STR_MODULE_DRAWINGDOCUMENT          "com.sun.star.drawing.DrawingDocument"
+#define STR_MODULE_FORMULAPROPERTIES        "com.sun.star.formula.FormulaProperties"
+#define STR_MODULE_BIBLIOGRAPHY             "com.sun.star.frame.Bibliography"
+#define STR_MODULE_STARTMODULE              "com.sun.star.frame.StartModule"
+#define STR_MODULE_PRESENTATIONDOCUMENT     "com.sun.star.presentation.PresentationDocument"
+#define STR_MODULE_REPORTDEFINITION         "com.sun.star.report.ReportDefinition"
+#define STR_MODULE_BASICIDE                 "com.sun.star.script.BasicIDE"
+#define STR_MODULE_DATASOURCEBROWSER        "com.sun.star.sdb.DataSourceBrowser"
+#define STR_MODULE_FORMDESIGN               "com.sun.star.sdb.FormDesign"
+#define STR_MODULE_OFFICEDATABASEDOCUMENT   "com.sun.star.sdb.OfficeDatabaseDocument"
+#define STR_MODULE_QUERYDESIGN              "com.sun.star.sdb.QueryDesign"
+#define STR_MODULE_RELATIONDESIGN           "com.sun.star.sdb.RelationDesign"
+#define STR_MODULE_TABLEDATAVIEW            "com.sun.star.sdb.TableDataView"
+#define STR_MODULE_TABLEDESIGN              "com.sun.star.sdb.TableDesign"
+#define STR_MODULE_TEXTREPORTDESIGN         "com.sun.star.sdb.TextReportDesign"
+#define STR_MODULE_VIEWDESIGN               "com.sun.star.sdb.ViewDesign"
+#define STR_MODULE_SPREADSHEETDOCUMENT      "com.sun.star.sheet.SpreadsheetDocument"
+#define STR_MODULE_GLOBALDOCUMENT           "com.sun.star.text.GlobalDocument"
+#define STR_MODULE_TEXTDOCUMENT             "com.sun.star.text.TextDocument"
+#define STR_MODULE_WEBDOCUMENT              "com.sun.star.text.WebDocument"
+#define STR_MODULE_XMLFORMDOCUMENT          "com.sun.star.xforms.XMLFormDocument"
+
+#endif

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/description/description_en-US.txt
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/description/description_en-US.txt?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/description/description_en-US.txt (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/description/description_en-US.txt Thu Dec  6 13:33:40 2012
@@ -0,0 +1 @@
+This extension enhances Apache OpenOffice status bar by adding a status bar item in Apache OpenOffice Writer's status bar that displays the word count.
\ No newline at end of file

Propchange: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/description/description_en-US.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/images/icon.png
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/images/icon.png?rev=1417873&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/images/icon.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/images/icon_hc.png
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/images/icon_hc.png?rev=1417873&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/images/icon_hc.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/macros.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/macros.hxx?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/macros.hxx (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/macros.hxx Thu Dec  6 13:33:40 2012
@@ -0,0 +1,55 @@
+/**************************************************************
+ *
+ * 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 GENERAL_MACROS_HXX
+#define GENERAL_MACROS_HXX
+
+#define STRINGIFY(x) _STRINGIFY(x)
+#define _STRINGIFY(x) #x
+
+#define C2U( constAsciiStr ) \
+    ( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( constAsciiStr ) ) )
+
+#define U2C( ouString ) \
+    ( ::rtl::OUStringToOString( ouString, RTL_TEXTENCODING_ASCII_US ).getStr() )
+
+#define GET_STR( OUSTR ) \
+    ::rtl::OUStringToOString( OUSTR, RTL_TEXTENCODING_ASCII_US ).getStr()
+
+#if OSL_DEBUG_LEVEL > 0
+#define DISPLAY_EXCEPTION_ENSURE( ClassName, MethodName, e )    \
+    ::rtl::OString sMessage( #ClassName "::" #MethodName ": caught an exception!\n" ); \
+    sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_UTF8 ); \
+    OSL_ENSURE( sal_False, sMessage.getStr() )
+#else
+#define DISPLAY_EXCEPTION_ENSURE( ClassName, MethodName, e ) ((void)e)
+#endif
+
+#if OSL_DEBUG_LEVEL > 0
+#define DISPLAY_EXCEPTION( ClassName, MethodName, e )    \
+    ::rtl::OString sMessage( #ClassName "::" #MethodName ": caught an exception!\n" ); \
+    sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_UTF8 ); \
+    OSL_TRACE( sMessage.getStr() )
+#else
+#define DISPLAY_EXCEPTION( ClassName, MethodName, e ) ((void)e)
+#endif
+
+#endif

Propchange: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/macros.hxx
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/project.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/project.mk?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/project.mk (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/project.mk Thu Dec  6 13:33:40 2012
@@ -0,0 +1,42 @@
+#**************************************************************
+#
+#  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=3.5.0
+DESCRIPTION_DEP_NAME=OpenOffice.org $(DESCRIPTION_OOO_MIN_VER)
+
+EXTENSION_ID=org.apache.openoffice.framework.statusbar.StatusWordCount
+EXTENSION_VERSION=0.0.1
+
+DESCRIPTION_PUBLISHER_URL=http://www.openoffice.org/api
+DESCRIPTION_PUBLISHER_NAME=Apache OpenOffice
+DESCRIPTION_DISPLAY_NAME=Word Count StatusBar Control
+
+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
+
+PROTOCOLHANDLER_IMPLNAME=org.apache.openoffice.framework.statusbar.comp.StatusWordCount.ProtocolHandler
+PROTOCOLHANDLER_SERVICE_NAME=org.apache.openoffice.framework.statusbar.StatusWordCount.ProtocolHandler
+PROTOCOLHANDLER_PROTOCOL=org.apache.openoffice.framework.statusbar.StatusWordCount
+
+STATUSBARCONTROLLER_IMPLNAME=org.apache.openoffice.framework.statusbar.comp.StatusWordCount.StatusbarController
+STATUSBARCONTROLLER_SERVICE_NAME=org.apache.openoffice.framework.statusbar.StatusWordCount.StatusbarController

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/Addons.xcu
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/Addons.xcu?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/Addons.xcu (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/Addons.xcu Thu Dec  6 13:33:40 2012
@@ -0,0 +1,69 @@
+<?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"
+oor:name="Addons"
+oor:package="org.openoffice.Office">
+    <node oor:name="AddonUI">
+        <node oor:name="OfficeStatusbarMerging">
+            <node oor:name="org.apache.openoffice.framework.OfficeStatusbarMerging.StatusWordCount" oor:op="replace">
+                <node oor:name="S1" oor:op="replace">
+                    <prop oor:name="MergePoint">
+                        <value>.uno:StatePageNumber</value>
+                    </prop>
+                    <prop oor:name="MergeCommand">
+                        <value>AddAfter</value>
+                    </prop>
+                    <prop oor:name="MergeFallback">
+                        <value>AddPath</value>
+                    </prop>
+                    <prop oor:name="MergeContext" oor:type="xs:string">
+                        <value>com.sun.star.text.TextDocument</value>
+                    </prop>
+                    <node oor:name="StatusBarItems">
+                        <node oor:name="M1" oor:op="replace">
+                            <prop oor:name="Title" oor:type="xs:string">
+                                <value xml:lang="en-US">Word Count. Double click to open the Word Count dialog</value>
+                            </prop>
+                            <prop oor:name="URL" oor:type="xs:string">
+                                <value>#PROTOCOLHANDLER_PROTOCOL#:StatusWordCount</value>
+                            </prop>
+                            <prop oor:name="Alignment" oor:type="xs:string">
+                                <value>left</value>
+                            </prop>
+                            <prop oor:name="AutoSize" oor:type="xs:boolean">
+                                <value>true</value>
+                            </prop>
+                            <prop oor:name="OwnerDraw" oor:type="xs:boolean">
+                                <value>false</value>
+                            </prop>
+                            <prop oor:name="Width" oor:type="xs:long">
+                                <value>50</value>
+                            </prop>
+                        </node>
+                    </node>
+                </node>
+            </node>
+        </node>
+    </node>
+</oor:component-data>

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/ProtocolHandler.xcu
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/ProtocolHandler.xcu?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/ProtocolHandler.xcu (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/ProtocolHandler.xcu Thu Dec  6 13:33:40 2012
@@ -0,0 +1,38 @@
+<?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="ProtocolHandler">
+
+    <node oor:name="HandlerSet">
+        <!-- This must be the IMPLEMENTATION NAME -->
+        <node oor:name="#PROTOCOLHANDLER_IMPLNAME#" oor:op="replace">
+            <prop oor:name="Protocols" oor:type="oor:string-list">
+                <value>#PROTOCOLHANDLER_PROTOCOL#:*</value>
+            </prop>
+        </node>
+    </node>
+
+</oor:component-data>

Propchange: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/ProtocolHandler.xcu
------------------------------------------------------------------------------
    svn:executable = *

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/UI/Controller.xcu
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/UI/Controller.xcu?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/UI/Controller.xcu (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/registry/data/org/openoffice/Office/UI/Controller.xcu Thu Dec  6 13:33:40 2012
@@ -0,0 +1,39 @@
+<?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 oor:component-data SYSTEM "../../../../../component-update.dtd">
+<oor:component-data oor:name="Controller" oor:package="org.openoffice.Office.UI" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+    <node oor:name="Registered">
+        <node oor:name="StatusBar">
+            <node oor:name="org.apache.openoffice.framework.statusbar.StatusWordCount.StatusbarController" oor:op="replace">
+                <prop oor:name="Command">
+                    <value>#PROTOCOLHANDLER_PROTOCOL#:StatusWordCount</value>
+                </prop>
+                <prop oor:name="Module">
+                    <value>com.sun.star.text.TextDocument</value>
+                </prop>
+                <prop oor:name="Controller">
+                    <value>#STATUSBARCONTROLLER_IMPLNAME#</value>
+                </prop>
+            </node>
+        </node>
+    </node>
+</oor:component-data>

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/components.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/components.xml?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/components.xml (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/components.xml Thu Dec  6 13:33:40 2012
@@ -0,0 +1,31 @@
+<?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="#PROTOCOLHANDLER_IMPLNAME#">
+      <service name="com.sun.star.frame.ProtocolHandler"/>
+    </implementation>
+    <implementation name="#STATUSBARCONTROLLER_IMPLNAME#">
+      <service name="com.sun.star.frame.StatusbarController"/>
+    </implementation>
+  </component>
+</components>

Propchange: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/description.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/description.xml?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/description.xml (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/description.xml Thu Dec  6 13:33:40 2012
@@ -0,0 +1,50 @@
+<?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#"/>
+    </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/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/description.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/manifest.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/manifest.xml?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/manifest.xml (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/manifest.xml Thu Dec  6 13:33:40 2012
@@ -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.
+ *
+ ***********************************************************-->
+<!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/ProtocolHandler.xcu"/>
+  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+                       manifest:full-path="registry/data/org/openoffice/Office/Addons.xcu"/>
+  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+                       manifest:full-path="registry/data/org/openoffice/Office/UI/GenericCommands.xcu"/>
+  <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
+                       manifest:full-path="registry/data/org/openoffice/Office/UI/Controller.xcu"/>
+  <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/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/manifest.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/update.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/update.xml?rev=1417873&view=auto
==============================================================================
--- openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/update.xml (added)
+++ openoffice/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/update.xml Thu Dec  6 13:33:40 2012
@@ -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/trunk/main/odk/examples/cpp/StatusbarController/WordCountStatusbarController/xml/update.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message