[Libreoffice-commits] .: officecfg/registry sd/Library_sdui.mk sd/source

Andrzej J.R. Hunt ajrhunt at kemper.freedesktop.org
Fri Aug 10 04:28:54 PDT 2012


 officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu |    2 
 sd/Library_sdui.mk                                                       |    1 
 sd/source/ui/dlg/RemoteDialog.cxx                                        |   32 
 sd/source/ui/dlg/RemoteDialog.hxx                                        |   42 
 sd/source/ui/dlg/RemoteDialog.src                                        |   22 
 sd/source/ui/dlg/RemoteDialogClientBox.cxx                               |  895 ++++++++++
 sd/source/ui/dlg/RemoteDialogClientBox.hxx                               |  194 ++
 sd/source/ui/inc/RemoteDialog.hrc                                        |    7 
 sd/source/ui/inc/RemoteDialog.hxx                                        |   34 
 sd/source/ui/inc/RemoteServer.hxx                                        |   18 
 sd/source/ui/remotecontrol/RemoteDialog.cxx                              |   20 
 sd/source/ui/remotecontrol/RemoteDialog.hxx                              |   29 
 sd/source/ui/remotecontrol/Server.cxx                                    |   14 
 sd/source/ui/slidesorter/controller/SlsSlotManager.cxx                   |    1 
 14 files changed, 1217 insertions(+), 94 deletions(-)

New commits:
commit 2d63c4689a13599ec9389c370726005f01fea08c
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Fri Aug 10 13:27:40 2012 +0200

    Basic Impress Remote + linking of dialog and server.
    
    Change-Id: Ifd69df9ccfb5b6a78044b002b6ec5bf1f12b6faa

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index cc55a9e..3c78ec6 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -45,7 +45,7 @@
       <node oor:name=".uno:Remote" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
 
-          <value xml:lang="en-US">Impress ~Remote</value>
+          <value xml:lang="en-US">Impress R~emote</value>
         </prop>
         <prop oor:name="Properties" oor:type="xs:int">
           <value>1</value>
diff --git a/sd/Library_sdui.mk b/sd/Library_sdui.mk
index 1e1cb5b..7044a98 100644
--- a/sd/Library_sdui.mk
+++ b/sd/Library_sdui.mk
@@ -83,6 +83,7 @@ $(eval $(call gb_Library_add_exception_objects,sdui,\
     sd/source/ui/dlg/prltempl \
     sd/source/ui/dlg/prntopts \
     sd/source/ui/dlg/RemoteDialog \
+    sd/source/ui/dlg/RemoteDialogClientBox \
     sd/source/ui/dlg/sddlgfact \
     sd/source/ui/dlg/sdpreslt \
     sd/source/ui/dlg/sduiexp \
diff --git a/sd/source/ui/dlg/RemoteDialog.cxx b/sd/source/ui/dlg/RemoteDialog.cxx
index 69894ec..85d5ad2 100644
--- a/sd/source/ui/dlg/RemoteDialog.cxx
+++ b/sd/source/ui/dlg/RemoteDialog.cxx
@@ -7,25 +7,47 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include <svl/itemset.hxx>
-
 #include "sdattr.hxx"
 #include "sdresid.hxx"
 #include "cusshow.hxx"
 
 #include "RemoteDialog.hxx"
 #include "RemoteDialog.hrc"
+#include "RemoteServer.hxx"
 
-using namespace sd;
+using namespace ::sd;
+using namespace ::std;
 
 RemoteDialog::RemoteDialog( Window *pWindow ) :
-    ModalDialog     ( pWindow, SdResId( DLG_PAIR_REMOTE ) )
+    ModalDialog( pWindow, SdResId( DLG_PAIR_REMOTE ) ),
+    mButtonConnect(     this, SdResId( BTN_CONNECT ) ),
+    mButtonCancel(      this, SdResId( BTN_CANCEL ) ),
+    mClientBox(         this, NULL, SdResId( LB_SERVERS ) )
 {
-FreeResource();
+     FreeResource();
+
+    vector<ClientInfo> aClients( RemoteServer::getClients() );
+
+    for ( vector<ClientInfo>::const_iterator aIt( aClients.begin() );
+        aIt < aClients.end(); aIt++ )
+    {
+        mClientBox.addEntry( *aIt );
+    }
+
+    mButtonConnect.SetClickHdl( LINK( this, RemoteDialog, HandleConnectButton ) );
 }
 
 RemoteDialog::~RemoteDialog()
 {
 }
 
+// -----------------------------------------------------------------------
+IMPL_LINK_NOARG(RemoteDialog, HandleConnectButton)
+{
+//     setBusy( true );
+    // Fixme: Try and connect
+
+    return 1;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/sd/source/ui/dlg/RemoteDialog.hxx b/sd/source/ui/dlg/RemoteDialog.hxx
new file mode 100644
index 0000000..87782a6
--- /dev/null
+++ b/sd/source/ui/dlg/RemoteDialog.hxx
@@ -0,0 +1,42 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+#ifndef _SD_REMOTEDIALOG_HXX_
+#define _SD_REMOTEDIALOG_HXX_
+
+#include <vcl/lstbox.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/field.hxx>
+#include <svtools/svtreebx.hxx>
+
+#include "RemoteDialogClientBox.hxx"
+
+namespace sd
+{
+
+class RemoteDialog : public ModalDialog
+{
+private:
+    OKButton        mButtonConnect;
+    CancelButton    mButtonCancel;
+    ClientBox       mClientBox;
+
+    DECL_DLLPRIVATE_LINK( HandleConnectButton, void * );
+public:
+    RemoteDialog( Window* pWindow );
+    ~RemoteDialog();
+
+};
+
+}
+
+#endif // _SD_REMOTEDIALOG_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/sd/source/ui/dlg/RemoteDialog.src b/sd/source/ui/dlg/RemoteDialog.src
index 1b5ef96..e7d9a96 100644
--- a/sd/source/ui/dlg/RemoteDialog.src
+++ b/sd/source/ui/dlg/RemoteDialog.src
@@ -16,18 +16,36 @@ ModalDialog DLG_PAIR_REMOTE
     HelpID = CMD_SID_REMOTE_DLG ;
     OutputSize = TRUE ;
     SVLook = TRUE ;
-    Size = MAP_APPFONT ( 256, 205 ) ;
+    Size = MAP_APPFONT ( 200, 160 ) ;
     Text [ en-US ] = "Impress Remote" ;
     Moveable = TRUE ;
     Closeable = TRUE ;
 
+    Control LB_SERVERS
+    {
+//;         HelpId = HID_SD_SLIDETRANSITIONPANE_LB_SLIDE_TRANSITIONS;
+        Border = TRUE ;
+        TabStop = TRUE ;
+//;         AutoVScroll = TRUE ;
+//;         Pos = MAP_APPFONT ( 0, 0 ) ;
+        Size = MAP_APPFONT( 200, 140 );
+    };
+
     OKButton BTN_CONNECT
     {
-        Pos = MAP_APPFONT ( 200, 6 ) ;
+        Pos = MAP_APPFONT ( 100, 146 ) ;
         Size = MAP_APPFONT ( 50, 14 ) ;
         TabStop = TRUE ;
+        Text [ en-US ] = "Connect" ;
         DefButton = TRUE ;
     };
+    CancelButton BTN_CANCEL
+    {
+        Pos = MAP_APPFONT ( 150, 146 ) ;
+        Size = MAP_APPFONT ( 50, 14 ) ;
+        Text [ en-US ] = "Close" ;
+        TabStop = TRUE ;
+    };
 
 };
 
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
new file mode 100644
index 0000000..e8c9edc
--- /dev/null
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx
@@ -0,0 +1,895 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "svtools/controldims.hrc"
+
+#include "RemoteDialogClientBox.hxx"
+#include "RemoteDialog.hrc"
+
+#include "comphelper/processfactory.hxx"
+#include "com/sun/star/i18n/CollatorOptions.hpp"
+#include "com/sun/star/deployment/DependencyException.hpp"
+#include "com/sun/star/deployment/DeploymentException.hpp"
+
+#define USER_PACKAGE_MANAGER    "user"
+#define SHARED_PACKAGE_MANAGER  "shared"
+#define BUNDLED_PACKAGE_MANAGER "bundled"
+
+using namespace ::com::sun::star;
+
+namespace sd {
+
+//------------------------------------------------------------------------------
+//                          struct ClientBoxEntry
+//------------------------------------------------------------------------------
+ClientBoxEntry::ClientBoxEntry( const ClientInfo& rClientInfo ) :
+    m_bActive( false ),
+    m_clientInfo( rClientInfo )
+{
+}
+
+//------------------------------------------------------------------------------
+ClientBoxEntry::~ClientBoxEntry()
+{}
+
+
+//------------------------------------------------------------------------------
+// ClientRemovedListener
+//------------------------------------------------------------------------------
+void ClientRemovedListener::disposing( lang::EventObject const & rEvt )
+    throw ( uno::RuntimeException )
+{
+    (void) rEvt;
+}
+
+//------------------------------------------------------------------------------
+ClientRemovedListener::~ClientRemovedListener()
+{
+}
+
+//------------------------------------------------------------------------------
+// ClientBox
+//------------------------------------------------------------------------------
+ClientBox::ClientBox( Dialog* pParent, RemoteServer *pServer,
+                      const SdResId& aId ) :
+    Control( pParent, aId ),
+    m_bHasScrollBar( false ),
+    m_bHasActive( false ),
+    m_bNeedsRecalc( true ),
+    m_bHasNew( false ),
+    m_bInCheckMode( false ),
+    m_bAdjustActive( false ),
+    m_bInDelete( false ),
+    m_nActive( 0 ),
+    m_nTopIndex( 0 ),
+    m_nActiveHeight( 0 ),
+    m_nExtraHeight( 2 ),
+    m_aPinBox( this, SdResId( INPUT_PIN ) ),
+    m_aPinDescription( this, SdResId( TEXT_PIN ) ),
+    m_pScrollBar( new ScrollBar( this, WB_VERT ) ),
+    m_pServer( pServer )
+{
+    m_pScrollBar->SetScrollHdl( LINK( this, ClientBox, ScrollHdl ) );
+    m_pScrollBar->EnableDrag();
+
+    SetPaintTransparent( true );
+    SetPosPixel( Point( RSC_SP_DLG_INNERBORDER_LEFT, RSC_SP_DLG_INNERBORDER_TOP ) );
+    long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
+    long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
+    if ( nIconHeight < nTitleHeight )
+        m_nStdHeight = nTitleHeight;
+    else
+        m_nStdHeight = nIconHeight;
+    m_nStdHeight += GetTextHeight() + TOP_OFFSET;
+
+//     nIconHeight = ICON_HEIGHT + 2*TOP_OFFSET + 1;
+//     if ( m_nStdHeight < nIconHeight )
+//         m_nStdHeight = nIconHeight;
+
+    m_nActiveHeight = m_nStdHeight;
+
+    const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+    if( IsControlBackground() )
+        SetBackground( GetControlBackground() );
+    else
+        SetBackground( rStyleSettings.GetFieldColor() );
+
+    m_xRemoveListener = new ClientRemovedListener( this );
+
+    Show();
+}
+
+//------------------------------------------------------------------------------
+ClientBox::~ClientBox()
+{
+    if ( ! m_bInDelete )
+        DeleteRemoved();
+
+    m_bInDelete = true;
+
+    typedef std::vector< TClientBoxEntry >::iterator ITER;
+
+    for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+    {
+//         (*iIndex)->m_xPackage->removeEventListener( uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) );
+    }
+
+    m_vEntries.clear();
+
+    m_xRemoveListener.clear();
+}
+
+
+//------------------------------------------------------------------------------
+void ClientBox::checkIndex( sal_Int32 nIndex ) const
+{
+    if ( nIndex < 0 )
+        throw lang::IllegalArgumentException( "The list index starts with 0",0, 0 );
+    if ( static_cast< sal_uInt32 >( nIndex ) >= m_vEntries.size())
+        throw lang::IllegalArgumentException( "There is no element at the provided position."
+        "The position exceeds the number of available list entries",0, 0 );
+}
+
+//------------------------------------------------------------------------------
+// Title + description
+void ClientBox::CalcActiveHeight( const long nPos )
+{
+    (void) nPos;
+    const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+    // get title height
+    long aTextHeight;
+    long nIconHeight = 2*TOP_OFFSET + SMALL_ICON_SIZE;
+    long nTitleHeight = 2*TOP_OFFSET + GetTextHeight();
+    if ( nIconHeight < nTitleHeight )
+        aTextHeight = nTitleHeight;
+    else
+        aTextHeight = nIconHeight;
+
+    // Text entry height
+    Size aSize = GetOutputSizePixel();
+    if ( m_bHasScrollBar )
+        aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+
+    aSize.Width() -= ICON_OFFSET;
+
+
+    aTextHeight += m_aPinBox.GetOutputHeightPixel();
+
+    if ( aTextHeight < m_nStdHeight )
+        aTextHeight = m_nStdHeight;
+
+    m_nActiveHeight = aTextHeight + 2;
+}
+
+//------------------------------------------------------------------------------
+const Size ClientBox::GetMinOutputSizePixel() const
+{
+    return Size( 200, 80 );
+}
+
+//------------------------------------------------------------------------------
+Rectangle ClientBox::GetEntryRect( const long nPos ) const
+{
+    const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+    Size aSize( GetOutputSizePixel() );
+
+    if ( m_bHasScrollBar )
+        aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+
+    if ( m_vEntries[ nPos ]->m_bActive )
+        aSize.Height() = m_nActiveHeight;
+    else
+        aSize.Height() = m_nStdHeight;
+
+    Point aPos( 0, -m_nTopIndex + nPos * m_nStdHeight );
+    if ( m_bHasActive && ( nPos < m_nActive ) )
+        aPos.Y() += m_nActiveHeight - m_nStdHeight;
+
+    return Rectangle( aPos, aSize );
+}
+
+//------------------------------------------------------------------------------
+void ClientBox::DeleteRemoved()
+{
+    const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+    m_bInDelete = true;
+
+    if ( ! m_vRemovedEntries.empty() )
+    {
+        typedef std::vector< TClientBoxEntry >::iterator ITER;
+
+        m_vRemovedEntries.clear();
+    }
+
+    m_bInDelete = false;
+}
+
+//------------------------------------------------------------------------------
+//This function may be called with nPos < 0
+void ClientBox::selectEntry( const long nPos )
+{
+    //ToDo whe should not use the guard at such a big scope here.
+    //Currently it is used to gard m_vEntries and m_nActive. m_nActive will be
+    //modified in this function.
+    //It would be probably best to always use a copy of m_vEntries
+    //and some other state variables from ClientBox for
+    //the whole painting operation. See issue i86993
+    ::osl::ClearableMutexGuard guard(m_entriesMutex);
+
+    if ( m_bInCheckMode )
+        return;
+
+    if ( m_bHasActive )
+    {
+        if ( nPos == m_nActive )
+            return;
+
+        m_bHasActive = false;
+        m_vEntries[ m_nActive ]->m_bActive = false;
+    }
+
+    if ( ( nPos >= 0 ) && ( nPos < (long) m_vEntries.size() ) )
+    {
+        m_bHasActive = true;
+        m_nActive = nPos;
+        m_vEntries[ nPos ]->m_bActive = true;
+
+        if ( IsReallyVisible() )
+        {
+            m_bAdjustActive = true;
+        }
+    }
+
+    if ( IsReallyVisible() )
+    {
+        m_bNeedsRecalc = true;
+        Invalidate();
+    }
+
+    guard.clear();
+}
+
+// -----------------------------------------------------------------------
+void ClientBox::DrawRow( const Rectangle& rRect, const TClientBoxEntry pEntry )
+{
+    const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+    if ( pEntry->m_bActive )
+        SetTextColor( rStyleSettings.GetHighlightTextColor() );
+    else
+        SetTextColor( rStyleSettings.GetFieldTextColor() );
+
+    if ( pEntry->m_bActive )
+    {
+        SetLineColor();
+        SetFillColor( rStyleSettings.GetHighlightColor() );
+        DrawRect( rRect );
+    }
+    else
+    {
+        if( IsControlBackground() )
+            SetBackground( GetControlBackground() );
+        else
+            SetBackground( rStyleSettings.GetFieldColor() );
+
+        SetTextFillColor();
+        Erase( rRect );
+    }
+
+    // FIXME: draw bluetooth or wifi icon
+     Point aPos( rRect.TopLeft() );
+//     aPos += Point( TOP_OFFSET, TOP_OFFSET );
+//     Image aImage;
+//     if ( ! pEntry->m_aIcon )
+//         aImage = m_aDefaultImage;
+//     else
+//         aImage = pEntry->m_aIcon;
+//     Size aImageSize = aImage.GetSizePixel();
+//     if ( ( aImageSize.Width() <= ICON_WIDTH ) && ( aImageSize.Height() <= ICON_HEIGHT ) )
+//         DrawImage( Point( aPos.X()+((ICON_WIDTH-aImageSize.Width())/2), aPos.Y()+((ICON_HEIGHT-aImageSize.Height())/2) ), aImage );
+//     else
+//         DrawImage( aPos, Size( ICON_WIDTH, ICON_HEIGHT ), aImage );
+
+    // Setup fonts
+    Font aStdFont( GetFont() );
+    Font aBoldFont( aStdFont );
+    aBoldFont.SetWeight( WEIGHT_BOLD );
+    SetFont( aBoldFont );
+    long aTextHeight = GetTextHeight();
+
+    // Get max title width
+    long nMaxTitleWidth = rRect.GetWidth() - ICON_OFFSET;
+    nMaxTitleWidth -= ( 2 * SMALL_ICON_SIZE ) + ( 4 * SPACE_BETWEEN );
+
+    long aTitleWidth = GetTextWidth( String( pEntry->m_clientInfo.mName ) ) + (aTextHeight / 3);
+
+    aPos = rRect.TopLeft() + Point( ICON_OFFSET, TOP_OFFSET );
+
+    if ( aTitleWidth > nMaxTitleWidth )
+    {
+        aTitleWidth = nMaxTitleWidth - (aTextHeight / 3);
+        String aShortTitle = GetEllipsisString( pEntry->m_clientInfo.mName,
+                                                aTitleWidth );
+        DrawText( aPos, aShortTitle );
+        aTitleWidth += (aTextHeight / 3);
+    }
+    else
+        DrawText( aPos, pEntry->m_clientInfo.mName );
+
+    SetFont( aStdFont );
+
+    aPos.Y() += aTextHeight;
+    if ( pEntry->m_bActive )
+    {
+        const Rectangle aRect( GetEntryRect( m_nActive ) );
+        Size  aBtnSize( m_aPinBox.GetSizePixel() );
+        Point aBtnPos( aRect.Left() + ICON_OFFSET,
+                   aRect.Bottom() - TOP_OFFSET - aBtnSize.Height() );
+
+        m_aPinBox.SetPosPixel( aBtnPos );
+
+        Size aSize = LogicToPixel( Size( RSC_CD_PUSHBUTTON_WIDTH, RSC_CD_PUSHBUTTON_HEIGHT ),
+                               MapMode( MAP_APPFONT ) );
+    m_aPinBox.SetSizePixel( aSize );
+//         long nExtraHeight = 0;
+//
+//         if ( pEntry->m_bHasButtons )
+//             nExtraHeight = m_nExtraHeight;
+//
+//         DrawText( Rectangle( aPos.X(), aPos.Y(), rRect.Right(), rRect.Bottom() - nExtraHeight ),
+//                   sDescription, TEXT_DRAW_MULTILINE | TEXT_DRAW_WORDBREAK );
+    }
+    else
+    {
+    }
+
+    SetLineColor( Color( COL_LIGHTGRAY ) );
+    DrawLine( rRect.BottomLeft(), rRect.BottomRight() );
+}
+
+// -----------------------------------------------------------------------
+void ClientBox::RecalcAll()
+{
+    if ( m_bHasActive )
+        CalcActiveHeight( m_nActive );
+
+    SetupScrollBar();
+
+    if ( m_bHasActive )
+    {
+        Rectangle aEntryRect = GetEntryRect( m_nActive );
+
+        if ( m_bAdjustActive )
+        {
+            m_bAdjustActive = false;
+
+            // If the top of the selected entry isn't visible, make it visible
+            if ( aEntryRect.Top() < 0 )
+            {
+                m_nTopIndex += aEntryRect.Top();
+                aEntryRect.Move( 0, -aEntryRect.Top() );
+            }
+
+            // If the bottom of the selected entry isn't visible, make it visible even if now the top
+            // isn't visible any longer ( the buttons are more important )
+            Size aOutputSize = GetOutputSizePixel();
+            if ( aEntryRect.Bottom() > aOutputSize.Height() )
+            {
+                m_nTopIndex += ( aEntryRect.Bottom() - aOutputSize.Height() );
+                aEntryRect.Move( 0, -( aEntryRect.Bottom() - aOutputSize.Height() ) );
+            }
+
+            // If there is unused space below the last entry but all entries don't fit into the box,
+            // move the content down to use the whole space
+            const long nTotalHeight = GetTotalHeight();
+            if ( m_bHasScrollBar && ( aOutputSize.Height() + m_nTopIndex > nTotalHeight ) )
+            {
+                long nOffset = m_nTopIndex;
+                m_nTopIndex = nTotalHeight - aOutputSize.Height();
+                nOffset -= m_nTopIndex;
+                aEntryRect.Move( 0, nOffset );
+            }
+
+            if ( m_bHasScrollBar )
+                m_pScrollBar->SetThumbPos( m_nTopIndex );
+        }
+    }
+
+    m_bNeedsRecalc = false;
+}
+
+// -----------------------------------------------------------------------
+bool ClientBox::HandleTabKey( bool )
+{
+    return false;
+}
+
+// -----------------------------------------------------------------------
+bool ClientBox::HandleCursorKey( sal_uInt16 nKeyCode )
+{
+    if ( m_vEntries.empty() )
+        return true;
+
+    long nSelect = 0;
+
+    if ( m_bHasActive )
+    {
+        long nPageSize = GetOutputSizePixel().Height() / m_nStdHeight;
+        if ( nPageSize < 2 )
+            nPageSize = 2;
+
+        if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_RIGHT ) )
+            nSelect = m_nActive + 1;
+        else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_LEFT ) )
+            nSelect = m_nActive - 1;
+        else if ( nKeyCode == KEY_HOME )
+            nSelect = 0;
+        else if ( nKeyCode == KEY_END )
+            nSelect = m_vEntries.size() - 1;
+        else if ( nKeyCode == KEY_PAGEUP )
+            nSelect = m_nActive - nPageSize + 1;
+        else if ( nKeyCode == KEY_PAGEDOWN )
+            nSelect = m_nActive + nPageSize - 1;
+    }
+    else // when there is no selected entry, we will select the first or the last.
+    {
+        if ( ( nKeyCode == KEY_DOWN ) || ( nKeyCode == KEY_PAGEDOWN ) || ( nKeyCode == KEY_HOME ) )
+            nSelect = 0;
+        else if ( ( nKeyCode == KEY_UP ) || ( nKeyCode == KEY_PAGEUP ) || ( nKeyCode == KEY_END ) )
+            nSelect = m_vEntries.size() - 1;
+    }
+
+    if ( nSelect < 0 )
+        nSelect = 0;
+    if ( nSelect >= (long) m_vEntries.size() )
+        nSelect = m_vEntries.size() - 1;
+
+    selectEntry( nSelect );
+
+    return true;
+}
+
+// -----------------------------------------------------------------------
+void ClientBox::Paint( const Rectangle &/*rPaintRect*/ )
+{
+    if ( !m_bInDelete )
+        DeleteRemoved();
+
+    if ( m_bNeedsRecalc )
+        RecalcAll();
+
+    Point aStart( 0, -m_nTopIndex );
+    Size aSize( GetOutputSizePixel() );
+
+    if ( m_bHasScrollBar )
+        aSize.Width() -= m_pScrollBar->GetSizePixel().Width();
+
+    const ::osl::MutexGuard aGuard( m_entriesMutex );
+
+    typedef std::vector< TClientBoxEntry >::iterator ITER;
+    for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+    {
+        aSize.Height() = (*iIndex)->m_bActive ? m_nActiveHeight : m_nStdHeight;
+        Rectangle aEntryRect( aStart, aSize );
+        DrawRow( aEntryRect, *iIndex );
+        aStart.Y() += aSize.Height();
+    }
+}
+
+// -----------------------------------------------------------------------
+long ClientBox::GetTotalHeight() const
+{
+    long nHeight = m_vEntries.size() * m_nStdHeight;
+
+    if ( m_bHasActive )
+    {
+        nHeight += m_nActiveHeight - m_nStdHeight;
+    }
+
+    return nHeight;
+}
+
+// -----------------------------------------------------------------------
+void ClientBox::SetupScrollBar()
+{
+    const Size aSize = GetOutputSizePixel();
+    const long nScrBarSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+    const long nTotalHeight = GetTotalHeight();
+    const bool bNeedsScrollBar = ( nTotalHeight > aSize.Height() );
+
+    if ( bNeedsScrollBar )
+    {
+        if ( m_nTopIndex + aSize.Height() > nTotalHeight )
+            m_nTopIndex = nTotalHeight - aSize.Height();
+
+        m_pScrollBar->SetPosSizePixel( Point( aSize.Width() - nScrBarSize, 0 ),
+                                       Size( nScrBarSize, aSize.Height() ) );
+        m_pScrollBar->SetRangeMax( nTotalHeight );
+        m_pScrollBar->SetVisibleSize( aSize.Height() );
+        m_pScrollBar->SetPageSize( ( aSize.Height() * 4 ) / 5 );
+        m_pScrollBar->SetLineSize( m_nStdHeight );
+        m_pScrollBar->SetThumbPos( m_nTopIndex );
+
+        if ( !m_bHasScrollBar )
+            m_pScrollBar->Show();
+    }
+    else if ( m_bHasScrollBar )
+    {
+        m_pScrollBar->Hide();
+        m_nTopIndex = 0;
+    }
+
+    m_bHasScrollBar = bNeedsScrollBar;
+}
+
+// -----------------------------------------------------------------------
+void ClientBox::Resize()
+{
+    RecalcAll();
+}
+
+//------------------------------------------------------------------------------
+long ClientBox::PointToPos( const Point& rPos )
+{
+    long nPos = ( rPos.Y() + m_nTopIndex ) / m_nStdHeight;
+
+    if ( m_bHasActive && ( nPos > m_nActive ) )
+    {
+        if ( rPos.Y() + m_nTopIndex <= m_nActive*m_nStdHeight + m_nActiveHeight )
+            nPos = m_nActive;
+        else
+            nPos = ( rPos.Y() + m_nTopIndex - (m_nActiveHeight - m_nStdHeight) ) / m_nStdHeight;
+    }
+
+    return nPos;
+}
+
+//------------------------------------------------------------------------------
+void ClientBox::MouseButtonDown( const MouseEvent& rMEvt )
+{
+    long nPos = PointToPos( rMEvt.GetPosPixel() );
+
+    if ( rMEvt.IsLeft() )
+    {
+        if ( rMEvt.IsMod1() && m_bHasActive )
+            selectEntry( m_vEntries.size() );   // Selecting an not existing entry will deselect the current one
+        else
+            selectEntry( nPos );
+    }
+}
+
+//------------------------------------------------------------------------------
+long ClientBox::Notify( NotifyEvent& rNEvt )
+{
+    if ( !m_bInDelete )
+        DeleteRemoved();
+
+    bool bHandled = false;
+
+    if ( rNEvt.GetType() == EVENT_KEYINPUT )
+    {
+        const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
+        KeyCode         aKeyCode = pKEvt->GetKeyCode();
+        sal_uInt16          nKeyCode = aKeyCode.GetCode();
+
+        if ( nKeyCode == KEY_TAB )
+            bHandled = HandleTabKey( aKeyCode.IsShift() );
+        else if ( aKeyCode.GetGroup() == KEYGROUP_CURSOR )
+            bHandled = HandleCursorKey( nKeyCode );
+    }
+
+    if ( rNEvt.GetType() == EVENT_COMMAND )
+    {
+        if ( m_bHasScrollBar &&
+             ( rNEvt.GetCommandEvent()->GetCommand() == COMMAND_WHEEL ) )
+        {
+            const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
+            if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
+            {
+                long nThumbPos = m_pScrollBar->GetThumbPos();
+                if ( pData->GetDelta() < 0 )
+                    m_pScrollBar->DoScroll( nThumbPos + m_nStdHeight );
+                else
+                    m_pScrollBar->DoScroll( nThumbPos - m_nStdHeight );
+                bHandled = true;
+            }
+        }
+    }
+
+    if ( !bHandled )
+        return Control::Notify( rNEvt );
+    else
+        return true;
+}
+
+
+//------------------------------------------------------------------------------
+long ClientBox::addEntry( const ClientInfo& rClientInfo )
+{
+    long         nPos = 0;
+//     PackageState eState = m_pManager->getPackageState( xPackage );
+//     bool         bLocked = m_pManager->isReadOnly( xPackage );
+
+    TClientBoxEntry pEntry( new ClientBoxEntry( rClientInfo ) );
+
+    bool bNewEntryInserted = false;
+
+    ::osl::ClearableMutexGuard guard(m_entriesMutex);
+    if ( m_vEntries.empty() )
+    {
+        m_vEntries.push_back( pEntry );
+        bNewEntryInserted = true;
+    }
+    else
+    {
+//         if ( !FindEntryPos( pEntry, 0, m_vEntries.size()-1, nPos ) )
+//         {
+            m_vEntries.insert( m_vEntries.begin()+nPos, pEntry );
+            bNewEntryInserted = true;
+//         }
+//         else if ( !m_bInCheckMode )
+//         {
+//             OSL_FAIL( "ClientBox::addEntry(): Will not add duplicate entries"  );
+//         }
+    }
+
+    //Related: rhbz#702833 Only add a Listener if we're adding a new entry, to
+    //keep in sync with removeEventListener logic
+    if (bNewEntryInserted)
+    {
+//         pEntry->m_xPackage->addEventListener(uno::Reference< lang::XEventListener > ( m_xRemoveListener, uno::UNO_QUERY ) );
+    }
+
+
+//     pEntry->m_bHasOptions = m_pManager->supportsOptions( xPackage );
+//     pEntry->m_bUser       = xPackage->getRepositoryName().equals( USER_PACKAGE_MANAGER );
+//     pEntry->m_bShared     = xPackage->getRepositoryName().equals( SHARED_PACKAGE_MANAGER );
+//     pEntry->m_bNew        = m_bInCheckMode;
+//     pEntry->m_bMissingLic = bLicenseMissing;
+
+//     if ( bLicenseMissing )
+//         pEntry->m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_MISSING_LICENSE );
+
+    //access to m_nActive must be guarded
+    if ( !m_bInCheckMode && m_bHasActive && ( m_nActive >= nPos ) )
+        m_nActive += 1;
+
+    guard.clear();
+
+    if ( IsReallyVisible() )
+        Invalidate();
+
+    m_bNeedsRecalc = true;
+
+    return nPos;
+}
+
+//------------------------------------------------------------------------------
+void ClientBox::updateEntry( const ClientInfo& rClientInfo )
+{
+    (void) rClientInfo;
+//     typedef std::vector< TClientBoxEntry >::iterator ITER;
+//     for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+//     {
+//         if ( (*iIndex)->m_xPackage == xPackage )
+//         {
+//             PackageState eState = m_pManager->getPackageState( xPackage );
+//             (*iIndex)->m_bHasOptions = m_pManager->supportsOptions( xPackage );
+//             (*iIndex)->m_eState = eState;
+//             (*iIndex)->m_sTitle = xPackage->getDisplayName();
+//             (*iIndex)->m_sVersion = xPackage->getVersion();
+//             (*iIndex)->m_sDescription = xPackage->getDescription();
+//
+//             if ( eState == REGISTERED )
+//                 (*iIndex)->m_bMissingLic = false;
+//
+//             if ( eState == AMBIGUOUS )
+//                 (*iIndex)->m_sErrorText = DialogHelper::getResourceString( RID_STR_ERROR_UNKNOWN_STATUS );
+//             else if ( ! (*iIndex)->m_bMissingLic )
+//                 (*iIndex)->m_sErrorText = String();
+//
+//             if ( IsReallyVisible() )
+//                 Invalidate();
+//             break;
+//         }
+//     }
+}
+
+//------------------------------------------------------------------------------
+void ClientBox::removeEntry( const ClientInfo& rClientInfo )
+{
+    (void) rClientInfo;
+//     if ( ! m_bInDelete )
+//     {
+//         ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
+//
+//         typedef std::vector< TClientBoxEntry >::iterator ITER;
+//
+//         for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+//         {
+//             if ( (*iIndex)->m_xPackage == xPackage )
+//             {
+//                 long nPos = iIndex - m_vEntries.begin();
+//
+//                 // Entries mustn't removed here, because they contain a hyperlink control
+//                 // which can only be deleted when the thread has the solar mutex. Therefor
+//                 // the entry will be moved into the m_vRemovedEntries list which will be
+//                 // cleared on the next paint event
+//                 m_vRemovedEntries.push_back( *iIndex );
+//                 m_vEntries.erase( iIndex );
+//
+//                 m_bNeedsRecalc = true;
+//
+//                 if ( IsReallyVisible() )
+//                     Invalidate();
+//
+//                 if ( m_bHasActive )
+//                 {
+//                     if ( nPos < m_nActive )
+//                         m_nActive -= 1;
+//                     else if ( ( nPos == m_nActive ) &&
+//                               ( nPos == (long) m_vEntries.size() ) )
+//                         m_nActive -= 1;
+//
+//                     m_bHasActive = false;
+//                     //clear before calling out of this method
+//                     aGuard.clear();
+//                     selectEntry( m_nActive );
+//                 }
+//                 break;
+//             }
+//         }
+//     }
+}
+
+//------------------------------------------------------------------------------
+void ClientBox::RemoveUnlocked()
+{
+//     bool bAllRemoved = false;
+//
+//     while ( ! bAllRemoved )
+//     {
+//         bAllRemoved = true;
+//
+//         ::osl::ClearableMutexGuard aGuard( m_entriesMutex );
+//
+//         typedef std::vector< TClientBoxEntry >::iterator ITER;
+//
+//         for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+//         {
+//             if ( !(*iIndex)->m_bLocked )
+//             {
+//                 bAllRemoved = false;
+//                 uno::Reference< deployment::XPackage> xPackage = (*iIndex)->m_xPackage;
+//                 aGuard.clear();
+//                 removeEntry( xPackage );
+//                 break;
+//             }
+//         }
+//     }
+}
+
+//------------------------------------------------------------------------------
+void ClientBox::prepareChecking()
+{
+    m_bInCheckMode = true;
+    typedef std::vector< TClientBoxEntry >::iterator ITER;
+    for ( ITER iIndex = m_vEntries.begin(); iIndex < m_vEntries.end(); ++iIndex )
+    {
+//         (*iIndex)->m_bChecked = false;
+//         (*iIndex)->m_bNew = false;
+    }
+}
+
+//------------------------------------------------------------------------------
+void ClientBox::checkEntries()
+{
+    long nNewPos = -1;
+//     long nPos = 0;
+    bool bNeedsUpdate = false;
+
+    ::osl::ClearableMutexGuard guard(m_entriesMutex);
+    typedef std::vector< TClientBoxEntry >::iterator ITER;
+    ITER iIndex = m_vEntries.begin();
+    while ( iIndex < m_vEntries.end() )
+    {
+//         if ( (*iIndex)->m_bChecked == false )
+//         {
+//             (*iIndex)->m_bChecked = true;
+//             bNeedsUpdate = true;
+//             nPos = iIndex-m_vEntries.begin();
+//             if ( (*iIndex)->m_bNew )
+//             { // add entry to list and correct active pos
+//                 if ( nNewPos == - 1)
+//                     nNewPos = nPos;
+//                 if ( nPos <= m_nActive )
+//                     m_nActive += 1;
+//                 ++iIndex;
+//             }
+//             else
+//             {   // remove entry from list
+//                 if ( nPos < m_nActive )
+//                     m_nActive -= 1;
+//                 else if ( ( nPos == m_nActive ) && ( nPos == (long) m_vEntries.size() - 1 ) )
+//                     m_nActive -= 1;
+//                 m_vRemovedEntries.push_back( *iIndex );
+//                 m_vEntries.erase( iIndex );
+//                 iIndex = m_vEntries.begin() + nPos;
+//             }
+//         }
+//         else
+            ++iIndex;
+    }
+    guard.clear();
+
+    m_bInCheckMode = false;
+
+    if ( nNewPos != - 1)
+        selectEntry( nNewPos );
+
+    if ( bNeedsUpdate )
+    {
+        m_bNeedsRecalc = true;
+        if ( IsReallyVisible() )
+            Invalidate();
+    }
+}
+
+//------------------------------------------------------------------------------
+void ClientBox::SetScrollHdl( const Link& rLink )
+{
+    m_pScrollBar->SetScrollHdl( rLink );
+}
+
+// -----------------------------------------------------------------------
+void ClientBox::DoScroll( long nDelta )
+{
+    m_nTopIndex += nDelta;
+    Point aNewSBPt( m_pScrollBar->GetPosPixel() );
+
+    Rectangle aScrRect( Point(), GetOutputSizePixel() );
+    aScrRect.Right() -= m_pScrollBar->GetSizePixel().Width();
+    Scroll( 0, -nDelta, aScrRect );
+
+    m_pScrollBar->SetPosPixel( aNewSBPt );
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( ClientBox, ScrollHdl, ScrollBar*, pScrBar )
+{
+    DoScroll( pScrBar->GetDelta() );
+
+    return 1;
+}
+
+} //namespace dp_gui
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.hxx b/sd/source/ui/dlg/RemoteDialogClientBox.hxx
new file mode 100644
index 0000000..c22af87
--- /dev/null
+++ b/sd/source/ui/dlg/RemoteDialogClientBox.hxx
@@ -0,0 +1,194 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "rtl/ustring.hxx"
+#include "vcl/scrbar.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/dialog.hxx"
+#include "vcl/field.hxx"
+
+#include "svtools/extensionlistbox.hxx"
+#include "svtools/fixedhyper.hxx"
+#include "cppuhelper/implbase1.hxx"
+#include "unotools/collatorwrapper.hxx"
+
+#include "com/sun/star/lang/Locale.hpp"
+#include "com/sun/star/lang/XEventListener.hpp"
+#include "com/sun/star/deployment/XPackage.hpp"
+
+#include <boost/shared_ptr.hpp>
+
+#include "RemoteServer.hxx"
+#include "sdresid.hxx"
+
+namespace sd {
+
+#define SMALL_ICON_SIZE     16
+#define TOP_OFFSET           5
+#define ICON_HEIGHT         42
+#define ICON_WIDTH          47
+#define ICON_OFFSET         72
+#define RIGHT_ICON_OFFSET    5
+#define SPACE_BETWEEN        3
+//------------------------------------------------------------------------------
+//                          struct ClientBoxEntry
+//------------------------------------------------------------------------------
+struct ClientBoxEntry;
+
+typedef ::boost::shared_ptr< ClientBoxEntry > TClientBoxEntry;
+
+struct ClientBoxEntry
+{
+    bool            m_bActive       :1;
+    ClientInfo     m_clientInfo;
+
+
+    ClientBoxEntry( const ClientInfo& rClientInfo );
+   ~ClientBoxEntry();
+
+};
+
+//------------------------------------------------------------------------------
+//                          class ExtensionBox_Impl
+//------------------------------------------------------------------------------
+
+class ClientBox;
+
+//------------------------------------------------------------------------------
+class ClientRemovedListener : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XEventListener >
+{
+    ClientBox   *m_pParent;
+
+public:
+
+    ClientRemovedListener( ClientBox *pParent ) { m_pParent = pParent; }
+   ~ClientRemovedListener();
+
+    //===================================================================================
+    // XEventListener
+    virtual void SAL_CALL disposing( ::com::sun::star::lang::EventObject const & evt )
+        throw (::com::sun::star::uno::RuntimeException);
+};
+
+
+//------------------------------------------------------------------------------
+class ClientBox:
+    public Control
+{
+    bool            m_bHasScrollBar;
+    bool            m_bHasActive;
+    bool            m_bNeedsRecalc;
+    bool            m_bHasNew;
+    bool            m_bInCheckMode;
+    bool            m_bAdjustActive;
+    bool            m_bInDelete;
+    //Must be guarded together with m_vEntries to ensure a valid index at all times.
+    //Use m_entriesMutex as guard.
+    long            m_nActive;
+    long            m_nTopIndex;
+    long            m_nStdHeight;
+    long            m_nActiveHeight;
+    long            m_nExtraHeight;
+    Size            m_aOutputSize;
+    Link            m_aClickHdl;
+
+    NumericBox      m_aPinBox;
+    FixedText       m_aPinDescription;
+
+    ScrollBar*      m_pScrollBar;
+
+    com::sun::star::uno::Reference< ClientRemovedListener > m_xRemoveListener;
+
+    RemoteServer      *m_pServer;
+    //This mutex is used for synchronizing access to m_vEntries.
+    //Currently it is used to synchronize adding, removing entries and
+    //functions like getItemName, getItemDescription, etc. to prevent
+    //that m_vEntries is accessed at an invalid index.
+    //ToDo: There are many more places where m_vEntries is read and which may
+    //fail. For example the Paint method is probable called from the main thread
+    //while new entries are added / removed in a separate thread.
+    mutable ::osl::Mutex    m_entriesMutex;
+    std::vector< TClientBoxEntry > m_vEntries;
+    std::vector< TClientBoxEntry > m_vRemovedEntries;
+
+    CollatorWrapper *m_pCollator;
+
+    void            CalcActiveHeight( const long nPos );
+    long            GetTotalHeight() const;
+    void            SetupScrollBar();
+    void            DrawRow( const Rectangle& rRect, const TClientBoxEntry pEntry );
+    bool            HandleTabKey( bool bReverse );
+    bool            HandleCursorKey( sal_uInt16 nKeyCode );
+    void            DeleteRemoved();
+
+    //-----------------
+    DECL_DLLPRIVATE_LINK( ScrollHdl, ScrollBar* );
+
+    //Index starts with 1.
+    //Throws an com::sun::star::lang::IllegalArgumentException, when the index is invalid.
+    void checkIndex(sal_Int32 pos) const;
+
+
+public:
+                    ClientBox( Dialog* pParent, RemoteServer *pServer,
+                               const SdResId& aId );
+                   ~ClientBox();
+
+    void    MouseButtonDown( const MouseEvent& rMEvt );
+    void    Paint( const Rectangle &rPaintRect );
+    void    Resize();
+    long    Notify( NotifyEvent& rNEvt );
+
+    const Size      GetMinOutputSizePixel() const;
+    void            SetExtraSize( long nSize ) { m_nExtraHeight = nSize; }
+    TClientBoxEntry     GetEntryData( long nPos ) { return m_vEntries[ nPos ]; }
+    long            GetEntryCount() { return (long) m_vEntries.size(); }
+    Rectangle       GetEntryRect( const long nPos ) const;
+    bool            HasActive() { return m_bHasActive; }
+    long            PointToPos( const Point& rPos );
+    void            SetScrollHdl( const Link& rLink );
+    void            DoScroll( long nDelta );
+    void            SetHyperlinkHdl( const Link& rLink ){ m_aClickHdl = rLink; }
+    void    RecalcAll();
+    void            RemoveUnlocked();
+
+    //-----------------
+    void    selectEntry( const long nPos );
+    long            addEntry( const ClientInfo& rClientInfo );
+    void            updateEntry( const ClientInfo& rPackageInfo );
+    void            removeEntry( const ClientInfo& rPackageInfo );
+
+    void            prepareChecking();
+    void            checkEntries();
+
+    RemoteServer*    getServer() const { return m_pServer; }
+};
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/sd/source/ui/inc/RemoteDialog.hrc b/sd/source/ui/inc/RemoteDialog.hrc
index 5e1a01f..7e3bee7 100644
--- a/sd/source/ui/inc/RemoteDialog.hrc
+++ b/sd/source/ui/inc/RemoteDialog.hrc
@@ -10,5 +10,8 @@
 
 #define DLG_PAIR_REMOTE  RID_APP_START+700
 
-#define BTN_CONNECT 1
-
+#define BTN_CONNECT     1
+#define BTN_CANCEL      2
+#define LB_SERVERS      3
+#define INPUT_PIN       4
+#define TEXT_PIN        5
\ No newline at end of file
diff --git a/sd/source/ui/inc/RemoteDialog.hxx b/sd/source/ui/inc/RemoteDialog.hxx
deleted file mode 100644
index 3056e3d..0000000
--- a/sd/source/ui/inc/RemoteDialog.hxx
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-#ifndef _SD_REMOTEDIALOG_HXX_
-#define _SD_REMOTEDIALOG_HXX_
-
-#include <vcl/lstbox.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/field.hxx>
-
-namespace sd
-{
-
-class RemoteDialog : public ModalDialog
-{
-
-public:
-    RemoteDialog( Window* pWindow );
-    ~RemoteDialog();
-
-};
-
-}
-
-#endif // _SD_REMOTEDIALOG_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/sd/source/ui/inc/RemoteServer.hxx b/sd/source/ui/inc/RemoteServer.hxx
index e79d356..b614dd1 100644
--- a/sd/source/ui/inc/RemoteServer.hxx
+++ b/sd/source/ui/inc/RemoteServer.hxx
@@ -14,6 +14,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/types.h>
+#include <vector>
 
 #include <osl/socket.hxx>
 #include <rtl/ref.hxx>
@@ -21,6 +22,8 @@
 
 #include <com/sun/star/presentation/XSlideShowController.hpp>
 
+#include "sddllapi.h"
+
 namespace css = ::com::sun::star;
 
 /**
@@ -29,6 +32,7 @@ namespace css = ::com::sun::star;
 #define PORT 1599
 
 #define CHARSET RTL_TEXTENCODING_UTF8
+namespace css = ::com::sun::star;
 
 namespace sd
 {
@@ -37,6 +41,17 @@ namespace sd
     class Listener;
     class ImagePreparer;
 
+    struct ClientInfo
+    {
+        const rtl::OUString mName;
+        const rtl::OUString mAddress;
+
+        enum PROTOCOL { NETWORK = 1, BLUETOOTH };
+        ClientInfo( OUString rName, OUString rAddress) :
+            mName( rName ),
+            mAddress( rAddress ) {}
+    };
+
     class RemoteServer : public salhelper::Thread
     {
         public:
@@ -45,6 +60,9 @@ namespace sd
                 css::presentation::XSlideShowController > &rController );
             static void presentationStopped();
             void informListenerDestroyed();
+
+            SD_DLLPUBLIC static std::vector<ClientInfo> getClients();
+            SD_DLLPUBLIC static void connectClient( ClientInfo aClient, rtl::OString aPin );
         private:
             RemoteServer();
             ~RemoteServer();
diff --git a/sd/source/ui/remotecontrol/RemoteDialog.cxx b/sd/source/ui/remotecontrol/RemoteDialog.cxx
deleted file mode 100644
index e2cbc6a..0000000
--- a/sd/source/ui/remotecontrol/RemoteDialog.cxx
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-#include "RemoteDialog.hxx"
-
-
-RemoteDialog::RemoteDialog()
-{
-}
-
-RemoteDialog::~RemoteDialog()
-{
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/RemoteDialog.hxx b/sd/source/ui/remotecontrol/RemoteDialog.hxx
deleted file mode 100644
index 417c155..0000000
--- a/sd/source/ui/remotecontrol/RemoteDialog.hxx
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-// SERVER
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "Server.hxx"
-
-namespace sd
-{
-    namespace remotecontrol
-    {
-        class RemoteDialog
-        {
-        public:
-            RemoteDialog();
-            ~RemoteDialog();
-        private:
-            //int mSocket;
-        };
-    }
-}
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx
index 2919bda..61284ff 100644
--- a/sd/source/ui/remotecontrol/Server.cxx
+++ b/sd/source/ui/remotecontrol/Server.cxx
@@ -166,6 +166,20 @@ void RemoteServer::setup()
   spServer->launch();
 }
 
+std::vector<ClientInfo> RemoteServer::getClients()
+{
+    std::vector<ClientInfo> aV;
+    aV.push_back( ClientInfo( "A phone", "akaakaskj" ) );
+    aV.push_back( ClientInfo( "B phone", "iiiiiii" ) );
+    return aV;
+}
+
+void RemoteServer::connectClient( ClientInfo aClient, rtl::OString aPin )
+{
+    (void) aClient;
+    (void) aPin;
+}
+
 void SdDLL::RegisterRemotes()
 {
     // Disable unless in experimental mode for now
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 3b53f1d..ec04129 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -1186,7 +1186,6 @@ void SlotManager::ChangeSlideExclusionState (
 
     SfxBindings& rBindings (mrSlideSorter.GetViewShell()->GetViewFrame()->GetBindings());
     rBindings.Invalidate(SID_PRESENTATION);
-    rBindings.Invalidate(SID_REMOTE_DLG);
     rBindings.Invalidate(SID_REHEARSE_TIMINGS);
     rBindings.Invalidate(SID_HIDE_SLIDE);
     rBindings.Invalidate(SID_SHOW_SLIDE);


More information about the Libreoffice-commits mailing list