Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
0632f77e
Kaydet (Commit)
0632f77e
authored
Nis 13, 2015
tarafından
Siqi Liu
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
LOK_STATE_CHANGED callback implemented with sfx events interception.
üst
cc54da22
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
134 additions
and
25 deletions
+134
-25
InvalidationHandler.java
...ndroid3/src/java/org/libreoffice/InvalidationHandler.java
+20
-12
ToolbarController.java
...OAndroid3/src/java/org/libreoffice/ToolbarController.java
+7
-1
LibreOfficeKitEnums.h
include/LibreOfficeKit/LibreOfficeKitEnums.h
+8
-1
objsh.hxx
include/sfx2/objsh.hxx
+11
-0
unoctitm.hxx
include/sfx2/unoctitm.hxx
+2
-0
lokdocview.cxx
libreofficekit/source/gtk/lokdocview.cxx
+6
-0
unoctitm.cxx
sfx2/source/control/unoctitm.cxx
+44
-11
objcont.cxx
sfx2/source/doc/objcont.cxx
+12
-0
docsh.hxx
sw/inc/docsh.hxx
+5
-0
docsh.cxx
sw/source/uibase/app/docsh.cxx
+19
-0
No files found.
android/experimental/LOAndroid3/src/java/org/libreoffice/InvalidationHandler.java
Dosyayı görüntüle @
0632f77e
...
@@ -4,6 +4,7 @@ import android.content.Intent;
...
@@ -4,6 +4,7 @@ import android.content.Intent;
import
android.graphics.PointF
;
import
android.graphics.PointF
;
import
android.graphics.RectF
;
import
android.graphics.RectF
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.util.Log
;
import
org.libreoffice.canvas.SelectionHandle
;
import
org.libreoffice.canvas.SelectionHandle
;
import
org.libreoffice.kit.Document
;
import
org.libreoffice.kit.Document
;
...
@@ -73,19 +74,26 @@ public class InvalidationHandler implements Document.MessageCallback {
...
@@ -73,19 +74,26 @@ public class InvalidationHandler implements Document.MessageCallback {
LibreOfficeMainActivity
.
mAppContext
.
startActivity
(
urlIntent
);
LibreOfficeMainActivity
.
mAppContext
.
startActivity
(
urlIntent
);
break
;
break
;
case
Document
.
CALLBACK_STATE_CHANGED
:
case
Document
.
CALLBACK_STATE_CHANGED
:
Log
.
d
(
"Document.CALLBACK_STATE_CHANGED: "
+
payload
);
stateChanged
(
payload
);
String
[]
parts
=
payload
.
split
(
":"
);
boolean
pressed
=
Boolean
.
parseBoolean
(
parts
[
1
]);
if
(
parts
[
0
].
equals
(
"Bold"
))
{
LOKitShell
.
getToolbarController
().
onToggleStateChanged
(
Document
.
BOLD
,
pressed
);
}
else
if
(
parts
[
0
].
equals
(
"Italic"
))
{
LOKitShell
.
getToolbarController
().
onToggleStateChanged
(
Document
.
ITALIC
,
pressed
);
}
else
if
(
parts
[
0
].
equals
(
"Underline"
))
{
LOKitShell
.
getToolbarController
().
onToggleStateChanged
(
Document
.
UNDERLINE
,
pressed
);
}
else
if
(
parts
[
0
].
equals
(
"Strikeout"
))
{
LOKitShell
.
getToolbarController
().
onToggleStateChanged
(
Document
.
STRIKEOUT
,
pressed
);
}
break
;
break
;
default
:
Log
.
d
(
LOGTAG
,
"LOK_CALLBACK uncatched: "
+
messageID
+
" : "
+
payload
);
}
}
private
void
stateChanged
(
String
payload
)
{
String
[]
parts
=
payload
.
split
(
"="
);
boolean
pressed
=
Boolean
.
parseBoolean
(
parts
[
1
]);
if
(
parts
[
0
].
equals
(
".uno:Bold"
))
{
LOKitShell
.
getToolbarController
().
onToggleStateChanged
(
Document
.
BOLD
,
pressed
);
}
else
if
(
parts
[
0
].
equals
(
".uno:Italic"
))
{
LOKitShell
.
getToolbarController
().
onToggleStateChanged
(
Document
.
ITALIC
,
pressed
);
}
else
if
(
parts
[
0
].
equals
(
".uno:Underline"
))
{
LOKitShell
.
getToolbarController
().
onToggleStateChanged
(
Document
.
UNDERLINE
,
pressed
);
}
else
if
(
parts
[
0
].
equals
(
".uno:StrikeOut"
))
{
LOKitShell
.
getToolbarController
().
onToggleStateChanged
(
Document
.
STRIKEOUT
,
pressed
);
}
else
{
Log
.
d
(
LOGTAG
,
"LOK_CALLBACK_STATE_CHANGED type uncatched: "
+
payload
);
}
}
}
}
...
...
android/experimental/LOAndroid3/src/java/org/libreoffice/ToolbarController.java
Dosyayı görüntüle @
0632f77e
...
@@ -72,7 +72,13 @@ public class ToolbarController {
...
@@ -72,7 +72,13 @@ public class ToolbarController {
icon
=
ImageUtils
.
bitmapToPressed
(
icon
);
icon
=
ImageUtils
.
bitmapToPressed
(
icon
);
}
}
menuItem
.
setIcon
(
new
BitmapDrawable
(
mContext
.
getResources
(),
icon
));
final
MenuItem
fMenuItem
=
menuItem
;
final
Bitmap
fIcon
=
icon
;
LOKitShell
.
getMainHandler
().
post
(
new
Runnable
()
{
public
void
run
()
{
fMenuItem
.
setIcon
(
new
BitmapDrawable
(
mContext
.
getResources
(),
fIcon
));
}
});
}
}
public
void
setOptionMenu
(
Menu
menu
)
{
public
void
setOptionMenu
(
Menu
menu
)
{
...
...
include/LibreOfficeKit/LibreOfficeKitEnums.h
Dosyayı görüntüle @
0632f77e
...
@@ -102,7 +102,14 @@ typedef enum
...
@@ -102,7 +102,14 @@ typedef enum
* User clicked on an hyperlink that should be handled by other
* User clicked on an hyperlink that should be handled by other
* applications accordingly.
* applications accordingly.
*/
*/
LOK_CALLBACK_HYPERLINK_CLICKED
LOK_CALLBACK_HYPERLINK_CLICKED
,
/**
* Emit state update to the client.
* For example, when cursor is on bold text, this callback is triggered
* with payload: ".uno:Bold=true"
*/
LOK_CALLBACK_STATE_CHANGED
}
}
LibreOfficeKitCallbackType
;
LibreOfficeKitCallbackType
;
...
...
include/sfx2/objsh.hxx
Dosyayı görüntüle @
0632f77e
...
@@ -49,6 +49,9 @@
...
@@ -49,6 +49,9 @@
#include <set>
#include <set>
#include <o3tl/typed_flags_set.hxx>
#include <o3tl/typed_flags_set.hxx>
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
class
SbxValue
;
class
SbxValue
;
class
SvxMacro
;
class
SvxMacro
;
class
SbxArray
;
class
SbxArray
;
...
@@ -708,6 +711,14 @@ public:
...
@@ -708,6 +711,14 @@ public:
SAL_DLLPRIVATE
void
CancelCheckOut
(
);
SAL_DLLPRIVATE
void
CancelCheckOut
(
);
SAL_DLLPRIVATE
void
CheckIn
(
);
SAL_DLLPRIVATE
void
CheckIn
(
);
SAL_DLLPRIVATE
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
document
::
CmisVersion
>
GetCmisVersions
();
SAL_DLLPRIVATE
::
com
::
sun
::
star
::
uno
::
Sequence
<
::
com
::
sun
::
star
::
document
::
CmisVersion
>
GetCmisVersions
();
/**
* Interface shared by document shell. Allow LOK calls from sfx.
* Default behavior doesn't do anything. relevant SfxObjectShells should override
* the default behavior and implements LOK calls.
*/
virtual
void
libreOfficeKitCallback
(
int
nType
,
const
char
*
pPayload
)
const
;
virtual
bool
isTiledRendering
()
const
;
};
};
#define SFX_GLOBAL_CLASSID \
#define SFX_GLOBAL_CLASSID \
...
...
include/sfx2/unoctitm.hxx
Dosyayı görüntüle @
0632f77e
...
@@ -175,6 +175,8 @@ public:
...
@@ -175,6 +175,8 @@ public:
void
UnBindController
();
void
UnBindController
();
SfxDispatcher
*
GetDispatcher
();
SfxDispatcher
*
GetDispatcher
();
void
SetFrame
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
frame
::
XFrame
>&
xFrame
);
void
SetFrame
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
frame
::
XFrame
>&
xFrame
);
void
InterceptLOKStateChangeEvent
(
const
SfxObjectShell
*
objSh
,
const
::
com
::
sun
::
star
::
frame
::
FeatureStateEvent
&
aEvent
)
const
;
};
};
#endif
#endif
...
...
libreofficekit/source/gtk/lokdocview.cxx
Dosyayı görüntüle @
0632f77e
...
@@ -857,6 +857,8 @@ const char* LOKDocView_Impl::callbackTypeToString(int nType)
...
@@ -857,6 +857,8 @@ const char* LOKDocView_Impl::callbackTypeToString(int nType)
return
"LOK_CALLBACK_GRAPHIC_SELECTION"
;
return
"LOK_CALLBACK_GRAPHIC_SELECTION"
;
case
LOK_CALLBACK_HYPERLINK_CLICKED
:
case
LOK_CALLBACK_HYPERLINK_CLICKED
:
return
"LOK_CALLBACK_HYPERLINK_CLICKED"
;
return
"LOK_CALLBACK_HYPERLINK_CLICKED"
;
case
LOK_CALLBACK_STATE_CHANGED
:
return
"LOK_CALLBACK_STATE_CHANGED"
;
}
}
return
0
;
return
0
;
}
}
...
@@ -937,6 +939,10 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
...
@@ -937,6 +939,10 @@ gboolean LOKDocView_Impl::callbackImpl(CallbackData* pCallback)
gtk_show_uri
(
NULL
,
pCallback
->
m_aPayload
.
c_str
(),
GDK_CURRENT_TIME
,
&
pError
);
gtk_show_uri
(
NULL
,
pCallback
->
m_aPayload
.
c_str
(),
GDK_CURRENT_TIME
,
&
pError
);
#endif
#endif
}
}
case
LOK_CALLBACK_STATE_CHANGED
:
{
g_info
(
pCallback
->
m_aPayload
.
c_str
());
}
break
;
break
;
default
:
default
:
g_assert
(
false
);
g_assert
(
false
);
...
...
sfx2/source/control/unoctitm.cxx
Dosyayı görüntüle @
0632f77e
...
@@ -68,6 +68,9 @@
...
@@ -68,6 +68,9 @@
#include <iostream>
#include <iostream>
#include <map>
#include <map>
#include <sal/log.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
util
;
using
namespace
::
com
::
sun
::
star
::
util
;
...
@@ -973,8 +976,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
...
@@ -973,8 +976,7 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
pLastState
=
pState
;
pLastState
=
pState
;
}
}
::
cppu
::
OInterfaceContainerHelper
*
pContnr
=
pDispatch
->
GetListeners
().
getContainer
(
aDispatchURL
.
Complete
);
if
(
bNotify
)
if
(
bNotify
&&
pContnr
)
{
{
::
com
::
sun
::
star
::
uno
::
Any
aState
;
::
com
::
sun
::
star
::
uno
::
Any
aState
;
if
(
(
eState
>=
SfxItemState
::
DEFAULT
)
&&
pState
&&
!
IsInvalidItem
(
pState
)
&&
!
pState
->
ISA
(
SfxVoidItem
)
)
if
(
(
eState
>=
SfxItemState
::
DEFAULT
)
&&
pState
&&
!
IsInvalidItem
(
pState
)
&&
!
pState
->
ISA
(
SfxVoidItem
)
)
...
@@ -1015,16 +1017,24 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
...
@@ -1015,16 +1017,24 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
aEvent
.
Requery
=
sal_False
;
aEvent
.
Requery
=
sal_False
;
aEvent
.
State
=
aState
;
aEvent
.
State
=
aState
;
::
cppu
::
OInterfaceIteratorHelper
aIt
(
*
pContnr
);
if
(
pDispatcher
&&
pDispatcher
->
GetFrame
())
{
while
(
aIt
.
hasMoreElements
()
)
InterceptLOKStateChangeEvent
(
{
pDispatcher
->
GetFrame
()
->
GetObjectShell
(),
aEvent
);
try
}
{
static_cast
<
::
com
::
sun
::
star
::
frame
::
XStatusListener
*>
(
aIt
.
next
())
->
statusChanged
(
aEvent
);
::
cppu
::
OInterfaceContainerHelper
*
pContnr
=
pDispatch
->
GetListeners
().
getContainer
(
aDispatchURL
.
Complete
);
}
if
(
pContnr
)
{
catch
(
const
::
com
::
sun
::
star
::
uno
::
RuntimeException
&
)
::
cppu
::
OInterfaceIteratorHelper
aIt
(
*
pContnr
);
while
(
aIt
.
hasMoreElements
()
)
{
{
aIt
.
remove
();
try
{
static_cast
<
::
com
::
sun
::
star
::
frame
::
XStatusListener
*>
(
aIt
.
next
())
->
statusChanged
(
aEvent
);
}
catch
(
const
::
com
::
sun
::
star
::
uno
::
RuntimeException
&
)
{
aIt
.
remove
();
}
}
}
}
}
}
}
...
@@ -1035,4 +1045,27 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
...
@@ -1035,4 +1045,27 @@ void SfxDispatchController_Impl::StateChanged( sal_uInt16 nSID, SfxItemState eSt
StateChanged
(
nSID
,
eState
,
pState
,
0
);
StateChanged
(
nSID
,
eState
,
pState
,
0
);
}
}
void
SfxDispatchController_Impl
::
InterceptLOKStateChangeEvent
(
const
SfxObjectShell
*
objSh
,
const
::
com
::
sun
::
star
::
frame
::
FeatureStateEvent
&
aEvent
)
const
{
if
(
!
objSh
||
!
objSh
->
isTiledRendering
())
{
return
;
}
if
(
aEvent
.
FeatureURL
.
Path
==
"Bold"
||
aEvent
.
FeatureURL
.
Path
==
"Italic"
||
aEvent
.
FeatureURL
.
Path
==
"Underline"
||
aEvent
.
FeatureURL
.
Path
==
"StrikeOut"
)
{
OUStringBuffer
aBuffer
;
aBuffer
.
append
(
aEvent
.
FeatureURL
.
Complete
);
aBuffer
.
append
(
"="
);
bool
bTemp
=
false
;
aEvent
.
State
>>=
bTemp
;
aBuffer
.
append
(
bTemp
);
OUString
payload
=
aBuffer
.
makeStringAndClear
();
objSh
->
libreOfficeKitCallback
(
LOK_CALLBACK_STATE_CHANGED
,
payload
.
toUtf8
().
getStr
());
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sfx2/source/doc/objcont.cxx
Dosyayı görüntüle @
0632f77e
...
@@ -76,6 +76,10 @@
...
@@ -76,6 +76,10 @@
#include "querytemplate.hxx"
#include "querytemplate.hxx"
#include <boost/scoped_array.hpp>
#include <boost/scoped_array.hpp>
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
#include <typeinfo>
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
uno
;
...
@@ -639,4 +643,12 @@ bool SfxObjectShell::IsModifyPasswordEntered()
...
@@ -639,4 +643,12 @@ bool SfxObjectShell::IsModifyPasswordEntered()
return
pImp
->
m_bModifyPasswordEntered
;
return
pImp
->
m_bModifyPasswordEntered
;
}
}
void
SfxObjectShell
::
libreOfficeKitCallback
(
SAL_UNUSED_PARAMETER
int
nType
,
SAL_UNUSED_PARAMETER
const
char
*
pPayload
)
const
{
SAL_WARN
(
"tiled-rendering"
,
"LOK callback interface not overridden for SfxObjectShell subclass typeId: "
<<
typeid
(
*
this
).
name
());
}
bool
SfxObjectShell
::
isTiledRendering
()
const
{
SAL_WARN
(
"tiled-rendering"
,
"LOK callback interface not overridden for SfxObjectShell subclass typeId: "
<<
typeid
(
*
this
).
name
());
return
false
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sw/inc/docsh.hxx
Dosyayı görüntüle @
0632f77e
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#include <svl/lstner.hxx>
#include <svl/lstner.hxx>
#include <svtools/embedhlp.hxx>
#include <svtools/embedhlp.hxx>
#define LOK_USE_UNSTABLE_API
#include <LibreOfficeKit/LibreOfficeKitTypes.h>
class
SwDoc
;
class
SwDoc
;
class
SfxDocumentInfoDialog
;
class
SfxDocumentInfoDialog
;
...
@@ -311,6 +313,9 @@ public:
...
@@ -311,6 +313,9 @@ public:
virtual
void
SetChangeRecording
(
bool
bActivate
)
SAL_OVERRIDE
;
virtual
void
SetChangeRecording
(
bool
bActivate
)
SAL_OVERRIDE
;
virtual
bool
SetProtectionPassword
(
const
OUString
&
rPassword
)
SAL_OVERRIDE
;
virtual
bool
SetProtectionPassword
(
const
OUString
&
rPassword
)
SAL_OVERRIDE
;
virtual
bool
GetProtectionHash
(
/*out*/
::
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>
&
rPasswordHash
)
SAL_OVERRIDE
;
virtual
bool
GetProtectionHash
(
/*out*/
::
com
::
sun
::
star
::
uno
::
Sequence
<
sal_Int8
>
&
rPasswordHash
)
SAL_OVERRIDE
;
virtual
void
libreOfficeKitCallback
(
int
nType
,
const
char
*
pPayload
)
const
SAL_OVERRIDE
;
virtual
bool
isTiledRendering
()
const
SAL_OVERRIDE
;
};
};
/** Find the right DocShell and create a new one:
/** Find the right DocShell and create a new one:
...
...
sw/source/uibase/app/docsh.cxx
Dosyayı görüntüle @
0632f77e
...
@@ -72,6 +72,7 @@
...
@@ -72,6 +72,7 @@
#include <docstyle.hxx>
#include <docstyle.hxx>
#include <doc.hxx>
#include <doc.hxx>
#include <docfunc.hxx>
#include <docfunc.hxx>
#include <drawdoc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <IDocumentUndoRedo.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentLinksAdministration.hxx>
#include <IDocumentLinksAdministration.hxx>
...
@@ -121,6 +122,9 @@
...
@@ -121,6 +122,9 @@
#include <sfx2/Metadatable.hxx>
#include <sfx2/Metadatable.hxx>
#include <calbck.hxx>
#include <calbck.hxx>
#include <sal/log.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
script
;
using
namespace
::
com
::
sun
::
star
::
script
;
...
@@ -1296,4 +1300,19 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal
...
@@ -1296,4 +1300,19 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal
return
bRes
;
return
bRes
;
}
}
void
SwDocShell
::
libreOfficeKitCallback
(
int
nType
,
const
char
*
pPayload
)
const
{
if
(
!
m_pDoc
)
{
return
;
}
SwDrawModel
*
pDrawModel
=
m_pDoc
->
getIDocumentDrawModelAccess
().
GetDrawModel
();
pDrawModel
->
libreOfficeKitCallback
(
nType
,
pPayload
);
}
bool
SwDocShell
::
isTiledRendering
()
const
{
SwDrawModel
*
pDrawModel
=
m_pDoc
->
getIDocumentDrawModelAccess
().
GetDrawModel
();
return
pDrawModel
->
isTiledRendering
();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment