Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit df7755e3 authored by Casper Boemann's avatar Casper Boemann

part 2 of rename from kofficeui to koguiutils


svn path=/trunk/koffice/; revision=662292
parent 9a54afee
......@@ -76,15 +76,15 @@ set(KOMAIN_INCLUDES ${CMAKE_SOURCE_DIR}/libs/main ${CMAKE_SOURCE_DIR}/libs/main/
set(PIGMENT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/pigment ${CMAKE_SOURCE_DIR}/libs/pigment/colorspaces ${LCMS_INCLUDE_DIR} )
# flake depends on komain
set(FLAKE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/flake ${CMAKE_SOURCE_DIR}/libs/flake/commands ${CMAKE_BINARY_DIR}/libs/flake)
# kofficeui depends on komain, flake and pigment
set(KOFFICEUI_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kofficeui ${CMAKE_BINARY_DIR}/libs/kofficeui ${KOMAIN_INCLUDES} ${FLAKE_INCLUDES} ${PIGMENT_INCLUDES})
# koguiutils depends on komain, flake and pigment
set(KOGUIUTILS_INCLUDES ${CMAKE_SOURCE_DIR}/libs/guiutils ${CMAKE_BINARY_DIR}/libs/guiutils ${KOMAIN_INCLUDES} ${FLAKE_INCLUDES} ${PIGMENT_INCLUDES})
# kopageapp
set(KOPAGEAPP_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kopageapp ${CMAKE_SOURCE_DIR}/libs/kopageapp/commands ${CMAKE_BINARY_DIR}/libs/kopageapp )
# The rest must be specified independently, in addition to one of the above three
set(KWMF_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kwmf ${CMAKE_BINARY_DIR}/libs/kwmf)
set(KOTEXT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kotext/styles ${CMAKE_SOURCE_DIR}/libs/kotext ${CMAKE_BINARY_DIR}/libs/kotext)
set(KOPAINTER_INCLUDES ${KOFFICEUI_INCLUDES} ${CMAKE_SOURCE_DIR}/libs/kopainter ${CMAKE_BINARY_DIR}/libs/kopainter ${PIGMENT_INCLUDES})
set(KOPAINTER_INCLUDES ${KOGUIUTILS_INCLUDES} ${CMAKE_SOURCE_DIR}/libs/kopainter ${CMAKE_BINARY_DIR}/libs/kopainter ${PIGMENT_INCLUDES})
set(KORESOURCES_INCLUDES ${CMAKE_SOURCE_DIR}/libs/resources ${CMAKE_BINARY_DIR}/libs/resources ${PIGMENT_INCLUDES})
set(KFORMULA_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kformula ${CMAKE_BINARY_DIR}/libs/kformula)
set(KOKROSS_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kokross ${CMAKE_BINARY_DIR}/libs/kokross)
......
......@@ -57,7 +57,7 @@ if (SHOULD_BUILD_KRITA)
${CMAKE_BINARY_DIR}/krita/ui
${KOPAINTER_INCLUDES}
${KOFFICEUI_INCLUDES}
${KOGUIUTILS_INCLUDES}
${LCMS_INCLUDE_DIR}
${PIGMENT_INCLUDES}
${KORESOURCES_INCLUDES}
......
include_directories( ${KOFFICEUI_INCLUDES} )
include_directories( ${KOGUIUTILS_INCLUDES} )
add_subdirectory(pics)
......@@ -14,7 +14,7 @@ SET (kritashape_LIB_SRCS
kde4_automoc(${kritashape_LIB_SRCS})
kde4_add_plugin(kritashape ${kritashape_LIB_SRCS})
target_link_libraries(kritashape flake kofficeui kritaui)
target_link_libraries(kritashape flake koguiutils kritaui)
install(TARGETS kritashape DESTINATION ${PLUGIN_INSTALL_DIR})
########### install files ###############
......
......@@ -137,7 +137,7 @@ kde4_add_ui_files(kritaui_LIB_SRCS
kde4_add_library(kritaui SHARED ${kritaui_LIB_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/asm_scale.o )
target_link_libraries(kritaui ${KDE4_KDE3SUPPORT_LIBS} kritaimage kofficeui kopainter ${PNG_LIBRARIES})
target_link_libraries(kritaui ${KDE4_KDE3SUPPORT_LIBS} kritaimage koguiutils kopainter ${PNG_LIBRARIES})
if(HAVE_OPENGL)
target_link_libraries(kritaui ${OPENGL_LIBRARIES} ${QT_QTOPENGL_LIBRARY})
......
if(KDE4_BUILD_TESTS)
include_directories( ${KOMAIN_INCLUDES} ${KOFFICEUI_INCLUDES} )
include_directories( ${KOMAIN_INCLUDES} ${KOGUIUTILS_INCLUDES} )
########### next target ###############
......@@ -11,7 +11,7 @@ kde4_automoc(${kis_layer_model_test_SRCS})
kde4_add_executable(kis_layer_model_test RUN_UNINSTALLED ${kis_layer_model_test_SRCS})
target_link_libraries(kis_layer_model_test ${KDE4_KDEUI_LIBS} kofficeui komain kritaui ${QT_QTTEST_LIBRARY})
target_link_libraries(kis_layer_model_test ${KDE4_KDEUI_LIBS} koguiutils komain kritaui ${QT_QTTEST_LIBRARY})
add_test(krita-ui-kis_layer_model_test kis_layer_model_test)
......
add_subdirectory( store )
add_subdirectory( kwmf )
add_subdirectory( main )
add_subdirectory( kofficeui )
add_subdirectory( guiutils )
add_subdirectory( koproperty )
add_subdirectory( kotext )
add_subdirectory( kopainter )
......
add_subdirectory( tests )
include_directories( ${KOMAIN_INCLUDES} ${FLAKE_INCLUDES} ${PIGMENT_INCLUDES} ${KOFFICEUI_INCLUDES})
########### next target ###############
set(kofficeui_LIB_SRCS
KoCharSelectDia.cpp
KoContextHelp.cpp
KoCsvImportDialog.cpp
KoDocumentSectionDelegate.cpp
KoDocumentSectionView.cpp
KoDocumentSectionToolTip.cpp
KoGeneralPropertyUi.cpp
KoGuideLineDia.cpp
KoGuides.cpp
KoImageResource.cpp
KoInsertLink.cpp
KoItemToolTip.cpp
#KoPageLayoutColumns.cpp
#KoPageLayoutDia.cpp
#KoPageLayoutHeader.cpp
#KoPageLayoutSize.cpp
KoPartSelectDia.cpp
KoPartSelectAction.cpp
KoPictureFilePreview.cpp
KoRuler.cpp
KoShapeGeometry.cpp
KoSliderCombo.cpp
KoTabBar.cpp
KoTabChooser.cpp
KoTemplateChooseDia.cpp
KoTemplateCreateDia.cpp
KoToolBox.cpp
KoUnitWidgets.cpp
KoZoomAction.cpp
KoZoomController.cpp
KoZoomHandler.cpp
KoZoomMode.cpp
KoToolBoxFactory.cpp
KoToolDocker.cpp
KoToolDockerFactory.cpp
KoLayoutVisitor.cpp
KoCopyController.cpp
KoImageData.cpp
KoImageCollection.cpp
KoColorDocker.cpp
KoResourceChooser.cpp
KoColorSlider.cc
KoXYColorSelector.cc
KoUniColorChooser.cpp
KoUniColorDialog.cpp
KoColorPatch.cpp
KoDualColorButton.cpp
)
kde4_automoc(${kofficeui_LIB_SRCS})
kde4_add_ui_files( kofficeui_LIB_SRCS
KoCsvImportDialog.ui
KoGeneralPropertyUi.ui
#KoPageLayoutColumns.ui
#KoPageLayoutHeaderBase.ui
KoShapeGeometry.ui
)
kde4_add_library(kofficeui SHARED ${kofficeui_LIB_SRCS})
target_link_libraries(kofficeui ${KDE4_KDECORE_LIBS} komain flake pigment )
set_target_properties(kofficeui PROPERTIES VERSION ${GENERIC_KOFFICE_LIB_VERSION} SOVERSION ${GENERIC_KOFFICE_LIB_SOVERSION} )
install(TARGETS kofficeui DESTINATION ${LIB_INSTALL_DIR})
install( FILES zoom-width.png zoom-page.png zoom-pixels.png DESTINATION ${DATA_INSTALL_DIR}/koffice/icons/hicolor/22x22/actions)
########### install files ###############
install(
FILES
KoCharSelectDia.h
KoContextHelp.h
KoDocumentSectionModel.h
KoDocumentSectionView.h
KoGeneralPropertyUi.h
KoGuideLineDia.h
KoGuides.h
KoImageResource.h
KoInsertLink.h
KoItemToolTip.h
#KoPageLayoutColumns.h
#KoPageLayoutDia.h
#KoPageLayoutHeader.h
#KoPageLayoutSize.h
KoPartSelectAction.h
KoPartSelectDia.h
KoPictureFilePreview.h
KoRuler.h
KoTabBar.h
KoTabChooser.h
KoTabulator.h
KoTemplateChooseDia.h
KoTemplateCreateDia.h
KoUnitWidgets.h
KoZoomAction.h
KoZoomController.h
KoZoomHandler.h
KoZoomMode.h
KoToolBoxFactory.h
KoToolDocker.h
KoToolDockerFactory.h
DESTINATION
${INCLUDE_INSTALL_DIR}
)
/* This file is part of the KDE project
Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
Copyright (C) 2007 Thomas Zander <zander@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "KoCharSelectDia.h"
#include "KoCharSelectDia.moc"
#include <QLayout>
#include <QGridLayout>
#include <klocale.h>
#include <kcharselect.h>
#include <kdebug.h>
#include <KStandardGuiItem>
class KoCharSelectDia::Private {
public:
Private() : charSelect(0) {}
KCharSelect *charSelect;
};
/******************************************************************/
/* class KoCharSelectDia */
/******************************************************************/
KoCharSelectDia::KoCharSelectDia( QWidget *parent, const char *name, const QChar &_chr, const QString &_font, bool _modal)
: KDialog( parent ),
d(new Private())
{
setCaption( i18n("Select Character") );
setModal( _modal );
setButtons( Ok | Cancel );
setDefaultButton( Ok );
setObjectName( name );
initDialog(_chr,_font);
KGuiItem okItem = KStandardGuiItem::ok(); // start from std item to keep the OK icon...
okItem.setText( i18n("&Insert") );
okItem.setWhatsThis( i18n("Insert the selected character in the text") );
setButtonGuiItem( KDialog::Ok, okItem );
}
KoCharSelectDia::KoCharSelectDia( QWidget *parent, const char *name, const QString &_font, const QChar &_chr, bool _modal )
: KDialog( parent ),
d(new Private())
{
setCaption( i18n("Select Character") );
setModal( _modal );
setButtons( User1 | Close );
setDefaultButton( User1 );
setObjectName( name );
initDialog(_chr,_font);
setButtonText( User1, i18n("&Insert") );
setButtonToolTip( User1, i18n("Insert the selected character in the text") );
connect(this,SIGNAL(user1Clicked()),this,SLOT(slotUser1()));
}
void KoCharSelectDia::initDialog(const QChar &_chr, const QString &_font)
{
QWidget *page = mainWidget()/*plainPage()*/;
QGridLayout *grid = new QGridLayout( page );
grid->setMargin(0);
grid->setSpacing(KDialog::spacingHint());
d->charSelect = new KCharSelect( page );
d->charSelect->setCurrentChar( _chr );
d->charSelect->setCurrentFont( QFont(_font) );
connect(d->charSelect, SIGNAL(charSelected()),this, SLOT(slotDoubleClicked()));
d->charSelect->resize( d->charSelect->sizeHint() );
// d->charSelect->enableFontCombo( true );
grid->addWidget( d->charSelect, 0, 0 );
grid->addItem( new QSpacerItem( d->charSelect->width(), 0 ), 0, 0 );
grid->addItem( new QSpacerItem( 0, d->charSelect->height() ), 0, 0 );
grid->setRowStretch( 0, 0 );
d->charSelect->setFocus();
}
KoCharSelectDia::~KoCharSelectDia()
{
delete d;
}
void KoCharSelectDia::closeDialog()
{
KDialog::close();
}
// static
bool KoCharSelectDia::selectChar( QString &_font, QChar &_chr, QWidget* parent, const char* name)
{
bool res = false;
KoCharSelectDia *dlg = new KoCharSelectDia( parent, name, _chr, _font);
dlg->setFocus();
if ( dlg->exec() == Accepted )
{
_font = dlg->font();
_chr = dlg->chr();
res = true;
}
delete dlg;
return res;
}
QChar KoCharSelectDia::chr() const
{
return d->charSelect->currentChar();
}
QString KoCharSelectDia::font() const
{
return d->charSelect->font().family();
}
void KoCharSelectDia::slotUser1()
{
emit insertChar(chr(),font());
}
void KoCharSelectDia::slotDoubleClicked()
{
emit insertChar(chr(),font());
}
/* This file is part of the KDE project
Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
Copyright (C) 2007 Thomas Zander <zander@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KOCHARSELECTDIA_H
#define KOCHARSELECTDIA_H
#include <kdialog.h>
#include <kofficeui_export.h>
class QWidget;
class QGridLayout;
class QPushButton;
class KCharSelect;
class KButtonBox;
/**
* A dialog for selecting a character.
*/
class KOFFICEUI_EXPORT KoCharSelectDia : public KDialog
{
Q_OBJECT
public:
// constructor
KoCharSelectDia( QWidget *parent, const char *name, const QChar &_chr,
const QString &_font, bool _modal=true );
//constructor when you want to insert multi char
KoCharSelectDia( QWidget *parent, const char *name, const QString &_font,
const QChar &_chr, bool _modal=true );
~KoCharSelectDia();
/**
* Shows the selection dialog and returns true if user pressed ok, after filling the font and character parameters.
* @param font will be filled when the user pressed Ok with the selected font.
* @param character will be filled when the user pressed Ok with the selected character.
* @param parent the parent widget this dialog will be associated with.
*/
KOFFICEUI_EXPORT static bool selectChar( QString &font, QChar &character, QWidget* parent = 0, const char* name = 0);
signals:
/**
* Emitted when the user presses the 'insert' button.
* @param character the character that the user selected
* @param font the font name that was selected when the user inserted the character.
*/
void insertChar(QChar character ,const QString &font);
private:
void initDialog(const QChar &_chr, const QString &_font);
QChar chr() const;
QString font() const;
void closeDialog();
private slots:
void slotUser1();
void slotDoubleClicked();
private:
class Private;
Private * const d;
};
#endif
/* This file is part of the KDE project
Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
Copyright (C) 2002 - 2005, Rob Buis <buis@kde.org>
Copyright (C) 2006 Jan Hambecht <jaham@gmx.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "KoColorDocker.h"
#include <klocale.h>
#include <kdebug.h>
#include <KoUniColorChooser.h>
KoColorDocker::KoColorDocker(bool showOpacitySlider)
: QDockWidget()
{
setWindowTitle( i18n( "Color Chooser" ) );
m_colorChooser = new KoUniColorChooser( this, showOpacitySlider );
setWidget( m_colorChooser );
setMinimumWidth( 194 );
}
KoColorDocker::~KoColorDocker()
{
}
QString KoColorDockerFactory::id() const
{
return QString("KoColorDocker");
}
Qt::DockWidgetArea KoColorDockerFactory::defaultDockWidgetArea() const
{
return Qt::RightDockWidgetArea;
}
QDockWidget* KoColorDockerFactory::createDockWidget()
{
KoColorDocker* widget = new KoColorDocker(m_showOpacitySlider);
widget->setObjectName(id());
return widget;
}
#include "KoColorDocker.moc"
/* This file is part of the KDE project
Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
Copyright (C) 2002 - 2005, Rob Buis <buis@kde.org>
Copyright (C) 2006 Jan Hambecht <jaham@gmx.net>
Copyright (C) 2006 Boudewijn Rempt <boud@valdyas.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef __KO_COLOR_DOCKER_H__
#define __KO_COLOR_DOCKER_H__
#include <QDockWidget>
#include <KoDockFactory.h>
#include "kofficeui_export.h"
class KoUniColorChooser;
/**
Dock widget that contains a color selector. Currently this is the
big, unified color selector, but I would prefer a small strip with
just a band of colors -- and have the unified color selector popup.
This just takes a tad too much place.
*/
class KOFFICEUI_EXPORT KoColorDocker : public QDockWidget
{
Q_OBJECT
public:
KoColorDocker(bool showOpacitySlider);
virtual ~KoColorDocker();
private:
KoUniColorChooser *m_colorChooser;
};
class KOFFICEUI_EXPORT KoColorDockerFactory : public KoDockFactory
{
public:
KoColorDockerFactory(bool showOpacitySlider = false)
: m_showOpacitySlider( showOpacitySlider )
{}
~KoColorDockerFactory() {}
QString id() const;
Qt::DockWidgetArea defaultDockWidgetArea() const;
QDockWidget * createDockWidget();
private:
bool m_showOpacitySlider;
};
#endif
/**
* Copyright (c) 2006 Casper Boemann (cbr@boemann.dk)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include <QPainter>
#include "KoColorPatch.h"
KoColorPatch::KoColorPatch( QWidget *parent ) : QFrame( parent )
{
setFrameStyle( QFrame::Panel | QFrame::Sunken );
}
KoColorPatch::~KoColorPatch()
{
}
void KoColorPatch::setColor(const KoColor c)
{
m_color = c;
update();
}
void KoColorPatch::paintEvent ( QPaintEvent* pe )
{
QColor qc;
m_color.toQColor(&qc);
QFrame::paintEvent(pe);
QPainter painter( this );
painter.setPen(qc);
painter.setBrush(QBrush(qc));
painter.drawRect(contentsRect());
}
#include "KoColorPatch.moc"
/**
* Copyright (c) 2006 Casper Boemann (cbr@boemann.dk)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef KOCOLORPATCH_H
#define KOCOLORPATCH_H
#include <QFrame>
#include <KoColor.h>
#include "kofficeui_export.h"
/**