Kaydet (Commit) 7a7e30a4 authored tarafından Javier Fernandez's avatar Javier Fernandez

PyWebWizard: Fixing bugs and implementation of mising features.

Additional files ported to python for the Common module.

Change-Id: I54afc234b0205c3854e569e691454a6921eb2a9f
üst 9d85fe82
...@@ -23,6 +23,11 @@ $(eval $(call gb_Pyuno_add_files,commonwizards,wizards,\ ...@@ -23,6 +23,11 @@ $(eval $(call gb_Pyuno_add_files,commonwizards,wizards,\
common/PropertyNames.py \ common/PropertyNames.py \
common/Resource.py \ common/Resource.py \
common/SystemDialog.py \ common/SystemDialog.py \
common/IRenderer.py \
common/UCB.py \
common/XMLHelper.py \
common/XMLProvider.py \
common/ListModel.py \
common/__init__.py \ common/__init__.py \
document/OfficeDocument.py \ document/OfficeDocument.py \
document/__init__.py \ document/__init__.py \
...@@ -46,6 +51,13 @@ $(eval $(call gb_Pyuno_add_files,commonwizards,wizards,\ ...@@ -46,6 +51,13 @@ $(eval $(call gb_Pyuno_add_files,commonwizards,wizards,\
ui/event/ListModelBinder.py \ ui/event/ListModelBinder.py \
ui/event/RadioDataAware.py \ ui/event/RadioDataAware.py \
ui/event/UnoDataAware.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 \ ui/event/__init__.py \
)) ))
......
#
# 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
#
# 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
#
# 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
#
# 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
#
# 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, ())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment