summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorJavier Fernandez <jfernandez@igalia.com>2013-05-03 13:02:13 +0000
committerJavier Fernandez <jfernandez@igalia.com>2013-05-08 09:36:37 +0000
commit7a7e30a44ba86cfc5246fcdc0990c587f71e9259 (patch)
treeaf0ce36944e4eb1af20530e0d6b45657f65bc021 /wizards
parent9d85fe82bc26e19abdbfd516bad55f2453f3b5e8 (diff)
PyWebWizard: Fixing bugs and implementation of mising features.
Additional files ported to python for the Common module. Change-Id: I54afc234b0205c3854e569e691454a6921eb2a9f
Diffstat (limited to 'wizards')
-rw-r--r--wizards/Pyuno_commonwizards.mk12
-rw-r--r--wizards/com/sun/star/wizards/common/ListModel.py39
-rw-r--r--wizards/com/sun/star/wizards/ui/event/EventListenerList.py30
-rw-r--r--wizards/com/sun/star/wizards/ui/event/ListDataEvent.py38
-rw-r--r--wizards/com/sun/star/wizards/ui/event/ListDataListener.py33
-rw-r--r--wizards/com/sun/star/wizards/ui/event/SimpleDataAware.py33
6 files changed, 185 insertions, 0 deletions
diff --git a/wizards/Pyuno_commonwizards.mk b/wizards/Pyuno_commonwizards.mk
index 91eeacae821f..6654d4d69e7b 100644
--- a/wizards/Pyuno_commonwizards.mk
+++ b/wizards/Pyuno_commonwizards.mk
@@ -23,6 +23,11 @@ $(eval $(call gb_Pyuno_add_files,commonwizards,wizards,\
common/PropertyNames.py \
common/Resource.py \
common/SystemDialog.py \
+ common/IRenderer.py \
+ common/UCB.py \
+ common/XMLHelper.py \
+ common/XMLProvider.py \
+ common/ListModel.py \
common/__init__.py \
document/OfficeDocument.py \
document/__init__.py \
@@ -46,6 +51,13 @@ $(eval $(call gb_Pyuno_add_files,commonwizards,wizards,\
ui/event/ListModelBinder.py \
ui/event/RadioDataAware.py \
ui/event/UnoDataAware.py \
+ ui/event/SimpleDataAware.py \
+ ui/event/Task.py \
+ ui/event/TaskEvent.py \
+ ui/event/TaskListener.py \
+ ui/event/ListDataEvent.py \
+ ui/event/ListDataListener.py \
+ ui/event/EventListenerList.py \
ui/event/__init__.py \
))
diff --git a/wizards/com/sun/star/wizards/common/ListModel.py b/wizards/com/sun/star/wizards/common/ListModel.py
new file mode 100644
index 000000000000..7a14f143c745
--- /dev/null
+++ b/wizards/com/sun/star/wizards/common/ListModel.py
@@ -0,0 +1,39 @@
+#
+# 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/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# 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 .
+#
+
+from abc import abstractmethod
+
+class ListModel(object):
+
+ @abstractmethod
+ def getSize(self):
+ pass
+
+ @abstractmethod
+ def getElementAt(self, arg0):
+ pass
+
+ @abstractmethod
+ def elements(self):
+ pass
+
+ def addListDataListener(self, listener):
+ pass
+
+ def removeListDataListener(self, listener):
+ pass
diff --git a/wizards/com/sun/star/wizards/ui/event/EventListenerList.py b/wizards/com/sun/star/wizards/ui/event/EventListenerList.py
new file mode 100644
index 000000000000..9b475a77bd00
--- /dev/null
+++ b/wizards/com/sun/star/wizards/ui/event/EventListenerList.py
@@ -0,0 +1,30 @@
+#
+# 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/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# 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 .
+#
+class EventListenerList(object):
+
+ def __init__(self):
+ self.list = []
+
+ def add(self, listener):
+ self.list.append(listener)
+
+ def remove(self, listener):
+ self.list.remove(listener)
+
+ def getListenerList(self):
+ return self.list
diff --git a/wizards/com/sun/star/wizards/ui/event/ListDataEvent.py b/wizards/com/sun/star/wizards/ui/event/ListDataEvent.py
new file mode 100644
index 000000000000..0aeb914742c8
--- /dev/null
+++ b/wizards/com/sun/star/wizards/ui/event/ListDataEvent.py
@@ -0,0 +1,38 @@
+#
+# 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/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# 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 .
+from com.sun.star.document import EventObject
+
+#class ListDataEvent(EventObject):
+class ListDataEvent:
+
+ INTERVAL_ADDED = 1
+ INTERVAL_REMOVED = 2
+ CONTENTS_CHANGED = 3
+
+ # general constructor -
+ # @param source
+ # @param type_
+ def __init__(self, source_, type_, i0, i1):
+ #super(TaskEvent, self).__init__(source)
+ self.index0 = i0
+ self.index1 = i1
+
+ def getIndex0(self):
+ return self.index0
+
+ def getIndex1(self):
+ return self.index1
diff --git a/wizards/com/sun/star/wizards/ui/event/ListDataListener.py b/wizards/com/sun/star/wizards/ui/event/ListDataListener.py
new file mode 100644
index 000000000000..56b4c6f8efcb
--- /dev/null
+++ b/wizards/com/sun/star/wizards/ui/event/ListDataListener.py
@@ -0,0 +1,33 @@
+#
+# 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/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# 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 .
+#
+from abc import abstractmethod
+from com.sun.star.script import EventListener
+
+class ListDataListener():
+
+ @abstractmethod
+ def intervalAdded(self, lde):
+ pass
+
+ @abstractmethod
+ def intervalRemoved(self, lde):
+ pass
+
+ @abstractmethod
+ def contentsChanged(self, lde):
+ pass
diff --git a/wizards/com/sun/star/wizards/ui/event/SimpleDataAware.py b/wizards/com/sun/star/wizards/ui/event/SimpleDataAware.py
new file mode 100644
index 000000000000..cb1cdc3806b3
--- /dev/null
+++ b/wizards/com/sun/star/wizards/ui/event/SimpleDataAware.py
@@ -0,0 +1,33 @@
+#
+# 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/.
+#
+# This file incorporates work covered by the following license notice:
+#
+# 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 .
+#
+import uno
+
+from .DataAware import DataAware
+
+class SimpleDataAware(DataAware):
+
+ def __init__(self, dataObject, field, control_, controlField_):
+ super(SimpleDataAware, self).__init__(dataObject, field)
+ self.control = control_
+ self.controlField = controlField_
+
+ def setToUI(self, value):
+ uno.invoke(self.control, "set" + self.controlField, (value,))
+
+ def getFromUI(self):
+ return uno.invoke(self.control, "get" + self.controlField, ())