From dfe289850f068f19ba4a83ab4e7e22a7e09c13c9 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 26 Jan 2013 13:17:21 -0600 Subject: Rename a number of libraries and executables to avoid conflicts with KDE4 --- tderandr/randr.cpp | 881 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 881 insertions(+) create mode 100644 tderandr/randr.cpp (limited to 'tderandr/randr.cpp') diff --git a/tderandr/randr.cpp b/tderandr/randr.cpp new file mode 100644 index 000000000..334da5a79 --- /dev/null +++ b/tderandr/randr.cpp @@ -0,0 +1,881 @@ +/* + * Copyright (c) 2002,2003 Hamish Rodda + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "randr.h" +#include "lowlevel_randr.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ktimerdialog.h" + +#include +#define INT8 _X11INT8 +#define INT32 _X11INT32 +#include +#undef INT8 +#undef INT32 +#include + +HotPlugRule::HotPlugRule() +{ + // +} + +HotPlugRule::~HotPlugRule() +{ + // +} + +SingleScreenData::SingleScreenData() +{ + generic_screen_detected = false; + screen_connected = false; + + current_resolution_index = 0; + current_refresh_rate_index = 0; + current_color_depth_index = 0; + + gamma_red = 0.0; + gamma_green = 0.0; + gamma_blue = 0.0; + + current_rotation_index = 0; + current_orientation_mask = 0; + has_x_flip = false; + has_y_flip = false; + supports_transformations = false; + + is_primary = false; + is_extended = false; + absolute_x_position = 0; + absolute_y_position = 0; + current_x_pixel_count = 0; + current_y_pixel_count = 0; + + has_dpms = false; + enable_dpms = false; + dpms_standby_delay = 0; + dpms_suspend_delay = 0; + dpms_off_delay = 0; +} + +SingleScreenData::~SingleScreenData() +{ + // +} + +class RandRScreenPrivate +{ +public: + RandRScreenPrivate() : config(0L) {}; + ~RandRScreenPrivate() + { + if (config) { + XRRFreeScreenConfigInfo(config); + } + } + + XRRScreenConfiguration* config; +}; + +KDE_EXPORT RandRScreen::RandRScreen(int screenIndex) + : d(new RandRScreenPrivate()) + , m_screen(screenIndex) + , m_shownDialog(NULL) +{ + loadSettings(); + setOriginal(); +} + +KDE_EXPORT RandRScreen::~RandRScreen() +{ + delete d; +} + +KDE_EXPORT void RandRScreen::loadSettings() +{ + if (d->config) { + XRRFreeScreenConfigInfo(d->config); + } + + d->config = XRRGetScreenInfo(tqt_xdisplay(), RootWindow(tqt_xdisplay(), m_screen)); + + Rotation rotation; + if (d->config) { + m_currentSize = m_proposedSize = XRRConfigCurrentConfiguration(d->config, &rotation); + m_currentRotation = m_proposedRotation = rotation; + } + else { + m_currentSize = m_proposedSize = 0; + m_currentRotation = m_proposedRotation = 0; + } + + m_pixelSizes.clear(); + m_mmSizes.clear(); + + if (d->config) { + int numSizes; + XRRScreenSize* sizes = XRRSizes(tqt_xdisplay(), m_screen, &numSizes); + for (int i = 0; i < numSizes; i++) { + m_pixelSizes.append(TQSize(sizes[i].width, sizes[i].height)); + m_mmSizes.append(TQSize(sizes[i].mwidth, sizes[i].mheight)); + } + + m_rotations = XRRRotations(tqt_xdisplay(), m_screen, &rotation); + } + else { + // Great, now we have to go after the information manually. Ughh. + ScreenInfo *screeninfo = internal_read_screen_info(tqt_xdisplay()); + XRROutputInfo *output_info = screeninfo->outputs[m_screen]->info; + CrtcInfo *current_crtc = screeninfo->outputs[m_screen]->cur_crtc; + int numSizes = output_info->nmode; + for (int i = 0; i < numSizes; i++) { + XRRModeInfo *xrrmode; + xrrmode = internal_find_mode_by_xid (screeninfo, output_info->modes[i]); + TQSize newSize = TQSize(xrrmode->width, xrrmode->height); + if (!m_pixelSizes.contains(newSize)) { + m_pixelSizes.append(newSize); + m_mmSizes.append(TQSize(output_info->mm_width, output_info->mm_height)); + } + } + if (current_crtc) { + m_rotations = current_crtc->rotations; + m_currentRotation = m_proposedRotation = current_crtc->cur_rotation; + } + } + + if (d->config) { + m_currentRefreshRate = m_proposedRefreshRate = refreshRateHzToIndex(m_currentSize, XRRConfigCurrentRate(d->config)); + } + else { + m_currentRefreshRate = m_proposedRefreshRate = 0; + } +} + +KDE_EXPORT void RandRScreen::setOriginal() +{ + m_originalSize = m_currentSize; + m_originalRotation = m_currentRotation; + m_originalRefreshRate = m_currentRefreshRate; +} + +KDE_EXPORT bool RandRScreen::applyProposed() +{ + //kdDebug() << k_funcinfo << " size " << (SizeID)proposedSize() << ", rotation " << proposedRotation() << ", refresh " << refreshRateIndexToHz(proposedSize(), proposedRefreshRate()) << endl; + + Status status; + + if (!d->config) { + d->config = XRRGetScreenInfo(tqt_xdisplay(), RootWindow(tqt_xdisplay(), m_screen)); + Q_ASSERT(d->config); + } + + if (d->config) { + if (proposedRefreshRate() < 0) + status = XRRSetScreenConfig(tqt_xdisplay(), d->config, DefaultRootWindow(tqt_xdisplay()), (SizeID)proposedSize(), (Rotation)proposedRotation(), CurrentTime); + else { + if( refreshRateIndexToHz(proposedSize(), proposedRefreshRate()) <= 0 ) { + m_proposedRefreshRate = 0; + } + status = XRRSetScreenConfigAndRate(tqt_xdisplay(), d->config, DefaultRootWindow(tqt_xdisplay()), (SizeID)proposedSize(), (Rotation)proposedRotation(), refreshRateIndexToHz(proposedSize(), proposedRefreshRate()), CurrentTime); + } + } + else { + // Great, now we have to set the information manually. Ughh. + // FIXME--this does not work! + ScreenInfo *screeninfo = internal_read_screen_info(tqt_xdisplay()); + screeninfo->cur_width = (*m_pixelSizes.at(proposedSize())).width(); + screeninfo->cur_height = (*m_pixelSizes.at(proposedSize())).height(); + internal_main_low_apply(screeninfo); + + status = RRSetConfigSuccess; + } + + //kdDebug() << "New size: " << WidthOfScreen(ScreenOfDisplay(TQPaintDevice::x11AppDisplay(), screen)) << ", " << HeightOfScreen(ScreenOfDisplay(TQPaintDevice::x11AppDisplay(), screen)) << endl; + + if (status == RRSetConfigSuccess) { + m_currentSize = m_proposedSize; + m_currentRotation = m_proposedRotation; + m_currentRefreshRate = m_proposedRefreshRate; + return true; + } + + return false; +} + +KDE_EXPORT bool RandRScreen::applyProposedAndConfirm() +{ + if (proposedChanged()) { + setOriginal(); + + if (applyProposed()) { + if (!confirm()) { + proposeOriginal(); + applyProposed(); + return false; + } + } else { + return false; + } + } + + return true; +} + +KDE_EXPORT bool RandRScreen::confirm() +{ + // uncomment the line below and edit out the KTimerDialog stuff to get + // a version which works on today's tdelibs (no accept dialog is presented) + + // FIXME remember to put the dialog on the right screen + + KTimerDialog acceptDialog ( 15000, KTimerDialog::CountDown, + TDEApplication::kApplication()->mainWidget(), + "mainKTimerDialog", + true, + i18n("Confirm Display Setting Change"), + KTimerDialog::Ok|KTimerDialog::Cancel, + KTimerDialog::Cancel); + + acceptDialog.setButtonOK(KGuiItem(i18n("&Accept Configuration"), "button_ok")); + acceptDialog.setButtonCancel(KGuiItem(i18n("&Return to Previous Configuration"), "button_cancel")); + + KActiveLabel *label = new KActiveLabel(i18n("Your screen orientation, size and refresh rate " + "have been changed to the requested settings. Please indicate whether you wish to " + "keep this configuration. In 15 seconds the display will revert to your previous " + "settings."), &acceptDialog, "userSpecifiedLabel"); + + acceptDialog.setMainWidget(label); + + KDialog::centerOnScreen(&acceptDialog, m_screen); + + m_shownDialog = &acceptDialog; + connect( m_shownDialog, TQT_SIGNAL( destroyed()), this, TQT_SLOT( shownDialogDestroyed())); + connect( kapp->desktop(), TQT_SIGNAL( resized(int)), this, TQT_SLOT( desktopResized())); + + return acceptDialog.exec(); +} + +KDE_EXPORT void RandRScreen::shownDialogDestroyed() +{ + m_shownDialog = NULL; + disconnect( kapp->desktop(), TQT_SIGNAL( resized(int)), this, TQT_SLOT( desktopResized())); +} + +KDE_EXPORT void RandRScreen::desktopResized() +{ + if( m_shownDialog != NULL ) + KDialog::centerOnScreen(m_shownDialog, m_screen); +} + +KDE_EXPORT TQString RandRScreen::changedMessage() const +{ + if (currentRefreshRate() == -1) + return i18n("New configuration:\nResolution: %1 x %2\nOrientation: %3") + .arg(currentPixelWidth()) + .arg(currentPixelHeight()) + .arg(currentRotationDescription()); + else + return i18n("New configuration:\nResolution: %1 x %2\nOrientation: %3\nRefresh rate: %4") + .arg(currentPixelWidth()) + .arg(currentPixelHeight()) + .arg(currentRotationDescription()) + .arg(currentRefreshRateDescription()); +} + +KDE_EXPORT bool RandRScreen::changedFromOriginal() const +{ + return m_currentSize != m_originalSize || m_currentRotation != m_originalRotation || m_currentRefreshRate != m_originalRefreshRate; +} + +KDE_EXPORT void RandRScreen::proposeOriginal() +{ + m_proposedSize = m_originalSize; + m_proposedRotation = m_originalRotation; + m_proposedRefreshRate = m_originalRefreshRate; +} + +KDE_EXPORT bool RandRScreen::proposedChanged() const +{ + return m_currentSize != m_proposedSize || m_currentRotation != m_proposedRotation || m_currentRefreshRate != m_proposedRefreshRate; +} + +KDE_EXPORT TQString RandRScreen::rotationName(int rotation, bool pastTense, bool capitalised) +{ + if (!pastTense) + switch (rotation) { + case RR_Rotate_0: + return i18n("Normal"); + case RR_Rotate_90: + return i18n("Left (90 degrees)"); + case RR_Rotate_180: + return i18n("Upside-down (180 degrees)"); + case RR_Rotate_270: + return i18n("Right (270 degrees)"); + case RR_Reflect_X: + return i18n("Mirror horizontally"); + case RR_Reflect_Y: + return i18n("Mirror vertically"); + default: + return i18n("Unknown orientation"); + } + + switch (rotation) { + case RR_Rotate_0: + return i18n("Normal"); + case RR_Rotate_90: + return i18n("Rotated 90 degrees counterclockwise"); + case RR_Rotate_180: + return i18n("Rotated 180 degrees counterclockwise"); + case RR_Rotate_270: + return i18n("Rotated 270 degrees counterclockwise"); + default: + if (rotation & RR_Reflect_X) + if (rotation & RR_Reflect_Y) + if (capitalised) + return i18n("Mirrored horizontally and vertically"); + else + return i18n("mirrored horizontally and vertically"); + else + if (capitalised) + return i18n("Mirrored horizontally"); + else + return i18n("mirrored horizontally"); + else if (rotation & RR_Reflect_Y) + if (capitalised) + return i18n("Mirrored vertically"); + else + return i18n("mirrored vertically"); + else + if (capitalised) + return i18n("Unknown orientation"); + else + return i18n("unknown orientation"); + } +} + +KDE_EXPORT TQPixmap RandRScreen::rotationIcon(int rotation) const +{ + // Adjust icons for current screen orientation + if (!(m_currentRotation & RR_Rotate_0) && rotation & (RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270)) { + int currentAngle = m_currentRotation & (RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270); + switch (currentAngle) { + case RR_Rotate_90: + rotation <<= 3; + break; + case RR_Rotate_180: + rotation <<= 2; + break; + case RR_Rotate_270: + rotation <<= 1; + break; + } + + // Fix overflow + if (rotation > RR_Rotate_270) { + rotation >>= 4; + } + } + + switch (rotation) { + case RR_Rotate_0: + return SmallIcon("up"); + case RR_Rotate_90: + return SmallIcon("back"); + case RR_Rotate_180: + return SmallIcon("down"); + case RR_Rotate_270: + return SmallIcon("forward"); + case RR_Reflect_X: + case RR_Reflect_Y: + default: + return SmallIcon("stop"); + } +} + +KDE_EXPORT TQString RandRScreen::currentRotationDescription() const +{ + TQString ret = rotationName(m_currentRotation & RotateMask); + + if (m_currentRotation != (m_currentRotation & RotateMask)) { + if (m_currentRotation & RR_Rotate_0) { + ret = rotationName(m_currentRotation & (RR_Reflect_X + RR_Reflect_X), true, true); + } + else { + ret += ", " + rotationName(m_currentRotation & (RR_Reflect_X + RR_Reflect_X), true, false); + } + } + + return ret; +} + +KDE_EXPORT int RandRScreen::rotationIndexToDegree(int rotation) const +{ + switch (rotation & RotateMask) { + case RR_Rotate_90: + return 90; + + case RR_Rotate_180: + return 180; + + case RR_Rotate_270: + return 270; + + default: + return 0; + } +} + +KDE_EXPORT int RandRScreen::rotationDegreeToIndex(int degree) const +{ + switch (degree) { + case 90: + return RR_Rotate_90; + + case 180: + return RR_Rotate_180; + + case 270: + return RR_Rotate_270; + + default: + return RR_Rotate_0; + } +} + +KDE_EXPORT int RandRScreen::currentPixelWidth() const +{ + return m_pixelSizes[m_currentSize].width(); +} + +KDE_EXPORT int RandRScreen::currentPixelHeight() const +{ + return m_pixelSizes[m_currentSize].height(); +} + +KDE_EXPORT int RandRScreen::currentMMWidth() const +{ + return m_pixelSizes[m_currentSize].width(); +} + +KDE_EXPORT int RandRScreen::currentMMHeight() const +{ + return m_pixelSizes[m_currentSize].height(); +} + +KDE_EXPORT TQStringList RandRScreen::refreshRates(int size) const +{ + int nrates; + TQStringList ret; + + if (d->config) { + short* rates = XRRRates(tqt_xdisplay(), m_screen, (SizeID)size, &nrates); + + for (int i = 0; i < nrates; i++) + ret << refreshRateDirectDescription(rates[i]); + } + else { + // Great, now we have to go after the information manually. Ughh. + ScreenInfo *screeninfo = internal_read_screen_info(tqt_xdisplay()); + int numSizes = screeninfo->res->nmode; + for (int i = 0; i < numSizes; i++) { + int refresh_rate = ((screeninfo->res->modes[i].dotClock*1.0)/((screeninfo->res->modes[i].hTotal)*(screeninfo->res->modes[i].vTotal)*1.0)); + TQString newRate = refreshRateDirectDescription(refresh_rate); + if (!ret.contains(newRate)) { + ret.append(newRate); + } + } + } + + return ret; +} + +KDE_EXPORT TQString RandRScreen::refreshRateDirectDescription(int rate) const +{ + return i18n("Refresh rate in Hertz (Hz)", "%1 Hz").arg(rate); +} + +KDE_EXPORT TQString RandRScreen::refreshRateIndirectDescription(int size, int index) const +{ + return i18n("Refresh rate in Hertz (Hz)", "%1 Hz").arg(refreshRateIndexToHz(size, index)); +} + +KDE_EXPORT TQString RandRScreen::refreshRateDescription(int size, int index) const +{ + return refreshRates(size)[index]; +} + +KDE_EXPORT bool RandRScreen::proposeRefreshRate(int index) +{ + if (index >= 0 && (int)refreshRates(proposedSize()).count() > index) { + m_proposedRefreshRate = index; + return true; + } + + return false; +} + +KDE_EXPORT int RandRScreen::currentRefreshRate() const +{ + return m_currentRefreshRate; +} + +KDE_EXPORT TQString RandRScreen::currentRefreshRateDescription() const +{ + return refreshRateIndirectDescription(m_currentSize, m_currentRefreshRate); +} + +KDE_EXPORT int RandRScreen::proposedRefreshRate() const +{ + return m_proposedRefreshRate; +} + +KDE_EXPORT int RandRScreen::refreshRateHzToIndex(int size, int hz) const +{ + int nrates; + short* rates = XRRRates(tqt_xdisplay(), m_screen, (SizeID)size, &nrates); + + for (int i = 0; i < nrates; i++) + if (hz == rates[i]) + return i; + + if (nrates != 0) + // Wrong input Hz! + Q_ASSERT(false); + + return -1; +} + +KDE_EXPORT int RandRScreen::refreshRateIndexToHz(int size, int index) const +{ + int nrates; + short* rates = XRRRates(tqt_xdisplay(), m_screen, (SizeID)size, &nrates); + + if (nrates == 0 || index < 0) + return 0; + + // Wrong input Hz! + if(index >= nrates) + return 0; + + return rates[index]; +} + +KDE_EXPORT int RandRScreen::numSizes() const +{ + return m_pixelSizes.count(); +} + +KDE_EXPORT const TQSize& RandRScreen::pixelSize(int index) const +{ + return m_pixelSizes[index]; +} + +KDE_EXPORT const TQSize& RandRScreen::mmSize(int index) const +{ + return m_mmSizes[index]; +} + +KDE_EXPORT int RandRScreen::sizeIndex(TQSize pixelSize) const +{ + for (uint i = 0; i < m_pixelSizes.count(); i++) + if (m_pixelSizes[i] == pixelSize) + return i; + + return -1; +} + +KDE_EXPORT int RandRScreen::rotations() const +{ + return m_rotations; +} + +KDE_EXPORT int RandRScreen::currentRotation() const +{ + return m_currentRotation; +} + +KDE_EXPORT int RandRScreen::currentSize() const +{ + return m_currentSize; +} + +KDE_EXPORT int RandRScreen::proposedRotation() const +{ + return m_proposedRotation; +} + +KDE_EXPORT void RandRScreen::proposeRotation(int newRotation) +{ + m_proposedRotation = newRotation & OrientationMask; +} + +KDE_EXPORT int RandRScreen::proposedSize() const +{ + return m_proposedSize; +} + +KDE_EXPORT bool RandRScreen::proposeSize(int newSize) +{ + if ((int)m_pixelSizes.count() > newSize) { + m_proposedSize = newSize; + return true; + } + + return false; +} + +KDE_EXPORT void RandRScreen::load(TDEConfig& config) +{ + config.setGroup(TQString("Screen%1").arg(m_screen)); + + if (proposeSize(sizeIndex(TQSize(config.readNumEntry("width", currentPixelWidth()), config.readNumEntry("height", currentPixelHeight()))))) + proposeRefreshRate(refreshRateHzToIndex(proposedSize(), config.readNumEntry("refresh", currentRefreshRate()))); + + proposeRotation(rotationDegreeToIndex(config.readNumEntry("rotation", 0)) + (config.readBoolEntry("reflectX") ? ReflectX : 0) + (config.readBoolEntry("reflectY") ? ReflectY : 0)); +} + +KDE_EXPORT void RandRScreen::save(TDEConfig& config) const +{ + config.setGroup(TQString("Screen%1").arg(m_screen)); + config.writeEntry("width", currentPixelWidth()); + config.writeEntry("height", currentPixelHeight()); + config.writeEntry("refresh", refreshRateIndexToHz(currentSize(), currentRefreshRate())); + config.writeEntry("rotation", rotationIndexToDegree(currentRotation())); + config.writeEntry("reflectX", (bool)(currentRotation() & ReflectMask) == ReflectX); + config.writeEntry("reflectY", (bool)(currentRotation() & ReflectMask) == ReflectY); +} + +KDE_EXPORT RandRDisplay::RandRDisplay() + : m_valid(true) +{ + // Check extension + Status s = XRRQueryExtension(tqt_xdisplay(), &m_eventBase, &m_errorBase); + if (!s) { + m_errorCode = TQString("%1, base %1").arg(s).arg(m_errorBase); + m_valid = false; + return; + } + + // Sometimes the extension is available but does not return any screens (!) + // Check for that case + Display *randr_display = XOpenDisplay(NULL); + int screen_num; + Window root_window; + + screen_num = DefaultScreen (randr_display); + root_window = RootWindow (randr_display, screen_num); + if (XRRGetScreenResources (randr_display, root_window) == NULL) { + m_errorCode = i18n("No screens detected"); + m_valid = false; + return; + } + + int major_version, minor_version; + XRRQueryVersion(tqt_xdisplay(), &major_version, &minor_version); + + m_version = TQString("X Resize and Rotate extension version %1.%1").arg(major_version).arg(minor_version); + + m_numScreens = ScreenCount(tqt_xdisplay()); + + // This assumption is WRONG with Xinerama + // Q_ASSERT(TQApplication::desktop()->numScreens() == ScreenCount(tqt_xdisplay())); + + m_screens.setAutoDelete(true); + for (int i = 0; i < m_numScreens; i++) { + m_screens.append(new RandRScreen(i)); + } + + setCurrentScreen(TQApplication::desktop()->primaryScreen()); +} + +KDE_EXPORT bool RandRDisplay::isValid() const +{ + return m_valid; +} + +KDE_EXPORT const TQString& RandRDisplay::errorCode() const +{ + return m_errorCode; +} + +KDE_EXPORT int RandRDisplay::eventBase() const +{ + return m_eventBase; +} + +KDE_EXPORT int RandRDisplay::screenChangeNotifyEvent() const +{ + return m_eventBase + RRScreenChangeNotify; +} + +KDE_EXPORT int RandRDisplay::errorBase() const +{ + return m_errorBase; +} + +KDE_EXPORT const TQString& RandRDisplay::version() const +{ + return m_version; +} + +KDE_EXPORT void RandRDisplay::setCurrentScreen(int index) +{ + m_currentScreenIndex = index; + m_currentScreen = m_screens.at(m_currentScreenIndex); + Q_ASSERT(m_currentScreen); +} + +KDE_EXPORT int RandRDisplay::screenIndexOfWidget(TQWidget* widget) +{ + int ret = TQApplication::desktop()->screenNumber(widget); + return ret != -1 ? ret : TQApplication::desktop()->primaryScreen(); +} + +KDE_EXPORT int RandRDisplay::currentScreenIndex() const +{ + return m_currentScreenIndex; +} + +KDE_EXPORT void RandRDisplay::refresh() +{ + for (RandRScreen* s = m_screens.first(); s; s = m_screens.next()) + s->loadSettings(); +} + +KDE_EXPORT int RandRDisplay::numScreens() const +{ + return m_numScreens; +} + +KDE_EXPORT RandRScreen* RandRDisplay::screen(int index) +{ + return m_screens.at(index); +} + +KDE_EXPORT RandRScreen* RandRDisplay::currentScreen() +{ + return m_currentScreen; +} + +KDE_EXPORT bool RandRDisplay::loadDisplay(TDEConfig& config, bool loadScreens) +{ + if (loadScreens) + for (RandRScreen* s = m_screens.first(); s; s = m_screens.next()) + s->load(config); + + return applyOnStartup(config); +} + +KDE_EXPORT bool RandRDisplay::applyOnStartup(TDEConfig& config) +{ + config.setGroup("Display"); + return config.readBoolEntry("ApplyOnStartup", false); +} + +KDE_EXPORT bool RandRDisplay::syncTrayApp(TDEConfig& config) +{ + config.setGroup("Display"); + return config.readBoolEntry("SyncTrayApp", false); +} + +KDE_EXPORT void RandRDisplay::saveDisplay(TDEConfig& config, bool applyOnStartup, bool syncTrayApp) +{ + Q_ASSERT(!config.isReadOnly()); + + config.setGroup("Display"); + config.writeEntry("ApplyOnStartup", applyOnStartup); + config.writeEntry("SyncTrayApp", syncTrayApp); + + for (RandRScreen* s = m_screens.first(); s; s = m_screens.next()) + s->save(config); +} + +KDE_EXPORT void RandRDisplay::applyProposed(bool confirm) +{ + for (int screenIndex = 0; screenIndex < numScreens(); screenIndex++) { + if (screen(screenIndex)->proposedChanged()) { + if (confirm) + screen(screenIndex)->applyProposedAndConfirm(); + else + screen(screenIndex)->applyProposed(); + } + } +} + +KDE_EXPORT bool RandRDisplay::showTestConfigurationDialog() +{ + RandRScreen* firstScreen = screen(0); + if (firstScreen) { + return firstScreen->showTestConfigurationDialog(); + } + else { + return false; + } +} + +KDE_EXPORT bool RandRScreen::showTestConfigurationDialog() +{ + // uncomment the line below and edit out the KTimerDialog stuff to get + // a version which works on today's tdelibs (no accept dialog is presented) + + // FIXME remember to put the dialog on the right screen + + KTimerDialog acceptDialog ( 15000, KTimerDialog::CountDown, + TDEApplication::kApplication()->mainWidget(), + "mainKTimerDialog", + true, + i18n("Confirm Display Settings"), + KTimerDialog::Ok|KTimerDialog::Cancel, + KTimerDialog::Cancel); + + acceptDialog.setButtonOK(KGuiItem(i18n("&Accept Configuration"), "button_ok")); + acceptDialog.setButtonCancel(KGuiItem(i18n("&Return to Previous Configuration"), "button_cancel")); + + KActiveLabel *label = new KActiveLabel(i18n("Your display devices has been configured " + "to match the settings shown above. Please indicate whether you wish to " + "keep this configuration. In 15 seconds the display will revert to your previous " + "settings."), &acceptDialog, "userSpecifiedLabel"); + + acceptDialog.setMainWidget(label); + + KDialog::centerOnScreen(&acceptDialog, 0); + + m_shownDialog = &acceptDialog; + connect( m_shownDialog, TQT_SIGNAL( destroyed()), this, TQT_SLOT( shownDialogDestroyed())); + connect( kapp->desktop(), TQT_SIGNAL( resized(int)), this, TQT_SLOT( desktopResized())); + + return acceptDialog.exec(); +} + +KDE_EXPORT int RandRScreen::pixelCount( int index ) const +{ + TQSize sz = pixelSize(index); + return sz.width() * sz.height(); +} + +#include "randr.moc" -- cgit v1.2.3 From 8bd62a3b0d3b362b783a273e2460811392485bbd Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 14 Feb 2013 17:17:18 -0600 Subject: Rename common header files for consistency with class renaming --- KDE2PORTING.html | 2 +- KDE3PORTING.html | 2 +- arts/kde/kaudioconverter.cc | 2 +- arts/kde/kconverttest.cc | 6 +- arts/kde/kioinputstream_impl.cpp | 2 +- arts/kde/kiotest.cc | 6 +- arts/kde/kiotestslow.cc | 6 +- arts/kde/mcop-dcop/kmcop.cpp | 4 +- arts/knotify/knotify.cpp | 4 +- arts/knotify/knotifytest.cpp | 2 +- arts/message/artsmessage.cc | 6 +- dcop/HOWTO | 2 +- dcop/dcop_deadlock_test.h | 2 +- dcop/tests/driver.cpp | 4 +- dcop/tests/test.cpp | 4 +- dnssd/domainbrowser.cpp | 2 +- interfaces/tdeimproxy/library/tdeimproxy.cpp | 2 +- interfaces/tdescript/sample/shellscript.cpp | 2 +- interfaces/tdescript/scriptloader.cpp | 2 +- interfaces/tdescript/scriptmanager.cpp | 2 +- interfaces/tdetexteditor/editorchooser.cpp | 2 +- interfaces/terminal/test/main.cc | 6 +- kab/addressbook.cc | 2 +- kabc/address.cpp | 2 +- kabc/addressbook.cpp | 2 +- kabc/key.cpp | 2 +- kabc/ldapclient.cpp | 2 +- kabc/lock.cpp | 2 +- kabc/phonenumber.cpp | 2 +- kabc/plugins/dir/resourcedir.cpp | 2 +- kabc/plugins/file/resourcefile.cpp | 2 +- kabc/scripts/addressee.src.cpp | 2 +- kabc/stdaddressbook.cpp | 2 +- kabc/tdeab2tdeabc.cpp | 6 +- kabc/tests/bigread.cpp | 6 +- kabc/tests/bigwrite.cpp | 6 +- kabc/tests/kabcargl.cpp | 6 +- kabc/tests/testaddressee.cpp | 6 +- kabc/tests/testaddresseelist.cpp | 6 +- kabc/tests/testaddressfmt.cpp | 6 +- kabc/tests/testaddresslineedit.cpp | 6 +- kabc/tests/testdb.cpp | 6 +- kabc/tests/testdistlist.cpp | 6 +- kabc/tests/testkabc.cpp | 6 +- kabc/tests/testkabcdlg.cpp | 6 +- kabc/tests/testldapclient.cpp | 4 +- kabc/tests/testlock.cpp | 6 +- kabc/vcard/testwrite.cpp | 6 +- kabc/vcardparser/testread.cpp | 6 +- kabc/vcardparser/testwrite.cpp | 6 +- kate/part/kateconfig.cpp | 2 +- kate/part/katedialogs.cpp | 2 +- kate/part/katedocument.cpp | 2 +- kate/part/katefactory.h | 2 +- kate/part/katehighlight.cpp | 2 +- kate/part/kateprinter.cpp | 2 +- kate/part/kateschema.cpp | 4 +- kate/part/kateview.cpp | 2 +- kate/part/kateviewhelpers.cpp | 2 +- kate/part/kateviewinternal.cpp | 2 +- kate/part/test_regression.cpp | 4 +- kate/plugins/autobookmarker/autobookmarker.cpp | 2 +- kate/plugins/wordcompletion/docwordcompletion.cpp | 2 +- kded/kded.cpp | 4 +- kded/khostname.cpp | 6 +- kded/tde-menu.cpp | 6 +- kded/tdebuildsycoca.cpp | 6 +- kded/tdemimelist.cpp | 2 +- kdewidgets/makekdewidgets.cpp | 4 +- kdoctools/meinproc.cpp | 4 +- kimgio/eps.cpp | 2 +- kinit/kinit.cpp | 2 +- kinit/tdelauncher_main.cpp | 4 +- kinit/tests/tdelaunchertest.cpp | 2 +- knewstuff/downloaddialog.cpp | 2 +- knewstuff/engine.cpp | 2 +- knewstuff/ghns.cpp | 6 +- knewstuff/ghns.h | 2 +- knewstuff/knewstuff.cpp | 2 +- knewstuff/tdehotnewstuff.cpp | 6 +- knewstuff/testnewstuff.cpp | 6 +- knewstuff/testnewstuff.h | 2 +- knewstuff/uploaddialog.cpp | 2 +- kstyles/asteroid/asteroid.h | 2 +- kstyles/highcolor/highcolor.h | 2 +- kstyles/highcontrast/highcontrast.cpp | 6 +- kstyles/highcontrast/highcontrast.h | 2 +- kstyles/keramik/keramik.h | 2 +- kstyles/klegacy/klegacystyle.h | 2 +- kstyles/kthemestyle/kthemebase.h | 2 +- kstyles/light/lightstyle-v2.h | 2 +- kstyles/light/lightstyle-v3.h | 2 +- kstyles/plastik/plastik.h | 2 +- kstyles/utils/installtheme/main.cpp | 4 +- kstyles/web/webstyle.cpp | 2 +- kstyles/web/webstyle.h | 2 +- libtdescreensaver/main.cpp | 4 +- libtdescreensaver/tdescreensaver.cpp | 2 +- networkstatus/connectionmanager.cpp | 2 +- networkstatus/networkstatus.cpp | 2 +- networkstatus/testservice.cpp | 2 +- tdecert/tdecertpart.cc | 2 +- tdecmshell/main.cpp | 6 +- tdecmshell/main.h | 2 +- tdeconf_update/tdeconf_update.cpp | 4 +- tdecore/CMakeLists.txt | 8 +- tdecore/MAINTAINERS | 6 +- tdecore/Makefile.am | 8 +- tdecore/kaboutdata.cpp | 512 --- tdecore/kaboutdata.h | 630 ---- tdecore/kapp.h | 6 +- tdecore/kappdcopiface.cpp | 2 +- tdecore/kapplication.cpp | 3638 -------------------- tdecore/kapplication.h | 1620 --------- tdecore/kapplication_win.cpp | 2 +- tdecore/kcharsets.cpp | 2 +- tdecore/kclipboard.cpp | 2 +- tdecore/kcmdlineargs.cpp | 1298 ------- tdecore/kcmdlineargs.h | 690 ---- tdecore/kcompletion.cpp | 2 +- tdecore/kcrash.cpp | 4 +- tdecore/kdebug.cpp | 2 +- tdecore/kdesktopfile.cpp | 2 +- tdecore/kdetcompmgr.cpp | 6 +- tdecore/kglobal.cpp | 4 +- tdecore/kglobalaccel_win.cpp | 2 +- tdecore/kglobalaccel_x11.cpp | 2 +- tdecore/kglobalsettings.cpp | 2 +- tdecore/kiconloader.cpp | 2 +- tdecore/kinstance.cpp | 2 +- tdecore/klibloader.cpp | 2 +- tdecore/klockfile.cpp | 4 +- tdecore/kmanagerselection.cpp | 2 +- tdecore/knotifyclient.cpp | 4 +- tdecore/kprotocolinfo_tdecore.cpp | 2 +- tdecore/kprotocolinfofactory.cpp | 2 +- tdecore/krandomsequence.cpp | 2 +- tdecore/krootprop.cpp | 2 +- tdecore/ksavefile.cpp | 2 +- tdecore/ksimpledirwatch.cpp | 2 +- tdecore/ksocks.cpp | 2 +- tdecore/kstartupinfo.cpp | 2 +- tdecore/ktempdir.cpp | 2 +- tdecore/ktempfile.cpp | 2 +- tdecore/kuniqueapplication.cpp | 4 +- tdecore/kuniqueapplication.h | 4 +- tdecore/kxmessages.cpp | 2 +- tdecore/network/kresolverstandardworkers.cpp | 2 +- tdecore/network/ksockssocketdevice.cpp | 2 +- tdecore/tde-config.cpp.cmake | 6 +- tdecore/tde-config.cpp.in | 6 +- tdecore/tdeaboutdata.cpp | 512 +++ tdecore/tdeaboutdata.h | 630 ++++ tdecore/tdeaccel.cpp | 2 +- tdecore/tdeapplication.cpp | 3638 ++++++++++++++++++++ tdecore/tdeapplication.h | 1620 +++++++++ tdecore/tdecmdlineargs.cpp | 1298 +++++++ tdecore/tdecmdlineargs.h | 690 ++++ tdecore/tdeconfig.cpp | 2 +- tdecore/tdeconfig_compiler/example/autoexample.cpp | 6 +- tdecore/tdeconfig_compiler/example/example.cpp | 6 +- tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp | 6 +- tdecore/tdeconfigbackend.cpp | 2 +- tdecore/tdeconfigbase.cpp | 2 +- tdecore/tdeconfigdialogmanager.cpp | 2 +- tdecore/tdehardwaredevices.cpp | 2 +- tdecore/tdesycoca.cpp | 2 +- tdecore/tests/KIDLTest.cpp | 2 +- tdecore/tests/KIDLTestClient.cpp | 2 +- tdecore/tests/dcopkonqtest.cpp | 2 +- tdecore/tests/kapptest.cpp | 6 +- tdecore/tests/kcalendartest.cpp | 6 +- tdecore/tests/kcmdlineargstest.cpp | 4 +- tdecore/tests/kglobaltest.cpp | 4 +- tdecore/tests/kiconloadertest.cpp | 2 +- tdecore/tests/kipctest.cpp | 2 +- tdecore/tests/klocaletest.cpp | 2 +- tdecore/tests/kmacroexpandertest.cpp | 4 +- tdecore/tests/kmdcodectest.cpp | 4 +- tdecore/tests/kmemtest.cpp | 2 +- tdecore/tests/knotifytest.cpp | 2 +- tdecore/tests/kprocesstest.cpp | 2 +- tdecore/tests/kprociotest.cpp | 2 +- tdecore/tests/krandomsequencetest.cpp | 2 +- tdecore/tests/kresolvertest.cpp | 4 +- tdecore/tests/krfcdatetest.cpp | 2 +- tdecore/tests/ksimpleconfigtest.cpp | 2 +- tdecore/tests/ksocktest.cpp | 4 +- tdecore/tests/kstddirstest.cpp | 2 +- tdecore/tests/ktempfiletest.cpp | 2 +- tdecore/tests/ktimezonestest.cpp | 2 +- tdecore/tests/kuniqueapptest.cpp | 4 +- tdecore/tests/kurltest.cpp | 4 +- tdecore/tests/startserviceby.cpp | 6 +- tdecore/tests/tdeconfigtestgui.cpp | 2 +- tdecore/tests/tdeconfigtestgui.h | 2 +- tdecore/tests/tdestdacceltest.cpp | 2 +- tdecore/tests/testqtargs.cpp | 8 +- tdecore/twin.cpp | 2 +- tdecore/twinmodule.cpp | 2 +- tdefx/CMakeLists.txt | 4 +- tdefx/Makefile.am | 4 +- tdefx/kstyle.cpp | 2418 ------------- tdefx/kstyle.h | 383 --- tdefx/tdestylen.cpp | 2418 +++++++++++++ tdefx/tdestylen.h | 383 +++ tdehtml/ecma/kjs_debugwin.cpp | 2 +- tdehtml/html/html_documentimpl.cpp | 2 +- tdehtml/html/html_formimpl.cpp | 2 +- tdehtml/java/kjavaappletserver.cpp | 2 +- tdehtml/java/kjavaappletviewer.cpp | 4 +- tdehtml/java/tests/testkjavaappletserver.cpp | 4 +- tdehtml/misc/helper.cpp | 2 +- tdehtml/misc/loader.cpp | 2 +- tdehtml/rendering/render_frames.cpp | 2 +- tdehtml/rendering/render_image.cpp | 2 +- tdehtml/tdehtml_ext.cpp | 2 +- tdehtml/tdehtml_factory.cpp | 2 +- tdehtml/tdehtml_part.cpp | 2 +- tdehtml/tdehtmlview.cpp | 2 +- tdehtml/tdemultipart/tdemultipart.h | 2 +- tdehtml/test_regression.cpp | 4 +- tdehtml/test_regression_fontoverload.cpp | 2 +- tdehtml/testtdehtml.cpp | 4 +- tdehtml/xml/dom_docimpl.cpp | 2 +- tdeio/bookmarks/kbookmark.cc | 2 +- tdeio/bookmarks/kbookmarkimporter_crash.cc | 2 +- tdeio/bookmarks/kbookmarkmanager.cc | 2 +- tdeio/bookmarks/kbookmarkmenu.cc | 2 +- tdeio/kpasswdserver/kpasswdserver.cpp | 2 +- tdeio/kssl/ksslcertdlg.cc | 2 +- tdeio/kssl/ksslinfodlg.cc | 2 +- tdeio/kssl/ksslkeygen.cc | 2 +- tdeio/misc/kpac/proxyscout.cpp | 2 +- tdeio/misc/tdefile/fileprops.cpp | 6 +- tdeio/misc/tdemailservice.cpp | 4 +- tdeio/misc/tdentlm/tdentlm.cpp | 2 +- tdeio/misc/tdesendbugmail/main.cpp | 6 +- tdeio/misc/tdetelnetservice.cpp | 4 +- tdeio/misc/tdewalletd/tdewalletd.cpp | 2 +- tdeio/misc/uiserver.cpp | 4 +- tdeio/tdefile/kcombiview.cpp | 2 +- tdeio/tdefile/kdiroperator.cpp | 2 +- tdeio/tdefile/kdirselectdialog.cpp | 2 +- tdeio/tdefile/kicondialog.cpp | 2 +- tdeio/tdefile/kimagefilepreview.cpp | 2 +- tdeio/tdefile/knotifydialog.cpp | 4 +- tdeio/tdefile/kopenwith.cpp | 2 +- tdeio/tdefile/kpropertiesdialog.cpp | 2 +- tdeio/tdefile/kurlbar.cpp | 2 +- tdeio/tdefile/tdefiledetailview.cpp | 2 +- tdeio/tdefile/tdefiledialog.cpp | 4 +- tdeio/tdefile/tdefileiconview.cpp | 2 +- tdeio/tdefile/tdefilesharedlg.cpp | 2 +- tdeio/tdefile/tdefileview.cpp | 2 +- tdeio/tdefile/tderecentdocument.cpp | 2 +- tdeio/tdefile/tests/kcustommenueditortest.cpp | 2 +- tdeio/tdefile/tests/kdirselectdialogtest.cpp | 2 +- tdeio/tdefile/tests/kfdtest.cpp | 2 +- tdeio/tdefile/tests/kfstest.cpp | 2 +- tdeio/tdefile/tests/kicondialogtest.cpp | 2 +- tdeio/tdefile/tests/knotifytest.cpp | 2 +- tdeio/tdefile/tests/kopenwithtest.cpp | 2 +- tdeio/tdefile/tests/kurlrequestertest.cpp | 2 +- tdeio/tdefile/tests/tdefiletreeviewtest.cpp | 2 +- tdeio/tdeio/defaultprogress.cpp | 2 +- tdeio/tdeio/job.cpp | 2 +- tdeio/tdeio/kdcopservicestarter.cpp | 2 +- tdeio/tdeio/kdirlister.cpp | 2 +- tdeio/tdeio/kdirwatch.cpp | 2 +- tdeio/tdeio/kimageio.cpp | 2 +- tdeio/tdeio/kmessageboxwrapper.h | 2 +- tdeio/tdeio/kmimemagic.cpp | 2 +- tdeio/tdeio/kmimetype.cpp | 2 +- tdeio/tdeio/kprotocolmanager.h | 2 +- tdeio/tdeio/krun.cpp | 2 +- tdeio/tdeio/kservice.cpp | 2 +- tdeio/tdeio/kservicetypefactory.cpp | 2 +- tdeio/tdeio/kshred.cpp | 2 +- tdeio/tdeio/kurlcompletion.cpp | 2 +- tdeio/tdeio/kuserprofile.cpp | 2 +- tdeio/tdeio/netaccess.cpp | 2 +- tdeio/tdeio/observer.cpp | 2 +- tdeio/tdeio/previewjob.cpp | 2 +- tdeio/tdeio/renamedlg.cpp | 2 +- tdeio/tdeio/skipdlg.cpp | 2 +- tdeio/tdeio/slave.cpp | 2 +- tdeio/tdeio/slavebase.cpp | 2 +- tdeio/tdeio/slaveinterface.cpp | 2 +- tdeio/tdeio/statusbarprogress.cpp | 2 +- tdeio/tdeio/tcpslavebase.cpp | 2 +- tdeio/tdeioexec/main.cpp | 6 +- tdeio/tests/getalltest.cpp | 2 +- tdeio/tests/jobtest.cpp | 4 +- tdeio/tests/kacltest.cpp | 4 +- tdeio/tests/kdcopcheck.cpp | 2 +- tdeio/tests/kdefaultprogresstest.cpp | 2 +- tdeio/tests/kdirlistertest.cpp | 2 +- tdeio/tests/kdirwatchtest.cpp | 2 +- tdeio/tests/kdirwatchtest.h | 2 +- tdeio/tests/kdirwatchunittest.h | 2 +- tdeio/tests/kionetrctest.cpp | 6 +- tdeio/tests/kiopassdlgtest.cpp | 6 +- tdeio/tests/kmimefromext.cpp | 4 +- tdeio/tests/kpropsdlgtest.cpp | 6 +- tdeio/tests/kprotocolinfotest.cpp | 6 +- tdeio/tests/kruntest.cpp | 2 +- tdeio/tests/kscantest.cpp | 2 +- tdeio/tests/kurifiltertest.cpp | 6 +- tdeio/tests/kurlcompletiontest.cpp | 4 +- tdeio/tests/metatest.cpp | 4 +- tdeio/tests/netaccesstest.cpp | 2 +- tdeio/tests/previewtest.cpp | 2 +- tdeio/tests/speed.cpp | 4 +- tdeio/tests/tdeioslavetest.cpp | 4 +- tdeio/tests/tdesycocatest.cpp | 2 +- tdeio/tests/tdesycocaupdatetest.cpp | 2 +- tdeio/tests/tdetradertest.cpp | 4 +- tdeioslave/http/http.cc | 2 +- tdeioslave/http/http_cache_cleaner.cpp | 2 +- tdeioslave/http/kcookiejar/kcookieserver.cpp | 4 +- tdeioslave/http/kcookiejar/kcookiewin.cpp | 2 +- tdeioslave/http/kcookiejar/main.cpp | 4 +- .../http/kcookiejar/tests/kcookiejartest.cpp | 6 +- tdeioslave/metainfo/metainfo.cpp | 2 +- tdelfeditor/tdelfeditor.cpp | 6 +- tdemdi/tdemdi/dockcontainer.cpp | 2 +- tdemdi/tdemdi/guiclient.cpp | 2 +- tdemdi/tdemdi/mainwindow.cpp | 2 +- tdemdi/tdemdidockcontainer.cpp | 2 +- tdemdi/tdemdiguiclient.cpp | 2 +- tdemdi/tdemdimainfrm.cpp | 2 +- tdemdi/test/main.cpp | 2 +- tdeparts/genericfactory.h | 2 +- tdeparts/historyprovider.cpp | 2 +- tdeparts/tests/example.cpp | 2 +- tdeparts/tests/ghostview.cpp | 4 +- tdeparts/tests/normalktm.cpp | 2 +- tdeparts/tests/notepad.cpp | 4 +- tdeparts/tests/parts.cpp | 2 +- tdeprint/cups/cupsdconf2/main.cpp | 4 +- tdeprint/cups/cupsinfos.cpp | 2 +- tdeprint/cups/kmcupsmanager.cpp | 2 +- tdeprint/kmfactory.cpp | 2 +- tdeprint/kmmanager.cpp | 2 +- tdeprint/kpcopiespage.cpp | 2 +- tdeprint/kpfilterpage.cpp | 2 +- tdeprint/kprintdialog.cpp | 2 +- tdeprint/kprinter.cpp | 2 +- tdeprint/kprinterimpl.cpp | 2 +- tdeprint/kprintpreview.cpp | 2 +- tdeprint/kprintprocess.cpp | 2 +- tdeprint/lpr/matichandler.cpp | 2 +- tdeprint/management/kaddprinterwizard.cpp | 4 +- tdeprint/management/kmdbcreator.cpp | 2 +- tdeprint/management/kmdriverdb.cpp | 2 +- tdeprint/management/kmjobviewer.cpp | 2 +- tdeprint/management/kmmainview.cpp | 2 +- tdeprint/management/kmwdrivertest.cpp | 2 +- tdeprint/management/kmwizard.cpp | 2 +- tdeprint/management/kmwsocketutil.cpp | 2 +- tdeprint/management/kxmlcommanddlg.cpp | 2 +- tdeprint/messagewindow.cpp | 2 +- tdeprint/tdeprintd.cpp | 2 +- tdeprint/tests/drawdemo.cpp | 2 +- tdeprint/tests/main.cpp | 2 +- tderandr/libtderandr.cc | 2 +- tderandr/randr.cpp | 2 +- tderesources/configpage.cpp | 2 +- tderesources/kcmtderesources.cpp | 2 +- tderesources/managerimpl.cpp | 4 +- tderesources/resource.cpp | 2 +- tderesources/testresources.cpp | 6 +- tdersync/rsyncconfigdialog.cpp | 2 +- tdersync/tdersync.h | 2 +- tdespell2/tests/backgroundtest.cpp | 2 +- tdespell2/tests/test.cpp | 2 +- tdespell2/tests/test_config.cpp | 2 +- tdespell2/tests/test_configdialog.cpp | 2 +- tdespell2/tests/test_dialog.cpp | 2 +- tdespell2/tests/test_filter.cpp | 2 +- tdespell2/tests/test_highlighter.cpp | 2 +- tdesu/client.cpp | 2 +- tdesu/stub.cpp | 2 +- tdeui/CMakeLists.txt | 10 +- tdeui/MAINTAINERS | 6 +- tdeui/Makefile.am | 10 +- tdeui/kaboutapplication.cpp | 188 - tdeui/kaboutapplication.h | 94 - tdeui/kaboutdialog.cpp | 1797 ---------- tdeui/kaboutdialog.h | 633 ---- tdeui/kaboutkde.cpp | 87 - tdeui/kaboutkde.h | 62 - tdeui/kactivelabel.cpp | 2 +- tdeui/kbugreport.cpp | 4 +- tdeui/kcharselect.cpp | 2 +- tdeui/kcolorcombo.cpp | 2 +- tdeui/kcolordialog.cpp | 2 +- tdeui/kdatepicker.cpp | 2 +- tdeui/kdatetbl.cpp | 2 +- tdeui/kdcopactionproxy.cpp | 2 +- tdeui/kdetrayproxy/kdetrayproxy.cpp | 4 +- tdeui/kdialog.cpp | 2 +- tdeui/kdialogbase.cpp | 2 +- tdeui/keditcl1.cpp | 2 +- tdeui/keditcl2.cpp | 2 +- tdeui/keditlistbox.cpp | 2 +- tdeui/khelpmenu.cpp | 8 +- tdeui/kiconview.cpp | 2 +- tdeui/kjanuswidget.cpp | 2 +- tdeui/kkeybutton.cpp | 2 +- tdeui/kkeydialog.cpp | 4 +- tdeui/kled.cpp | 2 +- tdeui/klineedit.cpp | 2 +- tdeui/klineeditdlg.cpp | 2 +- tdeui/kmenubar.cpp | 2 +- tdeui/kmessagebox.cpp | 2 +- tdeui/kpanelapplet.cpp | 2 +- tdeui/kpanelappmenu.cpp | 2 +- tdeui/kpassdlg.cpp | 4 +- tdeui/kprogress.cpp | 2 +- tdeui/kprogressbox.cpp | 2 +- tdeui/kpushbutton.cpp | 2 +- tdeui/krootpixmap.cpp | 2 +- tdeui/ksconfig.cpp | 2 +- tdeui/kseparator.cpp | 2 +- tdeui/ksharedpixmap.cpp | 2 +- tdeui/kstdaction.cpp | 4 +- tdeui/kstdguiitem.cpp | 2 +- tdeui/ksyntaxhighlighter.cpp | 2 +- tdeui/ksystemtray.cpp | 4 +- tdeui/ktextbrowser.cpp | 2 +- tdeui/ktip.cpp | 4 +- tdeui/kwhatsthismanager.cpp | 2 +- tdeui/kxmlguibuilder.cpp | 2 +- tdeui/kxmlguiclient.cpp | 2 +- tdeui/tdeaboutapplication.cpp | 188 + tdeui/tdeaboutapplication.h | 94 + tdeui/tdeaboutdialog.cpp | 1797 ++++++++++ tdeui/tdeaboutdialog.h | 633 ++++ tdeui/tdeabouttde.cpp | 87 + tdeui/tdeabouttde.h | 62 + tdeui/tdeaction.cpp | 2 +- tdeui/tdeactionclasses.cpp | 2 +- tdeui/tdeactioncollection.cpp | 2 +- tdeui/tdecmodule.cpp | 2 +- tdeui/tdefontdialog.cpp | 2 +- tdeui/tdelistbox.cpp | 2 +- tdeui/tdelistview.cpp | 2 +- tdeui/tdemainwindow.cpp | 2 +- tdeui/tdemainwindowiface.cpp | 2 +- tdeui/tdepopupmenu.cpp | 2 +- tdeui/tdeshortcutdialog.cpp | 2 +- tdeui/tdespell.cpp | 2 +- tdeui/tdespelldlg.cpp | 2 +- tdeui/tdetoolbar.cpp | 2 +- tdeui/tdetoolbarbutton.cpp | 2 +- tdeui/tdetoolbarhandler.cpp | 2 +- tdeui/tests/itemcontainertest.cpp | 2 +- tdeui/tests/kaboutdialogtest.cpp | 4 +- tdeui/tests/kblendtest.cpp | 2 +- tdeui/tests/kbuttonboxtest.cpp | 2 +- tdeui/tests/kcharselecttest.cpp | 2 +- tdeui/tests/kcolordlgtest.cpp | 2 +- tdeui/tests/kcolortest.cpp | 2 +- tdeui/tests/kcomboboxtest.cpp | 2 +- tdeui/tests/kcompletiontest.cpp | 2 +- tdeui/tests/kdatepicktest.cpp | 2 +- tdeui/tests/kdatetimewidgettest.cpp | 2 +- tdeui/tests/kdatewidgettest.cpp | 2 +- tdeui/tests/kdesattest.cpp | 2 +- tdeui/tests/kdialogbasetest.cpp | 2 +- tdeui/tests/kdocktest.cpp | 2 +- tdeui/tests/kdockwidgetdemo.cpp | 2 +- tdeui/tests/kdockwidgettest.cpp | 2 +- tdeui/tests/kdualcolortest.cpp | 2 +- tdeui/tests/keditlistboxtest.cpp | 2 +- tdeui/tests/kedittest.cpp | 2 +- tdeui/tests/kgradienttest.cpp | 2 +- tdeui/tests/khashtest.cpp | 2 +- tdeui/tests/kinputdialogtest.cpp | 2 +- tdeui/tests/kjanuswidgettest.cpp | 2 +- tdeui/tests/kledtest.cpp | 2 +- tdeui/tests/klineeditdlgtest.cpp | 2 +- tdeui/tests/klineedittest.cpp | 6 +- tdeui/tests/kmessageboxtest.cpp | 2 +- tdeui/tests/knuminputtest.cpp | 2 +- tdeui/tests/kpalettetest.cpp | 2 +- tdeui/tests/kpanelmenutest.cpp | 2 +- tdeui/tests/kpixmapregionselectordialogtest.cpp | 4 +- tdeui/tests/kprogresstest.cpp | 2 +- tdeui/tests/krulertest.h | 2 +- tdeui/tests/kseparatortest.cpp | 2 +- tdeui/tests/ksqueezedtextlabeltest.cpp | 2 +- tdeui/tests/kstatusbartest.cpp | 2 +- tdeui/tests/ksystemtraytest.cpp | 2 +- tdeui/tests/ktabctltest.cpp | 2 +- tdeui/tests/ktabwidgettest.cpp | 4 +- tdeui/tests/ktextedittest.cpp | 2 +- tdeui/tests/ktimewidgettest.cpp | 2 +- tdeui/tests/kunbalancedgrdtest.cpp | 2 +- tdeui/tests/kwizardtest.cpp | 2 +- tdeui/tests/kwordwraptest.cpp | 2 +- tdeui/tests/kxmlguitest.cpp | 2 +- tdeui/tests/tdeactiontest.cpp | 2 +- tdeui/tests/tdefontdialogtest.cpp | 2 +- tdeui/tests/tdelistviewtest.cpp | 2 +- tdeui/tests/tdemainwindowrestoretest.cpp | 2 +- tdeui/tests/tdemainwindowtest.cpp | 2 +- tdeui/tests/tdepopuptest.cpp | 2 +- tdeui/tests/tdespelltest.cpp | 2 +- tdeui/tests/tdetoolbarlabelactiontest.cpp | 2 +- tdeui/tests/twindowtest.cpp | 4 +- tdeui/twindowlistmenu.cpp | 4 +- tdeunittest/modrunner.cpp | 4 +- tdeunittest/tester.h | 8 +- tdeutils/kcmultidialog.cpp | 4 +- tdeutils/kfind.cpp | 2 +- tdeutils/kreplace.cpp | 2 +- tdeutils/tdecmoduleloader.cpp | 2 +- tdeutils/tdecmoduleproxy.cpp | 4 +- tdeutils/tdecmoduleproxyIfaceImpl.cpp | 2 +- tdeutils/tests/kfindtest.cpp | 4 +- tdeutils/tests/kreplacetest.cpp | 4 +- tdewallet/backend/tests/backendtest.cpp | 2 +- tdewallet/tests/tdewalletasync.cpp | 6 +- tdewallet/tests/tdewalletboth.cpp | 6 +- tdewallet/tests/tdewalletsync.cpp | 6 +- .../thinkeramik/widget-engine/thinkeramik_rel.pro | 4 +- win/pro_files/tdecore/tdecore.pro | 6 +- win/pro_files/tdefx/tdefx.pro | 2 +- win/pro_files/tdefx/tdefx_rel.pro | 4 +- win/pro_files/tdeui/tdeui.pro | 6 +- 533 files changed, 14767 insertions(+), 14767 deletions(-) delete mode 100644 tdecore/kaboutdata.cpp delete mode 100644 tdecore/kaboutdata.h delete mode 100644 tdecore/kapplication.cpp delete mode 100644 tdecore/kapplication.h delete mode 100644 tdecore/kcmdlineargs.cpp delete mode 100644 tdecore/kcmdlineargs.h create mode 100644 tdecore/tdeaboutdata.cpp create mode 100644 tdecore/tdeaboutdata.h create mode 100644 tdecore/tdeapplication.cpp create mode 100644 tdecore/tdeapplication.h create mode 100644 tdecore/tdecmdlineargs.cpp create mode 100644 tdecore/tdecmdlineargs.h delete mode 100644 tdefx/kstyle.cpp delete mode 100644 tdefx/kstyle.h create mode 100644 tdefx/tdestylen.cpp create mode 100644 tdefx/tdestylen.h delete mode 100644 tdeui/kaboutapplication.cpp delete mode 100644 tdeui/kaboutapplication.h delete mode 100644 tdeui/kaboutdialog.cpp delete mode 100644 tdeui/kaboutdialog.h delete mode 100644 tdeui/kaboutkde.cpp delete mode 100644 tdeui/kaboutkde.h create mode 100644 tdeui/tdeaboutapplication.cpp create mode 100644 tdeui/tdeaboutapplication.h create mode 100644 tdeui/tdeaboutdialog.cpp create mode 100644 tdeui/tdeaboutdialog.h create mode 100644 tdeui/tdeabouttde.cpp create mode 100644 tdeui/tdeabouttde.h (limited to 'tderandr/randr.cpp') diff --git a/KDE2PORTING.html b/KDE2PORTING.html index 1c8f95e38..b375854de 100644 --- a/KDE2PORTING.html +++ b/KDE2PORTING.html @@ -175,7 +175,7 @@ or this page online.

certain option was specified on the command line and your application now automatically supports --help and --version. It aborts with a useful error message when the command line contains a syntax error. - See tdelibs/tdecore/kcmdlineargs.h for more info.

+ See tdelibs/tdecore/tdecmdlineargs.h for more info.

Return to the Table of Contents

diff --git a/KDE3PORTING.html b/KDE3PORTING.html index edd317c11..47246adb8 100644 --- a/KDE3PORTING.html +++ b/KDE3PORTING.html @@ -73,7 +73,7 @@ instead, everything else is source compatible.

Header file names

    -
  • kapp.h is now kapplication.h
  • +
  • kapp.h is now tdeapplication.h
  • kuniqueapp.h is now kuniqueapplication.h
  • kstddirs.h is now kstandarddirs.h
  • kcolorbtn.h is now kcolorbutton.h
  • diff --git a/arts/kde/kaudioconverter.cc b/arts/kde/kaudioconverter.cc index c5a526db6..1eb8c20e5 100644 --- a/arts/kde/kaudioconverter.cc +++ b/arts/kde/kaudioconverter.cc @@ -37,7 +37,7 @@ #include #include #include -#include +#include using namespace std; diff --git a/arts/kde/kconverttest.cc b/arts/kde/kconverttest.cc index 42fd98072..70c4b7918 100644 --- a/arts/kde/kconverttest.cc +++ b/arts/kde/kconverttest.cc @@ -4,9 +4,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/arts/kde/kioinputstream_impl.cpp b/arts/kde/kioinputstream_impl.cpp index bf6b3654a..d893675cd 100644 --- a/arts/kde/kioinputstream_impl.cpp +++ b/arts/kde/kioinputstream_impl.cpp @@ -29,7 +29,7 @@ * until the buffer is small enough again. */ -#include +#include #include #include #include diff --git a/arts/kde/kiotest.cc b/arts/kde/kiotest.cc index cb26a649f..01ce8f3f1 100644 --- a/arts/kde/kiotest.cc +++ b/arts/kde/kiotest.cc @@ -1,10 +1,10 @@ #include #include -#include +#include #include #include -#include -#include +#include +#include #include "qiomanager.h" #include "artskde.h" diff --git a/arts/kde/kiotestslow.cc b/arts/kde/kiotestslow.cc index ffeceafd5..df6ed645f 100644 --- a/arts/kde/kiotestslow.cc +++ b/arts/kde/kiotestslow.cc @@ -1,10 +1,10 @@ #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include "qiomanager.h" #include "artskde.h" diff --git a/arts/kde/mcop-dcop/kmcop.cpp b/arts/kde/mcop-dcop/kmcop.cpp index 0ba9b48a4..d134aeca4 100644 --- a/arts/kde/mcop-dcop/kmcop.cpp +++ b/arts/kde/mcop-dcop/kmcop.cpp @@ -18,8 +18,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/arts/knotify/knotify.cpp b/arts/knotify/knotify.cpp index a5b736608..3d0e45d02 100644 --- a/arts/knotify/knotify.cpp +++ b/arts/knotify/knotify.cpp @@ -44,12 +44,12 @@ // KDE headers #include -#include +#include #ifndef WITHOUT_ARTS #include #include #endif -#include +#include #include #include #include diff --git a/arts/knotify/knotifytest.cpp b/arts/knotify/knotifytest.cpp index 232b1b8c7..0f370d80a 100644 --- a/arts/knotify/knotifytest.cpp +++ b/arts/knotify/knotifytest.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include int main(int argc, char **argv) diff --git a/arts/message/artsmessage.cc b/arts/message/artsmessage.cc index 389d09bf9..4eb62f1fb 100644 --- a/arts/message/artsmessage.cc +++ b/arts/message/artsmessage.cc @@ -33,10 +33,10 @@ Gnome, etc. and used instead. #include #include -#include -#include +#include +#include #include -#include +#include // command line options static TDECmdLineOptions options[] = diff --git a/dcop/HOWTO b/dcop/HOWTO index 7126d3c1d..4c98b6df2 100644 --- a/dcop/HOWTO +++ b/dcop/HOWTO @@ -491,7 +491,7 @@ A few back-of-the-napkin tests folks: Code: -#include +#include int main(int argc, char **argv) { diff --git a/dcop/dcop_deadlock_test.h b/dcop/dcop_deadlock_test.h index 0557e7062..461c53cba 100644 --- a/dcop/dcop_deadlock_test.h +++ b/dcop/dcop_deadlock_test.h @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef _TESTDCOP_H_ #define _TESTDCOP_H_ -#include +#include #include #include diff --git a/dcop/tests/driver.cpp b/dcop/tests/driver.cpp index eb953f1d7..18b983829 100644 --- a/dcop/tests/driver.cpp +++ b/dcop/tests/driver.cpp @@ -1,8 +1,8 @@ #include "driver.h" -#include +#include #include #include -#include +#include #include #include diff --git a/dcop/tests/test.cpp b/dcop/tests/test.cpp index 2be39f601..4a751c358 100644 --- a/dcop/tests/test.cpp +++ b/dcop/tests/test.cpp @@ -1,8 +1,8 @@ #include "test.h" -#include +#include #include #include -#include +#include diff --git a/dnssd/domainbrowser.cpp b/dnssd/domainbrowser.cpp index 2afadb769..229d56f7f 100644 --- a/dnssd/domainbrowser.cpp +++ b/dnssd/domainbrowser.cpp @@ -26,7 +26,7 @@ #include "remoteservice.h" #include "query.h" #include "servicebrowser.h" -#include +#include #ifdef HAVE_DNSSD #ifdef AVAHI_API_0_6 #include diff --git a/interfaces/tdeimproxy/library/tdeimproxy.cpp b/interfaces/tdeimproxy/library/tdeimproxy.cpp index a65388974..c4d77c61e 100644 --- a/interfaces/tdeimproxy/library/tdeimproxy.cpp +++ b/interfaces/tdeimproxy/library/tdeimproxy.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/interfaces/tdescript/sample/shellscript.cpp b/interfaces/tdescript/sample/shellscript.cpp index 9ec34f7a2..766613551 100644 --- a/interfaces/tdescript/sample/shellscript.cpp +++ b/interfaces/tdescript/sample/shellscript.cpp @@ -19,7 +19,7 @@ #include "shellscript.h" #include -#include +#include #include #include diff --git a/interfaces/tdescript/scriptloader.cpp b/interfaces/tdescript/scriptloader.cpp index 65b6604b5..ad6c8df20 100644 --- a/interfaces/tdescript/scriptloader.cpp +++ b/interfaces/tdescript/scriptloader.cpp @@ -18,7 +18,7 @@ */ #include "scriptloader.h" -#include +#include #include #include #include diff --git a/interfaces/tdescript/scriptmanager.cpp b/interfaces/tdescript/scriptmanager.cpp index cd20655d0..42e20cd5b 100644 --- a/interfaces/tdescript/scriptmanager.cpp +++ b/interfaces/tdescript/scriptmanager.cpp @@ -1,7 +1,7 @@ #include "scriptmanager.h" #include #include -#include +#include #include #include diff --git a/interfaces/tdetexteditor/editorchooser.cpp b/interfaces/tdetexteditor/editorchooser.cpp index 331e64bbb..aed904c54 100644 --- a/interfaces/tdetexteditor/editorchooser.cpp +++ b/interfaces/tdetexteditor/editorchooser.cpp @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include "editorchooser_ui.h" diff --git a/interfaces/terminal/test/main.cc b/interfaces/terminal/test/main.cc index 19b820056..bcce6fdbc 100644 --- a/interfaces/terminal/test/main.cc +++ b/interfaces/terminal/test/main.cc @@ -3,9 +3,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/kab/addressbook.cc b/kab/addressbook.cc index 0408a4db7..ab73111be 100644 --- a/kab/addressbook.cc +++ b/kab/addressbook.cc @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/kabc/address.cpp b/kabc/address.cpp index 2fce393e0..46b483b43 100644 --- a/kabc/address.cpp +++ b/kabc/address.cpp @@ -20,7 +20,7 @@ #include "address.h" -#include +#include #include #include #include diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index b31df2b73..8e1eca333 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/kabc/key.cpp b/kabc/key.cpp index fadc89dce..7c66579b3 100644 --- a/kabc/key.cpp +++ b/kabc/key.cpp @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include "key.h" diff --git a/kabc/ldapclient.cpp b/kabc/ldapclient.cpp index f696ae915..1c2b2d833 100644 --- a/kabc/ldapclient.cpp +++ b/kabc/ldapclient.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/kabc/lock.cpp b/kabc/lock.cpp index 42c8c8580..8f64a3c23 100644 --- a/kabc/lock.cpp +++ b/kabc/lock.cpp @@ -20,7 +20,7 @@ #include "lock.h" -#include +#include #include #include #include diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp index 0a58eeec2..adf8566f1 100644 --- a/kabc/phonenumber.cpp +++ b/kabc/phonenumber.cpp @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include "phonenumber.h" diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp index 6b1759f1d..936eea6e4 100644 --- a/kabc/plugins/dir/resourcedir.cpp +++ b/kabc/plugins/dir/resourcedir.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp index 2d2008c0d..7c99782c3 100644 --- a/kabc/plugins/file/resourcefile.cpp +++ b/kabc/plugins/file/resourcefile.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/kabc/scripts/addressee.src.cpp b/kabc/scripts/addressee.src.cpp index b235a70ae..9aff3a708 100644 --- a/kabc/scripts/addressee.src.cpp +++ b/kabc/scripts/addressee.src.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "addresseehelper.h" diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index f3c5b5c0e..c887fcb83 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp @@ -20,7 +20,7 @@ #include -#include +#include #include #include #include diff --git a/kabc/tdeab2tdeabc.cpp b/kabc/tdeab2tdeabc.cpp index 5472f3bc2..f03a80f45 100644 --- a/kabc/tdeab2tdeabc.cpp +++ b/kabc/tdeab2tdeabc.cpp @@ -22,9 +22,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/kabc/tests/bigread.cpp b/kabc/tests/bigread.cpp index bb19379bb..5ea2393dc 100644 --- a/kabc/tests/bigread.cpp +++ b/kabc/tests/bigread.cpp @@ -1,10 +1,10 @@ #include -#include -#include +#include +#include #include #include -#include +#include #include "addressbook.h" #include "vcardformat.h" diff --git a/kabc/tests/bigwrite.cpp b/kabc/tests/bigwrite.cpp index b1f705eb9..167f5d44d 100644 --- a/kabc/tests/bigwrite.cpp +++ b/kabc/tests/bigwrite.cpp @@ -1,10 +1,10 @@ #include -#include -#include +#include +#include #include #include -#include +#include #include "addressbook.h" #include "vcardformat.h" diff --git a/kabc/tests/kabcargl.cpp b/kabc/tests/kabcargl.cpp index 62b1df25e..589c973f2 100644 --- a/kabc/tests/kabcargl.cpp +++ b/kabc/tests/kabcargl.cpp @@ -22,10 +22,10 @@ #include #include -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/kabc/tests/testaddressee.cpp b/kabc/tests/testaddressee.cpp index 956af2b75..09f95d29b 100644 --- a/kabc/tests/testaddressee.cpp +++ b/kabc/tests/testaddressee.cpp @@ -1,8 +1,8 @@ -#include -#include +#include +#include #include #include -#include +#include #include #include "addressbook.h" diff --git a/kabc/tests/testaddresseelist.cpp b/kabc/tests/testaddresseelist.cpp index be14da540..10fa4aaef 100644 --- a/kabc/tests/testaddresseelist.cpp +++ b/kabc/tests/testaddresseelist.cpp @@ -1,8 +1,8 @@ -#include -#include +#include +#include #include #include -#include +#include #include #include "addressbook.h" diff --git a/kabc/tests/testaddressfmt.cpp b/kabc/tests/testaddressfmt.cpp index 0c4ae1439..ca13a116c 100644 --- a/kabc/tests/testaddressfmt.cpp +++ b/kabc/tests/testaddressfmt.cpp @@ -1,8 +1,8 @@ -#include -#include +#include +#include #include #include -#include +#include #include #include "addressbook.h" diff --git a/kabc/tests/testaddresslineedit.cpp b/kabc/tests/testaddresslineedit.cpp index 474b5fc7a..7315aef7e 100644 --- a/kabc/tests/testaddresslineedit.cpp +++ b/kabc/tests/testaddresslineedit.cpp @@ -1,8 +1,8 @@ -#include -#include +#include +#include #include #include -#include +#include #include "addresslineedit.h" diff --git a/kabc/tests/testdb.cpp b/kabc/tests/testdb.cpp index 4759a4bd2..fd4e4f6c1 100644 --- a/kabc/tests/testdb.cpp +++ b/kabc/tests/testdb.cpp @@ -1,8 +1,8 @@ -#include -#include +#include +#include #include #include -#include +#include #include "addressbook.h" #include "vcardformat.h" diff --git a/kabc/tests/testdistlist.cpp b/kabc/tests/testdistlist.cpp index 18e223e9a..0f0e90f90 100644 --- a/kabc/tests/testdistlist.cpp +++ b/kabc/tests/testdistlist.cpp @@ -1,10 +1,10 @@ #include -#include -#include +#include +#include #include #include -#include +#include #include "stdaddressbook.h" diff --git a/kabc/tests/testkabc.cpp b/kabc/tests/testkabc.cpp index b8b9fe3b5..3caea88f1 100644 --- a/kabc/tests/testkabc.cpp +++ b/kabc/tests/testkabc.cpp @@ -1,8 +1,8 @@ -#include -#include +#include +#include #include #include -#include +#include #include #include diff --git a/kabc/tests/testkabcdlg.cpp b/kabc/tests/testkabcdlg.cpp index 183c6a19d..24225cc1b 100644 --- a/kabc/tests/testkabcdlg.cpp +++ b/kabc/tests/testkabcdlg.cpp @@ -1,10 +1,10 @@ #include -#include -#include +#include +#include #include #include -#include +#include #include "addresseedialog.h" diff --git a/kabc/tests/testldapclient.cpp b/kabc/tests/testldapclient.cpp index bb52afd1a..df9fd6226 100644 --- a/kabc/tests/testldapclient.cpp +++ b/kabc/tests/testldapclient.cpp @@ -18,9 +18,9 @@ #include "testldapclient.h" -#include +#include #include -#include +#include #include diff --git a/kabc/tests/testlock.cpp b/kabc/tests/testlock.cpp index 389819ea7..632c690a6 100644 --- a/kabc/tests/testlock.cpp +++ b/kabc/tests/testlock.cpp @@ -23,11 +23,11 @@ #include "stdaddressbook.h" -#include -#include +#include +#include #include #include -#include +#include #include #include diff --git a/kabc/vcard/testwrite.cpp b/kabc/vcard/testwrite.cpp index fe218c0b1..67f8eb20a 100644 --- a/kabc/vcard/testwrite.cpp +++ b/kabc/vcard/testwrite.cpp @@ -1,8 +1,8 @@ -#include -#include +#include +#include #include #include -#include +#include #include diff --git a/kabc/vcardparser/testread.cpp b/kabc/vcardparser/testread.cpp index ebe5f14b2..6c3405ef9 100644 --- a/kabc/vcardparser/testread.cpp +++ b/kabc/vcardparser/testread.cpp @@ -25,10 +25,10 @@ #include #include -#include -#include +#include +#include #include -#include +#include #include "vcardconverter.h" #include "vcard.h" diff --git a/kabc/vcardparser/testwrite.cpp b/kabc/vcardparser/testwrite.cpp index 73d462d4a..5a58bd8a8 100644 --- a/kabc/vcardparser/testwrite.cpp +++ b/kabc/vcardparser/testwrite.cpp @@ -24,9 +24,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/kate/part/kateconfig.cpp b/kate/part/kateconfig.cpp index d1c9fd1ee..9c8e0856f 100644 --- a/kate/part/kateconfig.cpp +++ b/kate/part/kateconfig.cpp @@ -27,7 +27,7 @@ #include -#include +#include #include #include #include diff --git a/kate/part/katedialogs.cpp b/kate/part/katedialogs.cpp index 35a836072..03257735c 100644 --- a/kate/part/katedialogs.cpp +++ b/kate/part/katedialogs.cpp @@ -43,7 +43,7 @@ #include #include -#include +#include #include #include #include diff --git a/kate/part/katedocument.cpp b/kate/part/katedocument.cpp index 22a207fac..1928ec225 100644 --- a/kate/part/katedocument.cpp +++ b/kate/part/katedocument.cpp @@ -51,7 +51,7 @@ #include #include -#include +#include #include #include #include diff --git a/kate/part/katefactory.h b/kate/part/katefactory.h index bca0fe8a9..72fef8781 100644 --- a/kate/part/katefactory.h +++ b/kate/part/katefactory.h @@ -24,7 +24,7 @@ #include #include -#include +#include // katepart version must be a string in double quotes, format: "x.x" #define KATEPART_VERSION "2.5" diff --git a/kate/part/katehighlight.cpp b/kate/part/katehighlight.cpp index 3c84007eb..f6d5ae315 100644 --- a/kate/part/katehighlight.cpp +++ b/kate/part/katehighlight.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include diff --git a/kate/part/kateprinter.cpp b/kate/part/kateprinter.cpp index 77ed4dcca..6f22b2407 100644 --- a/kate/part/kateprinter.cpp +++ b/kate/part/kateprinter.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include // for spacingHint() diff --git a/kate/part/kateschema.cpp b/kate/part/kateschema.cpp index 8f4f03a10..388513f17 100644 --- a/kate/part/kateschema.cpp +++ b/kate/part/kateschema.cpp @@ -38,8 +38,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/kate/part/kateview.cpp b/kate/part/kateview.cpp index dc82922a3..92d1bb97e 100644 --- a/kate/part/kateview.cpp +++ b/kate/part/kateview.cpp @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kate/part/kateviewhelpers.cpp b/kate/part/kateviewhelpers.cpp index ef70e3449..e8df70aa8 100644 --- a/kate/part/kateviewhelpers.cpp +++ b/kate/part/kateviewhelpers.cpp @@ -32,7 +32,7 @@ #include "kateview.h" #include "kateviewinternal.h" -#include +#include #include #include #include diff --git a/kate/part/kateviewinternal.cpp b/kate/part/kateviewinternal.cpp index bea6ba3bc..a687c5523 100644 --- a/kate/part/kateviewinternal.cpp +++ b/kate/part/kateviewinternal.cpp @@ -37,7 +37,7 @@ #include #include -#include +#include #include #include diff --git a/kate/part/test_regression.cpp b/kate/part/test_regression.cpp index 5c10143ea..a503020c3 100644 --- a/kate/part/test_regression.cpp +++ b/kate/part/test_regression.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include #include @@ -40,7 +40,7 @@ #include #include -#include +#include #include "katefactory.h" #include #include diff --git a/kate/plugins/autobookmarker/autobookmarker.cpp b/kate/plugins/autobookmarker/autobookmarker.cpp index 4e0d70b86..495233d40 100644 --- a/kate/plugins/autobookmarker/autobookmarker.cpp +++ b/kate/plugins/autobookmarker/autobookmarker.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/kate/plugins/wordcompletion/docwordcompletion.cpp b/kate/plugins/wordcompletion/docwordcompletion.cpp index 5041cc8ad..4a3d34207 100644 --- a/kate/plugins/wordcompletion/docwordcompletion.cpp +++ b/kate/plugins/wordcompletion/docwordcompletion.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include #include diff --git a/kded/kded.cpp b/kded/kded.cpp index 774712e0e..b6e6b523f 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -36,8 +36,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 227106eea..7585e0ad0 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -28,10 +28,10 @@ #include -#include -#include +#include +#include #include -#include +#include #include #include #include diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp index fa2d220af..4ad6bc3db 100644 --- a/kded/tde-menu.cpp +++ b/kded/tde-menu.cpp @@ -23,9 +23,9 @@ #include #include -#include "kaboutdata.h" -#include "kapplication.h" -#include "kcmdlineargs.h" +#include "tdeaboutdata.h" +#include "tdeapplication.h" +#include "tdecmdlineargs.h" #include "kglobal.h" #include "klocale.h" #include "kservice.h" diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index 74eba4a1b..aa03c2c94 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include @@ -48,8 +48,8 @@ #include #include #include -#include -#include +#include +#include #include #ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build diff --git a/kded/tdemimelist.cpp b/kded/tdemimelist.cpp index c82f6d9f7..673520e52 100644 --- a/kded/tdemimelist.cpp +++ b/kded/tdemimelist.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include diff --git a/kdewidgets/makekdewidgets.cpp b/kdewidgets/makekdewidgets.cpp index e6208de0f..5e1338595 100644 --- a/kdewidgets/makekdewidgets.cpp +++ b/kdewidgets/makekdewidgets.cpp @@ -1,7 +1,7 @@ /* Copyright (C) 2004-2005 ian reinhart geiser */ -#include +#include #include -#include +#include #include #include #include diff --git a/kdoctools/meinproc.cpp b/kdoctools/meinproc.cpp index 730dd38d0..d0a1b7323 100644 --- a/kdoctools/meinproc.cpp +++ b/kdoctools/meinproc.cpp @@ -18,9 +18,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/kimgio/eps.cpp b/kimgio/eps.cpp index a323feace..d839ffe30 100644 --- a/kimgio/eps.cpp +++ b/kimgio/eps.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include "eps.h" diff --git a/kinit/kinit.cpp b/kinit/kinit.cpp index c1ba0920d..f6b4a3e59 100644 --- a/kinit/kinit.cpp +++ b/kinit/kinit.cpp @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #ifdef HAVE_SYS_PRCTL_H diff --git a/kinit/tdelauncher_main.cpp b/kinit/tdelauncher_main.cpp index 3ceadf84c..d59cfb86f 100644 --- a/kinit/tdelauncher_main.cpp +++ b/kinit/tdelauncher_main.cpp @@ -22,9 +22,9 @@ #include #include -#include "kapplication.h" +#include "tdeapplication.h" #include "tdelauncher.h" -#include "kcmdlineargs.h" +#include "tdecmdlineargs.h" #include "kcrash.h" #include "kdebug.h" #include diff --git a/kinit/tests/tdelaunchertest.cpp b/kinit/tests/tdelaunchertest.cpp index a8989870b..07eaf21f7 100644 --- a/kinit/tests/tdelaunchertest.cpp +++ b/kinit/tests/tdelaunchertest.cpp @@ -19,7 +19,7 @@ */ #include -#include +#include #include #include #include diff --git a/knewstuff/downloaddialog.cpp b/knewstuff/downloaddialog.cpp index 4ca68fbcb..ccbde83d6 100644 --- a/knewstuff/downloaddialog.cpp +++ b/knewstuff/downloaddialog.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/knewstuff/engine.cpp b/knewstuff/engine.cpp index 063c2c7b9..a22750f8b 100644 --- a/knewstuff/engine.cpp +++ b/knewstuff/engine.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/knewstuff/ghns.cpp b/knewstuff/ghns.cpp index 6c0c2a9fc..dfe86a2a4 100644 --- a/knewstuff/ghns.cpp +++ b/knewstuff/ghns.cpp @@ -25,11 +25,11 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include diff --git a/knewstuff/ghns.h b/knewstuff/ghns.h index 727dc6a0f..74efc007e 100644 --- a/knewstuff/ghns.h +++ b/knewstuff/ghns.h @@ -25,7 +25,7 @@ #include -#include +#include #include #include "knewstuff.h" diff --git a/knewstuff/knewstuff.cpp b/knewstuff/knewstuff.cpp index 7727783bb..07034b454 100644 --- a/knewstuff/knewstuff.cpp +++ b/knewstuff/knewstuff.cpp @@ -19,7 +19,7 @@ */ #include -#include +#include #include #include #include diff --git a/knewstuff/tdehotnewstuff.cpp b/knewstuff/tdehotnewstuff.cpp index 5a496328b..87d735330 100644 --- a/knewstuff/tdehotnewstuff.cpp +++ b/knewstuff/tdehotnewstuff.cpp @@ -18,11 +18,11 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include -#include -#include +#include +#include #include "downloaddialog.h" diff --git a/knewstuff/testnewstuff.cpp b/knewstuff/testnewstuff.cpp index db8e255ff..82b6d18f7 100644 --- a/knewstuff/testnewstuff.cpp +++ b/knewstuff/testnewstuff.cpp @@ -24,11 +24,11 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include diff --git a/knewstuff/testnewstuff.h b/knewstuff/testnewstuff.h index 3af0d68cc..a7bc5710f 100644 --- a/knewstuff/testnewstuff.h +++ b/knewstuff/testnewstuff.h @@ -25,7 +25,7 @@ #include -#include +#include #include #include "knewstuff.h" diff --git a/knewstuff/uploaddialog.cpp b/knewstuff/uploaddialog.cpp index 72ba4a2c4..98f8f60c7 100644 --- a/knewstuff/uploaddialog.cpp +++ b/knewstuff/uploaddialog.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include "engine.h" diff --git a/kstyles/asteroid/asteroid.h b/kstyles/asteroid/asteroid.h index 52d18291b..d6be130aa 100644 --- a/kstyles/asteroid/asteroid.h +++ b/kstyles/asteroid/asteroid.h @@ -7,7 +7,7 @@ #ifndef __ASTEROID_H #define __ASTEROID_H -#include +#include class AsteroidStyle : public TDEStyle { diff --git a/kstyles/highcolor/highcolor.h b/kstyles/highcolor/highcolor.h index 33ded2d17..7fa618a92 100644 --- a/kstyles/highcolor/highcolor.h +++ b/kstyles/highcolor/highcolor.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include enum GradientType{ VSmall=0, VMed, VLarge, HMed, HLarge, GradientCount }; diff --git a/kstyles/highcontrast/highcontrast.cpp b/kstyles/highcontrast/highcontrast.cpp index 0b2e677b1..af021a91a 100644 --- a/kstyles/highcontrast/highcontrast.cpp +++ b/kstyles/highcontrast/highcontrast.cpp @@ -776,7 +776,7 @@ void HighContrastStyle::drawTDEStylePrimitive (TDEStylePrimitive kpe, break; } case KPE_ListViewBranch: - // TODO Draw (thick) dotted line. Check kstyle.cpp + // TODO Draw (thick) dotted line. Check tdestyle.cpp // Fall down for now default: TDEStyle::drawTDEStylePrimitive( kpe, p, ceData, elementFlags, r, cg, flags, opt, widget); @@ -1194,7 +1194,7 @@ void HighContrastStyle::drawControlMask (TQ_ControlElement element, } // Helper to find the next sibling that's not hidden -// Lifted from kstyle.cpp +// Lifted from tdestyle.cpp static TQListViewItem* nextVisibleSibling(TQListViewItem* item) { TQListViewItem* sibling = item; @@ -1329,7 +1329,7 @@ void HighContrastStyle::drawComplexControl (TQ_ComplexControl control, // ------------------------------------------------------------------- case CC_ListView: { /* - * Sigh... Lifted and modified from kstyle.cpp + * Sigh... Lifted and modified from tdestyle.cpp */ /* * Many thanks to TrollTech AS for donating CC_ListView from TQWindowsStyle. diff --git a/kstyles/highcontrast/highcontrast.h b/kstyles/highcontrast/highcontrast.h index 1a721e8c6..552526254 100644 --- a/kstyles/highcontrast/highcontrast.h +++ b/kstyles/highcontrast/highcontrast.h @@ -41,7 +41,7 @@ #include #include #include -#include +#include class TQPopupMenu; diff --git a/kstyles/keramik/keramik.h b/kstyles/keramik/keramik.h index 02ec9499e..7bf8cd3d4 100644 --- a/kstyles/keramik/keramik.h +++ b/kstyles/keramik/keramik.h @@ -33,7 +33,7 @@ #define __keramik_h__ #include -#include +#include #include "pixmaploader.h" diff --git a/kstyles/klegacy/klegacystyle.h b/kstyles/klegacy/klegacystyle.h index ee3cecfe5..f82fd5d0a 100644 --- a/kstyles/klegacy/klegacystyle.h +++ b/kstyles/klegacy/klegacystyle.h @@ -25,7 +25,7 @@ #ifndef __KLegacyStyle_hh #define __KLegacyStyle_hh -#include +#include // forward declaration class KLegacyStylePrivate; diff --git a/kstyles/kthemestyle/kthemebase.h b/kstyles/kthemestyle/kthemebase.h index faef98dfd..1e16bcee7 100644 --- a/kstyles/kthemestyle/kthemebase.h +++ b/kstyles/kthemestyle/kthemebase.h @@ -34,7 +34,7 @@ Copyright (C) 1998, 1999, 2000 KDE Team #include #include #include -#include +#include #include #include // for QColorGroup #include "kstyledirs.h" diff --git a/kstyles/light/lightstyle-v2.h b/kstyles/light/lightstyle-v2.h index 75d096a4b..90b3e89c9 100644 --- a/kstyles/light/lightstyle-v2.h +++ b/kstyles/light/lightstyle-v2.h @@ -24,7 +24,7 @@ #define LIGHTSTYLE_V2_H -#include +#include #ifdef QT_PLUGIN diff --git a/kstyles/light/lightstyle-v3.h b/kstyles/light/lightstyle-v3.h index 7ce62c3a8..0330c8f87 100644 --- a/kstyles/light/lightstyle-v3.h +++ b/kstyles/light/lightstyle-v3.h @@ -28,7 +28,7 @@ #include #endif // QT_H -#include "kstyle.h" +#include "tdestyle.h" #ifdef QT_PLUGIN # define Q_EXPORT_STYLE_LIGHT_V3 diff --git a/kstyles/plastik/plastik.h b/kstyles/plastik/plastik.h index 7c3e0484b..68f707d79 100644 --- a/kstyles/plastik/plastik.h +++ b/kstyles/plastik/plastik.h @@ -39,7 +39,7 @@ #ifndef __PLASTIK_H #define __PLASTIK_H -#include +#include #include #include diff --git a/kstyles/utils/installtheme/main.cpp b/kstyles/utils/installtheme/main.cpp index 67e29f706..274c2d335 100644 --- a/kstyles/utils/installtheme/main.cpp +++ b/kstyles/utils/installtheme/main.cpp @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/kstyles/web/webstyle.cpp b/kstyles/web/webstyle.cpp index aca43fb74..d96688ee0 100644 --- a/kstyles/web/webstyle.cpp +++ b/kstyles/web/webstyle.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include #include diff --git a/kstyles/web/webstyle.h b/kstyles/web/webstyle.h index 68f83c99b..0e4c59dbd 100644 --- a/kstyles/web/webstyle.h +++ b/kstyles/web/webstyle.h @@ -20,7 +20,7 @@ #ifndef WEB_STYLE_H #define WEB_STYLE_H -#include +#include #include class TQPainter; diff --git a/libtdescreensaver/main.cpp b/libtdescreensaver/main.cpp index aa4fa8395..f9d8ccb17 100644 --- a/libtdescreensaver/main.cpp +++ b/libtdescreensaver/main.cpp @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include #include #include "tdescreensaver.h" diff --git a/libtdescreensaver/tdescreensaver.cpp b/libtdescreensaver/tdescreensaver.cpp index 4474e5874..30120b164 100644 --- a/libtdescreensaver/tdescreensaver.cpp +++ b/libtdescreensaver/tdescreensaver.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include "tdescreensaver.h" #ifdef Q_WS_X11 #include diff --git a/networkstatus/connectionmanager.cpp b/networkstatus/connectionmanager.cpp index 29174e773..c37214ecd 100644 --- a/networkstatus/connectionmanager.cpp +++ b/networkstatus/connectionmanager.cpp @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include #include diff --git a/networkstatus/networkstatus.cpp b/networkstatus/networkstatus.cpp index ed7c402f3..41bff9edb 100644 --- a/networkstatus/networkstatus.cpp +++ b/networkstatus/networkstatus.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include "clientifaceimpl.h" diff --git a/networkstatus/testservice.cpp b/networkstatus/testservice.cpp index 1611721ba..809d9cd0b 100644 --- a/networkstatus/testservice.cpp +++ b/networkstatus/testservice.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "provideriface.h" #include "testservice.h" diff --git a/tdecert/tdecertpart.cc b/tdecert/tdecertpart.cc index b02981e44..7c84f31d1 100644 --- a/tdecert/tdecertpart.cc +++ b/tdecert/tdecertpart.cc @@ -22,7 +22,7 @@ #include "tdecertpart.h" #include #include -#include +#include #include #include #include diff --git a/tdecmshell/main.cpp b/tdecmshell/main.cpp index 2174dfc36..3d54abc45 100644 --- a/tdecmshell/main.cpp +++ b/tdecmshell/main.cpp @@ -27,9 +27,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/tdecmshell/main.h b/tdecmshell/main.h index f135c2a33..e97145a82 100644 --- a/tdecmshell/main.h +++ b/tdecmshell/main.h @@ -24,7 +24,7 @@ #include -#include +#include #include /** diff --git a/tdeconf_update/tdeconf_update.cpp b/tdeconf_update/tdeconf_update.cpp index 208faa503..458b3b523 100644 --- a/tdeconf_update/tdeconf_update.cpp +++ b/tdeconf_update/tdeconf_update.cpp @@ -31,10 +31,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include diff --git a/tdecore/CMakeLists.txt b/tdecore/CMakeLists.txt index 871190eac..850bb10f2 100644 --- a/tdecore/CMakeLists.txt +++ b/tdecore/CMakeLists.txt @@ -71,8 +71,8 @@ link_directories( install( FILES tdeconfig.h tdeconfigskeleton.h tdeconfigdata.h ksimpleconfig.h tdeconfigdialogmanager.h tdeconfigbase.h kdesktopfile.h - kurl.h ksock.h kaboutdata.h kcmdlineargs.h tdeconfigbackend.h - kapp.h kapplication.h kuniqueapp.h kuniqueapplication.h + kurl.h ksock.h tdeaboutdata.h tdecmdlineargs.h tdeconfigbackend.h + kapp.h tdeapplication.h kuniqueapp.h kuniqueapplication.h kcharsets.h tdeversion.h kpty.h kprocess.h kprocctrl.h klocale.h kicontheme.h kiconloader.h kdebug.h twinmodule.h twin.h krootprop.h tdeshortcut.h kkeynative.h tdeaccel.h @@ -120,7 +120,7 @@ install( FILES eventsrc set( target tdecore ) set( ${target}_SRCS - libintl.cpp kapplication.cpp kdebug.cpp netwm.cpp + libintl.cpp tdeapplication.cpp kdebug.cpp netwm.cpp tdeconfigbase.cpp tdeconfig.cpp ksimpleconfig.cpp tdeconfigbackend.cpp kmanagerselection.cpp kdesktopfile.cpp kstandarddirs.cpp ksock.cpp kpty.cpp kprocess.cpp kprocctrl.cpp klocale.cpp @@ -134,7 +134,7 @@ set( ${target}_SRCS kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp ktempfile.cpp kuniqueapplication.cpp tdeaccelmanager.cpp ksavefile.cpp krandomsequence.cpp kstringhandler.cpp kcompletion.cpp - kcmdlineargs.cpp kaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp + tdecmdlineargs.cpp tdeaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp kaudioplayer.cpp kdcoppropertyproxy.cpp ksockaddr.cpp kextsock.cpp netsupp.cpp kprocio.cpp kbufferedio.cpp kpixmapprovider.cpp kurldrag.cpp kmdcodec.cpp ksocks.cpp diff --git a/tdecore/MAINTAINERS b/tdecore/MAINTAINERS index 2b171743c..e4a9ad80d 100644 --- a/tdecore/MAINTAINERS +++ b/tdecore/MAINTAINERS @@ -6,18 +6,18 @@ When adding yourself as a maintainer, don't be afraid to reorder the files to a more logical grouping. dmalloc.cpp -kaboutdata.cpp David Faure +tdeaboutdata.cpp David Faure tdeaccel.cpp Ellis Whitehead tdeaccelaction.cpp Ellis Whitehead tdeaccelbase.cpp Ellis Whitehead kallocator.cpp Waldo Bastian kappdcopiface.cpp -kapplication.cpp Waldo Bastian +tdeapplication.cpp Waldo Bastian kaudioplayer.cpp kcatalogue.cpp Hans Petter Bieker kcharsets.cpp Lars Knoll kckey.cpp -kcmdlineargs.cpp Waldo Bastian +tdecmdlineargs.cpp Waldo Bastian kcompletion.cpp Carsten Pfeiffer kcompletionbase.cpp tdeconfig.cpp Waldo Bastian diff --git a/tdecore/Makefile.am b/tdecore/Makefile.am index 332e178ea..ae5048ed9 100644 --- a/tdecore/Makefile.am +++ b/tdecore/Makefile.am @@ -38,8 +38,8 @@ lib_LIBRARIES = libtdefakes_nonpic.a libtdefakes_pic.a include_HEADERS = tdeconfig.h tdeconfigskeleton.h \ tdeconfigdata.h ksimpleconfig.h tdeconfigdialogmanager.h \ - tdeconfigbase.h kdesktopfile.h kurl.h ksock.h kaboutdata.h \ - kcmdlineargs.h tdeconfigbackend.h kapp.h kapplication.h kuniqueapp.h \ + tdeconfigbase.h kdesktopfile.h kurl.h ksock.h tdeaboutdata.h \ + tdecmdlineargs.h tdeconfigbackend.h kapp.h tdeapplication.h kuniqueapp.h \ kuniqueapplication.h kcharsets.h tdeversion.h kpty.h kprocess.h \ kprocctrl.h klocale.h kicontheme.h kiconloader.h kdebug.h \ twinmodule.h twin.h krootprop.h tdeshortcut.h kkeynative.h tdeaccel.h \ @@ -89,7 +89,7 @@ noinst_HEADERS = tdeaccelaction.h tdeaccelbase.h tdeaccelprivate.h kckey.h \ kcalendarsystemhijri.h kcalendarsystemhebrew.h kcalendarsystemjalali.h \ kprotocolinfofactory.h kqiodevicegzip_p.h kiconloader_p.h -libtdecore_la_SOURCES = libintl.cpp kapplication.cpp \ +libtdecore_la_SOURCES = libintl.cpp tdeapplication.cpp \ kdebug.cpp netwm.cpp tdeconfigbase.cpp tdeconfig.cpp ksimpleconfig.cpp \ tdeconfigbackend.cpp kmanagerselection.cpp kdesktopfile.cpp \ kstandarddirs.cpp ksock.cpp kpty.cpp kprocess.cpp kprocctrl.cpp \ @@ -103,7 +103,7 @@ libtdecore_la_SOURCES = libintl.cpp kapplication.cpp \ kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp ktempfile.cpp \ kuniqueapplication.cpp tdeaccelmanager.cpp \ ksavefile.cpp krandomsequence.cpp kstringhandler.cpp kcompletion.cpp \ - kcmdlineargs.cpp kaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp \ + tdecmdlineargs.cpp tdeaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp \ kaudioplayer.cpp kdcoppropertyproxy.cpp \ ksockaddr.cpp kextsock.cpp netsupp.cpp kprocio.cpp kbufferedio.cpp \ kpixmapprovider.cpp kurldrag.cpp \ diff --git a/tdecore/kaboutdata.cpp b/tdecore/kaboutdata.cpp deleted file mode 100644 index c5055e4dc..000000000 --- a/tdecore/kaboutdata.cpp +++ /dev/null @@ -1,512 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Espen Sand (espen@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 -#include -#include -#include - -TQString -TDEAboutPerson::name() const -{ - return TQString::fromUtf8(mName); -} - -TQString -TDEAboutPerson::task() const -{ - if (mTask && *mTask) - return i18n(mTask); - else - return TQString::null; -} - -TQString -TDEAboutPerson::emailAddress() const -{ - return TQString::fromUtf8(mEmailAddress); -} - - -TQString -TDEAboutPerson::webAddress() const -{ - return TQString::fromUtf8(mWebAddress); -} - - -TDEAboutTranslator::TDEAboutTranslator(const TQString & name, - const TQString & emailAddress) -{ - mName=name; - mEmail=emailAddress; -} - -TQString TDEAboutTranslator::name() const -{ - return mName; -} - -TQString TDEAboutTranslator::emailAddress() const -{ - return mEmail; -} - -class TDEAboutDataPrivate -{ -public: - TDEAboutDataPrivate() - : translatorName("_: NAME OF TRANSLATORS\nYour names") - , translatorEmail("_: EMAIL OF TRANSLATORS\nYour emails") - , productName(0) - , programLogo(0) - , customAuthorTextEnabled(false) - , mTranslatedProgramName( 0 ) - {} - ~TDEAboutDataPrivate() - { - delete programLogo; - delete[] mTranslatedProgramName; - } - const char *translatorName; - const char *translatorEmail; - const char *productName; - TQImage* programLogo; - TQString customAuthorPlainText, customAuthorRichText; - bool customAuthorTextEnabled; - const char *mTranslatedProgramName; -}; - -const char *TDEAboutData::defaultBugTracker = "http://bugs.trinitydesktop.org"; - -TDEAboutData::TDEAboutData( const char *appName, - const char *programName, - const char *version, - const char *shortDescription, - int licenseType, - const char *copyrightStatement, - const char *text, - const char *homePageAddress, - const char *bugsEmailAddress - ) : - mProgramName( programName ), - mVersion( version ), - mShortDescription( shortDescription ), - mLicenseKey( licenseType ), - mCopyrightStatement( copyrightStatement ), - mOtherText( text ), - mHomepageAddress( homePageAddress ), - mBugEmailAddress( (bugsEmailAddress!=0)?bugsEmailAddress:defaultBugTracker ), - mLicenseText (0) -{ - d = new TDEAboutDataPrivate; - - if( appName ) { - const char *p = strrchr(appName, '/'); - if( p ) - mAppName = p+1; - else - mAppName = appName; - } else - mAppName = 0; -} - -TDEAboutData::~TDEAboutData() -{ - if (mLicenseKey == License_File) - delete [] mLicenseText; - delete d; -} - -void -TDEAboutData::addAuthor( const char *name, const char *task, - const char *emailAddress, const char *webAddress ) -{ - mAuthorList.append(TDEAboutPerson(name,task,emailAddress,webAddress)); -} - -void -TDEAboutData::addCredit( const char *name, const char *task, - const char *emailAddress, const char *webAddress ) -{ - mCreditList.append(TDEAboutPerson(name,task,emailAddress,webAddress)); -} - -void -TDEAboutData::setTranslator( const char *name, const char *emailAddress) -{ - d->translatorName=name; - d->translatorEmail=emailAddress; -} - -void -TDEAboutData::setLicenseText( const char *licenseText ) -{ - mLicenseText = licenseText; - mLicenseKey = License_Custom; -} - -void -TDEAboutData::setLicenseTextFile( const TQString &file ) -{ - mLicenseText = tqstrdup(TQFile::encodeName(file)); - mLicenseKey = License_File; -} - -void -TDEAboutData::setAppName( const char *appName ) -{ - mAppName = appName; -} - -void -TDEAboutData::setProgramName( const char* programName ) -{ - mProgramName = programName; - translateInternalProgramName(); -} - -void -TDEAboutData::setVersion( const char* version ) -{ - mVersion = version; -} - -void -TDEAboutData::setShortDescription( const char *shortDescription ) -{ - mShortDescription = shortDescription; -} - -void -TDEAboutData::setLicense( LicenseKey licenseKey) -{ - mLicenseKey = licenseKey; -} - -void -TDEAboutData::setCopyrightStatement( const char *copyrightStatement ) -{ - mCopyrightStatement = copyrightStatement; -} - -void -TDEAboutData::setOtherText( const char *otherText ) -{ - mOtherText = otherText; -} - -void -TDEAboutData::setHomepage( const char *homepage ) -{ - mHomepageAddress = homepage; -} - -void -TDEAboutData::setBugAddress( const char *bugAddress ) -{ - mBugEmailAddress = bugAddress; -} - -void -TDEAboutData::setProductName( const char *productName ) -{ - d->productName = productName; -} - -const char * -TDEAboutData::appName() const -{ - return mAppName; -} - -const char * -TDEAboutData::productName() const -{ - if (d->productName) - return d->productName; - else - return appName(); -} - -TQString -TDEAboutData::programName() const -{ - if (mProgramName && *mProgramName) - return i18n(mProgramName); - else - return TQString::null; -} - -const char* -TDEAboutData::internalProgramName() const -{ - if (d->mTranslatedProgramName) - return d->mTranslatedProgramName; - else - return mProgramName; -} - -// TDECrash should call as few things as possible and should avoid e.g. malloc() -// because it may deadlock. Since i18n() needs it, when TDELocale is available -// the i18n() call will be done here in advance. -void -TDEAboutData::translateInternalProgramName() const -{ - delete[] d->mTranslatedProgramName; - d->mTranslatedProgramName = 0; - if( TDEGlobal::locale() ) - d->mTranslatedProgramName = tqstrdup( programName().utf8()); -} - -TQImage -TDEAboutData::programLogo() const -{ - return d->programLogo ? (*d->programLogo) : TQImage(); -} - -void -TDEAboutData::setProgramLogo(const TQImage& image) -{ - if (!d->programLogo) - d->programLogo = new TQImage( image ); - else - *d->programLogo = image; -} - -TQString -TDEAboutData::version() const -{ - return TQString::fromLatin1(mVersion); -} - -TQString -TDEAboutData::shortDescription() const -{ - if (mShortDescription && *mShortDescription) - return i18n(mShortDescription); - else - return TQString::null; -} - -TQString -TDEAboutData::homepage() const -{ - return TQString::fromLatin1(mHomepageAddress); -} - -TQString -TDEAboutData::bugAddress() const -{ - return TQString::fromLatin1(mBugEmailAddress); -} - -const TQValueList -TDEAboutData::authors() const -{ - return mAuthorList; -} - -const TQValueList -TDEAboutData::credits() const -{ - return mCreditList; -} - -const TQValueList -TDEAboutData::translators() const -{ - TQValueList personList; - - if(d->translatorName == 0) - return personList; - - TQStringList nameList; - TQStringList emailList; - - TQString names = i18n(d->translatorName); - if(names != TQString::fromUtf8(d->translatorName)) - { - nameList = TQStringList::split(',',names); - } - - - if(d->translatorEmail) - { - TQString emails = i18n(d->translatorEmail); - - if(emails != TQString::fromUtf8(d->translatorEmail)) - { - emailList = TQStringList::split(',',emails,true); - } - } - - - TQStringList::Iterator nit; - TQStringList::Iterator eit=emailList.begin(); - - for(nit = nameList.begin(); nit != nameList.end(); ++nit) - { - TQString email; - if(eit != emailList.end()) - { - email=*eit; - ++eit; - } - - TQString name=*nit; - - personList.append(TDEAboutTranslator(name.stripWhiteSpace(), email.stripWhiteSpace())); - } - - return personList; -} - -TQString -TDEAboutData::aboutTranslationTeam() -{ - return i18n("replace this with information about your translation team", - "

    KDE is translated into many languages thanks to the work " - "of the translation teams all over the world.

    " - "

    For more information on KDE internationalization " - "visit http://l10n.kde.org

    " - ); -} - -TQString -TDEAboutData::otherText() const -{ - if (mOtherText && *mOtherText) - return i18n(mOtherText); - else - return TQString::null; -} - - -TQString -TDEAboutData::license() const -{ - TQString result; - if (!copyrightStatement().isEmpty()) - result = copyrightStatement() + "\n\n"; - - TQString l; - TQString f; - switch ( mLicenseKey ) - { - case License_File: - f = TQFile::decodeName(mLicenseText); - break; - case License_GPL_V2: - l = "GPL v2"; - f = locate("data", "LICENSES/GPL_V2"); - break; - case License_LGPL_V2: - l = "LGPL v2"; - f = locate("data", "LICENSES/LGPL_V2"); - break; - case License_BSD: - l = "BSD License"; - f = locate("data", "LICENSES/BSD"); - break; - case License_Artistic: - l = "Artistic License"; - f = locate("data", "LICENSES/ARTISTIC"); - break; - case License_QPL_V1_0: - l = "QPL v1.0"; - f = locate("data", "LICENSES/QPL_V1.0"); - break; - case License_Custom: - if (mLicenseText && *mLicenseText) - return( i18n(mLicenseText) ); - // fall through - default: - result += i18n("No licensing terms for this program have been specified.\n" - "Please check the documentation or the source for any\n" - "licensing terms.\n"); - return result; - } - - if (!l.isEmpty()) - result += i18n("This program is distributed under the terms of the %1.").arg( l ); - - if (!f.isEmpty()) - { - TQFile file(f); - if (file.open(IO_ReadOnly)) - { - result += '\n'; - result += '\n'; - TQTextStream str(&file); - result += str.read(); - } - } - - return result; -} - -TQString -TDEAboutData::copyrightStatement() const -{ - if (mCopyrightStatement && *mCopyrightStatement) - return i18n(mCopyrightStatement); - else - return TQString::null; -} - -TQString -TDEAboutData::customAuthorPlainText() const -{ - return d->customAuthorPlainText; -} - -TQString -TDEAboutData::customAuthorRichText() const -{ - return d->customAuthorRichText; -} - -bool -TDEAboutData::customAuthorTextEnabled() const -{ - return d->customAuthorTextEnabled; -} - -void -TDEAboutData::setCustomAuthorText(const TQString &plainText, const TQString &richText) -{ - d->customAuthorPlainText = plainText; - d->customAuthorRichText = richText; - - d->customAuthorTextEnabled = true; -} - -void -TDEAboutData::unsetCustomAuthorText() -{ - d->customAuthorPlainText = TQString::null; - d->customAuthorRichText = TQString::null; - - d->customAuthorTextEnabled = false; -} - diff --git a/tdecore/kaboutdata.h b/tdecore/kaboutdata.h deleted file mode 100644 index d5addac0a..000000000 --- a/tdecore/kaboutdata.h +++ /dev/null @@ -1,630 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Espen Sand (espen@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 -#include -#include -#include - -#ifndef _KABOUTDATA_H_ -#define _KABOUTDATA_H_ - -class TDEAboutPersonPrivate; -class TDEAboutDataPrivate; - -/** - * This structure is used to store information about a person or developer. - * It can store the person's name, a task, an email address and a - * link to a home page. This class is intended for use in the - * TDEAboutData class, but it can be used elsewhere as well. - * Normally you should at least define the person's name. - * - * Example Usage within a main(): - * - * \code - * TDEAboutData about("khello", I18N_NOOP("KHello"), "0.1", - * I18N_NOOP("A TDE version of Hello, world!"), - * TDEAboutData::License_LGPL, - * I18N_NOOP("Copyright (c) 2003 Developer")); - * - * about.addAuthor("Joe Developer", I18N_NOOP("developer"), "joe@host.com", 0); - * about.addCredit("Joe User", I18N_NOOP("A lot of bug reports"), - * "joe.user@host.org", 0); - * TDECmdLineArgs::init(argc, argv, &about); - * \endcode - */ -class TDECORE_EXPORT TDEAboutPerson -{ -public: - /** - * Convenience constructor - * - * @param name The name of the person. - * - * @param task The task of this person. This string should be - * marked for translation, e.g. - * I18N_NOOP("Task description....") - * - * @param emailAddress The email address of the person. - * - * @param webAddress Home page of the person. - */ - TDEAboutPerson( const char *name, const char *task, - const char *emailAddress, const char *webAddress ) - { - mName = name; - mTask = task; - mEmailAddress = emailAddress; - mWebAddress = webAddress; - } - /** - * @internal - * Don't use. Required by QValueList - */ - TDEAboutPerson() {} - - /** - * The person's name - * @return the person's name (can be TQString::null, if it has been - * constructed with a null name) - */ - TQString name() const; - - /** - * The person's task - * @return the person's task (can be TQString::null, if it has been - * constructed with a null task) - */ - TQString task() const; - - /** - * The person's email address - * @return the person's email address (can be TQString::null, if it has been - * constructed with a null email) - */ - TQString emailAddress() const; - - /** - * The home page or a relevant link - * @return the persons home page (can be TQString::null, if it has been - * constructed with a null home page) - */ - TQString webAddress() const; - -private: - const char *mName; - const char *mTask; - const char *mEmailAddress; - const char *mWebAddress; - - TDEAboutPersonPrivate *d; -}; - -class TDEAboutTranslatorPrivate; -/** - * This structure is used to store information about a translator. - * It can store the translator's name and an email address. - * This class is intended for use in the TDEAboutData class, - * but it can be used elsewhere as well. - * Normally you should at least define the translator's name. - * - * It's not possible to use TDEAboutPerson for this, because - * TDEAboutPerson stores internally only const char* pointers, but the - * translator information is generated dynamically from the translation - * of a dummy string. -*/ -class TDECORE_EXPORT TDEAboutTranslator -{ -public: - /** - * Convenience constructor - * - * @param name The name of the person. - * - * @param emailAddress The email address of the person. - */ - TDEAboutTranslator(const TQString & name=TQString::null, - const TQString & emailAddress=TQString::null); - - /** - * The translator's name - * @return the translators's name (can be TQString::null, if it has been - * constructed with a null name) - */ - TQString name() const; - - /** - * The translator's email - * @return the translator's email address (can be TQString::null, if it has been - * constructed with a null email) - */ - TQString emailAddress() const; - -private: - TQString mName; - TQString mEmail; - TDEAboutTranslatorPrivate* d; -}; - - -/** - * This class is used to store information about a program. It can store - * such values as version number, program name, home page, email address - * for bug reporting, multiple authors and contributors - * (using TDEAboutPerson), license and copyright information. - * - * Currently, the values set here are shown by the "About" box - * (see TDEAboutDialog), used by the bug report dialog (see KBugReport), - * and by the help shown on command line (see TDECmdLineArgs). - * - * @short Holds information needed by the "About" box and other - * classes. - * @author Espen Sand (espen@kde.org), David Faure (faure@kde.org) - */ -class TDECORE_EXPORT TDEAboutData -{ - public: - /** - * Descibes the license of the software. - */ - enum LicenseKey - { - License_Custom = -2, - License_File = -1, - License_Unknown = 0, - License_GPL = 1, - License_GPL_V2 = 1, - License_LGPL = 2, - License_LGPL_V2 = 2, - License_BSD = 3, - License_Artistic = 4, - License_QPL = 5, - License_QPL_V1_0 = 5 - }; - - public: - /** - * Constructor. - * - * @param appName The program name used internally. Example: "kedit" - * - * @param programName A displayable program name string. This string - * should be marked for translation. Example: I18N_NOOP("KEdit") - * - * @param version The program version string. - * - * @param shortDescription A short description of what the program does. - * This string should be marked for translation. - * Example: I18N_NOOP("A simple text editor.") - * - * @param licenseType The license identifier. Use setLicenseText if - * you use a license not predefined here. - * - * @param copyrightStatement A copyright statement, that can look like this: - * "(c) 1999-2000, Name". The string specified here is not modified - * in any manner. The author information from addAuthor is not - * used. - * - * @param text Some free form text, that can contain any kind of - * information. The text can contain newlines. This string - * should be marked for translation. - * - * @param homePageAddress The program homepage string. - * Start the address with "http://". "http://some.domain" is - * is correct, "some.domain" is not. - * - * @param bugsEmailAddress The bug report email address string. - * This defaults to the trinitydesktop.org bug system. - * - */ - TDEAboutData( const char *appName, - const char *programName, - const char *version, - const char *shortDescription = 0, - int licenseType = License_Unknown, - const char *copyrightStatement = 0, - const char *text = 0, - const char *homePageAddress = 0, - const char *bugsEmailAddress = 0 - ); - - ~TDEAboutData(); - - /** - * Defines an author. You can call this function as many times you - * need. Each entry is appended to a list. The person in the first entry - * is assumed to be the leader of the project. - * - * @param name The developer's name in UTF-8 encoding. - * - * @param task What the person is responsible for. This text can contain - * newlines. It should be marked for translation like this: - * I18N_NOOP("Task description..."). Can be 0. - * - * @param emailAddress An Email address where the person can be reached. - * Can be 0. - * - * @param webAddress The person's homepage or a relevant link. - * Start the address with "http://". "http://some.domain" is - * correct, "some.domain" is not. Can be 0. - * - */ - void addAuthor( const char *name, - const char *task=0, - const char *emailAddress=0, - const char *webAddress=0 ); - - /** - * Defines a person that deserves credit. You can call this function - * as many times you need. Each entry is appended to a list. - * - * @param name The person's name in UTF-8 encoding. - * - * @param task What the person has done to deserve the honor. The - * text can contain newlines. It should be marked for - * translation like this: I18N_NOOP("Task description...") - * Can be 0. - * - * @param emailAddress An Email address when the person can be reached. - * Can be 0. - * - * @param webAddress The person's homepage or a relevant link. - * Start the address with "http://". "http://some.domain" is - * is correct, "some.domain" is not. Can be 0. - * - */ - void addCredit( const char *name, - const char *task=0, - const char *emailAddress=0, - const char *webAddress=0 ); - - /** - * Sets the name of the translator of the gui. Since this depends - * on the language, just use a dummy text marked for translation. - * - * For example: - * \code - * setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\\nYour names") - * ,I18N_NOOP("_: EMAIL OF TRANSLATORS\\nYour emails")); - * \endcode - * - * The translator can then translate this dummy text with his name - * or with a list of names separated with ",". - * If there is no translation or the application is used with the - * default language, this function call is ignored. - * - * Note: If you are using the default KDE automake environment, - * there is no need to use this function, because the two - * default strings above are added to the applications po file - * automatically. - * - * @param name the name of the translator - * @param emailAddress the email address of the translator - * @see TDEAboutTranslator - */ - void setTranslator(const char* name, const char* emailAddress); - - /** - * Defines a license text. - * - * The text will be translated if it got marked for - * translations with the I18N_NOOP() macro. - * - * Example: - * \code - * setLicenseText( I18N_NOOP("This is my license")); - * \endcode - * - * NOTE: No copy of the text is made. - * - * @param license The license text in utf8 encoding. - */ - void setLicenseText( const char *license ); - - /** - * Defines a license text. - * - * @param file File containing the license text. - */ - void setLicenseTextFile( const TQString &file ); - - /** - * Defines the program name used internally. - * - * @param appName The application name. Example: "kate". - */ - void setAppName( const char *appName ); - - /** - * Defines the displayable program name string. - * - * @param programName The program name. This string should be - * marked for translation. - * Example: I18N_NOOP("Advanced Text Editor"). - * @since 3.2 - */ - void setProgramName( const char* programName ); - - /** - * Defines the program logo. - * Use this if you need to have application logo - * in AboutData other than application icon. - * - * @param image logo image. - * @see programLogo() - * @since 3.4 - */ - void setProgramLogo(const TQImage& image); - - /** - * Defines the program version string. - * - * @param version The program version. - */ - void setVersion( const char* version ); - - /** - * Defines a short description of what the program does. - * - * @param shortDescription The program description This string should be marked - * for translation. Example: I18N_NOOP("An advanced text editor - * with syntax highlithing support."). - */ - void setShortDescription( const char *shortDescription ); - - /** - * Defines the license identifier. - * - * @param licenseKey The license identifier. - */ - void setLicense( LicenseKey licenseKey); - - /** - * Defines the copyright statement to show when displaying the license. - * - * @param copyrightStatement A copyright statement, that can look like - * this: "(c) 1999-2000, Name". The string specified here is not - * modified in any manner. The author information from addAuthor - * is not used. - */ - void setCopyrightStatement( const char *copyrightStatement ); - - /** - * Defines the additional text to show in the about dialog. - * - * @param otherText Some free form text, that can contain any kind of - * information. The text can contain newlines. This string - * should be marked for translation. - */ - void setOtherText( const char *otherText ); - - /** - * Defines the program homepage. - * - * @param homepage The program homepage string. - * Start the address with "http://". "http://kate.kde.org" is - * is correct, "kde.kde.org" is not. - */ - void setHomepage( const char *homepage ); - - /** - * Defines the address where bug reports should be sent. - * - * @param bugAddress The bug report email address string. - * This defaults to the kde.org bug system. - */ - void setBugAddress( const char *bugAddress ); - - /** - * Defines the product name wich will be used in the KBugReport dialog. - * By default it's the appName, but you can overwrite it here to provide - * support for special components e.g. 'product/component' like - * 'kontact/summary'. - * - * @param name The name of product - */ - void setProductName( const char *name ); - - /** - * Returns the application's internal name. - * @return the internal program name. - */ - const char *appName() const; - - /** - * Returns the application's product name, which will be used in KBugReport - * dialog. By default it returns appName(), otherwise the one which is set - * with setProductName() - * - * @return the product name. - */ - const char *productName() const; - - /** - * Returns the translated program name. - * @return the program name (translated). - */ - TQString programName() const; - - /** - * @internal - */ - const char* internalProgramName() const; - /** - * @internal - */ - void translateInternalProgramName() const; - - /** - * Returns the program logo image. - * @return the program logo data or null image if there is - * no custom application logo defined. - * @since 3.4 - */ - TQImage programLogo() const; - - /** - * Returns the program's version. - * @return the version string. - */ - TQString version() const; - - /** - * @internal - */ - const char* internalVersion() const { return mVersion; } - - /** - * Returns a short, translated description. - * @return the short description (translated). Can be - * TQString::null if not set. - */ - TQString shortDescription() const; - - /** - * Returns the application homepage. - * @return the application homepage URL. Can be TQString::null if - * not set. - */ - TQString homepage() const; - - /** - * Returns the email address for bugs. - * @return the email address where to report bugs. - */ - TQString bugAddress() const; - - /** - * @internal - */ - const char* internalBugAddress() const { return mBugEmailAddress; } - - /** - * Returns a list of authors. - * @return author information (list of persons). - */ - const TQValueList authors() const; - - /** - * Returns a list of persons who contributed. - * @return credit information (list of persons). - */ - const TQValueList credits() const; - - /** - * Returns a list of translators. - * @return translators information (list of persons) - */ - const TQValueList translators() const; - - /** - * Returns a message about the translation team. - * @return a message about the translation team - */ - static TQString aboutTranslationTeam(); - - /** - * Returns a translated, free form text. - * @return the free form text (translated). Can be TQString::null if not set. - */ - TQString otherText() const; - - /** - * Returns the license. If the licenseType argument of the constructor has been - * used, any text defined by setLicenseText is ignored, - * and the standard text for the chosen license will be returned. - * - * @return The license text. - */ - TQString license() const; - - /** - * Returns the copyright statement. - * @return the copyright statement. Can be TQString::null if not set. - */ - TQString copyrightStatement() const; - - /** - * Returns the plain text displayed around the list of authors instead - * of the default message telling users to send bug reports to bugAddress(). - * - * @return the plain text displayed around the list of authors instead - * of the default message. Can be TQString::null. - */ - TQString customAuthorPlainText() const; - - /** - * Returns the rich text displayed around the list of authors instead - * of the default message telling users to send bug reports to bugAddress(). - * - * @return the rich text displayed around the list of authors instead - * of the default message. Can be TQString::null. - */ - TQString customAuthorRichText() const; - - /** - * Returns whether custom text should be displayed around the list of - * authors. - * - * @return whether custom text should be displayed around the list of - * authors. - */ - bool customAuthorTextEnabled() const; - - /** - * Sets the custom text displayed around the list of authors instead - * of the default message telling users to send bug reports to bugAddress(). - * - * @param plainText The plain text. - * @param richText The rich text. - * - * Both parameters can be TQString::null to not display any message at - * all. Call unsetCustomAuthorText() to revert to the default mesage. - */ - void setCustomAuthorText(const TQString &plainText, const TQString &richText); - - /** - * Clears any custom text displayed around the list of authors and falls - * back to the default message telling users to send bug reports to - * bugAddress(). - */ - void unsetCustomAuthorText(); - - private: - const char *mAppName; - const char *mProgramName; - const char *mVersion; - const char *mShortDescription; - int mLicenseKey; - const char *mCopyrightStatement; - const char *mOtherText; - const char *mHomepageAddress; - const char *mBugEmailAddress; - TQValueList mAuthorList; - TQValueList mCreditList; - const char *mLicenseText; - static const char *defaultBugTracker; - - TDEAboutDataPrivate *d; -}; - -#endif - diff --git a/tdecore/kapp.h b/tdecore/kapp.h index c51c463a0..5d48a852f 100644 --- a/tdecore/kapp.h +++ b/tdecore/kapp.h @@ -1,6 +1,6 @@ -// kapp.h is the old name. Use #include from now on +// kapp.h is the old name. Use #include from now on #ifdef KDE_NO_COMPAT -#error include instead of +#error include instead of #else -#include +#include #endif diff --git a/tdecore/kappdcopiface.cpp b/tdecore/kappdcopiface.cpp index 9f1148579..31bc8dd5b 100644 --- a/tdecore/kappdcopiface.cpp +++ b/tdecore/kappdcopiface.cpp @@ -18,7 +18,7 @@ */ #include "kappdcopiface.h" -#include +#include #include #include #include diff --git a/tdecore/kapplication.cpp b/tdecore/kapplication.cpp deleted file mode 100644 index 15c8a132b..000000000 --- a/tdecore/kapplication.cpp +++ /dev/null @@ -1,3638 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) - Copyright (C) 1998, 1999, 2000 KDE Team - - 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 "config.h" - -#ifdef HAVE_XCOMPOSITE -#define COMPOSITE -#endif - -// #ifdef QTRANSLATOR_H -// #error qtranslator.h was already included -// #endif // QTRANSLATOR_H -// -// #ifdef TQTRANSLATOR_H -// #error tqtranslator.h was already included -// #endif // TQTRANSLATOR_H - -#undef QT_NO_TRANSLATION -#undef TQT_NO_TRANSLATION -#include -#include "kapplication.h" -#define QT_NO_TRANSLATION -#define TQT_NO_TRANSLATION -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef QT_NO_SQL -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "kcheckaccelerators.h" -#include -#include -#include -#include -#include -#include -#include - -#if defined Q_WS_X11 -#include -#endif - -#include -#include - -#include -#ifdef HAVE_SYS_STAT_H -#include -#endif -#include -#include -#include - -#ifndef Q_WS_WIN -#include "twin.h" -#endif - -#include -#include // getenv(), srand(), rand() -#include -#include -#include -#include -#include -#include -#include -#if defined Q_WS_X11 -//#ifndef Q_WS_QWS //FIXME(E): NetWM should talk to QWS... -#include -#endif - -#include "kprocctrl.h" - -#ifdef HAVE_PATHS_H -#include -#endif - -#ifdef Q_WS_X11 -#include -#ifdef COMPOSITE -#include -#include -#include -#endif -#include -#include -#include -#include -#endif - -#include - -#ifndef Q_WS_WIN -#include -#else -typedef void* IceIOErrorHandler; -#include -//KDE4: remove -#define Button1Mask (1<<8) -#define Button2Mask (1<<9) -#define Button3Mask (1<<10) -#endif - -#ifdef Q_WS_X11 -#define DISPLAY "DISPLAY" -#elif defined(Q_WS_QWS) -#define DISPLAY "QWS_DISPLAY" -#endif - -#if defined Q_WS_X11 -#include -#endif - -#ifdef Q_WS_MACX -#include -#include -#endif - -#include "kappdcopiface.h" - -// exported for tdm kfrontend -KDE_EXPORT bool kde_have_kipc = true; // magic hook to disable kipc in tdm -bool kde_kiosk_exception = false; // flag to disable kiosk restrictions -bool kde_kiosk_admin = false; - -TDEApplication* TDEApplication::KApp = 0L; -bool TDEApplication::loadedByKdeinit = false; -DCOPClient *TDEApplication::s_DCOPClient = 0L; -bool TDEApplication::s_dcopClientNeedsPostInit = false; - -#ifdef Q_WS_X11 -static Atom atom_DesktopWindow; -static Atom atom_NetSupported; -static Atom kde_xdnd_drop; -#endif - -#ifdef Q_WS_X11 -static int composite_event, composite_error, composite_opcode; -static bool x11_composite_error_generated; -static int x11_error(Display *dpy, XErrorEvent *ev) { - if (ev->request_code == composite_opcode && ev->minor_code == X_CompositeRedirectSubwindows) - { - x11_composite_error_generated = true; - return 0; - } - return 1; -} -#endif - -// duplicated from patched Qt, so that there won't be unresolved symbols if Qt gets -// replaced by unpatched one -TDECORE_EXPORT bool tqt_qclipboard_bailout_hack = false; - -template class TQPtrList; - -#ifdef Q_WS_X11 -extern "C" { -static int kde_xio_errhandler( Display * dpy ) -{ - return kapp->xioErrhandler( dpy ); -} - -static int kde_x_errhandler( Display *dpy, XErrorEvent *err ) -{ - return kapp->xErrhandler( dpy, err ); -} - -} - -extern "C" { -static void kde_ice_ioerrorhandler( IceConn conn ) -{ - if(kapp) - kapp->iceIOErrorHandler( conn ); - // else ignore the error for now -} -} -#endif - -#ifdef Q_WS_WIN -void TDEApplication_init_windows(bool GUIenabled); - -class QAssistantClient; -#endif - -/* - Private data to make keeping binary compatibility easier - */ -class TDEApplicationPrivate -{ -public: - TDEApplicationPrivate() - : actionRestrictions( false ), - refCount( 1 ), - oldIceIOErrorHandler( 0 ), - checkAccelerators( 0 ), - overrideStyle( TQString::null ), - startup_id( "0" ), - app_started_timer( NULL ), - m_KAppDCOPInterface( 0L ), - session_save( false ) -#ifdef Q_WS_X11 - ,oldXErrorHandler( NULL ) - ,oldXIOErrorHandler( NULL ) -#elif defined Q_WS_WIN - ,qassistantclient( 0 ) -#endif - { - } - - ~TDEApplicationPrivate() - { -#ifdef Q_WS_WIN - delete qassistantclient; -#endif - } - - - bool actionRestrictions : 1; - bool guiEnabled : 1; - /** - * This counter indicates when to exit the application. - * It starts at 1, is decremented in TDEMainWindow when the last window is closed, but - * is incremented by operations that should outlive the last window closed - * (e.g. a file copy for a file manager, or 'compacting folders on exit' for a mail client). - */ - int refCount; - IceIOErrorHandler oldIceIOErrorHandler; - KCheckAccelerators* checkAccelerators; - TQString overrideStyle; - TQString geometry_arg; - TQCString startup_id; - TQTimer* app_started_timer; - KAppDCOPInterface *m_KAppDCOPInterface; - bool session_save; -#ifdef Q_WS_X11 - int (*oldXErrorHandler)(Display*,XErrorEvent*); - int (*oldXIOErrorHandler)(Display*); -#elif defined Q_WS_WIN - QAssistantClient* qassistantclient; -#endif - - class URLActionRule - { - public: -#define checkExactMatch(s, b) \ - if (s.isEmpty()) b = true; \ - else if (s[s.length()-1] == '!') \ - { b = false; s.truncate(s.length()-1); } \ - else b = true; -#define checkStartWildCard(s, b) \ - if (s.isEmpty()) b = true; \ - else if (s[0] == '*') \ - { b = true; s = s.mid(1); } \ - else b = false; -#define checkEqual(s, b) \ - b = (s == "="); - - URLActionRule(const TQString &act, - const TQString &bProt, const TQString &bHost, const TQString &bPath, - const TQString &dProt, const TQString &dHost, const TQString &dPath, - bool perm) - : action(act), - baseProt(bProt), baseHost(bHost), basePath(bPath), - destProt(dProt), destHost(dHost), destPath(dPath), - permission(perm) - { - checkExactMatch(baseProt, baseProtWildCard); - checkStartWildCard(baseHost, baseHostWildCard); - checkExactMatch(basePath, basePathWildCard); - checkExactMatch(destProt, destProtWildCard); - checkStartWildCard(destHost, destHostWildCard); - checkExactMatch(destPath, destPathWildCard); - checkEqual(destProt, destProtEqual); - checkEqual(destHost, destHostEqual); - } - - bool baseMatch(const KURL &url, const TQString &protClass) - { - if (baseProtWildCard) - { - if ( !baseProt.isEmpty() && !url.protocol().startsWith(baseProt) && - (protClass.isEmpty() || (protClass != baseProt)) ) - return false; - } - else - { - if ( (url.protocol() != baseProt) && - (protClass.isEmpty() || (protClass != baseProt)) ) - return false; - } - if (baseHostWildCard) - { - if (!baseHost.isEmpty() && !url.host().endsWith(baseHost)) - return false; - } - else - { - if (url.host() != baseHost) - return false; - } - if (basePathWildCard) - { - if (!basePath.isEmpty() && !url.path().startsWith(basePath)) - return false; - } - else - { - if (url.path() != basePath) - return false; - } - return true; - } - - bool destMatch(const KURL &url, const TQString &protClass, const KURL &base, const TQString &baseClass) - { - if (destProtEqual) - { - if ( (url.protocol() != base.protocol()) && - (protClass.isEmpty() || baseClass.isEmpty() || protClass != baseClass) ) - return false; - } - else if (destProtWildCard) - { - if ( !destProt.isEmpty() && !url.protocol().startsWith(destProt) && - (protClass.isEmpty() || (protClass != destProt)) ) - return false; - } - else - { - if ( (url.protocol() != destProt) && - (protClass.isEmpty() || (protClass != destProt)) ) - return false; - } - if (destHostWildCard) - { - if (!destHost.isEmpty() && !url.host().endsWith(destHost)) - return false; - } - else if (destHostEqual) - { - if (url.host() != base.host()) - return false; - } - else - { - if (url.host() != destHost) - return false; - } - if (destPathWildCard) - { - if (!destPath.isEmpty() && !url.path().startsWith(destPath)) - return false; - } - else - { - if (url.path() != destPath) - return false; - } - return true; - } - - TQString action; - TQString baseProt; - TQString baseHost; - TQString basePath; - TQString destProt; - TQString destHost; - TQString destPath; - bool baseProtWildCard : 1; - bool baseHostWildCard : 1; - bool basePathWildCard : 1; - bool destProtWildCard : 1; - bool destHostWildCard : 1; - bool destPathWildCard : 1; - bool destProtEqual : 1; - bool destHostEqual : 1; - bool permission; - }; - TQPtrList urlActionRestrictions; - - TQString sessionKey; - TQString pSessionConfigFile; -}; - - -static TQPtrList*x11Filter = 0; -static bool autoDcopRegistration = true; - -void TDEApplication::installX11EventFilter( TQWidget* filter ) -{ - if ( !filter ) - return; - if (!x11Filter) - x11Filter = new TQPtrList; - connect ( filter, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( x11FilterDestroyed() ) ); - x11Filter->append( filter ); -} - -void TDEApplication::x11FilterDestroyed() -{ - removeX11EventFilter( static_cast< const TQWidget* >( sender())); -} - -void TDEApplication::removeX11EventFilter( const TQWidget* filter ) -{ - if ( !x11Filter || !filter ) - return; - x11Filter->removeRef( filter ); - if ( x11Filter->isEmpty() ) { - delete x11Filter; - x11Filter = 0; - } -} - -// FIXME: remove this when we've get a better method of -// customizing accelerator handling -- hopefully in Qt. -// For now, this is set whenever an accelerator is overridden -// in TDEAccelEventHandler so that the AccelOverride isn't sent twice. -- ellis, 19/10/02 -extern bool kde_g_bKillAccelOverride; - -bool TDEApplication::notify(TQObject *receiver, TQEvent *event) -{ - TQEvent::Type t = event->type(); - if (kde_g_bKillAccelOverride) - { - kde_g_bKillAccelOverride = false; - // Indicate that the accelerator has been overridden. - if (t == TQEvent::AccelOverride) - { - TQT_TQKEYEVENT(event)->accept(); - return true; - } - else - kdWarning(125) << "kde_g_bKillAccelOverride set, but received an event other than AccelOverride." << endl; - } - - if ((t == TQEvent::AccelOverride) || (t == TQEvent::KeyPress)) - { - static const TDEShortcut& _selectAll = TDEStdAccel::selectAll(); - TQLineEdit *edit = ::tqqt_cast(receiver); - if (edit) - { - // We have a keypress for a lineedit... - TQKeyEvent *kevent = TQT_TQKEYEVENT(event); - KKey key(kevent); - if (_selectAll.contains(key)) - { - if (t == TQEvent::KeyPress) - { - edit->selectAll(); - return true; - } - else - { - kevent->accept(); - } - } - // Ctrl-U deletes from start of line. - if (key == KKey(Qt::CTRL + Qt::Key_U)) - { - if (t == TQEvent::KeyPress) - { - if (!edit->isReadOnly()) - { - TQString t(edit->text()); - t = t.mid(edit->cursorPosition()); - edit->validateAndSet(t, 0, 0, 0); - } - return true; - } - else - { - kevent->accept(); - } - - } - } - TQTextEdit *medit = ::tqqt_cast(receiver); - if (medit) - { - // We have a keypress for a multilineedit... - TQKeyEvent *kevent = TQT_TQKEYEVENT(event); - if (_selectAll.contains(KKey(kevent))) - { - if (t == TQEvent::KeyPress) - { - medit->selectAll(); - return true; - } - else - { - kevent->accept(); - } - } - } - } - if( t == TQEvent::Show && receiver->isWidgetType()) - { - TQWidget* w = TQT_TQWIDGET( receiver ); -#if defined Q_WS_X11 - if( w->isTopLevel() && !startupId().isEmpty() && !TQT_TQSHOWEVENT(event)->spontaneous()) // TODO better done using window group leader? - TDEStartupInfo::setWindowStartupId( w->winId(), startupId()); -#endif - if( w->isTopLevel() && !w->testWFlags( WX11BypassWM ) && !w->isPopup() && !event->spontaneous()) - { - if( d->app_started_timer == NULL ) - { - d->app_started_timer = new TQTimer( this, "app_started_timer" ); - connect( d->app_started_timer, TQT_SIGNAL( timeout()), TQT_SLOT( checkAppStartedSlot())); - } - if( !d->app_started_timer->isActive()) - d->app_started_timer->start( 0, true ); - } - if( w->isTopLevel() && ( w->icon() == NULL || w->icon()->isNull())) - { - // icon() cannot be null pixmap, it'll be the "unknown" icon - so check if there is this application icon - static TQPixmap* ic = NULL; - if( ic == NULL ) - ic = new TQPixmap( TDEGlobal::iconLoader()->loadIcon( iconName(), - TDEIcon::NoGroup, 0, TDEIcon::DefaultState, NULL, true )); - if( !ic->isNull()) - { - w->setIcon( *ic ); -#if defined Q_WS_X11 - KWin::setIcons( w->winId(), *ic, miniIcon()); -#endif - } - } - } - return TQApplication::notify(receiver, event); -} - -void TDEApplication::checkAppStartedSlot() -{ -#if defined Q_WS_X11 - TDEStartupInfo::handleAutoAppStartedSending(); -#endif -} - -// the help class for session management communication -static TQPtrList* sessionClients() -{ - static TQPtrList* session_clients = 0L; - if ( !session_clients ) - session_clients = new TQPtrList; - return session_clients; -} - -/* - Auxiliary function to calculate a a session config name used for the - instance specific config object. - Syntax: "session/_" - */ -TQString TDEApplication::sessionConfigName() const -{ - TQString sessKey = sessionKey(); - if ( sessKey.isEmpty() && !d->sessionKey.isEmpty() ) - sessKey = d->sessionKey; - return TQString("session/%1_%2_%3").arg(name()).arg(sessionId()).arg(sessKey); -} - -#ifdef Q_WS_X11 -static SmcConn mySmcConnection = 0; -static SmcConn tmpSmcConnection = 0; -#else -// FIXME(E): Implement for Qt Embedded -// Possibly "steal" XFree86's libSM? -#endif -static TQTime* smModificationTime = 0; - -TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName, - bool allowStyles, bool GUIenabled ) : - TQApplication( argc, argv, GUIenabled ), TDEInstance(rAppName), -#ifdef Q_WS_X11 - display(0L), - argb_visual(false), -#endif - d (new TDEApplicationPrivate()) -{ - aIconPixmap.pm.icon = 0L; - aIconPixmap.pm.miniIcon = 0L; - read_app_startup_id(); - if (!GUIenabled) - allowStyles = false; - useStyles = allowStyles; - Q_ASSERT (!rAppName.isEmpty()); - setName(rAppName); - - installSigpipeHandler(); - TDECmdLineArgs::initIgnore(argc, argv, rAppName.data()); - parseCommandLine( ); - init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); -} - -TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) : -// TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), TRUE ), // Qt4 requires that there always be a GUI - TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled ), // We need to be able to run command line apps - TDEInstance( TDECmdLineArgs::about), -#ifdef Q_WS_X11 - display(0L), - argb_visual(false), -#endif - d (new TDEApplicationPrivate) -{ - aIconPixmap.pm.icon = 0L; - aIconPixmap.pm.miniIcon = 0L; - read_app_startup_id(); - if (!GUIenabled) - allowStyles = false; - useStyles = allowStyles; - setName( instanceName() ); - - installSigpipeHandler(); - parseCommandLine( ); - init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); -} - -#ifdef Q_WS_X11 -TDEApplication::TDEApplication( Display *dpy, bool allowStyles ) : - TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), - getX11RGBAVisual(dpy), getX11RGBAColormap(dpy) ), - TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate) -{ - aIconPixmap.pm.icon = 0L; - aIconPixmap.pm.miniIcon = 0L; - read_app_startup_id(); - useStyles = allowStyles; - setName( instanceName() ); - installSigpipeHandler(); - parseCommandLine( ); - init( true ); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); -} - -TDEApplication::TDEApplication( Display *dpy, bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap, bool allowStyles ) : - TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), - disable_argb?visual:getX11RGBAVisual(dpy), disable_argb?colormap:getX11RGBAColormap(dpy) ), - TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate) -{ - aIconPixmap.pm.icon = 0L; - aIconPixmap.pm.miniIcon = 0L; - read_app_startup_id(); - useStyles = allowStyles; - if (disable_argb) argb_visual = false; - setName( instanceName() ); - installSigpipeHandler(); - parseCommandLine( ); - init( true ); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); -} - -TDEApplication::TDEApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, - bool allowStyles ) : - TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), - visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ), - TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate) -{ - if ((visual) && (colormap)) - getX11RGBAInformation(dpy); - aIconPixmap.pm.icon = 0L; - aIconPixmap.pm.miniIcon = 0L; - read_app_startup_id(); - useStyles = allowStyles; - setName( instanceName() ); - installSigpipeHandler(); - parseCommandLine( ); - init( true ); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); -} - -TDEApplication::TDEApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, - bool allowStyles, TDEInstance * _instance ) : - TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), - visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ), - TDEInstance( _instance ), display(0L), d (new TDEApplicationPrivate) -{ - if ((visual) && (colormap)) - getX11RGBAInformation(dpy); - aIconPixmap.pm.icon = 0L; - aIconPixmap.pm.miniIcon = 0L; - read_app_startup_id(); - useStyles = allowStyles; - setName( instanceName() ); - installSigpipeHandler(); - parseCommandLine( ); - init( true ); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); -} -#endif - -TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance* _instance ) : - TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), - GUIenabled ), - TDEInstance( _instance ), -#ifdef Q_WS_X11 - display(0L), -#endif - argb_visual(false), - d (new TDEApplicationPrivate) -{ - aIconPixmap.pm.icon = 0L; - aIconPixmap.pm.miniIcon = 0L; - read_app_startup_id(); - if (!GUIenabled) - allowStyles = false; - useStyles = allowStyles; - setName( instanceName() ); - - installSigpipeHandler(); - parseCommandLine( ); - init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); -} - -#ifdef Q_WS_X11 -TDEApplication::TDEApplication(Display *display, int& argc, char** argv, const TQCString& rAppName, - bool allowStyles, bool GUIenabled ) : - TQApplication( display ), TDEInstance(rAppName), - display(0L), - argb_visual(false), - d (new TDEApplicationPrivate()) -{ - aIconPixmap.pm.icon = 0L; - aIconPixmap.pm.miniIcon = 0L; - read_app_startup_id(); - if (!GUIenabled) - allowStyles = false; - useStyles = allowStyles; - - Q_ASSERT (!rAppName.isEmpty()); - setName(rAppName); - - installSigpipeHandler(); - TDECmdLineArgs::initIgnore(argc, argv, rAppName.data()); - parseCommandLine( ); - init(GUIenabled); - d->m_KAppDCOPInterface = new KAppDCOPInterface(this); -} -#endif - -int TDEApplication::xioErrhandler( Display* dpy ) -{ - if(kapp) - { - emit shutDown(); -#ifdef Q_WS_X11 - d->oldXIOErrorHandler( dpy ); -#else - Q_UNUSED(dpy); -#endif - } - exit( 1 ); - return 0; -} - -int TDEApplication::xErrhandler( Display* dpy, void* err_ ) -{ // no idea how to make forward decl. for XErrorEvent -#ifdef Q_WS_X11 - XErrorEvent* err = static_cast< XErrorEvent* >( err_ ); - if(kapp) - { - // add KDE specific stuff here - d->oldXErrorHandler( dpy, err ); - } -#endif - return 0; -} - -void TDEApplication::iceIOErrorHandler( _IceConn *conn ) -{ - emit shutDown(); - -#ifdef Q_WS_X11 - if ( d->oldIceIOErrorHandler != NULL ) - (*d->oldIceIOErrorHandler)( conn ); -#endif - exit( 1 ); -} - -class KDETranslator : public TQTranslator -{ -public: - KDETranslator(TQObject *parent) : TQTranslator(parent, "kdetranslator") {} - virtual TQTranslatorMessage findMessage(const char* context, - const char *sourceText, - const char* message) const - { - TQTranslatorMessage res; - res.setTranslation(TDEGlobal::locale()->translateQt(context, sourceText, message)); - return res; - } -}; - -void TDEApplication::init(bool GUIenabled) -{ - d->guiEnabled = GUIenabled; - if ((getuid() != geteuid()) || - (getgid() != getegid()) ) - { - // man permissions are not exploitable and better than - // world writable directories - struct group *man = getgrnam("man"); - if ( !man || man->gr_gid != getegid() ){ - fprintf(stderr, "The TDE libraries are not designed to run with suid privileges.\n"); - ::exit(127); - } - } - - TDEProcessController::ref(); - - (void) TDEClipboardSynchronizer::self(); - - TQApplication::setDesktopSettingsAware( false ); - - KApp = this; - - -#ifdef Q_WS_X11 //FIXME(E) - // create all required atoms in _one_ roundtrip to the X server - if ( GUIenabled ) { - const int max = 20; - Atom* atoms[max]; - char* names[max]; - Atom atoms_return[max]; - int n = 0; - - atoms[n] = &kipcCommAtom; - names[n++] = (char *) "KIPC_COMM_ATOM"; - - atoms[n] = &atom_DesktopWindow; - names[n++] = (char *) "KDE_DESKTOP_WINDOW"; - - atoms[n] = &atom_NetSupported; - names[n++] = (char *) "_NET_SUPPORTED"; - - atoms[n] = &kde_xdnd_drop; - names[n++] = (char *) "XdndDrop"; - - XInternAtoms( tqt_xdisplay(), names, n, false, atoms_return ); - - for (int i = 0; i < n; i++ ) - *atoms[i] = atoms_return[i]; - } -#endif - - dcopAutoRegistration(); - dcopClientPostInit(); - - smw = 0; - - // Initial KIPC event mask. -#if defined Q_WS_X11 - kipcEventMask = (1 << KIPC::StyleChanged) | (1 << KIPC::PaletteChanged) | - (1 << KIPC::FontChanged) | (1 << KIPC::BackgroundChanged) | - (1 << KIPC::ToolbarStyleChanged) | (1 << KIPC::SettingsChanged) | - (1 << KIPC::ClipboardConfigChanged) | (1 << KIPC::BlockShortcuts); -#endif - - // Trigger creation of locale. - (void) TDEGlobal::locale(); - - TDEConfig* config = TDEGlobal::config(); - d->actionRestrictions = config->hasGroup("KDE Action Restrictions" ) && !kde_kiosk_exception; - // For brain-dead configurations where the user's local config file is not writable. - // * We use kdialog to warn the user, so we better not generate warnings from - // kdialog itself. - // * Don't warn if we run with a read-only $HOME - TQCString readOnly = getenv("TDE_HOME_READONLY"); - if (readOnly.isEmpty() && (tqstrcmp(name(), "kdialog") != 0)) - { - TDEConfigGroupSaver saver(config, "KDE Action Restrictions"); - if (config->readBoolEntry("warn_unwritable_config",true)) - config->checkConfigFilesWritable(true); - } - - if (GUIenabled) - { -#ifdef Q_WS_X11 - // this is important since we fork() to launch the help (Matthias) - fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, FD_CLOEXEC); - // set up the fancy (=robust and error ignoring ) KDE xio error handlers (Matthias) - d->oldXErrorHandler = XSetErrorHandler( kde_x_errhandler ); - d->oldXIOErrorHandler = XSetIOErrorHandler( kde_xio_errhandler ); -#endif - - connect( this, TQT_SIGNAL( aboutToQuit() ), this, TQT_SIGNAL( shutDown() ) ); - -#ifdef Q_WS_X11 //FIXME(E) - display = desktop()->x11Display(); -#endif - - { - TQStringList plugins = TDEGlobal::dirs()->resourceDirs( "qtplugins" ); - TQStringList::Iterator it = plugins.begin(); - while (it != plugins.end()) { - addLibraryPath( *it ); - ++it; - } - - } - tdedisplaySetStyle(); - tdedisplaySetFont(); -// tdedisplaySetPalette(); done by tdedisplaySetStyle - propagateSettings(SETTINGS_QT); - - // Set default mime-source factory - // XXX: This is a hack. Make our factory the default factory, but add the - // previous default factory to the list of factories. Why? When the default - // factory can't resolve something, it iterates in the list of factories. - // But it TQWhatsThis only uses the default factory. So if there was already - // a default factory (which happens when using an image library using uic), - // we prefer KDE's factory and so we put that old default factory in the - // list and use KDE as the default. This may speed up things as well. - TQMimeSourceFactory* oldDefaultFactory = TQMimeSourceFactory::takeDefaultFactory(); - TQMimeSourceFactory::setDefaultFactory( mimeSourceFactory() ); - if ( oldDefaultFactory ) { - TQMimeSourceFactory::addFactory( oldDefaultFactory ); - } - - d->checkAccelerators = new KCheckAccelerators( TQT_TQOBJECT(this) ); - } - -#ifdef Q_WS_MACX - if (GUIenabled) { - TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon( TDECmdLineArgs::appName(), - TDEIcon::NoGroup, TDEIcon::SizeLarge, TDEIcon::DefaultState, 0L, false ); - if (!pixmap.isNull()) { - TQImage i = pixmap.convertToImage().convertDepth(32).smoothScale(40, 40); - for(int y = 0; y < i.height(); y++) { - uchar *l = i.scanLine(y); - for(int x = 0; x < i.width(); x+=4) - *(l+x) = 255; - } - CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); - CGDataProviderRef dp = CGDataProviderCreateWithData(NULL, - i.bits(), i.numBytes(), NULL); - CGImageRef ir = CGImageCreate(i.width(), i.height(), 8, 32, i.bytesPerLine(), - cs, kCGImageAlphaNoneSkipFirst, dp, - 0, 0, kCGRenderingIntentDefault); - //cleanup - SetApplicationDockTileImage(ir); - CGImageRelease(ir); - CGColorSpaceRelease(cs); - CGDataProviderRelease(dp); - } - } -#endif - - - // save and restore the RTL setting, as installTranslator calls qt_detectRTLLanguage, - // which makes it impossible to use the -reverse cmdline switch with KDE apps - bool rtl = reverseLayout(); - installTranslator(new KDETranslator(TQT_TQOBJECT(this))); - setReverseLayout( rtl ); - if (i18n( "_: Dear Translator! Translate this string to the string 'LTR' in " - "left-to-right languages (as english) or to 'RTL' in right-to-left " - "languages (such as Hebrew and Arabic) to get proper widget layout." ) == "RTL") - setReverseLayout( !rtl ); - - // install appdata resource type - TDEGlobal::dirs()->addResourceType("appdata", TDEStandardDirs::kde_default("data") - + TQString::fromLatin1(name()) + '/'); - pSessionConfig = 0L; - bSessionManagement = true; - -#ifdef Q_WS_X11 - // register a communication window for desktop changes (Matthias) - if (GUIenabled && kde_have_kipc ) - { - smw = new TQWidget(0,0); - long data = 1; - XChangeProperty(tqt_xdisplay(), smw->winId(), - atom_DesktopWindow, atom_DesktopWindow, - 32, PropModeReplace, (unsigned char *)&data, 1); - } - d->oldIceIOErrorHandler = IceSetIOErrorHandler( kde_ice_ioerrorhandler ); -#elif defined(Q_WS_WIN) - TDEApplication_init_windows(GUIenabled); -#else - // FIXME(E): Implement for Qt Embedded -#endif -} - -static int my_system (const char *command) { - int pid, status; - - pid = fork(); - if (pid == -1) - return -1; - if (pid == 0) { - const char* shell = "/bin/sh"; - execl(shell, shell, "-c", command, (void *)0); - ::_exit(127); - } - do { - if (waitpid(pid, &status, 0) == -1) { - if (errno != EINTR) - return -1; - } else - return status; - } while(1); -} - - -DCOPClient *TDEApplication::dcopClient() -{ - if (s_DCOPClient) - return s_DCOPClient; - - s_DCOPClient = new DCOPClient(); - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs("tde"); - if (args && args->isSet("dcopserver")) - { - s_DCOPClient->setServerAddress( args->getOption("dcopserver")); - } - if( kapp ) { - connect(s_DCOPClient, TQT_SIGNAL(attachFailed(const TQString &)), - kapp, TQT_SLOT(dcopFailure(const TQString &))); - connect(s_DCOPClient, TQT_SIGNAL(blockUserInput(bool) ), - kapp, TQT_SLOT(dcopBlockUserInput(bool)) ); - } - else - s_dcopClientNeedsPostInit = true; - - DCOPClient::setMainClient( s_DCOPClient ); - return s_DCOPClient; -} - -void TDEApplication::dcopClientPostInit() -{ - if( s_dcopClientNeedsPostInit ) - { - s_dcopClientNeedsPostInit = false; - connect(s_DCOPClient, TQT_SIGNAL(blockUserInput(bool) ), - TQT_SLOT(dcopBlockUserInput(bool)) ); - s_DCOPClient->bindToApp(); // Make sure we get events from the DCOPClient. - } -} - -void TDEApplication::dcopAutoRegistration() -{ - if (autoDcopRegistration) - { - ( void ) dcopClient(); - if( dcopClient()->appId().isEmpty()) - dcopClient()->registerAs(name()); - } -} - -void TDEApplication::disableAutoDcopRegistration() -{ - autoDcopRegistration = false; -} - -TDEConfig* TDEApplication::sessionConfig() -{ - if (pSessionConfig) - return pSessionConfig; - - // create an instance specific config object - pSessionConfig = new TDEConfig( sessionConfigName(), false, false); - return pSessionConfig; -} - -void TDEApplication::ref() -{ - d->refCount++; - //kdDebug() << "TDEApplication::ref() : refCount = " << d->refCount << endl; -} - -void TDEApplication::deref() -{ - d->refCount--; - //kdDebug() << "TDEApplication::deref() : refCount = " << d->refCount << endl; - if ( d->refCount <= 0 ) - quit(); -} - -KSessionManaged::KSessionManaged() -{ - sessionClients()->remove( this ); - sessionClients()->append( this ); -} - -KSessionManaged::~KSessionManaged() -{ - sessionClients()->remove( this ); -} - -bool KSessionManaged::saveState(TQSessionManager&) -{ - return true; -} - -bool KSessionManaged::commitData(TQSessionManager&) -{ - return true; -} - - -void TDEApplication::disableSessionManagement() { - bSessionManagement = false; -} - -void TDEApplication::enableSessionManagement() { - bSessionManagement = true; -#ifdef Q_WS_X11 - // Session management support in Qt/TDE is awfully broken. - // If konqueror disables session management right after its startup, - // and enables it later (preloading stuff), it won't be properly - // saved on session shutdown. - // I'm not actually sure why it doesn't work, but saveState() - // doesn't seem to be called on session shutdown, possibly - // because disabling session management after konqueror startup - // disabled it somehow. Forcing saveState() here for this application - // seems to fix it. - if( mySmcConnection ) { - SmcRequestSaveYourself( mySmcConnection, SmSaveLocal, False, - SmInteractStyleAny, - False, False ); - - // flush the request - IceFlush(SmcGetIceConnection(mySmcConnection)); - } -#endif -} - - -bool TDEApplication::requestShutDown( - ShutdownConfirm confirm, ShutdownType sdtype, ShutdownMode sdmode ) -{ -#ifdef Q_WS_X11 - TQApplication::syncX(); - /* use ksmserver's dcop interface if necessary */ - if ( confirm == ShutdownConfirmYes || - sdtype != ShutdownTypeDefault || - sdmode != ShutdownModeDefault ) - { - TQByteArray data; - TQDataStream arg(data, IO_WriteOnly); - arg << (int)confirm << (int)sdtype << (int)sdmode; - return dcopClient()->send( "ksmserver", "ksmserver", - "logout(int,int,int)", data ); - } - - if ( mySmcConnection ) { - // we already have a connection to the session manager, use it. - SmcRequestSaveYourself( mySmcConnection, SmSaveBoth, True, - SmInteractStyleAny, - confirm == ShutdownConfirmNo, True ); - - // flush the request - IceFlush(SmcGetIceConnection(mySmcConnection)); - return true; - } - - // open a temporary connection, if possible - - propagateSessionManager(); - TQCString smEnv = ::getenv("SESSION_MANAGER"); - if (smEnv.isEmpty()) - return false; - - if (! tmpSmcConnection) { - char cerror[256]; - char* myId = 0; - char* prevId = 0; - SmcCallbacks cb; - tmpSmcConnection = SmcOpenConnection( 0, 0, 1, 0, - 0, &cb, - prevId, - &myId, - 255, - cerror ); - ::free( myId ); // it was allocated by C - if (!tmpSmcConnection ) - return false; - } - - SmcRequestSaveYourself( tmpSmcConnection, SmSaveBoth, True, - SmInteractStyleAny, False, True ); - - // flush the request - IceFlush(SmcGetIceConnection(tmpSmcConnection)); - return true; -#else - // FIXME(E): Implement for Qt Embedded - return false; -#endif -} - -void TDEApplication::propagateSessionManager() -{ -#ifdef Q_WS_X11 - TQCString fName = TQFile::encodeName(locateLocal("socket", "KSMserver")); - TQCString display = ::getenv(DISPLAY); - // strip the screen number from the display - display.replace(TQRegExp("\\.[0-9]+$"), ""); - int i; - while( (i = display.find(':')) >= 0) - display[i] = '_'; - - fName += "_"+display; - TQCString smEnv = ::getenv("SESSION_MANAGER"); - bool check = smEnv.isEmpty(); - if ( !check && smModificationTime ) { - TQFileInfo info( fName ); - TQTime current = TQT_TQTIME_OBJECT(info.lastModified().time()); - check = current > *smModificationTime; - } - if ( check ) { - delete smModificationTime; - TQFile f( fName ); - if ( !f.open( IO_ReadOnly ) ) - return; - TQFileInfo info ( f ); - smModificationTime = new TQTime( TQT_TQTIME_OBJECT(info.lastModified().time()) ); - TQTextStream t(&f); - t.setEncoding( TQTextStream::Latin1 ); - TQString s = t.readLine(); - f.close(); - ::setenv( "SESSION_MANAGER", s.latin1(), true ); - } -#endif -} - -void TDEApplication::commitData( TQSessionManager& sm ) -{ - d->session_save = true; - bool canceled = false; - for (KSessionManaged* it = sessionClients()->first(); - it && !canceled; - it = sessionClients()->next() ) { - canceled = !it->commitData( sm ); - } - if ( canceled ) - sm.cancel(); - - if ( sm.allowsInteraction() ) { - TQWidgetList done; - TQWidgetList *list = TQApplication::topLevelWidgets(); - bool canceled = false; - TQWidget* w = list->first(); - while ( !canceled && w ) { - if ( !w->testWState( WState_ForceHide ) && !w->inherits("TDEMainWindow") ) { - TQCloseEvent e; - sendEvent( w, &e ); - canceled = !e.isAccepted(); - if ( !canceled ) - done.append( w ); - delete list; // one never knows... - list = TQApplication::topLevelWidgets(); - w = list->first(); - } else { - w = list->next(); - } - while ( w && done.containsRef( w ) ) - w = list->next(); - } - delete list; - } - - - if ( !bSessionManagement ) - sm.setRestartHint( TQSessionManager::RestartNever ); - else - sm.setRestartHint( TQSessionManager::RestartIfRunning ); - d->session_save = false; -} - -static void checkRestartVersion( TQSessionManager& sm ) -{ - Display* dpy = tqt_xdisplay(); - Atom type; - int format; - unsigned long nitems, after; - unsigned char* data; - if( XGetWindowProperty( dpy, RootWindow( dpy, 0 ), XInternAtom( dpy, "TDE_FULL_SESSION", False ), - 0, 1, False, AnyPropertyType, &type, &format, &nitems, &after, &data ) == Success ) { - if( data != NULL ) - XFree( data ); - if( type == XA_STRING && format == 8 ) { // session set, check if TDE_SESSION_VERSION is not set (meaning KDE3) - if( XGetWindowProperty( dpy, RootWindow( dpy, 0 ), XInternAtom( dpy, "TDE_SESSION_VERSION", False ), - 0, 1, False, AnyPropertyType, &type, &format, &nitems, &after, &data ) == Success ) { - if( data != NULL ) - XFree( data ); // KDE4 or newer - if( type == None ) - return; // we run in our native session, no need to wrap - } else { - return; // we run in our native session, no need to wrap - } - } - } - TQString wrapper = TDEStandardDirs::findExe( "trinity" ); - TQStringList restartCommand = sm.restartCommand(); - restartCommand.prepend( wrapper ); - sm.setRestartCommand( restartCommand ); -} - -void TDEApplication::saveState( TQSessionManager& sm ) -{ - d->session_save = true; -#ifdef Q_WS_X11 - static bool firstTime = true; - mySmcConnection = (SmcConn) sm.handle(); - - if ( !bSessionManagement ) { - sm.setRestartHint( TQSessionManager::RestartNever ); - d->session_save = false; - return; - } - else - sm.setRestartHint( TQSessionManager::RestartIfRunning ); - - if ( firstTime ) { - firstTime = false; - d->session_save = false; - return; // no need to save the state. - } - - // remove former session config if still existing, we want a new - // and fresh one. Note that we do not delete the config file here, - // this is done by the session manager when it executes the - // discard commands. In fact it would be harmful to remove the - // file here, as the session might be stored under a different - // name, meaning the user still might need it eventually. - if ( pSessionConfig ) { - delete pSessionConfig; - pSessionConfig = 0; - } - - // tell the session manager about our new lifecycle - TQStringList restartCommand = sm.restartCommand(); - - TQCString multiHead = getenv("TDE_MULTIHEAD"); - if (multiHead.lower() == "true") { - // if multihead is enabled, we save our -display argument so that - // we are restored onto the correct head... one problem with this - // is that the display is hard coded, which means we cannot restore - // to a different display (ie. if we are in a university lab and try, - // try to restore a multihead session, our apps could be started on - // someone else's display instead of our own) - TQCString displayname = getenv(DISPLAY); - if (! displayname.isNull()) { - // only store the command if we actually have a DISPLAY - // environment variable - restartCommand.append("-display"); - restartCommand.append(displayname); - } - sm.setRestartCommand( restartCommand ); - } - - checkRestartVersion( sm ); - - // finally: do session management - emit saveYourself(); // for compatibility - bool canceled = false; - for (KSessionManaged* it = sessionClients()->first(); - it && !canceled; - it = sessionClients()->next() ) { - canceled = !it->saveState( sm ); - } - - // if we created a new session config object, register a proper discard command - if ( pSessionConfig ) { - pSessionConfig->sync(); - TQStringList discard; - discard << "rm" << locateLocal("config", sessionConfigName()); - sm.setDiscardCommand( discard ); - } else { - sm.setDiscardCommand( TQStringList("") ); - } - - if ( canceled ) - sm.cancel(); -#else - // FIXME(E): Implement for Qt Embedded -#endif - d->session_save = false; -} - -bool TDEApplication::sessionSaving() const -{ - return d->session_save; -} - -void TDEApplication::startKdeinit() -{ -#ifndef Q_WS_WIN //TODO - TDEInstance inst( "starttdeinitlock" ); - TDELockFile lock( locateLocal( "tmp", "starttdeinitlock", &inst )); - if( lock.lock( TDELockFile::LockNoBlock ) != TDELockFile::LockOK ) { - lock.lock(); - DCOPClient cl; - if( cl.attach()) - return; // whoever held the lock has already started dcopserver - } - // Try to launch tdeinit. - TQString srv = TDEStandardDirs::findExe(TQString::fromLatin1("tdeinit")); - if (srv.isEmpty()) - srv = TDEStandardDirs::findExe(TQString::fromLatin1("tdeinit"), TDEGlobal::dirs()->kfsstnd_defaultbindir()); - if (srv.isEmpty()) - return; - if (kapp && (Tty != kapp->type())) - setOverrideCursor( tqwaitCursor ); - my_system(TQFile::encodeName(srv)+" --suicide"+" --new-startup"); - if (kapp && (Tty != kapp->type())) - restoreOverrideCursor(); -#endif -} - -void TDEApplication::dcopFailure(const TQString &msg) -{ - static int failureCount = 0; - failureCount++; - if (failureCount == 1) - { - startKdeinit(); - return; - } - if (failureCount == 2) - { -#ifdef Q_WS_WIN - TDEGlobal::config()->setGroup("General"); - if (TDEGlobal::config()->readBoolEntry("ignoreDCOPFailures", false)) - return; -#endif - TQString msgStr(i18n("There was an error setting up inter-process " - "communications for TDE. The message returned " - "by the system was:\n\n")); - msgStr += msg; - msgStr += i18n("\n\nPlease check that the \"dcopserver\" program is running!"); - - if (Tty != kapp->type()) - { - TQMessageBox::critical - ( - kapp->mainWidget(), - i18n("DCOP communications error (%1)").arg(kapp->caption()), - msgStr, - i18n("&OK") - ); - } - else - { - fprintf(stderr, "%s\n", msgStr.local8Bit().data()); - } - - return; - } -} - -static const TDECmdLineOptions qt_options[] = -{ - //FIXME: Check if other options are specific to Qt/X11 -#ifdef Q_WS_X11 - { "display ", I18N_NOOP("Use the X-server display 'displayname'"), 0}, -#else - { "display ", I18N_NOOP("Use the QWS display 'displayname'"), 0}, -#endif - { "session ", I18N_NOOP("Restore the application for the given 'sessionId'"), 0}, - { "cmap", I18N_NOOP("Causes the application to install a private color\nmap on an 8-bit display"), 0}, - { "ncols ", I18N_NOOP("Limits the number of colors allocated in the color\ncube on an 8-bit display, if the application is\nusing the TQApplication::ManyColor color\nspecification"), 0}, - { "nograb", I18N_NOOP("tells Qt to never grab the mouse or the keyboard"), 0}, - { "dograb", I18N_NOOP("running under a debugger can cause an implicit\n-nograb, use -dograb to override"), 0}, - { "sync", I18N_NOOP("switches to synchronous mode for debugging"), 0}, - { "fn", 0, 0}, - { "font ", I18N_NOOP("defines the application font"), 0}, - { "bg", 0, 0}, - { "background ", I18N_NOOP("sets the default background color and an\napplication palette (light and dark shades are\ncalculated)"), 0}, - { "fg", 0, 0}, - { "foreground ", I18N_NOOP("sets the default foreground color"), 0}, - { "btn", 0, 0}, - { "button ", I18N_NOOP("sets the default button color"), 0}, - { "name ", I18N_NOOP("sets the application name"), 0}, - { "title ", I18N_NOOP("sets the application title (caption)"), 0}, -#ifdef Q_WS_X11 - { "visual TrueColor", I18N_NOOP("forces the application to use a TrueColor visual on\nan 8-bit display"), 0}, - { "inputstyle <inputstyle>", I18N_NOOP("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot"), 0 }, - { "im <XIM server>", I18N_NOOP("set XIM server"),0}, - { "noxim", I18N_NOOP("disable XIM"), 0 }, -#endif -#ifdef Q_WS_QWS - { "qws", I18N_NOOP("forces the application to run as QWS Server"), 0}, -#endif - { "reverse", I18N_NOOP("mirrors the whole layout of widgets"), 0}, - TDECmdLineLastOption -}; - -static const TDECmdLineOptions kde_options[] = -{ - { "caption <caption>", I18N_NOOP("Use 'caption' as name in the titlebar"), 0}, - { "icon <icon>", I18N_NOOP("Use 'icon' as the application icon"), 0}, - { "miniicon <icon>", I18N_NOOP("Use 'icon' as the icon in the titlebar"), 0}, - { "config <filename>", I18N_NOOP("Use alternative configuration file"), 0}, - { "dcopserver <server>", I18N_NOOP("Use the DCOP Server specified by 'server'"), 0}, - { "nocrashhandler", I18N_NOOP("Disable crash handler, to get core dumps"), 0}, - { "waitforwm", I18N_NOOP("Waits for a WM_NET compatible windowmanager"), 0}, - { "style <style>", I18N_NOOP("sets the application GUI style"), 0}, - { "geometry <geometry>", I18N_NOOP("sets the client geometry of the main widget - see man X for the argument format"), 0}, - { "smkey <sessionKey>", 0, 0}, // this option is obsolete and exists only to allow smooth upgrades from sessions - // saved under Qt 3.0.x -- Qt 3.1.x includes the session key now automatically in - // the session id (Simon) - TDECmdLineLastOption -}; - -void -TDEApplication::addCmdLineOptions() -{ - TDECmdLineArgs::addCmdLineOptions(qt_options, "Qt", "qt"); - TDECmdLineArgs::addCmdLineOptions(kde_options, "TDE", "tde"); -} - -void TDEApplication::parseCommandLine( ) -{ - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs("tde"); - - if ( !args ) return; - - if (args->isSet("config")) - { - TQString config = TQString::fromLocal8Bit(args->getOption("config")); - setConfigName(config); - } - - if (args->isSet("style")) - { - - TQStringList plugins = TDEGlobal::dirs()->resourceDirs( "qtplugins" ); - TQStringList::Iterator itp = plugins.begin(); - while (itp != plugins.end()) { - addLibraryPath( *itp ); - ++itp; - } - - TQStringList styles = TQStyleFactory::keys(); - TQString reqStyle(args->getOption("style").lower()); - - TQStringList list = libraryPaths(); - TQStringList::Iterator it = list.begin(); - while( it != list.end() ) { - ++it; - } - - for (TQStringList::ConstIterator it = styles.begin(); it != styles.end(); ++it) { - if ((*it).lower() == reqStyle) - { - d->overrideStyle = *it; - break; - } - } - - if (d->overrideStyle.isEmpty()) - fprintf(stderr, "%s", TQString(i18n("The style %1 was not found\n").arg(reqStyle)).local8Bit().data()); - } - - if (args->isSet("caption")) - { - aCaption = TQString::fromLocal8Bit(args->getOption("caption")); - } - - if (args->isSet("miniicon")) - { - const char *tmp = args->getOption("miniicon"); - if (!aIconPixmap.pm.miniIcon) { - aIconPixmap.pm.miniIcon = new TQPixmap; - } - *aIconPixmap.pm.miniIcon = SmallIcon(tmp); - aMiniIconName = tmp; - } - - if (args->isSet("icon")) - { - const char *tmp = args->getOption("icon"); - if (!aIconPixmap.pm.icon) { - aIconPixmap.pm.icon = new TQPixmap; - } - *aIconPixmap.pm.icon = DesktopIcon( tmp ); - aIconName = tmp; - if (!aIconPixmap.pm.miniIcon) { - aIconPixmap.pm.miniIcon = new TQPixmap; - } - if (aIconPixmap.pm.miniIcon->isNull()) - { - *aIconPixmap.pm.miniIcon = SmallIcon( tmp ); - aMiniIconName = tmp; - } - } - - bool nocrashhandler = (getenv("TDE_DEBUG") != NULL); - if (!nocrashhandler && args->isSet("crashhandler")) - { - // set default crash handler / set emergency save function to nothing - TDECrash::setCrashHandler(TDECrash::defaultCrashHandler); - TDECrash::setEmergencySaveFunction(NULL); - - TDECrash::setApplicationName(TQString(args->appName())); - } - -#ifdef Q_WS_X11 - if ( args->isSet( "waitforwm" ) ) { - Atom type; - (void) desktop(); // trigger desktop creation, we need PropertyNotify events for the root window - int format; - unsigned long length, after; - unsigned char *data; - while ( XGetWindowProperty( tqt_xdisplay(), tqt_xrootwin(), atom_NetSupported, - 0, 1, false, AnyPropertyType, &type, &format, - &length, &after, &data ) != Success || !length ) { - if ( data ) - XFree( data ); - XEvent event; - XWindowEvent( tqt_xdisplay(), tqt_xrootwin(), PropertyChangeMask, &event ); - } - if ( data ) - XFree( data ); - } -#else - // FIXME(E): Implement for Qt Embedded -#endif - - if (args->isSet("geometry")) - { - d->geometry_arg = args->getOption("geometry"); - } - - if (args->isSet("smkey")) - { - d->sessionKey = args->getOption("smkey"); - } - -} - -TQString TDEApplication::geometryArgument() const -{ - return d->geometry_arg; -} - -TQPixmap TDEApplication::icon() const -{ - if( !aIconPixmap.pm.icon) { - aIconPixmap.pm.icon = new TQPixmap; - } - if( aIconPixmap.pm.icon->isNull()) { - *aIconPixmap.pm.icon = DesktopIcon( instanceName() ); - } - return *aIconPixmap.pm.icon; -} - -TQString TDEApplication::iconName() const -{ - return aIconName.isNull() ? (TQString)instanceName() : aIconName; -} - -TQPixmap TDEApplication::miniIcon() const -{ - if (!aIconPixmap.pm.miniIcon) { - aIconPixmap.pm.miniIcon = new TQPixmap; - } - if (aIconPixmap.pm.miniIcon->isNull()) { - *aIconPixmap.pm.miniIcon = SmallIcon( instanceName() ); - } - return *aIconPixmap.pm.miniIcon; -} - -TQString TDEApplication::miniIconName() const -{ - return aMiniIconName.isNull() ? (TQString)instanceName() : aMiniIconName; -} - -extern void kDebugCleanup(); - -TDEApplication::~TDEApplication() -{ - delete aIconPixmap.pm.miniIcon; - aIconPixmap.pm.miniIcon = 0L; - delete aIconPixmap.pm.icon; - aIconPixmap.pm.icon = 0L; - delete d->m_KAppDCOPInterface; - - // First call the static deleters and then call KLibLoader::cleanup() - // The static deleters may delete libraries for which they need KLibLoader. - // KLibLoader will take care of the remaining ones. - TDEGlobal::deleteStaticDeleters(); - KLibLoader::cleanUp(); - - delete smw; - - // close down IPC - delete s_DCOPClient; - s_DCOPClient = 0L; - - TDEProcessController::deref(); - -#ifdef Q_WS_X11 - if ( d->oldXErrorHandler != NULL ) - XSetErrorHandler( d->oldXErrorHandler ); - if ( d->oldXIOErrorHandler != NULL ) - XSetIOErrorHandler( d->oldXIOErrorHandler ); - if ( d->oldIceIOErrorHandler != NULL ) - IceSetIOErrorHandler( d->oldIceIOErrorHandler ); -#endif - - delete d; - KApp = 0; - -#ifdef Q_WS_X11 - mySmcConnection = 0; - delete smModificationTime; - smModificationTime = 0; - - // close the temporary smc connection - if (tmpSmcConnection) { - SmcCloseConnection( tmpSmcConnection, 0, 0 ); - tmpSmcConnection = 0; - } -#else - // FIXME(E): Implement for Qt Embedded -#endif -} - - -#ifdef Q_WS_X11 -class KAppX11HackWidget: public TQWidget -{ -public: - bool publicx11Event( XEvent * e) { return x11Event( e ); } -}; -#endif - -#if defined(Q_WS_X11) && defined(COMPOSITE) -bool TDEApplication::isCompositionManagerAvailable() { - bool have_manager = false; - const char *home; - struct passwd *p; - p = getpwuid(getuid()); - if (p) - home = p->pw_dir; - else - home = getenv("HOME"); - - char *filename; - const char *configfile = "/.kompmgr.available"; - int n = strlen(home)+strlen(configfile)+1; - filename = (char*)malloc(n*sizeof(char)); - memset(filename,0,n); - strcat(filename, home); - strcat(filename, configfile); - - // Now that we did all that by way of introduction...read the file! - FILE *pFile; - pFile = fopen(filename, "r"); - if (pFile) { - have_manager = true; - fclose(pFile); - } - - free(filename); - filename = NULL; - - return have_manager; -} - -bool TDEApplication::detectCompositionManagerAvailable(bool force_available, bool available) { - bool compositing_manager_available; - if (force_available) { - compositing_manager_available = available; - } - else { - // See if compositing has been enabled - TDECmdLineArgs *qtargs = TDECmdLineArgs::parsedArgs("qt"); - char *displayname = 0; - if ( qtargs->isSet("display")) - displayname = qtargs->getOption( "display" ).data(); - - Display *dpy = XOpenDisplay( displayname ); - - x11_composite_error_generated = false; - compositing_manager_available = false; - XSetErrorHandler(x11_error); - if (!XQueryExtension (dpy, COMPOSITE_NAME, &composite_opcode, &composite_event, &composite_error)) { - XSetErrorHandler(NULL); - compositing_manager_available = false; - } - else { - if (available) { // FIXME This variable does double duty to avoid breaking the ABI for R14.0. In reality it should be called perform_deep_check - Window root_window = XDefaultRootWindow(dpy); - XCompositeRedirectSubwindows(dpy, root_window, CompositeRedirectManual); - XSync(dpy, false); - if (x11_composite_error_generated == true) { - compositing_manager_available = true; - } - else { - XCompositeUnredirectSubwindows(dpy, root_window, CompositeRedirectManual); - compositing_manager_available = false; - } - XSetErrorHandler(NULL); - XCloseDisplay(dpy); - } - else { - compositing_manager_available = true; - } - } - } - - const char *home; - struct passwd *p; - p = getpwuid(getuid()); - if (p) - home = p->pw_dir; - else - home = getenv("HOME"); - - char *filename; - const char *configfile = "/.kompmgr.available"; - int n = strlen(home)+strlen(configfile)+1; - filename = (char*)malloc(n*sizeof(char)); - memset(filename,0,n); - strcat(filename, home); - strcat(filename, configfile); - - /* now that we did all that by way of introduction...create or remove the file! */ - if (compositing_manager_available) { - FILE *pFile; - char buffer[255]; - sprintf(buffer, "available"); - pFile = fopen(filename, "w"); - if (pFile) { - fwrite(buffer,1,strlen(buffer), pFile); - fclose(pFile); - } - } - else { - unlink(filename); - } - - free(filename); - filename = NULL; - - return compositing_manager_available; -} - -Display* TDEApplication::openX11RGBADisplay() { - TDECmdLineArgs *qtargs = TDECmdLineArgs::parsedArgs("qt"); - char *display = 0; - if ( qtargs->isSet("display")) - display = qtargs->getOption( "display" ).data(); - - Display *dpy = XOpenDisplay( display ); - if ( !dpy ) { - kdError() << "cannot connect to X server " << display << endl; - exit( 1 ); - } - - return dpy; -} - -Qt::HANDLE TDEApplication::getX11RGBAVisual(Display *dpy) { - getX11RGBAInformation(dpy); - if (TDEApplication::isCompositionManagerAvailable() == true) { - return argb_x11_visual; - } - else { - return (Qt::HANDLE)NULL; - } -} - -Qt::HANDLE TDEApplication::getX11RGBAColormap(Display *dpy) { - getX11RGBAInformation(dpy); - if (TDEApplication::isCompositionManagerAvailable() == true) { - return argb_x11_colormap; - } - else { - return (Qt::HANDLE)NULL; - } -} - -bool TDEApplication::isX11CompositionAvailable() { - return (argb_visual & isCompositionManagerAvailable()); -} - -void TDEApplication::getX11RGBAInformation(Display *dpy) { - if ( !dpy ) { - argb_visual = false; - return; - } - - int screen = DefaultScreen( dpy ); - Colormap colormap = 0; - Visual *visual = 0; - int event_base, error_base; - - if ( XRenderQueryExtension( dpy, &event_base, &error_base ) ) { - int nvi; - XVisualInfo templ; - templ.screen = screen; - templ.depth = 32; - templ.c_class = TrueColor; - XVisualInfo *xvi = XGetVisualInfo( dpy, VisualScreenMask | VisualDepthMask - | VisualClassMask, &templ, &nvi ); - - for ( int i = 0; i < nvi; i++ ) { - XRenderPictFormat *format = XRenderFindVisualFormat( dpy, xvi[i].visual ); - if ( format->type == PictTypeDirect && format->direct.alphaMask ) { - visual = xvi[i].visual; - colormap = XCreateColormap( dpy, RootWindow( dpy, screen ), visual, AllocNone ); - kdDebug() << "found visual with alpha support" << endl; - argb_visual = true; - break; - } - } - } - - if( argb_visual ) { - argb_x11_visual = Qt::HANDLE( visual ); - argb_x11_colormap = Qt::HANDLE( colormap ); - argb_visual = true; - return; - } - argb_visual = false; - return; -} -#else -void TDEApplication::getX11RGBAInformation(Display *dpy) { -} - -bool TDEApplication::isCompositionManagerAvailable() { - return false; -} - -bool TDEApplication::detectCompositionManagerAvailable(bool force_available) { - const char *home; - struct passwd *p; - p = getpwuid(getuid()); - if (p) - home = p->pw_dir; - else - home = getenv("HOME"); - - char *filename; - const char *configfile = "/.kompmgr.available"; - int n = strlen(home)+strlen(configfile)+1; - filename = (char*)malloc(n*sizeof(char)); - memset(filename,0,n); - strcat(filename, home); - strcat(filename, configfile); - - /* now that we did all that by way of introduction...create or remove the file! */ - if (force_available) { - FILE *pFile; - char buffer[255]; - sprintf(buffer, "available"); - pFile = fopen(filename, "w"); - if (pFile) { - fwrite(buffer,1,strlen(buffer), pFile); - fclose(pFile); - } - } - else { - unlink(filename); - } - - free(filename); - filename = NULL; - - return false; -} - -Display* TDEApplication::openX11RGBADisplay() { - return 0; -} - -Qt::HANDLE TDEApplication::getX11RGBAVisual(char *display) { - return 0; -} - -Qt::HANDLE TDEApplication::getX11RGBAColormap(char *display) { - return 0; -} - -bool TDEApplication::isX11CompositionAvailable() { - return false; -} - -TDEApplication TDEApplication::KARGBApplication( bool allowStyles ) { - return TDEApplication::TDEApplication(allowStyles, true); -} -#endif - -static bool kapp_block_user_input = false; - -void TDEApplication::dcopBlockUserInput( bool b ) -{ - kapp_block_user_input = b; -} - -#ifdef Q_WS_X11 -bool TDEApplication::x11EventFilter( XEvent *_event ) -{ - switch ( _event->type ) { - case ClientMessage: - { -#if KDE_IS_VERSION( 3, 90, 90 ) -#warning This should be already in Qt, check. -#endif - // Workaround for focus stealing prevention not working when dragging e.g. text from KWrite - // to KDesktop -> the dialog asking for filename doesn't get activated. This is because - // Qt-3.2.x doesn't have concept of tqt_x_user_time at all, and Qt-3.3.0b1 passes the timestamp - // in the XdndDrop message in incorrect field (and doesn't update tqt_x_user_time either). - // Patch already sent, future Qt version should have this fixed. - if( _event->xclient.message_type == kde_xdnd_drop ) - { // if the message is XdndDrop - if( _event->xclient.data.l[ 1 ] == 1 << 24 // and it's broken the way it's in Qt-3.2.x - && _event->xclient.data.l[ 2 ] == 0 - && _event->xclient.data.l[ 4 ] == 0 - && _event->xclient.data.l[ 3 ] != 0 ) - { - if( GET_QT_X_USER_TIME() == 0 - || NET::timestampCompare( _event->xclient.data.l[ 3 ], GET_QT_X_USER_TIME() ) > 0 ) - { // and the timestamp looks reasonable - SET_QT_X_USER_TIME(_event->xclient.data.l[ 3 ]); // update our tqt_x_user_time from it - } - } - else // normal DND, only needed until Qt updates tqt_x_user_time from XdndDrop - { - if( GET_QT_X_USER_TIME() == 0 - || NET::timestampCompare( _event->xclient.data.l[ 2 ], GET_QT_X_USER_TIME() ) > 0 ) - { // the timestamp looks reasonable - SET_QT_X_USER_TIME(_event->xclient.data.l[ 2 ]); // update our tqt_x_user_time from it - } - } - } - } - default: break; - } - - if ( kapp_block_user_input ) { - switch ( _event->type ) { - case ButtonPress: - case ButtonRelease: - case XKeyPress: - case XKeyRelease: - case MotionNotify: - case EnterNotify: - case LeaveNotify: - return true; - default: - break; - } - } - - if (x11Filter) { - for (TQWidget *w=x11Filter->first(); w; w=x11Filter->next()) { - if (((KAppX11HackWidget*) w)->publicx11Event(_event)) - return true; - } - } - - if ((_event->type == ClientMessage) && - (_event->xclient.message_type == kipcCommAtom)) - { - XClientMessageEvent *cme = (XClientMessageEvent *) _event; - - int id = cme->data.l[0]; - int arg = cme->data.l[1]; - if ((id < 32) && (kipcEventMask & (1 << id))) - { - switch (id) - { - case KIPC::StyleChanged: - TDEGlobal::config()->reparseConfiguration(); - tdedisplaySetStyle(); - break; - - case KIPC::ToolbarStyleChanged: - TDEGlobal::config()->reparseConfiguration(); - if (useStyles) - emit toolbarAppearanceChanged(arg); - break; - - case KIPC::PaletteChanged: - TDEGlobal::config()->reparseConfiguration(); - tdedisplaySetPalette(); - break; - - case KIPC::FontChanged: - TDEGlobal::config()->reparseConfiguration(); - TDEGlobalSettings::rereadFontSettings(); - tdedisplaySetFont(); - break; - - case KIPC::BackgroundChanged: - emit backgroundChanged(arg); - break; - - case KIPC::SettingsChanged: - TDEGlobal::config()->reparseConfiguration(); - if (arg == SETTINGS_PATHS) - TDEGlobalSettings::rereadPathSettings(); - else if (arg == SETTINGS_MOUSE) - TDEGlobalSettings::rereadMouseSettings(); - propagateSettings((SettingsCategory)arg); - break; - - case KIPC::IconChanged: - TQPixmapCache::clear(); - TDEGlobal::config()->reparseConfiguration(); - TDEGlobal::instance()->newIconLoader(); - emit updateIconLoaders(); - emit iconChanged(arg); - break; - - case KIPC::ClipboardConfigChanged: - TDEClipboardSynchronizer::newConfiguration(arg); - break; - - case KIPC::BlockShortcuts: - TDEGlobalAccel::blockShortcuts(arg); - emit kipcMessage(id, arg); // some apps may do additional things - break; - } - } - else if (id >= 32) - { - emit kipcMessage(id, arg); - } - return true; - } - return false; -} -#endif // Q_WS_X11 - -void TDEApplication::updateUserTimestamp( unsigned long time ) -{ -#if defined Q_WS_X11 - if( time == 0 ) - { // get current X timestamp - Window w = XCreateSimpleWindow( tqt_xdisplay(), tqt_xrootwin(), 0, 0, 1, 1, 0, 0, 0 ); - XSelectInput( tqt_xdisplay(), w, PropertyChangeMask ); - unsigned char data[ 1 ]; - XChangeProperty( tqt_xdisplay(), w, XA_ATOM, XA_ATOM, 8, PropModeAppend, data, 1 ); - XEvent ev; - XWindowEvent( tqt_xdisplay(), w, PropertyChangeMask, &ev ); - time = ev.xproperty.time; - XDestroyWindow( tqt_xdisplay(), w ); - } - if( GET_QT_X_USER_TIME() == 0 - || NET::timestampCompare( time, GET_QT_X_USER_TIME() ) > 0 ) // check time > tqt_x_user_time - SET_QT_X_USER_TIME(time); -#endif -} - -unsigned long TDEApplication::userTimestamp() const -{ -#if defined Q_WS_X11 - return GET_QT_X_USER_TIME(); -#else - return 0; -#endif -} - -void TDEApplication::updateRemoteUserTimestamp( const TQCString& dcopId, unsigned long time ) -{ -#if defined Q_WS_X11 - if( time == 0 ) - time = GET_QT_X_USER_TIME(); - DCOPRef( dcopId, "MainApplication-Interface" ).call( "updateUserTimestamp", time ); -#endif -} - -void TDEApplication::invokeEditSlot( const char *slot ) -{ - TQObject *object = TQT_TQOBJECT(focusWidget()); - if( !object ) - return; - - TQMetaObject *meta = object->metaObject(); - - int idx = meta->findSlot( slot + 1, true ); - if( idx < 0 ) - return; - - object->tqt_invoke( idx, 0 ); -} - -void TDEApplication::addKipcEventMask(int id) -{ - if (id >= 32) - { - kdDebug(101) << "Cannot use KIPC event mask for message IDs >= 32\n"; - return; - } - kipcEventMask |= (1 << id); -} - -void TDEApplication::removeKipcEventMask(int id) -{ - if (id >= 32) - { - kdDebug(101) << "Cannot use KIPC event mask for message IDs >= 32\n"; - return; - } - kipcEventMask &= ~(1 << id); -} - -void TDEApplication::enableStyles() -{ - if (!useStyles) - { - useStyles = true; - applyGUIStyle(); - } -} - -void TDEApplication::disableStyles() -{ - useStyles = false; -} - -void TDEApplication::applyGUIStyle() -{ - if ( !useStyles ) return; - - TDEConfigGroup pConfig (TDEGlobal::config(), "General"); - TQString defaultStyle = TDEStyle::defaultStyle(); - TQString styleStr = pConfig.readEntry("widgetStyle", defaultStyle); - - if (d->overrideStyle.isEmpty()) { - // ### add check whether we already use the correct style to return then - // (workaround for Qt misbehavior to avoid double style initialization) - - TQStyle* sp = TQStyleFactory::create( styleStr ); - - // If there is no default style available, try falling back any available style - if ( !sp && styleStr != defaultStyle) - sp = TQStyleFactory::create( defaultStyle ); - if ( !sp ) - sp = TQStyleFactory::create( *(TQStyleFactory::keys().begin()) ); - setStyle(sp); - } - else - setStyle(d->overrideStyle); - // Reread palette from config file. - tdedisplaySetPalette(); -} - -TQString TDEApplication::caption() const -{ - // Caption set from command line ? - if( !aCaption.isNull() ) - return aCaption; - else - // We have some about data ? - if ( TDEGlobal::instance()->aboutData() ) - return TDEGlobal::instance()->aboutData()->programName(); - else - // Last resort : application name - return name(); -} - - -// -// 1999-09-20: Espen Sand -// An attempt to simplify consistent captions. -// -TQString TDEApplication::makeStdCaption( const TQString &userCaption, - bool withAppName, bool modified ) const -{ - TQString s = userCaption.isEmpty() ? caption() : userCaption; - - // If the document is modified, add '[modified]'. - if (modified) - s += TQString::fromUtf8(" [") + i18n("modified") + TQString::fromUtf8("]"); - - if ( !userCaption.isEmpty() ) { - // Add the application name if: - // User asked for it, it's not a duplication and the app name (caption()) is not empty - if ( withAppName && !caption().isNull() && !userCaption.endsWith(caption()) ) - s += TQString::fromUtf8(" - ") + caption(); - } - - return s; -} - -TQPalette TDEApplication::createApplicationPalette() -{ - TDEConfig *config = TDEGlobal::config(); - TDEConfigGroupSaver saver( config, "General" ); - return createApplicationPalette( config, TDEGlobalSettings::contrast() ); -} - -TQPalette TDEApplication::createApplicationPalette( TDEConfig *config, int contrast_ ) -{ - TQColor trinity4Background( 239, 239, 239 ); - TQColor trinity4Blue( 103,141,178 ); - - TQColor trinity4Button; - if ( TQPixmap::defaultDepth() > 8 ) - trinity4Button.setRgb( 221, 223, 228 ); - else - trinity4Button.setRgb( 220, 220, 220 ); - - TQColor trinity4Link( 0, 0, 238 ); - TQColor trinity4VisitedLink( 82, 24, 139 ); - - TQColor background = config->readColorEntry( "background", &trinity4Background ); - TQColor foreground = config->readColorEntry( "foreground", tqblackptr ); - TQColor button = config->readColorEntry( "buttonBackground", &trinity4Button ); - TQColor buttonText = config->readColorEntry( "buttonForeground", tqblackptr ); - TQColor highlight = config->readColorEntry( "selectBackground", &trinity4Blue ); - TQColor highlightedText = config->readColorEntry( "selectForeground", tqwhiteptr ); - TQColor base = config->readColorEntry( "windowBackground", tqwhiteptr ); - TQColor baseText = config->readColorEntry( "windowForeground", tqblackptr ); - TQColor link = config->readColorEntry( "linkColor", &trinity4Link ); - TQColor visitedLink = config->readColorEntry( "visitedLinkColor", &trinity4VisitedLink ); - - int highlightVal, lowlightVal; - highlightVal = 100 + (2*contrast_+4)*16/10; - lowlightVal = 100 + (2*contrast_+4)*10; - - TQColor disfg = foreground; - - int h, s, v; - disfg.hsv( &h, &s, &v ); - if (v > 128) - // dark bg, light fg - need a darker disabled fg - disfg = disfg.dark(lowlightVal); - else if (disfg != Qt::black) - // light bg, dark fg - need a lighter disabled fg - but only if !black - disfg = disfg.light(highlightVal); - else - // black fg - use darkgray disabled fg - disfg = Qt::darkGray; - - - TQColorGroup disabledgrp(disfg, background, - background.light(highlightVal), - background.dark(lowlightVal), - background.dark(120), - background.dark(120), base); - - TQColorGroup colgrp(foreground, background, background.light(highlightVal), - background.dark(lowlightVal), - background.dark(120), - baseText, base); - - int inlowlightVal = lowlightVal-25; - if(inlowlightVal < 120) - inlowlightVal = 120; - - colgrp.setColor(TQColorGroup::Highlight, highlight); - colgrp.setColor(TQColorGroup::HighlightedText, highlightedText); - colgrp.setColor(TQColorGroup::Button, button); - colgrp.setColor(TQColorGroup::ButtonText, buttonText); - colgrp.setColor(TQColorGroup::Midlight, background.light(110)); - colgrp.setColor(TQColorGroup::Link, link); - colgrp.setColor(TQColorGroup::LinkVisited, visitedLink); - - disabledgrp.setColor(TQColorGroup::Button, button); - - TQColor disbtntext = buttonText; - disbtntext.hsv( &h, &s, &v ); - if (v > 128) - // dark button, light buttonText - need a darker disabled buttonText - disbtntext = disbtntext.dark(lowlightVal); - else if (disbtntext != Qt::black) - // light buttonText, dark button - need a lighter disabled buttonText - but only if !black - disbtntext = disbtntext.light(highlightVal); - else - // black button - use darkgray disabled buttonText - disbtntext = Qt::darkGray; - - disabledgrp.setColor(TQColorGroup::ButtonText, disbtntext); - disabledgrp.setColor(TQColorGroup::Midlight, background.light(110)); - disabledgrp.setColor(TQColorGroup::Highlight, highlight.dark(120)); - disabledgrp.setColor(TQColorGroup::Link, link); - disabledgrp.setColor(TQColorGroup::LinkVisited, visitedLink); - - return TQPalette(colgrp, disabledgrp, colgrp); -} - - -void TDEApplication::tdedisplaySetPalette() -{ -#ifdef Q_WS_MACX - //Can I have this on other platforms, please!? --Sam - { - TDEConfig *config = TDEGlobal::config(); - TDEConfigGroupSaver saver( config, "General" ); - bool do_not_set_palette = FALSE; - if(config->readBoolEntry("nopaletteChange", &do_not_set_palette)) - return; - } -#endif - TQApplication::setPalette( createApplicationPalette(), true); - emit tdedisplayPaletteChanged(); - emit appearanceChanged(); -} - - -void TDEApplication::tdedisplaySetFont() -{ - TQApplication::setFont(TDEGlobalSettings::generalFont(), true); - TQApplication::setFont(TDEGlobalSettings::menuFont(), true, TQMENUBAR_OBJECT_NAME_STRING); - TQApplication::setFont(TDEGlobalSettings::menuFont(), true, TQPOPUPMENU_OBJECT_NAME_STRING); - TQApplication::setFont(TDEGlobalSettings::menuFont(), true, "TDEPopupTitle"); - - // "patch" standard TQStyleSheet to follow our fonts - TQStyleSheet* sheet = TQStyleSheet::defaultSheet(); - sheet->item ("pre")->setFontFamily (TDEGlobalSettings::fixedFont().family()); - sheet->item ("code")->setFontFamily (TDEGlobalSettings::fixedFont().family()); - sheet->item ("tt")->setFontFamily (TDEGlobalSettings::fixedFont().family()); - - emit tdedisplayFontChanged(); - emit appearanceChanged(); -} - - -void TDEApplication::tdedisplaySetStyle() -{ - if (useStyles) - { - applyGUIStyle(); - emit tdedisplayStyleChanged(); - emit appearanceChanged(); - } -} - - -void TDEApplication::propagateSettings(SettingsCategory arg) -{ - TDEConfigBase* config = TDEGlobal::config(); - TDEConfigGroupSaver saver( config, "KDE" ); - -#ifdef QT_HAVE_MAX_IMAGE_SIZE - TQSize maxImageSize(4096, 4096); - maxImageSize = config->readSizeEntry("MaxImageSize", &maxImageSize); - TQImage::setMaxImageSize(maxImageSize); -#endif - - int num = config->readNumEntry("CursorBlinkRate", TQApplication::cursorFlashTime()); - if ((num != 0) && (num < 200)) - num = 200; - if (num > 2000) - num = 2000; - TQApplication::setCursorFlashTime(num); - num = config->readNumEntry("DoubleClickInterval", TQApplication::doubleClickInterval()); - TQApplication::setDoubleClickInterval(num); - num = config->readNumEntry("StartDragTime", TQApplication::startDragTime()); - TQApplication::setStartDragTime(num); - num = config->readNumEntry("StartDragDist", TQApplication::startDragDistance()); - TQApplication::setStartDragDistance(num); - num = config->readNumEntry("WheelScrollLines", TQApplication::wheelScrollLines()); - TQApplication::setWheelScrollLines(num); - - bool b = config->readBoolEntry("EffectAnimateMenu", false); - TQApplication::setEffectEnabled( Qt::UI_AnimateMenu, b); - b = config->readBoolEntry("EffectFadeMenu", false); - TQApplication::setEffectEnabled( Qt::UI_FadeMenu, b); - b = config->readBoolEntry("EffectAnimateCombo", false); - TQApplication::setEffectEnabled( Qt::UI_AnimateCombo, b); - b = config->readBoolEntry("EffectAnimateTooltip", false); - TQApplication::setEffectEnabled( Qt::UI_AnimateTooltip, b); - b = config->readBoolEntry("EffectFadeTooltip", false); - TQApplication::setEffectEnabled( Qt::UI_FadeTooltip, b); - b = !config->readBoolEntry("EffectNoTooltip", false); - TQToolTip::setGloballyEnabled( b ); - - emit settingsChanged(arg); -} - -void TDEApplication::installKDEPropertyMap() -{ -#ifndef QT_NO_SQL - static bool installed = false; - if (installed) return; - installed = true; - /** - * If you are adding a widget that was missing please - * make sure to also add it to TDEConfigDialogManager's retrieveSettings() - * function. - * Thanks. - */ - // TQSqlPropertyMap takes ownership of the new default map. - TQSqlPropertyMap *kdeMap = new TQSqlPropertyMap; - kdeMap->insert( "KColorButton", "color" ); - kdeMap->insert( "KComboBox", "currentItem" ); - kdeMap->insert( "KDatePicker", "date" ); - kdeMap->insert( "KDateWidget", "date" ); - kdeMap->insert( "KDateTimeWidget", "dateTime" ); - kdeMap->insert( "KEditListBox", "items" ); - kdeMap->insert( "TDEFontCombo", "family" ); - kdeMap->insert( "TDEFontRequester", "font" ); - kdeMap->insert( "TDEFontChooser", "font" ); - kdeMap->insert( "KHistoryCombo", "currentItem" ); - kdeMap->insert( "TDEListBox", "currentItem" ); - kdeMap->insert( "KLineEdit", "text" ); - kdeMap->insert( "KRestrictedLine", "text" ); - kdeMap->insert( "KSqueezedTextLabel", "text" ); - kdeMap->insert( "KTextBrowser", "source" ); - kdeMap->insert( "KTextEdit", "text" ); - kdeMap->insert( "KURLRequester", "url" ); - kdeMap->insert( "KPasswordEdit", "password" ); - kdeMap->insert( "KIntNumInput", "value" ); - kdeMap->insert( "KIntSpinBox", "value" ); - kdeMap->insert( "KDoubleNumInput", "value" ); - // Temp til fixed in QT then enable ifdef with the correct version num - kdeMap->insert( TQGROUPBOX_OBJECT_NAME_STRING, "checked" ); - kdeMap->insert( TQTABWIDGET_OBJECT_NAME_STRING, "currentPage" ); - TQSqlPropertyMap::installDefaultMap( kdeMap ); -#endif -} - -void TDEApplication::invokeHelp( const TQString& anchor, - const TQString& _appname) const -{ - return invokeHelp( anchor, _appname, "" ); -} - -#ifndef Q_WS_WIN -// for win32 we're using simple help tools like Qt Assistant, -// see kapplication_win.cpp -void TDEApplication::invokeHelp( const TQString& anchor, - const TQString& _appname, - const TQCString& startup_id ) const -{ - TQString url; - TQString appname; - if (_appname.isEmpty()) - appname = name(); - else - appname = _appname; - - if (!anchor.isEmpty()) - url = TQString("help:/%1?anchor=%2").arg(appname).arg(anchor); - else - url = TQString("help:/%1/index.html").arg(appname); - - TQString error; - if ( !dcopClient()->isApplicationRegistered("khelpcenter") ) - { - if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, startup_id, false)) - { - if (Tty != kapp->type()) - TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Help Center"), - i18n("Could not launch the TDE Help Center:\n\n%1").arg(error), i18n("&OK")); - else - kdWarning() << "Could not launch help:\n" << error << endl; - return; - } - } - else - DCOPRef( "khelpcenter", "KHelpCenterIface" ).send( "openUrl", url, startup_id ); -} -#endif - -void TDEApplication::invokeHTMLHelp( const TQString& _filename, const TQString& topic ) const -{ - kdWarning() << "invoking HTML help is deprecated! use docbook and invokeHelp!\n"; - - TQString filename; - - if( _filename.isEmpty() ) - filename = TQString(name()) + "/index.html"; - else - filename = _filename; - - TQString url; - if (!topic.isEmpty()) - url = TQString("help:/%1#%2").arg(filename).arg(topic); - else - url = TQString("help:/%1").arg(filename); - - TQString error; - if ( !dcopClient()->isApplicationRegistered("khelpcenter") ) - { - if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, "", false)) - { - if (Tty != kapp->type()) - TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Help Center"), - i18n("Could not launch the TDE Help Center:\n\n%1").arg(error), i18n("&OK")); - else - kdWarning() << "Could not launch help:\n" << error << endl; - return; - } - } - else - DCOPRef( "khelpcenter", "KHelpCenterIface" ).send( "openUrl", url ); -} - - -void TDEApplication::invokeMailer(const TQString &address, const TQString &subject) -{ - return invokeMailer(address,subject,""); -} - -void TDEApplication::invokeMailer(const TQString &address, const TQString &subject, const TQCString& startup_id) -{ - invokeMailer(address, TQString::null, TQString::null, subject, TQString::null, TQString::null, - TQStringList(), startup_id ); -} - -void TDEApplication::invokeMailer(const KURL &mailtoURL) -{ - return invokeMailer( mailtoURL, "" ); -} - -void TDEApplication::invokeMailer(const KURL &mailtoURL, const TQCString& startup_id ) -{ - return invokeMailer( mailtoURL, startup_id, false); -} - -void TDEApplication::invokeMailer(const KURL &mailtoURL, const TQCString& startup_id, bool allowAttachments ) -{ - TQString address = KURL::decode_string(mailtoURL.path()), subject, cc, bcc, body; - TQStringList queries = TQStringList::split('&', mailtoURL.query().mid(1)); - TQStringList attachURLs; - for (TQStringList::Iterator it = queries.begin(); it != queries.end(); ++it) - { - TQString q = (*it).lower(); - if (q.startsWith("subject=")) - subject = KURL::decode_string((*it).mid(8)); - else - if (q.startsWith("cc=")) - cc = cc.isEmpty()? KURL::decode_string((*it).mid(3)): cc + ',' + KURL::decode_string((*it).mid(3)); - else - if (q.startsWith("bcc=")) - bcc = bcc.isEmpty()? KURL::decode_string((*it).mid(4)): bcc + ',' + KURL::decode_string((*it).mid(4)); - else - if (q.startsWith("body=")) - body = KURL::decode_string((*it).mid(5)); - else - if (allowAttachments && q.startsWith("attach=")) - attachURLs.push_back(KURL::decode_string((*it).mid(7))); - else - if (allowAttachments && q.startsWith("attachment=")) - attachURLs.push_back(KURL::decode_string((*it).mid(11))); - else - if (q.startsWith("to=")) - address = address.isEmpty()? KURL::decode_string((*it).mid(3)): address + ',' + KURL::decode_string((*it).mid(3)); - } - - invokeMailer( address, cc, bcc, subject, body, TQString::null, attachURLs, startup_id ); -} - -void TDEApplication::invokeMailer(const TQString &to, const TQString &cc, const TQString &bcc, - const TQString &subject, const TQString &body, - const TQString & messageFile, const TQStringList &attachURLs) -{ - return invokeMailer(to,cc,bcc,subject,body,messageFile,attachURLs,""); -} - -#ifndef Q_WS_WIN -// on win32, for invoking browser we're using win32 API -// see kapplication_win.cpp - -static TQStringList splitEmailAddressList( const TQString & aStr ) -{ - // This is a copy of KPIM::splitEmailAddrList(). - // Features: - // - always ignores quoted characters - // - ignores everything (including parentheses and commas) - // inside quoted strings - // - supports nested comments - // - ignores everything (including double quotes and commas) - // inside comments - - TQStringList list; - - if (aStr.isEmpty()) - return list; - - TQString addr; - uint addrstart = 0; - int commentlevel = 0; - bool insidequote = false; - - for (uint index=0; index<aStr.length(); index++) { - // the following conversion to latin1 is o.k. because - // we can safely ignore all non-latin1 characters - switch (aStr[index].latin1()) { - case '"' : // start or end of quoted string - if (commentlevel == 0) - insidequote = !insidequote; - break; - case '(' : // start of comment - if (!insidequote) - commentlevel++; - break; - case ')' : // end of comment - if (!insidequote) { - if (commentlevel > 0) - commentlevel--; - else { - //kdDebug() << "Error in address splitting: Unmatched ')'" - // << endl; - return list; - } - } - break; - case '\\' : // quoted character - index++; // ignore the quoted character - break; - case ',' : - if (!insidequote && (commentlevel == 0)) { - addr = aStr.mid(addrstart, index-addrstart); - if (!addr.isEmpty()) - list += addr.simplifyWhiteSpace(); - addrstart = index+1; - } - break; - } - } - // append the last address to the list - if (!insidequote && (commentlevel == 0)) { - addr = aStr.mid(addrstart, aStr.length()-addrstart); - if (!addr.isEmpty()) - list += addr.simplifyWhiteSpace(); - } - //else - // kdDebug() << "Error in address splitting: " - // << "Unexpected end of address list" - // << endl; - - return list; -} - -void TDEApplication::invokeMailer(const TQString &_to, const TQString &_cc, const TQString &_bcc, - const TQString &subject, const TQString &body, - const TQString & /*messageFile TODO*/, const TQStringList &attachURLs, - const TQCString& startup_id ) -{ - TDEConfig config("emaildefaults"); - - config.setGroup("Defaults"); - TQString group = config.readEntry("Profile","Default"); - - config.setGroup( TQString("PROFILE_%1").arg(group) ); - TQString command = config.readPathEntry("EmailClient"); - - TQString to, cc, bcc; - if (command.isEmpty() || command == TQString::fromLatin1("kmail") - || command.endsWith("/kmail")) - { - command = TQString::fromLatin1("kmail --composer -s %s -c %c -b %b --body %B --attach %A -- %t"); - if ( !_to.isEmpty() ) - { - // put the whole address lists into RFC2047 encoded blobs; technically - // this isn't correct, but KMail understands it nonetheless - to = TQString( "=?utf8?b?%1?=" ) - .arg( TQString(KCodecs::base64Encode( _to.utf8(), false )) ); - } - if ( !_cc.isEmpty() ) - cc = TQString( "=?utf8?b?%1?=" ) - .arg( TQString(KCodecs::base64Encode( _cc.utf8(), false )) ); - if ( !_bcc.isEmpty() ) - bcc = TQString( "=?utf8?b?%1?=" ) - .arg( TQString(KCodecs::base64Encode( _bcc.utf8(), false )) ); - } else { - to = _to; - cc = _cc; - bcc = _bcc; - if( !command.contains( '%' )) - command += " %u"; - } - - if (config.readBoolEntry("TerminalClient", false)) - { - TDEConfigGroup confGroup( TDEGlobal::config(), "General" ); - TQString preferredTerminal = confGroup.readPathEntry("TerminalApplication", "konsole"); - command = preferredTerminal + " -e " + command; - } - - TQStringList cmdTokens = KShell::splitArgs(command); - TQString cmd = cmdTokens[0]; - cmdTokens.remove(cmdTokens.begin()); - - KURL url; - TQStringList qry; - if (!to.isEmpty()) - { - TQStringList tos = splitEmailAddressList( to ); - url.setPath( tos.first() ); - tos.remove( tos.begin() ); - for (TQStringList::ConstIterator it = tos.begin(); it != tos.end(); ++it) - qry.append( "to=" + KURL::encode_string( *it ) ); - } - const TQStringList ccs = splitEmailAddressList( cc ); - for (TQStringList::ConstIterator it = ccs.begin(); it != ccs.end(); ++it) - qry.append( "cc=" + KURL::encode_string( *it ) ); - const TQStringList bccs = splitEmailAddressList( bcc ); - for (TQStringList::ConstIterator it = bccs.begin(); it != bccs.end(); ++it) - qry.append( "bcc=" + KURL::encode_string( *it ) ); - for (TQStringList::ConstIterator it = attachURLs.begin(); it != attachURLs.end(); ++it) - qry.append( "attach=" + KURL::encode_string( *it ) ); - if (!subject.isEmpty()) - qry.append( "subject=" + KURL::encode_string( subject ) ); - if (!body.isEmpty()) - qry.append( "body=" + KURL::encode_string( body ) ); - url.setQuery( qry.join( "&" ) ); - if ( ! (to.isEmpty() && qry.isEmpty()) ) - url.setProtocol("mailto"); - - TQMap<TQChar, TQString> keyMap; - keyMap.insert('t', to); - keyMap.insert('s', subject); - keyMap.insert('c', cc); - keyMap.insert('b', bcc); - keyMap.insert('B', body); - keyMap.insert('u', url.url()); - - TQString attachlist = attachURLs.join(","); - attachlist.prepend('\''); - attachlist.append('\''); - keyMap.insert('A', attachlist); - - for (TQStringList::Iterator it = cmdTokens.begin(); it != cmdTokens.end(); ) - { - if (*it == "%A") - { - if (it == cmdTokens.begin()) // better safe than sorry ... - continue; - TQStringList::ConstIterator urlit = attachURLs.begin(); - TQStringList::ConstIterator urlend = attachURLs.end(); - if ( urlit != urlend ) - { - TQStringList::Iterator previt = it; - --previt; - *it = *urlit; - ++it; - while ( ++urlit != urlend ) - { - cmdTokens.insert( it, *previt ); - cmdTokens.insert( it, *urlit ); - } - } else { - --it; - it = cmdTokens.remove( cmdTokens.remove( it ) ); - } - } else { - *it = KMacroExpander::expandMacros(*it, keyMap); - ++it; - } - } - - TQString error; - // TODO this should check if cmd has a .desktop file, and use data from it, together - // with sending more ASN data - if (tdeinitExec(cmd, cmdTokens, &error, NULL, startup_id )) { - if (Tty != kapp->type()) { - TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Mail Client"), - i18n("Could not launch the mail client:\n\n%1").arg(error), i18n("&OK")); - } - else { - kdWarning() << "Could not launch mail client:\n" << error << endl; - } - } -} -#endif - -void TDEApplication::invokeBrowser( const TQString &url ) -{ - return invokeBrowser( url, "" ); -} - -#ifndef Q_WS_WIN -// on win32, for invoking browser we're using win32 API -// see kapplication_win.cpp -void TDEApplication::invokeBrowser( const TQString &url, const TQCString& startup_id ) -{ - TQString error; - - if (startServiceByDesktopName("kfmclient", url, &error, 0, 0, startup_id, false)) - { - if (Tty != kapp->type()) - TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Browser"), - i18n("Could not launch the browser:\n\n%1").arg(error), i18n("&OK")); - else - kdWarning() << "Could not launch browser:\n" << error << endl; - return; - } -} -#endif - -void TDEApplication::cut() -{ - invokeEditSlot( TQT_SLOT( cut() ) ); -} - -void TDEApplication::copy() -{ - invokeEditSlot( TQT_SLOT( copy() ) ); -} - -void TDEApplication::paste() -{ - invokeEditSlot( TQT_SLOT( paste() ) ); -} - -void TDEApplication::clear() -{ - invokeEditSlot( TQT_SLOT( clear() ) ); -} - -void TDEApplication::selectAll() -{ - invokeEditSlot( TQT_SLOT( selectAll() ) ); -} - -void TDEApplication::broadcastKeyCode(unsigned int keyCode) -{ - emit coreFakeKeyPress(keyCode); -} - -TQCString -TDEApplication::launcher() -{ - return "tdelauncher"; -} - -static int -startServiceInternal( const TQCString &function, - const TQString& _name, const TQStringList &URLs, - TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) -{ - struct serviceResult - { - int result; - TQCString dcopName; - TQString error; - pid_t pid; - }; - - // Register app as able to send DCOP messages - DCOPClient *dcopClient; - if (kapp) - dcopClient = kapp->dcopClient(); - else - dcopClient = new DCOPClient; - - if (!dcopClient->isAttached()) - { - if (!dcopClient->attach()) - { - if (error) - *error = i18n("Could not register with DCOP.\n"); - if (!kapp) - delete dcopClient; - - return -1; - } - } - TQByteArray params; - TQDataStream stream(params, IO_WriteOnly); - stream << _name << URLs; - TQCString replyType; - TQByteArray replyData; - TQCString _launcher = TDEApplication::launcher(); - TQValueList<TQCString> envs; -#ifdef Q_WS_X11 - if (tqt_xdisplay()) { - TQCString dpystring(XDisplayString(tqt_xdisplay())); - envs.append( TQCString("DISPLAY=") + dpystring ); - } else if( getenv( "DISPLAY" )) { - TQCString dpystring( getenv( "DISPLAY" )); - envs.append( TQCString("DISPLAY=") + dpystring ); - } -#endif - stream << envs; -#if defined Q_WS_X11 - // make sure there is id, so that user timestamp exists - stream << ( startup_id.isEmpty() ? TDEStartupInfo::createNewStartupId() : startup_id ); -#endif - if( function.left( 12 ) != "tdeinit_exec" ) - stream << noWait; - - if (!dcopClient->call(_launcher, _launcher, - function, params, replyType, replyData)) - { - if (error) - *error = i18n("TDELauncher could not be reached via DCOP.\n"); - if (!kapp) - delete dcopClient; - return -1; - } - if (!kapp) - delete dcopClient; - - if (noWait) - return 0; - - TQDataStream stream2(replyData, IO_ReadOnly); - serviceResult result; - stream2 >> result.result >> result.dcopName >> result.error >> result.pid; - if (dcopService) - *dcopService = result.dcopName; - if (error) - *error = result.error; - if (pid) - *pid = result.pid; - return result.result; -} - -int -TDEApplication::startServiceByName( const TQString& _name, const TQString &URL, - TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) -{ - TQStringList URLs; - if (!URL.isEmpty()) - URLs.append(URL); - return startServiceInternal( - "start_service_by_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", - _name, URLs, error, dcopService, pid, startup_id, noWait); -} - -int -TDEApplication::startServiceByName( const TQString& _name, const TQStringList &URLs, - TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) -{ - return startServiceInternal( - "start_service_by_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", - _name, URLs, error, dcopService, pid, startup_id, noWait); -} - -int -TDEApplication::startServiceByDesktopPath( const TQString& _name, const TQString &URL, - TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) -{ - TQStringList URLs; - if (!URL.isEmpty()) - URLs.append(URL); - return startServiceInternal( - "start_service_by_desktop_path(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", - _name, URLs, error, dcopService, pid, startup_id, noWait); -} - -int -TDEApplication::startServiceByDesktopPath( const TQString& _name, const TQStringList &URLs, - TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) -{ - return startServiceInternal( - "start_service_by_desktop_path(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", - _name, URLs, error, dcopService, pid, startup_id, noWait); -} - -int -TDEApplication::startServiceByDesktopName( const TQString& _name, const TQString &URL, - TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) -{ - TQStringList URLs; - if (!URL.isEmpty()) - URLs.append(URL); - return startServiceInternal( - "start_service_by_desktop_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", - _name, URLs, error, dcopService, pid, startup_id, noWait); -} - -int -TDEApplication::startServiceByDesktopName( const TQString& _name, const TQStringList &URLs, - TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) -{ - return startServiceInternal( - "start_service_by_desktop_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", - _name, URLs, error, dcopService, pid, startup_id, noWait); -} - -int -TDEApplication::tdeinitExec( const TQString& name, const TQStringList &args, - TQString *error, int *pid ) -{ - return tdeinitExec( name, args, error, pid, "" ); -} - -int -TDEApplication::tdeinitExec( const TQString& name, const TQStringList &args, - TQString *error, int *pid, const TQCString& startup_id ) -{ - return startServiceInternal("tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)", - name, args, error, 0, pid, startup_id, false); -} - -int -TDEApplication::tdeinitExecWait( const TQString& name, const TQStringList &args, - TQString *error, int *pid ) -{ - return tdeinitExecWait( name, args, error, pid, "" ); -} - -int -TDEApplication::tdeinitExecWait( const TQString& name, const TQStringList &args, - TQString *error, int *pid, const TQCString& startup_id ) -{ - return startServiceInternal("tdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>,TQCString)", - name, args, error, 0, pid, startup_id, false); -} - -TQString TDEApplication::tempSaveName( const TQString& pFilename ) const -{ - TQString aFilename; - - if( TQDir::isRelativePath(pFilename) ) - { - kdWarning(101) << "Relative filename passed to TDEApplication::tempSaveName" << endl; - aFilename = TQFileInfo( TQDir( "." ), pFilename ).absFilePath(); - } - else - aFilename = pFilename; - - TQDir aAutosaveDir( TQDir::homeDirPath() + "/autosave/" ); - if( !aAutosaveDir.exists() ) - { - if( !aAutosaveDir.mkdir( aAutosaveDir.absPath() ) ) - { - // Last chance: use temp dir - aAutosaveDir.setPath( TDEGlobal::dirs()->saveLocation("tmp") ); - } - } - - aFilename.replace( "/", "\\!" ).prepend( "#" ).append( "#" ).prepend( "/" ).prepend( aAutosaveDir.absPath() ); - - return aFilename; -} - - -TQString TDEApplication::checkRecoverFile( const TQString& pFilename, - bool& bRecover ) const -{ - TQString aFilename; - - if( TQDir::isRelativePath(pFilename) ) - { - kdWarning(101) << "Relative filename passed to TDEApplication::tempSaveName" << endl; - aFilename = TQFileInfo( TQDir( "." ), pFilename ).absFilePath(); - } - else - aFilename = pFilename; - - TQDir aAutosaveDir( TQDir::homeDirPath() + "/autosave/" ); - if( !aAutosaveDir.exists() ) - { - if( !aAutosaveDir.mkdir( aAutosaveDir.absPath() ) ) - { - // Last chance: use temp dir - aAutosaveDir.setPath( TDEGlobal::dirs()->saveLocation("tmp") ); - } - } - - aFilename.replace( "/", "\\!" ).prepend( "#" ).append( "#" ).prepend( "/" ).prepend( aAutosaveDir.absPath() ); - - if( TQFile( aFilename ).exists() ) - { - bRecover = true; - return aFilename; - } - else - { - bRecover = false; - return pFilename; - } -} - - -bool checkAccess(const TQString& pathname, int mode) -{ - int accessOK = access( TQFile::encodeName(pathname), mode ); - if ( accessOK == 0 ) - return true; // OK, I can really access the file - - // else - // if we want to write the file would be created. Check, if the - // user may write to the directory to create the file. - if ( (mode & W_OK) == 0 ) - return false; // Check for write access is not part of mode => bail out - - - if (!access( TQFile::encodeName(pathname), F_OK)) // if it already exists - return false; - - //strip the filename (everything until '/' from the end - TQString dirName(pathname); - int pos = dirName.findRev('/'); - if ( pos == -1 ) - return false; // No path in argument. This is evil, we won't allow this - else if ( pos == 0 ) // don't turn e.g. /root into an empty string - pos = 1; - - dirName.truncate(pos); // strip everything starting from the last '/' - - accessOK = access( TQFile::encodeName(dirName), W_OK ); - // -?- Can I write to the accessed diretory - if ( accessOK == 0 ) - return true; // Yes - else - return false; // No -} - -void TDEApplication::setTopWidget( TQWidget *topWidget ) -{ - if( !topWidget ) - return; - - // set the specified caption - if ( !topWidget->inherits("TDEMainWindow") ) { // TDEMainWindow does this already for us - topWidget->setCaption( caption() ); - } - - // set the specified icons - topWidget->setIcon( icon() ); //standard X11 -#if defined Q_WS_X11 -//#ifdef Q_WS_X11 // FIXME(E): Implement for Qt/Embedded - KWin::setIcons(topWidget->winId(), icon(), miniIcon() ); // NET_WM hints for KWin - - // set the app startup notification window property - TDEStartupInfo::setWindowStartupId( topWidget->winId(), startupId()); -#endif -} - -TQCString TDEApplication::startupId() const -{ - return d->startup_id; -} - -void TDEApplication::setStartupId( const TQCString& startup_id ) -{ - if( startup_id == d->startup_id ) - return; -#if defined Q_WS_X11 - TDEStartupInfo::handleAutoAppStartedSending(); // finish old startup notification if needed -#endif - if( startup_id.isEmpty()) - d->startup_id = "0"; - else - { - d->startup_id = startup_id; -#if defined Q_WS_X11 - TDEStartupInfoId id; - id.initId( startup_id ); - long timestamp = id.timestamp(); - if( timestamp != 0 ) - updateUserTimestamp( timestamp ); -#endif - } -} - -// read the startup notification env variable, save it and unset it in order -// not to propagate it to processes started from this app -void TDEApplication::read_app_startup_id() -{ -#if defined Q_WS_X11 - TDEStartupInfoId id = TDEStartupInfo::currentStartupIdEnv(); - TDEStartupInfo::resetStartupEnv(); - d->startup_id = id.id(); -#endif -} - -int TDEApplication::random() -{ - static bool init = false; - if (!init) - { - unsigned int seed; - init = true; - int fd = open("/dev/urandom", O_RDONLY); - if (fd < 0 || ::read(fd, &seed, sizeof(seed)) != sizeof(seed)) - { - // No /dev/urandom... try something else. - srand(getpid()); - seed = rand()+time(0); - } - if (fd >= 0) close(fd); - srand(seed); - } - return rand(); -} - -TQString TDEApplication::randomString(int length) -{ - if (length <=0 ) return TQString::null; - - TQString str; str.setLength( length ); - int i = 0; - while (length--) - { - int r=random() % 62; - r+=48; - if (r>57) r+=7; - if (r>90) r+=6; - str[i++] = char(r); - // so what if I work backwards? - } - return str; -} - -bool TDEApplication::authorize(const TQString &genericAction) -{ - if (!d->actionRestrictions) - return true; - - TDEConfig *config = TDEGlobal::config(); - TDEConfigGroupSaver saver( config, "KDE Action Restrictions" ); - return config->readBoolEntry(genericAction, true); -} - -bool TDEApplication::authorizeTDEAction(const char *action) -{ - if (!d->actionRestrictions || !action) - return true; - - static const TQString &action_prefix = TDEGlobal::staticQString( "action/" ); - - return authorize(action_prefix + action); -} - -bool TDEApplication::authorizeControlModule(const TQString &menuId) -{ - if (menuId.isEmpty() || kde_kiosk_exception) - return true; - TDEConfig *config = TDEGlobal::config(); - TDEConfigGroupSaver saver( config, "TDE Control Module Restrictions" ); - return config->readBoolEntry(menuId, true); -} - -TQStringList TDEApplication::authorizeControlModules(const TQStringList &menuIds) -{ - TDEConfig *config = TDEGlobal::config(); - TDEConfigGroupSaver saver( config, "TDE Control Module Restrictions" ); - TQStringList result; - for(TQStringList::ConstIterator it = menuIds.begin(); - it != menuIds.end(); ++it) - { - if (config->readBoolEntry(*it, true)) - result.append(*it); - } - return result; -} - -void TDEApplication::initUrlActionRestrictions() -{ - d->urlActionRestrictions.setAutoDelete(true); - d->urlActionRestrictions.clear(); - d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule - ("open", TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, true)); - d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule - ("list", TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, true)); -// TEST: -// d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule -// ("list", TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, false)); -// d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule -// ("list", TQString::null, TQString::null, TQString::null, "file", TQString::null, TQDir::homeDirPath(), true)); - d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule - ("link", TQString::null, TQString::null, TQString::null, ":internet", TQString::null, TQString::null, true)); - d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule - ("redirect", TQString::null, TQString::null, TQString::null, ":internet", TQString::null, TQString::null, true)); - - // We allow redirections to file: but not from internet protocols, redirecting to file: - // is very popular among io-slaves and we don't want to break them - d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule - ("redirect", TQString::null, TQString::null, TQString::null, "file", TQString::null, TQString::null, true)); - d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule - ("redirect", ":internet", TQString::null, TQString::null, "file", TQString::null, TQString::null, false)); - - // local protocols may redirect everywhere - d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule - ("redirect", ":local", TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, true)); - - // Anyone may redirect to about: - d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule - ("redirect", TQString::null, TQString::null, TQString::null, "about", TQString::null, TQString::null, true)); - - // Anyone may redirect to itself, cq. within it's own group - d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule - ("redirect", TQString::null, TQString::null, TQString::null, "=", TQString::null, TQString::null, true)); - - TDEConfig *config = TDEGlobal::config(); - TDEConfigGroupSaver saver( config, "KDE URL Restrictions" ); - int count = config->readNumEntry("rule_count"); - TQString keyFormat = TQString("rule_%1"); - for(int i = 1; i <= count; i++) - { - TQString key = keyFormat.arg(i); - TQStringList rule = config->readListEntry(key); - if (rule.count() != 8) - continue; - TQString action = rule[0]; - TQString refProt = rule[1]; - TQString refHost = rule[2]; - TQString refPath = rule[3]; - TQString urlProt = rule[4]; - TQString urlHost = rule[5]; - TQString urlPath = rule[6]; - TQString strEnabled = rule[7].lower(); - - bool bEnabled = (strEnabled == "true"); - - if (refPath.startsWith("$HOME")) - refPath.replace(0, 5, TQDir::homeDirPath()); - else if (refPath.startsWith("~")) - refPath.replace(0, 1, TQDir::homeDirPath()); - if (urlPath.startsWith("$HOME")) - urlPath.replace(0, 5, TQDir::homeDirPath()); - else if (urlPath.startsWith("~")) - urlPath.replace(0, 1, TQDir::homeDirPath()); - - if (refPath.startsWith("$TMP")) - refPath.replace(0, 4, TDEGlobal::dirs()->saveLocation("tmp")); - if (urlPath.startsWith("$TMP")) - urlPath.replace(0, 4, TDEGlobal::dirs()->saveLocation("tmp")); - - d->urlActionRestrictions.append(new TDEApplicationPrivate::URLActionRule - ( action, refProt, refHost, refPath, urlProt, urlHost, urlPath, bEnabled)); - } -} - -void TDEApplication::allowURLAction(const TQString &action, const KURL &_baseURL, const KURL &_destURL) -{ - if (authorizeURLAction(action, _baseURL, _destURL)) - return; - - d->urlActionRestrictions.append(new TDEApplicationPrivate::URLActionRule - ( action, _baseURL.protocol(), _baseURL.host(), _baseURL.path(-1), - _destURL.protocol(), _destURL.host(), _destURL.path(-1), true)); -} - -bool TDEApplication::authorizeURLAction(const TQString &action, const KURL &_baseURL, const KURL &_destURL) -{ - if (_destURL.isEmpty()) - return true; - - bool result = false; - if (d->urlActionRestrictions.isEmpty()) - initUrlActionRestrictions(); - - KURL baseURL(_baseURL); - baseURL.setPath(TQDir::cleanDirPath(baseURL.path())); - TQString baseClass = KProtocolInfo::protocolClass(baseURL.protocol()); - KURL destURL(_destURL); - destURL.setPath(TQDir::cleanDirPath(destURL.path())); - TQString destClass = KProtocolInfo::protocolClass(destURL.protocol()); - - for(TDEApplicationPrivate::URLActionRule *rule = d->urlActionRestrictions.first(); - rule; rule = d->urlActionRestrictions.next()) - { - if ((result != rule->permission) && // No need to check if it doesn't make a difference - (action == rule->action) && - rule->baseMatch(baseURL, baseClass) && - rule->destMatch(destURL, destClass, baseURL, baseClass)) - { - result = rule->permission; - } - } - return result; -} - - -uint TDEApplication::keyboardModifiers() -{ -#ifdef Q_WS_X11 - Window root; - Window child; - int root_x, root_y, win_x, win_y; - uint keybstate; - XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child, - &root_x, &root_y, &win_x, &win_y, &keybstate ); - return keybstate & 0x00ff; -#elif defined W_WS_MACX - return GetCurrentEventKeyModifiers() & 0x00ff; -#else - //TODO for win32 - return 0; -#endif -} - -uint TDEApplication::mouseState() -{ - uint mousestate; -#ifdef Q_WS_X11 - Window root; - Window child; - int root_x, root_y, win_x, win_y; - XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child, - &root_x, &root_y, &win_x, &win_y, &mousestate ); -#elif defined(Q_WS_WIN) - const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON); - if (GetAsyncKeyState(VK_LBUTTON)) - mousestate |= (mousebtn_swapped ? Button3Mask : Button1Mask); - if (GetAsyncKeyState(VK_MBUTTON)) - mousestate |= Button2Mask; - if (GetAsyncKeyState(VK_RBUTTON)) - mousestate |= (mousebtn_swapped ? Button1Mask : Button3Mask); -#elif defined(Q_WS_MACX) - mousestate = GetCurrentEventButtonState(); -#else - //TODO: other platforms -#endif - return mousestate & 0xff00; -} - -TQ_ButtonState TDEApplication::keyboardMouseState() -{ - int ret = 0; -#ifdef Q_WS_X11 - Window root; - Window child; - int root_x, root_y, win_x, win_y; - uint state; - XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child, - &root_x, &root_y, &win_x, &win_y, &state ); - // transform the same way like Qt's qt_x11_translateButtonState() - if( state & Button1Mask ) - ret |= TQ_LeftButton; - if( state & Button2Mask ) - ret |= TQ_MidButton; - if( state & Button3Mask ) - ret |= TQ_RightButton; - if( state & ShiftMask ) - ret |= TQ_ShiftButton; - if( state & ControlMask ) - ret |= TQ_ControlButton; - if( state & KKeyNative::modX( KKey::ALT )) - ret |= TQ_AltButton; - if( state & KKeyNative::modX( KKey::WIN )) - ret |= TQ_MetaButton; -#elif defined(Q_WS_WIN) - const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON); - if (GetAsyncKeyState(VK_LBUTTON)) - ret |= (mousebtn_swapped ? RightButton : LeftButton); - if (GetAsyncKeyState(VK_MBUTTON)) - ret |= TQ_MidButton; - if (GetAsyncKeyState(VK_RBUTTON)) - ret |= (mousebtn_swapped ? TQ_LeftButton : TQ_RightButton); - if (GetAsyncKeyState(VK_SHIFT)) - ret |= TQ_ShiftButton; - if (GetAsyncKeyState(VK_CONTROL)) - ret |= TQ_ControlButton; - if (GetAsyncKeyState(VK_MENU)) - ret |= TQ_AltButton; - if (GetAsyncKeyState(VK_LWIN) || GetAsyncKeyState(VK_RWIN)) - ret |= TQ_MetaButton; -#else - //TODO: other platforms -#endif - return static_cast< ButtonState >( ret ); -} - -void TDEApplication::installSigpipeHandler() -{ -#ifdef Q_OS_UNIX - struct sigaction act; - act.sa_handler = SIG_IGN; - sigemptyset( &act.sa_mask ); - act.sa_flags = 0; - sigaction( SIGPIPE, &act, 0 ); -#endif -} - -void TDEApplication::sigpipeHandler(int) -{ - int saved_errno = errno; - // Using kdDebug from a signal handler is not a good idea. -#ifndef NDEBUG - char msg[1000]; - sprintf(msg, "*** SIGPIPE *** (ignored, pid = %ld)\n", (long) getpid()); - if (write(2, msg, strlen(msg)) < 0) { - // ERROR - } -#endif - - // Do nothing. - errno = saved_errno; -} - -bool TDEApplication::guiEnabled() -{ - return kapp && kapp->d->guiEnabled; -} - -void TDEApplication::virtual_hook( int id, void* data ) -{ TDEInstance::virtual_hook( id, data ); } - -void KSessionManaged::virtual_hook( int, void* ) -{ /*BASE::virtual_hook( id, data );*/ } - -#include "kapplication.moc" diff --git a/tdecore/kapplication.h b/tdecore/kapplication.h deleted file mode 100644 index 5ab8d7ee7..000000000 --- a/tdecore/kapplication.h +++ /dev/null @@ -1,1620 +0,0 @@ -/* This file is part of the KDE libraries - Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) - Copyright (c) 1998, 1999 KDE Team - - 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 _KAPP_H -#define _KAPP_H - -// Version macros. Never put this further down. -#include "tdeversion.h" -#include "tdelibs_export.h" - -class TDEConfig; -class KCharsets; -class DCOPClient; -class DCOPObject; - -#include <tqtglobaldefines.h> - -typedef unsigned long Atom; -#if !defined(Q_WS_X11) -typedef void Display; -#endif - -#include <tqapplication.h> -#include <tqpixmap.h> -#include <kinstance.h> - -struct _IceConn; -class TQPopupMenu; -class TQStrList; -class KSessionManaged; -class TDEStyle; -class KURL; - -#define kapp TDEApplication::kApplication() - -class TDEApplicationPrivate; - -/** -* Controls and provides information to all KDE applications. -* -* Only one object of this class can be instantiated in a single app. -* This instance is always accessible via the 'kapp' global variable. -* See cut() for an example. -* -* This class provides the following services to all KDE applications. -* -* @li It controls the event queue (see TQApplication ). -* @li It provides the application with KDE resources such as -* accelerators, common menu entries, a TDEConfig object. session -* management events, help invocation etc. -* @li Installs a signal handler for the SIGCHLD signal in order to -* avoid zombie children. If you want to catch this signal yourself or -* don't want it to be caught at all, you have set a new signal handler -* (or SIG_IGN) after TDEApplication's constructor has run. -* @li Installs an empty signal handler for the SIGPIPE signal using -* installSigpipeHandler(). If you want to catch this signal -* yourself, you have set a new signal handler after TDEApplication's -* constructor has run. -* @li It can start new services -* -* -* The way a service gets started depends on the 'X-DCOP-ServiceType' -* entry in the desktop file of the service: -* -* There are three possibilities: -* @li X-DCOP-ServiceType=None (default) -* Always start a new service, -* don't wait till the service registers with dcop. -* @li X-DCOP-ServiceType=Multi -* Always start a new service, -* wait until the service has registered with dcop. -* @li X-DCOP-ServiceType=Unique -* Only start the service if it isn't already running, -* wait until the service has registered with dcop. -* -* @short Controls and provides information to all KDE applications. -* @author Matthias Kalle Dalheimer <kalle@kde.org> -*/ -class TDECORE_EXPORT TDEApplication : public TQApplication, public TDEInstance -{ - - Q_OBJECT -public: - /** Position of the caption (presumably in the application window's - * title bar). This enum appears to be unused. - * - * @todo Find out if this is used anywhere. - */ - enum CaptionLayout { - CaptionAppLast=1 /**< Display the application name last (before document name). */, - CaptionAppFirst /**< Display the application name first. */ , - CaptionNoApp /**< Do not display application name at all. */ - }; - - /** - * This constructor takes aboutData and command line - * arguments from TDECmdLineArgs. - * - * If ARGB (transparent) widgets are to be used in your application, - * please use - * TDEApplication app(TDEApplication::openX11RGBADisplay()); - * or - * TDEApplication app(TDEApplication::openX11RGBADisplay(), useStyles); - * - * @param allowStyles Set to false to disable the loading on plugin based - * styles. This is only useful to applications that do not display a GUI - * normally. If you do create an application with @p allowStyles set to false - * it normally runs in the background but under special circumstances - * displays widgets. Call enableStyles() before displaying any widgets. - * - * @param GUIenabled Set to false to disable all GUI stuff. This implies - * no styles either. - */ - TDEApplication( bool allowStyles=true, bool GUIenabled=true); - -#ifdef Q_WS_X11 - /** - * Constructor. Parses command-line arguments. Use this constructor when you - * you want ARGB support to be automatically detected and enabled. - * - * @param display Will be passed to Qt as the X display. The display must be - * valid and already opened. - * - * @param allowStyles Set to false to disable the loading on plugin based - * styles. This is only useful to applications that do not display a GUI - * normally. If you do create an application with @p allowStyles set to false - * that normally runs in the background but under special circumstances - * displays widgets call enableStyles() before displaying any widgets. - * - * @since KDE 3.5 - * - * @see RGBADisplay() - */ - TDEApplication(Display *display, bool allowStyles); - - /** - * Constructor. Parses command-line arguments. Use this constructor when you - * you want ARGB support to be automatically detected and enabled. - * - * @param display Will be passed to Qt as the X display. The display must be - * valid and already opened. - * - * @param disable_argb Set to true to disable ARGB visuals in this application. - * - * @param display Will be passed to Qt as the X display. The display must be - * valid and already opened. - * - * @param visual A pointer to the X11 visual that should be used by the - * appliction. Note that only TrueColor visuals are supported on depths - * greater than 8 bpp. If this parameter is NULL, the default visual will - * be used instead. - * - * @param allowStyles Set to false to disable the loading on plugin based - * styles. This is only useful to applications that do not display a GUI - * normally. If you do create an application with @p allowStyles set to false - * that normally runs in the background but under special circumstances - * displays widgets call enableStyles() before displaying any widgets. - * - * @since KDE 3.5 - * - * @see RGBADisplay() - */ - TDEApplication(Display *display, bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap, bool allowStyles); - - /** - * Constructor. Parses command-line arguments. Use this constructor when you - * you need to use a non-default visual or colormap. - * - * @param display Will be passed to Qt as the X display. The display must be - * valid and already opened. - * - * @param visual A pointer to the X11 visual that should be used by the - * appliction. Note that only TrueColor visuals are supported on depths - * greater than 8 bpp. If this parameter is NULL, the default visual will - * be used instead. - * - * @param colormap The colormap that should be used by the application. If - * this parameter is 0, the default colormap will be used instead. - * - * @param allowStyles Set to false to disable the loading on plugin based - * styles. This is only useful to applications that do not display a GUI - * normally. If you do create an application with @p allowStyles set to false - * that normally runs in the background but under special circumstances - * displays widgets call enableStyles() before displaying any widgets. - * - * @since KDE 3.3 - */ - TDEApplication(Display *display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0, - bool allowStyles=true); - - /** - * Constructor. Parses command-line arguments. Use this constructor to use TDEApplication - * in a Motif or Xt program. - * - * @param display Will be passed to Qt as the X display. The display must be valid and already - * opened. - * - * @param argc command line argument count - * - * @param argv command line argument value(s) - * - * @param rAppName application name. Will be used for finding the - * associated message files and icon files, and as the default - * registration name for DCOP. This is a mandatory parameter. - * - * @param allowStyles Set to false to disable the loading on plugin based - * styles. This is only useful to applications that do not display a GUI - * normally. If you do create an application with @p allowStyles set to false - * that normally runs in the background but under special circumstances - * displays widgets call enableStyles() before displaying any widgets. - * - * @param GUIenabled Set to false to disable all GUI stuff. This implies - * no styles either. - */ - TDEApplication(Display *display, int& argc, char** argv, const TQCString& rAppName, - bool allowStyles=true, bool GUIenabled=true); -#endif - - /** - * @deprecated do not use it at all, it will make your application crash, use TDECmdLineArgs - * - * Constructor. Parses command-line arguments. - * - * @param argc command line argument count - * - * @param argv command line argument value(s) - * - * @param rAppName application name. Will be used for finding the - * associated message files and icon files, and as the default - * registration name for DCOP. This is a mandatory parameter. - * - * @param allowStyles Set to false to disable the loading on plugin based - * styles. This is only useful to applications that do not display a GUI - * normally. If you do create an application with @p allowStyles set to false - * that normally runs in the background but under special circumstances - * displays widgets call enableStyles() before displaying any widgets. - * - * @param GUIenabled Set to false to disable all GUI stuff. This implies - * no styles either. - */ - // REMOVE FOR KDE 4.0 - using it only gives crashing applications because - // TDECmdLineArgs::init isn't called - TDEApplication(int& argc, char** argv, - const TQCString& rAppName, bool allowStyles=true, bool GUIenabled=true) KDE_DEPRECATED; - - /** - * Add Qt and KDE command line options to TDECmdLineArgs. - */ - static void addCmdLineOptions(); - - virtual ~TDEApplication(); - - /** - * Returns the current application object. - * - * This is similar to the global TQApplication pointer tqApp. It - * allows access to the single global TDEApplication object, since - * more than one cannot be created in the same application. It - * saves you the trouble of having to pass the pointer explicitly - * to every function that may require it. - * @return the current application object - */ - static TDEApplication* kApplication() { return KApp; } - - /** - * Returns the application session config object. - * - * @return A pointer to the application's instance specific - * TDEConfig object. - * @see TDEConfig - */ - TDEConfig* sessionConfig(); - - /** - * Is the application restored from the session manager? - * - * @return If true, this application was restored by the session manager. - * Note that this may mean the config object returned by - * sessionConfig() contains data saved by a session closedown. - * @see sessionConfig() - */ - bool isRestored() const { return TQApplication::isSessionRestored(); } - - /** - * Disables session management for this application. - * - * Useful in case your application is started by the - * initial "starttde" script. - */ - void disableSessionManagement(); - - /** - * Enables again session management for this application, formerly - * disabled by calling disableSessionManagement(). You usually - * shouldn't call this function, as the session management is enabled - * by default. - */ - void enableSessionManagement(); - - /** - * The possible values for the @p confirm parameter of requestShutDown(). - */ - enum ShutdownConfirm { - /** - * Obey the user's confirmation setting. - */ - ShutdownConfirmDefault = -1, - /** - * Don't confirm, shutdown without asking. - */ - ShutdownConfirmNo = 0, - /** - * Always confirm, ask even if the user turned it off. - */ - ShutdownConfirmYes = 1 - }; - - /** - * The possible values for the @p sdtype parameter of requestShutDown(). - */ - enum ShutdownType { - /** - * Select previous action or the default if it's the first time. - */ - ShutdownTypeDefault = -1, - /** - * Only log out. - */ - ShutdownTypeNone = 0, - /** - * Log out and reboot the machine. - */ - ShutdownTypeReboot = 1, - /** - * Log out and halt the machine. - */ - ShutdownTypeHalt = 2 - }; - - /** - * The possible values for the @p sdmode parameter of requestShutDown(). - */ - enum ShutdownMode { - /** - * Select previous mode or the default if it's the first time. - */ - ShutdownModeDefault = -1, - /** - * Schedule a shutdown (halt or reboot) for the time all active sessions - * have exited. - */ - ShutdownModeSchedule = 0, - /** - * Shut down, if no sessions are active. Otherwise do nothing. - */ - ShutdownModeTryNow = 1, - /** - * Force shutdown. Kill any possibly active sessions. - */ - ShutdownModeForceNow = 2, - /** - * Pop up a dialog asking the user what to do if sessions are still active. - */ - ShutdownModeInteractive = 3 - }; - - /** - * Asks the session manager to shut the session down. - * - * Using @p confirm == ShutdownConfirmYes or @p sdtype != ShutdownTypeDefault or - * @p sdmode != ShutdownModeDefault causes the use of ksmserver's DCOP - * interface. The remaining two combinations use the standard XSMP and - * will work with any session manager compliant with it. - * - * @param confirm Whether to ask the user if he really wants to log out. - * ShutdownConfirm - * @param sdtype The action to take after logging out. ShutdownType - * @param sdmode If/When the action should be taken. ShutdownMode - * @return true on success, false if the session manager could not be - * contacted. - */ - bool requestShutDown( ShutdownConfirm confirm = ShutdownConfirmDefault, - ShutdownType sdtype = ShutdownTypeDefault, - ShutdownMode sdmode = ShutdownModeDefault ); - - /** - * Propagates the network address of the session manager in the - * SESSION_MANAGER environment variable so that child processes can - * pick it up. - * - * If SESSION_MANAGER isn't defined yet, the address is searched in - * $HOME/.KSMserver. - * - * This function is called by clients that are started outside the - * session ( i.e. before ksmserver is started), but want to launch - * other processes that should participate in the session. Examples - * are kdesktop or kicker. - */ - void propagateSessionManager(); - - /** - * Reimplemented for internal purposes, mainly the highlevel - * handling of session management with KSessionManaged. - * @internal - */ - void commitData( TQSessionManager& sm ); - - /** - * Reimplemented for internal purposes, mainly the highlevel - * handling of session management with KSessionManaged. - * @internal - */ - void saveState( TQSessionManager& sm ); - - /** - * Returns true if the application is currently saving its session - * data (most probably before KDE logout). This is intended for use - * mainly in TDEMainWindow::queryClose() and TDEMainWindow::queryExit(). - * - * @see TDEMainWindow::queryClose - * @see TDEMainWindow::queryExit - * @since 3.1.1 - */ - bool sessionSaving() const; - - /** - * Returns a pointer to a DCOPClient for the application. - * If a client does not exist yet, it is created when this - * function is called. - * @return the DCOPClient for the application - */ - static DCOPClient *dcopClient(); - - /** - * Disable automatic dcop registration - * Must be called before creating a TDEApplication instance to have an effect. - */ - static void disableAutoDcopRegistration(); - - /** - * Returns a TQPixmap with the application icon. - * @return the application icon - */ - TQPixmap icon() const; - - /** - * Returns the name of the application icon. - * @return the icon's name - */ - TQString iconName() const; - - /** - * Returns the mini-icon for the application as a TQPixmap. - * @return the application's mini icon - */ - TQPixmap miniIcon() const; - - /** - * Returns the name of the mini-icon for the application. - * @return the mini icon's name - */ - TQString miniIconName() const; - - /** - * Sets the top widget of the application. - * This means basically applying the right window caption and - * icon. An application may have several top widgets. You don't - * need to call this function manually when using TDEMainWindow. - * - * @param topWidget A top widget of the application. - * - * @see icon(), caption() - **/ - void setTopWidget( TQWidget *topWidget ); - - /** - * Invokes the KHelpCenter HTML help viewer from docbook sources. - * - * @param anchor This has to be a defined anchor in your - * docbook sources. If empty the main index - * is loaded - * @param appname This allows you to show the help of another - * application. If empty the current name() is - * used - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - */ - void invokeHelp( const TQString& anchor, - const TQString& appname, - const TQCString& startup_id ) const; - - // KDE4 merge with above with startup_id = "" - void invokeHelp( const TQString& anchor = TQString::null, - const TQString& appname = TQString::null ) const; - - /** - * @deprecated - * Invoke the khelpcenter HTML help viewer from HTML sources. - * Please use invokeHelp() instead. - * - * @param aFilename The filename that is to be loaded. Its - * location is computed automatically - * according to the KFSSTND. If @p aFilename - * is empty, the logical appname with .html - * appended to it is used. - * @param aTopic This allows context-sensitive help. Its - * value will be appended to the filename, - * prefixed with a "#" (hash) character. - */ - void invokeHTMLHelp( const TQString& aFilename, const TQString& aTopic = TQString::null ) const KDE_DEPRECATED; - - /** - * Convenience method; invokes the standard email application. - * - * @param address The destination address - * @param subject Subject string. Can be TQString::null. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - */ - void invokeMailer( const TQString &address, const TQString &subject, const TQCString& startup_id ); - // KDE4 merge with above with startup_id = "" - void invokeMailer( const TQString &address, const TQString &subject ); - - /** - * Invokes the standard email application. - * - * @param mailtoURL A mailto URL. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - * @param allowAttachments whether attachments specified in mailtoURL should be honoured. - The default is false; do not honour requests for attachments. - */ - void invokeMailer( const KURL &mailtoURL, const TQCString& startup_id, bool allowAttachments ); - // KDE4 merge with above with allowAttachments = false - void invokeMailer( const KURL &mailtoURL, const TQCString& startup_id ); - // KDE4 merge with above with startup_id = "" - void invokeMailer( const KURL &mailtoURL ); - - /** - * Convenience method; invokes the standard email application. - * - * All parameters are optional. - * - * @param to The destination address. - * @param cc The Cc field - * @param bcc The Bcc field - * @param subject Subject string - * @param body A string containing the body of the mail (exclusive with messageFile) - * @param messageFile A file (URL) containing the body of the mail (exclusive with body) - currently unsupported - * @param attachURLs List of URLs to be attached to the mail. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - */ - void invokeMailer(const TQString &to, const TQString &cc, const TQString &bcc, - const TQString &subject, const TQString &body, - const TQString &messageFile, const TQStringList &attachURLs, - const TQCString& startup_id ); - // KDE4 merge with above with startup_id = "" - void invokeMailer(const TQString &to, const TQString &cc, const TQString &bcc, - const TQString &subject, const TQString &body, - const TQString &messageFile = TQString::null, const TQStringList &attachURLs = TQStringList()); - -public slots: - /** - * Invokes the standard browser. - * Note that you should only do this when you know for sure that the browser can - * handle the URL (i.e. its mimetype). In doubt, if the URL can point to an image - * or anything else than directory or HTML, prefer to use new KRun( url ). - * - * @param url The destination address - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - */ - void invokeBrowser( const TQString &url, const TQCString& startup_id ); - // KDE4 merge with above with startup_id = "" - /** - * Invoke the standard browser. Uses a @p startup_id of "" (empty) - * and is otherwise the same as the above function. - */ - void invokeBrowser( const TQString &url ); - - /** - * If the widget with focus provides a cut() slot, call that slot. Thus for a - * simple application cut can be implemented as: - * \code - * KStdAction::cut( kapp, TQT_SLOT( cut() ), actionCollection() ); - * \endcode - */ - void cut(); - - /** - * If the widget with focus provides a copy() slot, call that slot. Thus for a - * simple application copy can be implemented as: - * \code - * KStdAction::copy( kapp, TQT_SLOT( copy() ), actionCollection() ); - * \endcode - */ - void copy(); - - /** - * If the widget with focus provides a paste() slot, call that slot. Thus for a - * simple application copy can be implemented as: - * \code - * KStdAction::paste( kapp, TQT_SLOT( paste() ), actionCollection() ); - * \endcode - */ - void paste(); - - /** - * If the widget with focus provides a clear() slot, call that slot. Thus for a - * simple application clear() can be implemented as: - * \code - * new TDEAction( i18n( "Clear" ), "editclear", 0, kapp, TQT_SLOT( clear() ), actionCollection(), "clear" ); - * \endcode - * - * Note that for some widgets, this may not provide the intended bahavior. For - * example if you make use of the code above and a TDEListView has the focus, clear() - * will clear all of the items in the list. If this is not the intened behavior - * and you want to make use of this slot, you can subclass TDEListView and reimplement - * this slot. For example the following code would implement a TDEListView without this - * behavior: - * - * \code - * class MyListView : public TDEListView { - * Q_OBJECT - * public: - * MyListView( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ) : TDEListView( parent, name, f ) {} - * virtual ~MyListView() {} - * public slots: - * virtual void clear() {} - * }; - * \endcode - */ - void clear(); - - /** - * If the widget with focus provides a selectAll() slot, call that slot. Thus for a - * simple application select all can be implemented as: - * \code - * KStdAction::selectAll( kapp, TQT_SLOT( selectAll() ), actionCollection() ); - * \endcode - */ - void selectAll(); - - /** - * Broadcast a received keycode to all listening KDE applications - * The primary use for this feature is to connect hotkeys such as - * XF86Display to their respective TDEGlobalAccel functions while - * the screen is locked by kdesktop_lock. - */ - void broadcastKeyCode(unsigned int keyCode); - -public: - /** - * Returns the DCOP name of the service launcher. This will be something like - * klaucher_$host_$uid. - * @return the name of the service launcher - */ - static TQCString launcher(); - - /** - * Starts a service based on the (translated) name of the service. - * E.g. "Web Browser" - * - * @param _name the name of the service - * @param URL if not empty this URL is passed to the service - * @param error On failure, @p error contains a description of the error - * that occurred. If the pointer is 0, the argument will be - * ignored - * @param dcopService On success, @p dcopService contains the DCOP name - * under which this service is available. If empty, the service does - * not provide DCOP services. If the pointer is 0 the argument - * will be ignored - * @param pid On success, the process id of the new service will be written - * here. If the pointer is 0, the argument will be ignored. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - * @param noWait if set, the function does not wait till the service is running. - * @return an error code indicating success (== 0) or failure (> 0). - */ - static int startServiceByName( const TQString& _name, const TQString &URL, - TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id = "", bool noWait = false ); - - /** - * Starts a service based on the (translated) name of the service. - * E.g. "Web Browser" - * - * @param _name the name of the service - * @param URLs if not empty these URLs will be passed to the service - * @param error On failure, @p error contains a description of the error - * that occurred. If the pointer is 0, the argument will be - * ignored - * @param dcopService On success, @p dcopService contains the DCOP name - * under which this service is available. If empty, the service does - * not provide DCOP services. If the pointer is 0 the argument - * will be ignored - * @param pid On success, the process id of the new service will be written - * here. If the pointer is 0, the argument will be ignored. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - * @param noWait if set, the function does not wait till the service is running. - * @return an error code indicating success (== 0) or failure (> 0). - */ - static int startServiceByName( const TQString& _name, const TQStringList &URLs=TQStringList(), - TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id = "", bool noWait = false ); - - /** - * Starts a service based on the desktop path of the service. - * E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop" - * - * @param _name the path of the desktop file - * @param URL if not empty this URL is passed to the service - * @param error On failure, @p error contains a description of the error - * that occurred. If the pointer is 0, the argument will be - * ignored - * @param dcopService On success, @p dcopService contains the DCOP name - * under which this service is available. If empty, the service does - * not provide DCOP services. If the pointer is 0 the argument - * will be ignored - * @param pid On success, the process id of the new service will be written - * here. If the pointer is 0, the argument will be ignored. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - * @param noWait if set, the function does not wait till the service is running. - * @return an error code indicating success (== 0) or failure (> 0). - */ - static int startServiceByDesktopPath( const TQString& _name, const TQString &URL, - TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false ); - - /** - * Starts a service based on the desktop path of the service. - * E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop" - * - * @param _name the path of the desktop file - * @param URLs if not empty these URLs will be passed to the service - * @param error On failure, @p error contains a description of the error - * that occurred. If the pointer is 0, the argument will be - * ignored - * @param dcopService On success, @p dcopService contains the DCOP name - * under which this service is available. If empty, the service does - * not provide DCOP services. If the pointer is 0 the argument - * will be ignored - * @param pid On success, the process id of the new service will be written - * here. If the pointer is 0, the argument will be ignored. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - * @param noWait if set, the function does not wait till the service is running. - * @return an error code indicating success (== 0) or failure (> 0). - */ - static int startServiceByDesktopPath( const TQString& _name, const TQStringList &URLs=TQStringList(), - TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false ); - - /** - * Starts a service based on the desktop name of the service. - * E.g. "konqueror" - * - * @param _name the desktop name of the service - * @param URL if not empty this URL is passed to the service - * @param error On failure, @p error contains a description of the error - * that occurred. If the pointer is 0, the argument will be - * ignored - * @param dcopService On success, @p dcopService contains the DCOP name - * under which this service is available. If empty, the service does - * not provide DCOP services. If the pointer is 0 the argument - * will be ignored - * @param pid On success, the process id of the new service will be written - * here. If the pointer is 0, the argument will be ignored. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - * @param noWait if set, the function does not wait till the service is running. - * @return an error code indicating success (== 0) or failure (> 0). - */ - static int startServiceByDesktopName( const TQString& _name, const TQString &URL, - TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false ); - - /** - * Starts a service based on the desktop name of the service. - * E.g. "konqueror" - * - * @param _name the desktop name of the service - * @param URLs if not empty these URLs will be passed to the service - * @param error On failure, @p error contains a description of the error - * that occurred. If the pointer is 0, the argument will be - * ignored - * @param dcopService On success, @p dcopService contains the DCOP name - * under which this service is available. If empty, the service does - * not provide DCOP services. If the pointer is 0 the argument - * will be ignored - * @param pid On success, the process id of the new service will be written - * here. If the pointer is 0, the argument will be ignored. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - * @param noWait if set, the function does not wait till the service is running. - * @return an error code indicating success (== 0) or failure (> 0). - */ - static int startServiceByDesktopName( const TQString& _name, const TQStringList &URLs=TQStringList(), - TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false ); - - /** - * Starts a program via tdeinit. - * - * program name and arguments are converted to according to the - * local encoding and passed as is to tdeinit. - * - * @param name Name of the program to start - * @param args Arguments to pass to the program - * @param error On failure, @p error contains a description of the error - * that occurred. If the pointer is 0, the argument will be - * ignored - * @param pid On success, the process id of the new service will be written - * here. If the pointer is 0, the argument will be ignored. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - * @return an error code indicating success (== 0) or failure (> 0). - */ - static int tdeinitExec( const TQString& name, const TQStringList &args, - TQString *error, int *pid, const TQCString& startup_id ); - // KDE4 merge with above with startup_id = "" - static int tdeinitExec( const TQString& name, const TQStringList &args=TQStringList(), - TQString *error=0, int *pid = 0 ); - - /** - * Starts a program via tdeinit and wait for it to finish. - * - * Like tdeinitExec(), but it waits till the program is finished. - * As such it behaves similar to the system(...) function. - * - * @param name Name of the program to start - * @param args Arguments to pass to the program - * @param error On failure, @p error contains a description of the error - * that occurred. If the pointer is 0, the argument will be - * ignored - * @param pid On success, the process id of the new service will be written - * here. If the pointer is 0, the argument will be ignored. - * @param startup_id for app startup notification, "0" for none, - * "" ( empty string ) is the default - * @return an error code indicating success (== 0) or failure (> 0). - */ - static int tdeinitExecWait( const TQString& name, const TQStringList &args, - TQString *error, int *pid, const TQCString& startup_id ); - // KDE4 merge with above with startup_id = "" - static int tdeinitExecWait( const TQString& name, const TQStringList &args=TQStringList(), - TQString *error=0, int *pid = 0 ); - - /** - * Returns a text for the window caption. - * - * This may be set by - * "-caption", otherwise it will be equivalent to the name of the - * executable. - * @return the text for the window caption - */ - TQString caption() const; - - /** - * @deprecated - */ - KDE_DEPRECATED TDEStyle* kstyle() const { return 0; } - - /** - * Builds a caption that contains the application name along with the - * userCaption using a standard layout. - * - * To make a compliant caption - * for your window, simply do: @p setCaption(kapp->makeStdCaption(yourCaption)); - * - * @param userCaption The caption string you want to display in the - * window caption area. Do not include the application name! - * @param withAppName Indicates that the method shall include or ignore - * the application name when making the caption string. You are not - * compliant if you set this to @p false. - * @param modified If true, a 'modified' sign will be included in the - * returned string. This is useful when indicating that a file is - * modified, i.e., it contains data that has not been saved. - * @return the created caption - */ - TQString makeStdCaption( const TQString &userCaption, - bool withAppName=true, bool modified=false ) const; - - /** - * Get a file name in order to make a temporary copy of your document. - * - * @param pFilename The full path to the current file of your - * document. - * @return A new filename for auto-saving. - */ - TQString tempSaveName( const TQString& pFilename ) const; - - /** - * Check whether an auto-save file exists for the document you want to - * open. - * - * @param pFilename The full path to the document you want to open. - * @param bRecover This gets set to true if there was a recover - * file. - * @return The full path of the file to open. - */ - TQString checkRecoverFile( const TQString& pFilename, bool& bRecover ) const; - -#if defined(Q_WS_X11) - /** - * @internal - * Get the X11 display - * @return the X11 Display - */ - Display *getDisplay() { return display; } -#endif - - /** - * @internal - * Gets X11 composition information - */ - void getX11RGBAInformation(Display *dpy); - - /** - * Gets the availability of a composition manager such as kompmgr - * Note that at least one application must have called detectCompositionManagerAvailable - * while the current X display was active in order for this method to return valid results. - * @see detectCompositionManagerAvailable() - * @return whether the composition manager is enabled - */ - static bool isCompositionManagerAvailable(); - - /** - * Detects the availability of a composition manager such as kompmgr - * Note that calling this method will probably cause the screen to flicker. - * @see isCompositionManagerAvailable() - * @param force_available If set, force TDE to assume a composition manager is available - * @param available Whether or not the composition manager is available (only used if force_available is TRUE) - * @return whether the composition manager is enabled - */ - bool detectCompositionManagerAvailable(bool force_available=false, bool available=true); - - /** - * @internal - * Opens the display - * This can be used to initialize a TDEApplication with RGBA support like this: - * TDEApplication app(TDEApplication::openX11RGBADisplay()); - * or - * TDEApplication app(TDEApplication::openX11RGBADisplay(), useStyles); - */ - static Display* openX11RGBADisplay(); - - /** - * Returns the X11 display visual - * - * @return A pointer to the X11 display visual - */ - Qt::HANDLE getX11RGBAVisual(Display *dpy); - - /** - * Returns the X11 display colormap - * - * @return An X11 display colormap object - */ - Qt::HANDLE getX11RGBAColormap(Display *dpy); - - /** - * Returns whether or not X11 composition is available - * - * You must first call getX11RGBAInformation() - * - * Note that getX11RGBAInformation() has already - * been called if you used the default TDEApplication - * constructor. - * - * Additionally, at least one application must have called - * detectCompositionManagerAvailable while the current X - * display was active in order for this method to return - * valid results. - * - * @return true if composition is available - */ - bool isX11CompositionAvailable(); - - /** - * Enables style plugins. - * - * This is useful only to applications that normally - * do not display a GUI and create the TDEApplication with - * allowStyles set to false. - */ - void enableStyles(); - - /** - * Disables style plugins. - * - * Current style plugins do not get unloaded. - * - * This is only useful when used in combination with enableStyles(). - */ - void disableStyles(); - - /** - * Installs widget filter as global X11 event filter. - * - * The widget - * filter receives XEvents in its standard TQWidget::x11Event() function. - * - * Warning: Only do this when absolutely necessary. An installed X11 filter - * can slow things down. - **/ - void installX11EventFilter( TQWidget* filter ); - - /** - * Removes global X11 event filter previously installed by - * installX11EventFilter(). - */ - void removeX11EventFilter( const TQWidget* filter ); - - /** - * Generates a uniform random number. - * @return A truly unpredictable number in the range [0, RAND_MAX) - */ - static int random(); - - /** - * Generates a random string. It operates in the range [A-Za-z0-9] - * @param length Generate a string of this length. - * @return the random string - */ - static TQString randomString(int length); - - /** - * Adds a message type to the KIPC event mask. You can only add "system - * messages" to the event mask. These are the messages with id < 32. - * Messages with id >= 32 are user messages. - * @param id The message id. See KIPC::Message. - * @see KIPC - * @see removeKipcEventMask() - * @see kipcMessage() - */ - void addKipcEventMask(int id); - - /** - * Removes a message type from the KIPC event mask. This message will - * not be handled anymore. - * @param id The message id. - * @see KIPC - * @see addKipcEventMask() - * @see kipcMessage() - */ - void removeKipcEventMask(int id); - - /** - * Returns the app startup notification identifier for this running - * application. - * @return the startup notification identifier - */ - TQCString startupId() const; - - /** - * @internal - * Sets a new value for the application startup notification window property for newly - * created toplevel windows. - * @param startup_id the startup notification identifier - * @see TDEStartupInfo::setNewStartupId - */ - void setStartupId( const TQCString& startup_id ); - - /** - * Updates the last user action timestamp to the given time, or to the current time, - * if 0 is given. Do not use unless you're really sure what you're doing. - * Consult focus stealing prevention section in tdebase/twin/README. - * @since 3.2 - */ - void updateUserTimestamp( unsigned long time = 0 ); - - /** - * Returns the last user action timestamp or 0 if no user activity has taken place yet. - * @since 3.2.3 - * @see updateuserTimestamp - */ - unsigned long userTimestamp() const; - - /** - * Updates the last user action timestamp in the application registered to DCOP with dcopId - * to the given time, or to this application's user time, if 0 is given. - * Use before causing user interaction in the remote application, e.g. invoking a dialog - * in the application using a DCOP call. - * Consult focus stealing prevention section in tdebase/twin/README. - * @since 3.3 - */ - void updateRemoteUserTimestamp( const TQCString& dcopId, unsigned long time = 0 ); - - /** - * Returns the argument to --geometry if any, so the geometry can be set - * wherever necessary - * @return the geometry argument, or TQString::null if there is none - */ - TQString geometryArgument() const; - - /** - * Install a Qt SQL property map with entries for all KDE widgets - * Call this in any application using KDE widgets in TQSqlForm or TQDataView. - */ - void installKDEPropertyMap(); - - /** - * Returns whether a certain action is authorized - * @param genericAction The name of a generic action - * @return true if the action is authorized - */ - bool authorize(const TQString &genericAction); - - /** - * Returns whether a certain TDEAction is authorized. - * - * @param action The name of a TDEAction action. The name is prepended - * with "action/" before being passed to authorize() - * @return true if the TDEAction is authorized - */ - bool authorizeTDEAction(const char *action); - - /** - * Returns whether a certain URL related action is authorized. - * - * @param action The name of the action. Known actions are - * list (may be listed (e.g. in file selection dialog)), - * link (may be linked to), - * open (may open) and - * redirect (may be redirected to) - * @param baseURL The url where the action originates from - * @param destURL The object of the action - * @return true when the action is authorized, false otherwise. - * @since 3.1 - */ - bool authorizeURLAction(const TQString &action, const KURL &baseURL, const KURL &destURL); - - /** - * Allow a certain URL action. This can be useful if your application - * needs to ensure access to an application specific directory that may - * otherwise be subject to KIOSK restrictions. - * @param action The name of the action. - * @param _baseURL The url where the action originates from - * @param _destURL The object of the action - * @since 3.2 - */ - void allowURLAction(const TQString &action, const KURL &_baseURL, const KURL &_destURL); - - /** - * Returns whether access to a certain control module is authorized. - * - * @param menuId identifying the control module, e.g. tde-mouse.desktop - * @return true if access to the module is authorized, false otherwise. - * @since 3.2 - */ - bool authorizeControlModule(const TQString &menuId); - - /** - * Returns whether access to a certain control modules is authorized. - * - * @param menuIds list of menu-ids of control module, - * an example of a menu-id is tde-mouse.desktop. - * @return Those control modules for which access has been authorized. - * @since 3.2 - */ - TQStringList authorizeControlModules(const TQStringList &menuIds); - - /** - * Returns the state of the currently pressed keyboard modifiers (e.g. shift, control, etc.) - * and mouse buttons, similarly to TQKeyEvent::state() and TQMouseEvent::state(). - * You usually should simply use the information provided by TQKeyEvent and TQMouseEvent, - * but it can be useful to query for the status of the modifiers at another moment - * (e.g. some KDE apps do that upon a drop event). - * @return the keyboard modifiers and mouse buttons state - * @since 3.4 - */ - static ButtonState keyboardMouseState(); - - // Same values as ShiftMask etc. in X.h - enum { ShiftModifier = 1<<0, - LockModifier = 1<<1, - ControlModifier = 1<<2, - Modifier1 = 1<<3, - Modifier2 = 1<<4, - Modifier3 = 1<<5, - Modifier4 = 1<<6, - Modifier5 = 1<<7 }; - /** - * @deprecated Use keyboardMouseState() - * @since 3.1 - */ - static uint keyboardModifiers() KDE_DEPRECATED; - - /** @deprecated Same values as Button1Mask etc. in X.h */ - enum { Button1Pressed = 1<<8, - Button2Pressed = 1<<9, - Button3Pressed = 1<<10, - Button4Pressed = 1<<11, - Button5Pressed = 1<<12 }; - /** - * @deprecated Use keyboardMouseState() - * @since 3.1 - */ - static uint mouseState() KDE_DEPRECATED; - - -public slots: - /** - * Tells TDEApplication about one more operation that should be finished - * before the application exits. The standard behavior is to exit on the - * "last window closed" event, but some events should outlive the last window closed - * (e.g. a file copy for a file manager, or 'compacting folders on exit' for a mail client). - */ - void ref(); - - /** - * Tells TDEApplication that one operation such as those described in ref() just finished. - * The application exits if the counter is back to 0. - */ - void deref(); - -protected: - /** - * @internal Used by KUniqueApplication - */ - TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance* _instance ); - -#ifdef Q_WS_X11 - /** - * @internal Used by KUniqueApplication - */ - TDEApplication( Display *display, Qt::HANDLE visual, Qt::HANDLE colormap, - bool allowStyles, TDEInstance* _instance ); - - /** - * Used to catch X11 events - */ - bool x11EventFilter( XEvent * ); - - Display *display; -#endif - Atom kipcCommAtom; - int kipcEventMask; - - /// Current application object. - static TDEApplication *KApp; - int pArgc; - - /** - * This method is used internally to determine which edit slots are implemented - * by the widget that has the focus, and to invoke those slots if available. - * - * @param slot is the slot as returned using the TQT_SLOT() macro, for example TQT_SLOT( cut() ) - * - * This method can be used in TDEApplication subclasses to implement application wide - * edit actions not supported by the TDEApplication class. For example (in your subclass): - * - * \code - * void MyApplication::deselect() - * { - * invokeEditSlot( TQT_SLOT( deselect() ) ); - * } - * \endcode - * - * Now in your application calls to MyApplication::deselect() will call this slot on the - * focused widget if it provides this slot. You can combine this with TDEAction with: - * - * \code - * KStdAction::deselect( static_cast<MyApplication *>( kapp ), TQT_SLOT( cut() ), actionCollection() ); - * \endcode - * - * @see cut() - * @see copy() - * @see paste() - * @see clear() - * @see selectAll() - * - * @since 3.2 - */ - void invokeEditSlot( const char *slot ); - -private slots: - void dcopFailure(const TQString &); - void dcopBlockUserInput( bool ); - void x11FilterDestroyed(); - void checkAppStartedSlot(); - -private: - TQString sessionConfigName() const; - TDEConfig* pSessionConfig; //instance specific application config object - static DCOPClient *s_DCOPClient; // app specific application communication client - static bool s_dcopClientNeedsPostInit; - TQString aCaption; // the name for the window title - bool bSessionManagement; - struct oldPixmapType { TQPixmap a, b; }; - mutable union { - struct { - TQPixmap *icon, *miniIcon; - } pm; - char unused[sizeof(oldPixmapType)]; - } aIconPixmap; // KDE4: remove me - TQString aIconName; - TQString aMiniIconName; - bool useStyles; - TQWidget *smw; - - void init( bool GUIenabled ); - - void parseCommandLine( ); // Handle KDE arguments (Using TDECmdLineArgs) - - void read_app_startup_id(); - - void dcopAutoRegistration(); - void dcopClientPostInit(); - void initUrlActionRestrictions(); - - bool argb_visual; -#if defined(Q_WS_X11) - Qt::HANDLE argb_x11_visual; - Qt::HANDLE argb_x11_colormap; -#endif - -public: - /** - * @internal - */ - bool notify(TQObject *receiver, TQEvent *event); - - /** - @internal - */ - int xErrhandler( Display*, void* ); - - /** - @internal - */ - int xioErrhandler( Display* ); - - /** - * @internal - */ - void iceIOErrorHandler( _IceConn *conn ); - - /** - * @internal - */ - static bool loadedByKdeinit; - - /** - * @internal - */ - static void startKdeinit(); - - /** - * Valid values for the settingsChanged signal - */ - enum SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS, - SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS }; - - /** - * Used to obtain the TQPalette that will be used to set the application palette. - * - * This is only useful for configuration modules such as krdb and should not be - * used in normal circumstances. - * @return the QPalette - * @since 3.1 - */ - static TQPalette createApplicationPalette(); - - /** - * @internal - * Raw access for use by TDM. - */ - static TQPalette createApplicationPalette( TDEConfig *config, int contrast ); - - /** - * Installs a handler for the SIGPIPE signal. It is thrown when you write to - * a pipe or socket that has been closed. - * The handler is installed automatically in the constructor, but you may - * need it if your application or component does not have a TDEApplication - * instance. - */ - static void installSigpipeHandler(); - - /** - * @internal - * Whether widgets can be used. - * - * @since 3.2 - */ - static bool guiEnabled(); - -signals: - /** - * Emitted when TDEApplication has changed its palette due to a KControl request. - * - * Normally, widgets will update their palette automatically, but you - * should connect to this to program special behavior. - */ - void tdedisplayPaletteChanged(); - - /** - * Emitted when TDEApplication has changed its GUI style in response to a KControl request. - * - * Normally, widgets will update their styles automatically (as they would - * respond to an explicit setGUIStyle() call), but you should connect to - * this to program special behavior. - */ - void tdedisplayStyleChanged(); - - /** - * Emitted when TDEApplication has changed its font in response to a KControl request. - * - * Normally widgets will update their fonts automatically, but you should - * connect to this to monitor global font changes, especially if you are - * using explicit fonts. - * - * Note: If you derive from a QWidget-based class, a faster method is to - * reimplement TQWidget::fontChange(). This is the preferred way - * to get informed about font updates. - */ - void tdedisplayFontChanged(); - - /** - * Emitted when TDEApplication has changed either its GUI style, its font or its palette - * in response to a tdedisplay request. Normally, widgets will update their styles - * automatically, but you should connect to this to program special - * behavior. */ - void appearanceChanged(); - - /** - * Emitted when the settings for toolbars have been changed. TDEToolBar will know what to do. - */ - void toolbarAppearanceChanged(int); - - /** - * Emitted when the desktop background has been changed by @p kcmdisplay. - * - * @param desk The desktop whose background has changed. - */ - void backgroundChanged(int desk); - - /** - * Emitted when the global settings have been changed - see TDEGlobalSettings - * TDEApplication takes care of calling reparseConfiguration on TDEGlobal::config() - * so that applications/classes using this only have to re-read the configuration - * @param category the category among the enum above - */ - void settingsChanged(int category); - - /** - * Emitted when the global icon settings have been changed. - * @param group the new group - */ - void iconChanged(int group); - - /** - * Emitted when a KIPC user message has been received. - * @param id the message id - * @param data the data - * @see KIPC - * @see KIPC::Message - * @see addKipcEventMask - * @see removeKipcEventMask - */ - void kipcMessage(int id, int data); - - /** - Session management asks you to save the state of your application. - - This signal is provided for compatibility only. For new - applications, simply use TDEMainWindow. By reimplementing - TDEMainWindow::queryClose(), TDEMainWindow::saveProperties() and - TDEMainWindow::readProperties() you can simply handle session - management for applications with multiple toplevel windows. - - For purposes without TDEMainWindow, create an instance of - KSessionManaged and reimplement the functions - KSessionManaged::commitData() and/or - KSessionManaged::saveState() - - If you still want to use this signal, here is what you should do: - - Connect to this signal in order to save your data. Do NOT - manipulate the UI in that slot, it is blocked by the session - manager. - - Use the sessionConfig() TDEConfig object to store all your - instance specific data. - - Do not do any closing at this point! The user may still select - Cancel wanting to continue working with your - application. Cleanups could be done after shutDown() (see - the following). - - */ - void saveYourself(); - - /** Your application is killed. Either by your program itself, - @p xkill or (the usual case) by KDE's logout. - - The signal is particularly useful if your application has to do some - last-second cleanups. Note that no user interaction is possible at - this state. - */ - void shutDown(); - - /** - * @internal - * Used to notify TDEIconLoader objects that they need to reload. - */ - void updateIconLoaders(); - - /** - * @internal - * Used to send TDEGlobalAccel objects a new keypress from physical hotkeys. - */ - void coreFakeKeyPress(unsigned int keyCode); - -private: - void propagateSettings(SettingsCategory category); - void tdedisplaySetPalette(); - void tdedisplaySetStyle(); - void tdedisplaySetFont(); - void applyGUIStyle(); - static void sigpipeHandler(int); - - int captionLayout; - - TDEApplication(const TDEApplication&); - TDEApplication& operator=(const TDEApplication&); -protected: - virtual void virtual_hook( int id, void* data ); -private: - TDEApplicationPrivate* d; -}; - - -/** - * \relates TDEGlobal - * Check, if a file may be accessed in a given mode. - * This is a wrapper around the access() system call. - * checkAccess() calls access() with the given parameters. - * If this is OK, checkAccess() returns true. If not, and W_OK - * is part of mode, it is checked if there is write access to - * the directory. If yes, checkAccess() returns true. - * In all other cases checkAccess() returns false. - * - * Other than access() this function EXPLICITLY ignores non-existant - * files if checking for write access. - * - * @param pathname The full path of the file you want to test - * @param mode The access mode, as in the access() system call. - * @return Whether the access is allowed, true = Access allowed - */ -TDECORE_EXPORT bool checkAccess(const TQString& pathname, int mode); - -class KSessionManagedPrivate; - -/** - Provides highlevel access to session management on a per-object - base. - - KSessionManaged makes it possible to provide implementations for - TQApplication::commitData() and TQApplication::saveState(), without - subclassing TDEApplication. TDEMainWindow internally makes use of this. - - You don't need to do anything with this class when using - TDEMainWindow. Instead, use TDEMainWindow::saveProperties(), - TDEMainWindow::readProperties(), TDEMainWindow::queryClose(), - TDEMainWindow::queryExit() and friends. - - @short Highlevel access to session management. - @author Matthias Ettrich <ettrich@kde.org> - */ -class TDECORE_EXPORT KSessionManaged -{ -public: - KSessionManaged(); - virtual ~KSessionManaged(); - - /** - See TQApplication::saveState() for documentation. - - This function is just a convenience version to avoid subclassing TDEApplication. - - Return true to indicate a successful state save or false to - indicate a problem and to halt the shutdown process (will - implicitly call sm.cancel() ). - */ - virtual bool saveState( TQSessionManager& sm ); - /** - See TQApplication::commitData() for documentation. - - This function is just a convenience version to avoid subclassing TDEApplication. - - Return true to indicate a successful commit of data or false to - indicate a problem and to halt the shutdown process (will - implicitly call sm.cancel() ). - */ - virtual bool commitData( TQSessionManager& sm ); - -protected: - virtual void virtual_hook( int id, void* data ); -private: - KSessionManagedPrivate *d; -}; - - -#endif - diff --git a/tdecore/kapplication_win.cpp b/tdecore/kapplication_win.cpp index cd7145ac7..940bc379e 100644 --- a/tdecore/kapplication_win.cpp +++ b/tdecore/kapplication_win.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <klocale.h> #include <kurl.h> diff --git a/tdecore/kcharsets.cpp b/tdecore/kcharsets.cpp index 17617bf9e..fa623b693 100644 --- a/tdecore/kcharsets.cpp +++ b/tdecore/kcharsets.cpp @@ -21,7 +21,7 @@ #include "kqiodevicegzip_p.h" #include "kentities.c" -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> #include <klocale.h> #include <tdeconfig.h> diff --git a/tdecore/kclipboard.cpp b/tdecore/kclipboard.cpp index 53865a2c2..54d051486 100644 --- a/tdecore/kclipboard.cpp +++ b/tdecore/kclipboard.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kglobal.h> diff --git a/tdecore/kcmdlineargs.cpp b/tdecore/kcmdlineargs.cpp deleted file mode 100644 index a1d3adcf9..000000000 --- a/tdecore/kcmdlineargs.cpp +++ /dev/null @@ -1,1298 +0,0 @@ -/* - Copyright (C) 1999 Waldo Bastian <bastian@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 version 2 as published by the Free Software Foundation. - - 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 <config.h> - -#include <sys/param.h> - -#include <assert.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <unistd.h> - -#ifdef HAVE_LIMITS_H -#include <limits.h> -#endif - -#include <tqdir.h> -#include <tqfile.h> -#include <tqasciidict.h> -#include <tqstrlist.h> - -#include "kcmdlineargs.h" -#include <kaboutdata.h> -#include <klocale.h> -#include <kapplication.h> -#include <kglobal.h> -#include <kstringhandler.h> -#include <kstaticdeleter.h> - -#ifdef Q_WS_X11 -#define DISPLAY "DISPLAY" -#elif defined(Q_WS_QWS) -#define DISPLAY "QWS_DISPLAY" -#endif - -#ifdef Q_WS_WIN -#include <win32_utils.h> -#endif - -template class TQAsciiDict<TQCString>; -template class TQPtrList<TDECmdLineArgs>; - -class TDECmdLineParsedOptions : public TQAsciiDict<TQCString> -{ -public: - TDECmdLineParsedOptions() - : TQAsciiDict<TQCString>( 7 ) { } - - // WABA: Huh? - // The compiler doesn't find TDECmdLineParsedOptions::write(s) by itself ??? - // WABA: No, because there is another write function that hides the - // write function in the base class even though this function has a - // different signature. (obscure C++ feature) - TQDataStream& save( TQDataStream &s) const - { return TQGDict::write(s); } - - TQDataStream& load( TQDataStream &s) - { return TQGDict::read(s); } - -protected: - virtual TQDataStream& write( TQDataStream &s, TQPtrCollection::Item data) const - { - TQCString *str = (TQCString *) data; - s << (*str); - return s; - } - - virtual TQDataStream& read( TQDataStream &s, TQPtrCollection::Item &item) - { - TQCString *str = new TQCString; - s >> (*str); - item = (void *)str; - return s; - } - -}; - -class TDECmdLineParsedArgs : public TQStrList -{ -public: - TDECmdLineParsedArgs() - : TQStrList( true ) { } - TQDataStream& save( TQDataStream &s) const - { return TQGList::write(s); } - - TQDataStream& load( TQDataStream &s) - { return TQGList::read(s); } -}; - - -class TDECmdLineArgsList: public TQPtrList<TDECmdLineArgs> -{ -public: - TDECmdLineArgsList() { } -}; - -TDECmdLineArgsList *TDECmdLineArgs::argsList = 0; -int TDECmdLineArgs::argc = 0; -char **TDECmdLineArgs::argv = 0; -char *TDECmdLineArgs::mCwd = 0; -static KStaticDeleter <char> mCwdd; -const TDEAboutData *TDECmdLineArgs::about = 0; -bool TDECmdLineArgs::parsed = false; -bool TDECmdLineArgs::ignoreUnknown = false; - -// -// Static functions -// - -void -TDECmdLineArgs::init(int _argc, char **_argv, const char *_appname, const char* programName, - const char *_description, const char *_version, bool noKApp) -{ - init(_argc, _argv, - new TDEAboutData(_appname, programName, _version, _description), - noKApp); -} - -void -TDECmdLineArgs::init(int _argc, char **_argv, const char *_appname, - const char *_description, const char *_version, bool noKApp) -{ - init(_argc, _argv, - new TDEAboutData(_appname, _appname, _version, _description), - noKApp); -} - -void -TDECmdLineArgs::initIgnore(int _argc, char **_argv, const char *_appname ) -{ - init(_argc, _argv, - new TDEAboutData(_appname, _appname, "unknown", "TDE Application", false)); - ignoreUnknown = true; -} - -void -TDECmdLineArgs::init(const TDEAboutData* ab) -{ - char **_argv = (char **) malloc(sizeof(char *)); - _argv[0] = (char *) ab->appName(); - init(1,_argv,ab, true); -} - - -void -TDECmdLineArgs::init(int _argc, char **_argv, const TDEAboutData *_about, bool noKApp) -{ - argc = _argc; - argv = _argv; - - if (!argv) - { - fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); - fprintf(stderr, "Passing null-pointer to 'argv' is not allowed.\n\n"); - - assert( 0 ); - exit(255); - } - - // Strip path from argv[0] - if (argc) { - char *p = strrchr( argv[0], '/'); - if (p) - argv[0] = p+1; - } - - about = _about; - parsed = false; - mCwd = mCwdd.setObject(mCwd, new char [PATH_MAX+1], true); - (void) getcwd(mCwd, PATH_MAX); -#ifdef Q_WS_WIN - win32_slashify(mCwd, PATH_MAX); -#endif - if (!noKApp) - TDEApplication::addCmdLineOptions(); -} - -TQString TDECmdLineArgs::cwd() -{ - return TQFile::decodeName(TQCString(mCwd)); -} - -const char * TDECmdLineArgs::appName() -{ - if (!argc) return 0; - return argv[0]; -} - -void -TDECmdLineArgs::addCmdLineOptions( const TDECmdLineOptions *options, const char *name, - const char *id, const char *afterId) -{ - if (!argsList) - argsList = new TDECmdLineArgsList(); - - int pos = argsList->count(); - - if (pos && id && argsList->last() && !argsList->last()->name) - pos--; - - TDECmdLineArgs *args; - int i = 0; - for(args = argsList->first(); args; args = argsList->next(), i++) - { - if (!id && !args->id) - return; // Options already present. - - if (id && args->id && (::qstrcmp(id, args->id) == 0)) - return; // Options already present. - - if (afterId && args->id && (::qstrcmp(afterId, args->id) == 0)) - pos = i+1; - } - - assert( parsed == false ); // You must add _ALL_ cmd line options - // before accessing the arguments! - args = new TDECmdLineArgs(options, name, id); - argsList->insert(pos, args); -} - -void -TDECmdLineArgs::saveAppArgs( TQDataStream &ds) -{ - if (!parsed) - parseAllArgs(); - - // Remove Qt and TDE options. - removeArgs("qt"); - removeArgs("tde"); - - TQCString qCwd = mCwd; - ds << qCwd; - - uint count = argsList ? argsList->count() : 0; - ds << count; - - if (!count) return; - - TDECmdLineArgs *args; - for(args = argsList->first(); args; args = argsList->next()) - { - ds << TQCString(args->id); - args->save(ds); - } -} - -void -TDECmdLineArgs::loadAppArgs( TQDataStream &ds) -{ - parsed = true; // don't reparse argc/argv! - - // Remove Qt and TDE options. - removeArgs("qt"); - removeArgs("tde"); - - TDECmdLineArgs *args; - if ( argsList ) { - for(args = argsList->first(); args; args = argsList->next()) - { - args->clear(); - } - } - - if (ds.atEnd()) - return; - - TQCString qCwd; - ds >> qCwd; - delete [] mCwd; - - mCwd = mCwdd.setObject(mCwd, new char[qCwd.length()+1], true); - strncpy(mCwd, qCwd.data(), qCwd.length()+1); - - uint count; - ds >> count; - - while(count--) - { - TQCString id; - ds >> id; - assert( argsList ); - for(args = argsList->first(); args; args = argsList->next()) - { - if (args->id == id) - { - args->load(ds); - break; - } - } - } - parsed = true; -} - -TDECmdLineArgs *TDECmdLineArgs::parsedArgs(const char *id) -{ - TDECmdLineArgs *args = argsList ? argsList->first() : 0; - while(args) - { - if ((id && ::qstrcmp(args->id, id) == 0) || (!id && !args->id)) - { - if (!parsed) - parseAllArgs(); - return args; - } - args = argsList->next(); - } - - return args; -} - -void TDECmdLineArgs::removeArgs(const char *id) -{ - TDECmdLineArgs *args = argsList ? argsList->first() : 0; - while(args) - { - if (args->id && id && ::qstrcmp(args->id, id) == 0) - { - if (!parsed) - parseAllArgs(); - break; - } - args = argsList->next(); - } - - if (args) - delete args; -} - -/* - * @return: - * 0 - option not found. - * 1 - option found // -fork - * 2 - inverse option found ('no') // -nofork - * 3 - option + arg found // -fork now - * - * +4 - no more options follow // !fork - */ -static int -findOption(const TDECmdLineOptions *options, TQCString &opt, - const char *&opt_name, const char *&def, bool &enabled) -{ - int result; - bool inverse; - int len = opt.length(); - while(options && options->name) - { - result = 0; - inverse = false; - opt_name = options->name; - if ((opt_name[0] == ':') || (opt_name[0] == 0)) - { - options++; - continue; - } - - if (opt_name[0] == '!') - { - opt_name++; - result = 4; - } - if ((opt_name[0] == 'n') && (opt_name[1] == 'o')) - { - opt_name += 2; - inverse = true; - } - if (strncmp(opt.data(), opt_name, len) == 0) - { - opt_name += len; - if (!opt_name[0]) - { - if (inverse) - return result+2; - - if (!options->description) - { - options++; - if (!options->name) - return result+0; - TQCString nextOption = options->name; - int p = nextOption.find(' '); - if (p > 0) - nextOption = nextOption.left(p); - if (nextOption[0] == '!') - nextOption = nextOption.mid(1); - if (strncmp(nextOption.data(), "no", 2) == 0) - { - nextOption = nextOption.mid(2); - enabled = !enabled; - } - result = findOption(options, nextOption, opt_name, def, enabled); - assert(result); - opt = nextOption; - return result; - } - - return 1; - } - if (opt_name[0] == ' ') - { - opt_name++; - def = options->def; - return result+3; - } - } - - options++; - } - return 0; -} - - -void -TDECmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled, bool &moreOptions) -{ - TDECmdLineArgs *args = argsList->first(); - const char *opt_name; - const char *def; - TQCString argument; - int j = opt.find('='); - if (j != -1) - { - argument = opt.mid(j+1); - opt = opt.left(j); - } - - bool enabled = true; - int result = 0; - while (args) - { - enabled = _enabled; - result = ::findOption(args->options, opt, opt_name, def, enabled); - if (result) break; - args = argsList->next(); - } - if (!args && (_opt[0] == '-') && _opt[1] && (_opt[1] != '-')) - { - // Option not found check if it is a valid option - // in the style of -Pprinter1 or ps -aux - int p = 1; - while (true) - { - TQCString singleCharOption = " "; - singleCharOption[0] = _opt[p]; - args = argsList->first(); - while (args) - { - enabled = _enabled; - result = ::findOption(args->options, singleCharOption, opt_name, def, enabled); - if (result) break; - args = argsList->next(); - } - if (!args) - break; // Unknown argument - - p++; - if (result == 1) // Single option - { - args->setOption(singleCharOption, enabled); - if (_opt[p]) - continue; // Next option - else - return; // Finished - } - else if (result == 3) // This option takes an argument - { - if (argument.isEmpty()) - { - argument = _opt+p; - } - args->setOption(singleCharOption, (const char*)argument); - return; - } - break; // Unknown argument - } - args = 0; - result = 0; - } - - if (!args || !result) - { - if (ignoreUnknown) - return; - enable_i18n(); - usage( i18n("Unknown option '%1'.").arg(TQString::fromLocal8Bit(_opt))); - } - - if ((result & 4) != 0) - { - result &= ~4; - moreOptions = false; - } - - if (result == 3) // This option takes an argument - { - if (!enabled) - { - if (ignoreUnknown) - return; - enable_i18n(); - usage( i18n("Unknown option '%1'.").arg(TQString::fromLocal8Bit(_opt))); - } - if (argument.isEmpty()) - { - i++; - if (i >= argc) - { - enable_i18n(); - usage( i18n("'%1' missing.").arg( opt_name)); - } - argument = argv[i]; - } - args->setOption(opt, (const char*)argument); - } - else - { - args->setOption(opt, enabled); - } -} - -void -TDECmdLineArgs::printQ(const TQString &msg) -{ - TQCString localMsg = msg.local8Bit(); - fprintf(stdout, "%s", localMsg.data()); -} - -void -TDECmdLineArgs::parseAllArgs() -{ - bool allowArgs = false; - bool inOptions = true; - bool everythingAfterArgIsArgs = false; - TDECmdLineArgs *appOptions = argsList->last(); - if (!appOptions->id) - { - const TDECmdLineOptions *option = appOptions->options; - while(option && option->name) - { - if (option->name[0] == '+') - allowArgs = true; - if ( option->name[0] == '!' && option->name[1] == '+' ) - { - allowArgs = true; - everythingAfterArgIsArgs = true; - } - option++; - } - } - for(int i = 1; i < argc; i++) - { - if (!argv[i]) - continue; - - if ((argv[i][0] == '-') && argv[i][1] && inOptions) - { - bool enabled = true; - const char *option = &argv[i][1]; - const char *orig = argv[i]; - if (option[0] == '-') - { - option++; - argv[i]++; - if (!option[0]) - { - inOptions = false; - continue; - } - } - if (::qstrcmp(option, "help") == 0) - { - usage(0); - } - else if (strncmp(option, "help-",5) == 0) - { - usage(option+5); - } - else if ( (::qstrcmp(option, "version") == 0) || - (::qstrcmp(option, "v") == 0)) - { - printQ( TQString("Qt: %1\n").arg(tqVersion())); - printQ( TQString("TDE: %1\n").arg(TDE_VERSION_STRING)); - printQ( TQString("%1: %2\n"). - arg(about->programName()).arg(about->version())); - exit(0); - } else if ( (::qstrcmp(option, "license") == 0) ) - { - enable_i18n(); - printQ( about->license() ); - printQ( "\n" ); - exit(0); - } else if ( ::qstrcmp( option, "author") == 0 ) { - enable_i18n(); - if ( about ) { - const TQValueList<TDEAboutPerson> authors = about->authors(); - if ( !authors.isEmpty() ) { - TQString authorlist; - for (TQValueList<TDEAboutPerson>::ConstIterator it = authors.begin(); it != authors.end(); ++it ) { - TQString email; - if ( !(*it).emailAddress().isEmpty() ) - email = " <" + (*it).emailAddress() + ">"; - authorlist += TQString(" ") + (*it).name() + email + "\n"; - } - printQ( i18n("the 2nd argument is a list of name+address, one on each line","%1 was written by\n%2").arg ( TQString(about->programName()) ).arg( authorlist ) ); - } - } else { - printQ( i18n("This application was written by somebody who wants to remain anonymous.") ); - } - if (about) - { - if (!about->customAuthorTextEnabled ()) - { - if (about->bugAddress().isEmpty() || about->bugAddress() == "bugs.pearsoncomputing.net" ) - printQ( i18n( "Please use http://bugs.pearsoncomputing.net to report bugs.\n" ) ); - else { - if( about->authors().count() == 1 && about->authors().first().emailAddress() == about->bugAddress() ) - printQ( i18n( "Please report bugs to %1.\n" ).arg( about->authors().first().emailAddress() ) ); - else - printQ( i18n( "Please report bugs to %1.\n" ).arg(about->bugAddress()) ); - } - } - else - { - printQ(about->customAuthorPlainText()); - } - } - exit(0); - } else { - if ((option[0] == 'n') && (option[1] == 'o')) - { - option += 2; - enabled = false; - } - findOption(orig, option, i, enabled, inOptions); - } - } - else - { - // Check whether appOptions allows these arguments - if (!allowArgs) - { - if (ignoreUnknown) - continue; - enable_i18n(); - usage( i18n("Unexpected argument '%1'.").arg(TQString::fromLocal8Bit(argv[i]))); - } - else - { - appOptions->addArgument(argv[i]); - if (everythingAfterArgIsArgs) - inOptions = false; - } - } - } - parsed = true; -} - -/** - * For TDEApplication only: - * - * Return argc - */ -int * -TDECmdLineArgs::tqt_argc() -{ - if (!argsList) - TDEApplication::addCmdLineOptions(); // Lazy bastards! - - static int tqt_argc = -1; - if( tqt_argc != -1 ) - return &tqt_argc; - - TDECmdLineArgs *args = parsedArgs("qt"); - assert(args); // No qt options have been added! - if (!argv) - { - fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); - fprintf(stderr, "Application has not called TDECmdLineArgs::init(...).\n\n"); - - assert( 0 ); - exit(255); - } - - assert(argc >= (args->count()+1)); - tqt_argc = args->count() +1; - return &tqt_argc; -} - -/** - * For TDEApplication only: - * - * Return argv - */ -char *** -TDECmdLineArgs::tqt_argv() -{ - if (!argsList) - TDEApplication::addCmdLineOptions(); // Lazy bastards! - - static char** tqt_argv; - if( tqt_argv != NULL ) - return &tqt_argv; - - TDECmdLineArgs *args = parsedArgs("qt"); - assert(args); // No qt options have been added! - if (!argv) - { - fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); - fprintf(stderr, "Application has not called TDECmdLineArgs::init(...).\n\n"); - - assert( 0 ); - exit(255); - } - - tqt_argv = new char*[ args->count() + 2 ]; - tqt_argv[ 0 ] = tqstrdup( appName()); - int i = 0; - for(; i < args->count(); i++) - { - tqt_argv[i+1] = tqstrdup((char *) args->arg(i)); - } - tqt_argv[i+1] = 0; - - return &tqt_argv; -} - -void -TDECmdLineArgs::enable_i18n() -{ - // called twice or too late - if (TDEGlobal::_locale) - return; - - if (!TDEGlobal::_instance) { - TDEInstance *instance = new TDEInstance(about); - (void) instance->config(); - // Don't delete instance! - } -} - -void -TDECmdLineArgs::usage(const TQString &error) -{ - assert(TDEGlobal::_locale); - TQCString localError = error.local8Bit(); - if (localError[error.length()-1] == '\n') - localError = localError.left(error.length()-1); - fprintf(stderr, "%s: %s\n", argv[0], localError.data()); - - TQString tmp = i18n("Use --help to get a list of available command line options."); - localError = tmp.local8Bit(); - fprintf(stderr, "%s: %s\n", argv[0], localError.data()); - exit(254); -} - -void -TDECmdLineArgs::usage(const char *id) -{ - enable_i18n(); - assert(argsList != 0); // It's an error to call usage(...) without - // having done addCmdLineOptions first! - - TQString optionFormatString = " %1 %2\n"; - TQString optionFormatStringDef = " %1 %2 [%3]\n"; - TQString optionHeaderString = i18n("\n%1:\n"); - TQString tmp; - TQString usage; - - TDECmdLineArgs *args = argsList->last(); - - if (!(args->id) && (args->options) && - (args->options->name) && (args->options->name[0] != '+')) - { - usage = i18n("[options] ")+usage; - } - - while(args) - { - if (args->name) - { - usage = i18n("[%1-options]").arg(args->name)+" "+usage; - } - args = argsList->prev(); - } - - TDECmdLineArgs *appOptions = argsList->last(); - if (!appOptions->id) - { - const TDECmdLineOptions *option = appOptions->options; - while(option && option->name) - { - if (option->name[0] == '+') - usage = usage + (option->name+1) + " "; - else if ( option->name[0] == '!' && option->name[1] == '+' ) - usage = usage + (option->name+2) + " "; - - option++; - } - } - - printQ(i18n("Usage: %1 %2\n").arg(argv[0]).arg(usage)); - printQ("\n"+about->shortDescription()+"\n"); - - printQ(optionHeaderString.arg(i18n("Generic options"))); - printQ(optionFormatString.arg("--help", -25).arg(i18n("Show help about options"))); - - args = argsList->first(); - while(args) - { - if (args->name && args->id) - { - TQString option = TQString("--help-%1").arg(args->id); - TQString desc = i18n("Show %1 specific options").arg(args->name); - - printQ(optionFormatString.arg(option, -25).arg(desc)); - } - args = argsList->next(); - } - - printQ(optionFormatString.arg("--help-all",-25).arg(i18n("Show all options"))); - printQ(optionFormatString.arg("--author",-25).arg(i18n("Show author information"))); - printQ(optionFormatString.arg("-v, --version",-25).arg(i18n("Show version information"))); - printQ(optionFormatString.arg("--license",-25).arg(i18n("Show license information"))); - printQ(optionFormatString.arg("--", -25).arg(i18n("End of options"))); - - args = argsList->first(); // Sets current to 1st. - - bool showAll = id && (::qstrcmp(id, "all") == 0); - - if (!showAll) - { - while(args) - { - if (!id && !args->id) break; - if (id && (::qstrcmp(args->id, id) == 0)) break; - args = argsList->next(); - } - } - - while(args) - { - bool hasArgs = false; - bool hasOptions = false; - TQString optionsHeader; - if (args->name) - optionsHeader = optionHeaderString.arg(i18n("%1 options").arg(TQString::fromLatin1(args->name))); - else - optionsHeader = i18n("\nOptions:\n"); - - while (args) - { - const TDECmdLineOptions *option = args->options; - TQCString opt = ""; -// - while(option && option->name) - { - TQString description; - TQString descriptionRest; - TQStringList dl; - - // Option header - if (option->name[0] == ':') - { - if (option->description) - { - optionsHeader = "\n"+i18n(option->description); - if (!optionsHeader.endsWith("\n")) - optionsHeader.append("\n"); - hasOptions = false; - } - option++; - continue; - } - - // Free-form comment - if (option->name[0] == 0) - { - if (option->description) - { - TQString tmp = "\n"+i18n(option->description); - if (!tmp.endsWith("\n")) - tmp.append("\n"); - printQ(tmp); - } - option++; - continue; - } - - // Options - if (option->description) - { - description = i18n(option->description); - dl = TQStringList::split("\n", description, true); - description = dl.first(); - dl.remove( dl.begin() ); - } - TQCString name = option->name; - if (name[0] == '!') - name = name.mid(1); - - if (name[0] == '+') - { - if (!hasArgs) - { - printQ(i18n("\nArguments:\n")); - hasArgs = true; - } - - name = name.mid(1); - if ((name[0] == '[') && (name[name.length()-1] == ']')) - name = name.mid(1, name.length()-2); - printQ(optionFormatString.arg(QString(name), -25) - .arg(description)); - } - else - { - if (!hasOptions) - { - printQ(optionsHeader); - hasOptions = true; - } - - if ((name.length() == 1) || (name[1] == ' ')) - name = "-"+name; - else - name = "--"+name; - if (!option->description) - { - opt = name + ", "; - } - else - { - opt = opt + name; - if (!option->def) - { - printQ(optionFormatString.arg(QString(opt), -25) - .arg(description)); - } - else - { - printQ(optionFormatStringDef.arg(QString(opt), -25) - .arg(description).arg(option->def)); - } - opt = ""; - } - } - for(TQStringList::Iterator it = dl.begin(); - it != dl.end(); - ++it) - { - printQ(optionFormatString.arg("", -25).arg(*it)); - } - - option++; - } - args = argsList->next(); - if (!args || args->name || !args->id) break; - } - if (!showAll) break; - } - - exit(254); -} - -// -// Member functions -// - -/** - * Constructor. - * - * The given arguments are assumed to be constants. - */ -TDECmdLineArgs::TDECmdLineArgs( const TDECmdLineOptions *_options, - const char *_name, const char *_id) - : options(_options), name(_name), id(_id) -{ - parsedOptionList = 0; - parsedArgList = 0; - isQt = (::qstrcmp(id, "qt") == 0); -} - -/** - * Destructor. - */ -TDECmdLineArgs::~TDECmdLineArgs() -{ - delete parsedOptionList; - delete parsedArgList; - if (argsList) - argsList->removeRef(this); -} - -void -TDECmdLineArgs::clear() -{ - delete parsedArgList; - parsedArgList = 0; - delete parsedOptionList; - parsedOptionList = 0; -} - -void -TDECmdLineArgs::reset() -{ - if ( argsList ) { - argsList->setAutoDelete( true ); - argsList->clear(); - delete argsList; - argsList = 0; - } - parsed = false; -} - -void -TDECmdLineArgs::save( TQDataStream &ds) const -{ - uint count = 0; - if (parsedOptionList) - parsedOptionList->save( ds ); - else - ds << count; - - if (parsedArgList) - parsedArgList->save( ds ); - else - ds << count; -} - -void -TDECmdLineArgs::load( TQDataStream &ds) -{ - if (!parsedOptionList) parsedOptionList = new TDECmdLineParsedOptions; - if (!parsedArgList) parsedArgList = new TDECmdLineParsedArgs; - - parsedOptionList->load( ds ); - parsedArgList->load( ds ); - - if (parsedOptionList->count() == 0) - { - delete parsedOptionList; - parsedOptionList = 0; - } - if (parsedArgList->count() == 0) - { - delete parsedArgList; - parsedArgList = 0; - } -} - -void -TDECmdLineArgs::setOption(const TQCString &opt, bool enabled) -{ - if (isQt) - { - // Qt does it own parsing. - TQCString arg = "-"; - if( !enabled ) - arg += "no"; - arg += opt; - addArgument(arg); - } - if (!parsedOptionList) { - parsedOptionList = new TDECmdLineParsedOptions; - parsedOptionList->setAutoDelete(true); - } - - if (enabled) - parsedOptionList->replace( opt, new TQCString("t") ); - else - parsedOptionList->replace( opt, new TQCString("f") ); -} - -void -TDECmdLineArgs::setOption(const TQCString &opt, const char *value) -{ - if (isQt) - { - // Qt does it's own parsing. - TQCString arg = "-"; - arg += opt; - addArgument(arg); - addArgument(value); - -#ifdef Q_WS_X11 - // Hack coming up! - if (arg == "-display") - { - setenv(DISPLAY, value, true); - } -#endif - } - if (!parsedOptionList) { - parsedOptionList = new TDECmdLineParsedOptions; - parsedOptionList->setAutoDelete(true); - } - - parsedOptionList->insert( opt, new TQCString(value) ); -} - -TQCString -TDECmdLineArgs::getOption(const char *_opt) const -{ - TQCString *value = 0; - if (parsedOptionList) - { - value = parsedOptionList->find(_opt); - } - - if (value) - return (*value); - - // Look up the default. - const char *opt_name; - const char *def; - bool dummy = true; - TQCString opt = _opt; - int result = ::findOption( options, opt, opt_name, def, dummy) & ~4; - - if (result != 3) - { - fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); - fprintf(stderr, "Application requests for getOption(\"%s\") but the \"%s\" option\n", - _opt, _opt); - fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n"); - - assert( 0 ); - exit(255); - } - return TQCString(def); -} - -QCStringList -TDECmdLineArgs::getOptionList(const char *_opt) const -{ - QCStringList result; - if (!parsedOptionList) - return result; - - while(true) - { - TQCString *value = parsedOptionList->take(_opt); - if (!value) - break; - result.prepend(*value); - delete value; - } - - // Reinsert items in dictionary - // WABA: This is rather silly, but I don't want to add restrictions - // to the API like "you can only call this function once". - // I can't access all items without taking them out of the list. - // So taking them out and then putting them back is the only way. - for(QCStringList::ConstIterator it=result.begin(); - it != result.end(); - ++it) - { - parsedOptionList->insert(_opt, new TQCString(*it)); - } - return result; -} - -bool -TDECmdLineArgs::isSet(const char *_opt) const -{ - // Look up the default. - const char *opt_name; - const char *def; - bool dummy = true; - TQCString opt = _opt; - int result = ::findOption( options, opt, opt_name, def, dummy) & ~4; - - if (result == 0) - { - fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); - fprintf(stderr, "Application requests for isSet(\"%s\") but the \"%s\" option\n", - _opt, _opt); - fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n"); - - assert( 0 ); - exit(255); - } - - TQCString *value = 0; - if (parsedOptionList) - { - value = parsedOptionList->find(opt); - } - - if (value) - { - if (result == 3) - return true; - else - return ((*value)[0] == 't'); - } - - if (result == 3) - return false; // String option has 'false' as default. - - // We return 'true' as default if the option was listed as '-nofork' - // We return 'false' as default if the option was listed as '-fork' - return (result == 2); -} - -int -TDECmdLineArgs::count() const -{ - if (!parsedArgList) - return 0; - return parsedArgList->count(); -} - -const char * -TDECmdLineArgs::arg(int n) const -{ - if (!parsedArgList || (n >= (int) parsedArgList->count())) - { - fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs): Argument out of bounds\n"); - fprintf(stderr, "Application requests for arg(%d) without checking count() first.\n", - n); - - assert( 0 ); - exit(255); - } - - return parsedArgList->at(n); -} - -KURL -TDECmdLineArgs::url(int n) const -{ - return makeURL( arg(n) ); -} - -KURL TDECmdLineArgs::makeURL(const char *_urlArg) -{ - const TQString urlArg = TQFile::decodeName(_urlArg); - TQFileInfo fileInfo(urlArg); - if (!fileInfo.isRelative()) { // i.e. starts with '/', on unix - KURL result; - result.setPath(urlArg); - return result; // Absolute path. - } - - if ( KURL::isRelativeURL(urlArg) || fileInfo.exists() ) { - KURL result; - result.setPath( cwd()+'/'+urlArg ); - result.cleanPath(); - return result; // Relative path - } - - return KURL(urlArg); // Argument is a URL -} - -void -TDECmdLineArgs::addArgument(const char *argument) -{ - if (!parsedArgList) - parsedArgList = new TDECmdLineParsedArgs; - - parsedArgList->append(argument); -} - -static const TDECmdLineOptions kde_tempfile_option[] = -{ - { "tempfile", I18N_NOOP("The files/URLs opened by the application will be deleted after use"), 0}, - TDECmdLineLastOption -}; - -void -TDECmdLineArgs::addTempFileOption() -{ - TDECmdLineArgs::addCmdLineOptions( kde_tempfile_option, "TDE-tempfile", "tde-tempfile" ); -} - -bool TDECmdLineArgs::isTempFileSet() -{ - TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs( "tde-tempfile" ); - if ( args ) - return args->isSet( "tempfile" ); - return false; -} diff --git a/tdecore/kcmdlineargs.h b/tdecore/kcmdlineargs.h deleted file mode 100644 index 9b7dc0f4f..000000000 --- a/tdecore/kcmdlineargs.h +++ /dev/null @@ -1,690 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 1999 Waldo Bastian <bastian@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 version 2 as published by the Free Software Foundation. - - 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 _KCMDLINEARGS_H_ -#define _KCMDLINEARGS_H_ - -#include "tdelibs_export.h" -#include <kurl.h> - -#include <tqptrlist.h> -#include <tqstring.h> -#include <tqvaluelist.h> - -typedef TQValueList<TQCString> QCStringList; - -/** - * @short Structure that holds command line options. - * - * This class is intended to be used with the TDECmdLineArgs class, which - * provides convenient and powerful command line argument parsing and - * handling functionality. - * - * @see TDECmdLineArgs for additional usage information - */ -struct TDECORE_EXPORT TDECmdLineOptions -{ - /** - * The name of the argument as it should be called on the command line and - * appear in <i>myapp --help</i>. - * - * Note that if this option starts with "no" that you will need to test for - * the name without the "no" and the result will be the inverse of what is - * specified. i.e. if "nofoo" is the name of the option and - * <i>myapp --nofoo</i> is called: - * - * \code - * TDECmdLineArgs::parsedArgs()->isSet("foo"); // false - * \endcode - */ - const char *name; - /** - * The text description of the option as should appear in - * <i>myapp --help</i>. This value should be wrapped with I18N_NOOP(). - */ - const char *description; - /** - * The default value for the option, if it is not specified on the - * command line. - */ - const char *def; // Default -}; - -#define TDECmdLineLastOption { 0, 0, 0 } - -class TDECmdLineArgsList; -class TDEApplication; -class KUniqueApplication; -class TDECmdLineParsedOptions; -class TDECmdLineParsedArgs; -class TDEAboutData; -class TDECmdLineArgsPrivate; - -/** - * @short A class for command-line argument handling. - * - * TDECmdLineArgs provides simple access to the command-line arguments - * for an application. It takes into account Qt-specific options, - * KDE-specific options and application specific options. - * - * This class is used in %main() via the static method - * init(). - * - * A typical %KDE application using %TDECmdLineArgs should look like this: - * - * \code - * int main(int argc, char *argv[]) - * { - * // Initialize command line args - * TDECmdLineArgs::init(argc, argv, appName, programName, description, version); - * - * // Tell which options are supported - * TDECmdLineArgs::addCmdLineOptions( options ); - * - * // Add options from other components - * KUniqueApplication::addCmdLineOptions(); - * - * .... - * - * // Create application object without passing 'argc' and 'argv' again. - * KUniqueApplication app; - * - * .... - * - * // Handle our own options/arguments - * // A TDEApplication will usually do this in main but this is not - * // necessary. - * // A KUniqueApplication might want to handle it in newInstance(). - * - * TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - * - * // A binary option (on / off) - * if (args->isSet("some-option")) - * .... - * - * // An option which takes an additional argument - * TQCString anotherOptionArg = args->getOption("another-option"); - * - * // Arguments (e.g. files to open) - * for(int i = 0; i < args->count(); i++) // Counting start at 0! - * { - * // don't forget to convert to Unicode! - * openFile( TQFile::decodeName( args->arg(i))); - * // Or more convenient: - * // openURL( args->url(i)); - * - * } - * - * args->clear(); // Free up some memory. - * .... - * } - * \endcode - * - * The options that an application supports are configured using the - * TDECmdLineOptions class. An example is shown below: - * - * \code - * static const TDECmdLineOptions options[] = - * { - * { "a", I18N_NOOP("A short binary option"), 0 }, - * { "b \<file>", I18N_NOOP("A short option which takes an argument"), 0 }, - * { "c \<speed>", I18N_NOOP("As above but with a default value"), "9600" }, - * { "option1", I18N_NOOP("A long binary option, off by default"), 0 }, - * { "nooption2", I18N_NOOP("A long binary option, on by default"), 0 }, - * { ":", I18N_NOOP("Extra options:"), 0 }, - * { "option3 \<file>", I18N_NOOP("A long option which takes an argument"), 0 }, - * { "option4 \<speed>", I18N_NOOP("A long option which takes an argument, defaulting to 9600"), "9600" }, - * { "d", 0, 0 }, - * { "option5", I18N_NOOP("A long option which has a short option as alias"), 0 }, - * { "e", 0, 0 }, - * { "nooption6", I18N_NOOP("Another long option with an alias"), 0 }, - * { "f", 0, 0 }, - * { "option7 \<speed>", I18N_NOOP("'--option7 speed' is the same as '-f speed'"), 0 }, - * { "!option8 \<cmd>", I18N_NOOP("All options following this one will be treated as arguments"), 0 }, - * { "+file", I18N_NOOP("A required argument 'file'"), 0 }, - * { "+[arg1]", I18N_NOOP("An optional argument 'arg1'"), 0 }, - * { "!+command", I18N_NOOP("A required argument 'command', that can contain multiple words, even starting with '-'"), 0 }, - * { "", I18N_NOOP("Additional help text not associated with any particular option") 0 }, - * TDECmdLineLastOption // End of options. - * }; - * \endcode - * - * The I18N_NOOP macro is used to indicate that these strings should be - * marked for translation. The actual translation is done by TDECmdLineArgs. - * You can't use i18n() here because we are setting up a static data - * structure and can't do translations at compile time. - * - * Note that a program should define the options before any arguments. - * - * When a long option has a short option as an alias, a program should - * only test for the long option. - * - * With the above options a command line could look like: - * \code - * myapp -a -c 4800 --display localhost:0.0 --nooption5 -d /tmp/file - * \endcode - * - * Long binary options can be in the form 'option' and 'nooption'. - * A command line may contain the same binary option multiple times, - * the last option determines the outcome: - * \code - * myapp --nooption4 --option4 --nooption4 - * \endcode - * is the same as: - * \code - * myapp --nooption4 - * \endcode - * - * If an option value is provided multiple times, normally only the last - * value is used: - * \code - * myapp -c 1200 -c 2400 -c 4800 - * \endcode - * is usually the same as: - * \code - * myapp -c 4800 - * \endcode - * - * However, an application can choose to use all values specified as well. - * As an example of this, consider that you may wish to specify a - * number of directories to use: - * \code - * myapp -I /usr/include -I /opt/kde/include -I /usr/X11/include - * \endcode - * When an application does this it should mention this in the description - * of the option. To access these options, use getOptionList() - * - * Tips for end-users: - * - * @li Single char options like "-a -b -c" may be combined into "-abc" - * @li The option "--foo bar" may also be written "--foo=bar" - * @li The option "-P lp1" may also be written "-P=lp1" or "-Plp1" - * @li The option "--foo bar" may also be written "-foo bar" - * - * @author Waldo Bastian - * @version 0.0.4 - */ -class TDECORE_EXPORT TDECmdLineArgs -{ - friend class TDEApplication; - friend class KUniqueApplication; - friend class TQPtrList<TDECmdLineArgs>; -public: - // Static functions: - - /** - * Initialize class. - * - * This function should be called as the very first thing in - * your application. - * @param _argc As passed to @p main(...). - * @param _argv As passed to @p main(...). - * @param _appname The untranslated name of your application. This should - * match with @p argv[0]. - * @param programName A program name string to be used for display - * purposes. This string should be marked for - * translation. Example: I18N_NOOP("KEdit") - * @param _description A short description of what your application is about. - * @param _version A version. - * @param noKApp Set this true to not add commandline options for - * TQApplication / TDEApplication - * - * @since 3.2 - */ - static void init(int _argc, char **_argv, const char *_appname, - const char* programName, const char *_description, - const char *_version, bool noKApp = false); - /** - * @deprecated - * You should convert any calls to this method to use the one - * above, by adding in the program name to be used for display - * purposes. Do not forget to mark it for translation using I18N_NOOP. - */ - static void init(int _argc, char **_argv, - const char *_appname, const char *_description, - const char *_version, bool noKApp = false) KDE_DEPRECATED; - - /** - * Initialize class. - * - * This function should be called as the very first thing in - * your application. It uses TDEAboutData to replace some of the - * arguments that would otherwise be required. - * - * @param _argc As passed to @p main(...). - * @param _argv As passed to @p main(...). - * @param about A TDEAboutData object describing your program. - * @param noKApp Set this true to not add commandline options for - * TQApplication / TDEApplication - */ - static void init(int _argc, char **_argv, - const TDEAboutData *about, bool noKApp = false); - - /** - * Initialize Class - * - * This function should be called as the very first thing in your - * application. This method will rarely be used, since it doesn't - * provide any argument parsing. It does provide access to the - * TDEAboutData information. - * This method is exactly the same as calling - * init(0,0, const TDEAboutData *about, true). - * - * @param about the about data. - * \see TDEAboutData - */ - static void init(const TDEAboutData *about); - - /** - * Add options to your application. - * - * You must make sure that all possible options have been added before - * any class uses the command line arguments. - * - * The list of options should look like this: - * - * \code - * static TDECmdLineOptions options[] = - * { - * { "option1 \<argument>", I18N_NOOP("Description 1"), "my_extra_arg" }, - * { "o", 0, 0 }, - * { "option2", I18N_NOOP("Description 2"), 0 }, - * { "nooption3", I18N_NOOP("Description 3"), 0 }, - * TDECmdLineLastOption - * } - * \endcode - * - * @li "option1" is an option that requires an additional argument, - * but if one is not provided, it uses "my_extra_arg". - * @li "option2" is an option that can be turned on. The default is off. - * @li "option3" is an option that can be turned off. The default is on. - * @li "o" does not have a description. It is an alias for the option - * that follows. In this case "option2". - * @li "+file" specifies an argument. The '+' is removed. If your program - * doesn't specify that it can use arguments your program will abort - * when an argument is passed to it. Note that the reverse is not - * true. If required, you must check yourself the number of arguments - * specified by the user: - * \code - * TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - * if (args->count() == 0) TDECmdLineArgs::usage(i18n("No file specified!")); - * \endcode - * - * In BNF: - * \code - * cmd = myapp [options] file - * options = (option)* - * option = --option1 \<argument> | - * (-o | --option2 | --nooption2) | - * ( --option3 | --nooption3 ) - * \endcode - * - * Instead of "--option3" one may also use "-option3" - * - * Usage examples: - * - * @li "myapp --option1 test" - * @li "myapp" (same as "myapp --option1 my_extra_arg") - * @li "myapp --option2" - * @li "myapp --nooption2" (same as "myapp", since it is off by default) - * @li "myapp -o" (same as "myapp --option2") - * @li "myapp --nooption3" - * @li "myapp --option3 (same as "myapp", since it is on by default) - * @li "myapp --option2 --nooption2" (same as "myapp", because it - * option2 is off by default, and the last usage applies) - * @li "myapp /tmp/file" - * - * @param options A list of options that your code supplies. - * @param name the name of the option, can be 0. - * @param id A name with which these options can be identified, can be 0. - * @param afterId The options are inserted after this set of options, can be 0. - */ - static void addCmdLineOptions( const TDECmdLineOptions *options, - const char *name=0, const char *id = 0, - const char *afterId=0); - - /** - * Access parsed arguments. - * - * This function returns all command line arguments that your code - * handles. If unknown command-line arguments are encountered the program - * is aborted and usage information is shown. - * - * @param id The name of the options you are interested in, can be 0. - */ - static TDECmdLineArgs *parsedArgs(const char *id=0); - - /** - * Get the CWD (Current Working Directory) associated with the - * current command line arguments. - * - * Typically this is needed in KUniqueApplication::newInstance() - * since the CWD of the process may be different from the CWD - * where the user started a second instance. - * @return the current working directory - **/ - static TQString cwd(); - - /** - * Get the appname according to argv[0]. - * @return the name of the application - **/ - static const char *appName(); - - /** - * Print the usage help to stdout and exit. - * - * @param id if 0, print all options. If id is set, only print the - * option specified by id. The id is the value set by - * addCmdLineOptions(). - **/ - static void usage(const char *id = 0); - - /** - * Print an error to stderr and the usage help to stdout and exit. - * @param error the error to print - **/ - static void usage(const TQString &error); - - /** - * Enable i18n to be able to print a translated error message. - * - * N.B.: This function leaks memory, therefore you are expected to exit - * afterwards (e.g., by calling usage()). - **/ - static void enable_i18n(); - - // Member functions: - - - /** - * Read out a string option. - * - * The option must have a corresponding TDECmdLineOptions entry - * of the form: - * \code - * { "option \<argument>", I18N_NOOP("Description"), "default" } - * \endcode - * You cannot test for the presence of an alias - you must always - * test for the full option. - * - * @param option The name of the option without '-'. - * - * @return The value of the option. If the option was not - * present on the command line the default is returned. - * If the option was present more than the value of the - * last occurrence is used. - */ - TQCString getOption(const char *option) const; - - /** - * Read out all occurrences of a string option. - * - * The option must have a corresponding TDECmdLineOptions entry - * of the form: - * \code - * { "option \<argument>", I18N_NOOP("Description"), "default" } - * \endcode - * You cannot test for the presence of an alias - you must always - * test for the full option. - * - * @param option The name of the option, without '-' or '-no'. - * - * @return A list of all option values. If no option was present - * on the command line, an empty list is returned. - */ - QCStringList getOptionList(const char *option) const; - - /** - * Read out a boolean option or check for the presence of string option. - * - * @param option The name of the option without '-' or '-no'. - * - * @return The value of the option. It will be true if the option - * was specifically turned on in the command line, or if the option - * is turned on by default (in the TDECmdLineOptions list) and was - * not specifically turned off in the command line. Equivalently, - * it will be false if the option was specifically turned off in - * the command line, or if the option is turned off by default (in - * the TDECmdLineOptions list) and was not specifically turned on in - * the command line. - */ - bool isSet(const char *option) const; - - /** - * Read the number of arguments that aren't options (but, - * for example, filenames). - * - * @return The number of arguments that aren't options - */ - int count() const; - - /** - * Read out an argument. - * - * @param n The argument to read. 0 is the first argument. - * count()-1 is the last argument. - * - * @return A @p const @p char @p * pointer to the n'th argument. - */ - const char *arg(int n) const; - - /** - * Read out an argument representing a URL. - * - * The argument can be - * @li an absolute filename - * @li a relative filename - * @li a URL - * - * @param n The argument to read. 0 is the first argument. - * count()-1 is the last argument. - * - * @return a URL representing the n'th argument. - */ - KURL url(int n) const; - - /** - * Used by url(). - * Made public for apps that don't use TDECmdLineArgs - * @param urlArg the argument - * @return the url. - */ - static KURL makeURL( const char * urlArg ); - - /** - * Made public for apps that don't use TDECmdLineArgs - * To be done before makeURL, to set the current working - * directory in case makeURL needs it. - * @param cwd the new working directory - */ - static void setCwd( char * cwd ) { mCwd = cwd; } - - /** - * Clear all options and arguments. - */ - void clear(); - - /** - * Reset all option definitions, i.e. cancel all addCmdLineOptions calls. - * Note that TDEApplication's options are removed too, you might want to - * call TDEApplication::addCmdLineOptions if you want them back. - * - * You usually don't want to call this method. - */ - static void reset(); - - /** - * Load arguments from a stream. - */ - static void loadAppArgs( TQDataStream &); - - /** - * Add standard option --tempfile - * @since 3.4 - */ - static void addTempFileOption(); - - // this avoids having to know the "id" used by addTempFileOption - // but this approach doesn't scale well, we can't have 50 standard options here... - /** - * @return true if --tempfile was set - * @since 3.4 - */ - static bool isTempFileSet(); - -protected: - /** - * @internal - * Constructor. - */ - TDECmdLineArgs( const TDECmdLineOptions *_options, const char *_name, - const char *_id); - - /** - * @internal use only. - * - * Use clear() if you want to free up some memory. - * - * Destructor. - */ - ~TDECmdLineArgs(); - -private: - /** - * @internal - * - * Checks what to do with a single option - */ - static void findOption(const char *_opt, TQCString opt, int &i, bool enabled, bool &moreOptions); - - /** - * @internal - * - * Parse all arguments, verify correct syntax and put all arguments - * where they belong. - */ - static void parseAllArgs(); - - /** - * @internal for TDEApplication only: - * - * Return argc - */ - static int *tqt_argc(); - - /** - * @internal for TDEApplication only: - * - * Return argv - */ - - static char ***tqt_argv(); - - /** - * @internal - * - * Remove named options. - * - * @param id The name of the options to be removed. - */ - static void removeArgs(const char *id); - - /** - * @internal for KUniqueApplication only: - * - * Save all but the Qt and KDE arguments to a stream. - */ - static void saveAppArgs( TQDataStream &); - - /** - * @internal - * - * Set a boolean option - */ - void setOption(const TQCString &option, bool enabled); - - /** - * @internal - * - * Set a string option - */ - void setOption(const TQCString &option, const char *value); - - /** - * @internal - * - * Add an argument - */ - void addArgument(const char *argument); - - /** - * @internal - * - * Save to a stream. - */ - void save( TQDataStream &) const; - - /** - * @internal - * - * Restore from a stream. - */ - void load( TQDataStream &); - - /** - * @internal for TDEApplication only - * - * Initialize class. - * - * This function should be called as the very first thing in - * your application. - * @param argc As passed to @p main(...). - * @param argv As passed to @p main(...). - * @param appname The untranslated name of your application. This should - * match with @p argv[0]. - * - * This function makes TDECmdLineArgs ignore all unknown options as well as - * all arguments. - */ - static void initIgnore(int _argc, char **_argv, const char *_appname); - - static void printQ(const TQString &msg); - - const TDECmdLineOptions *options; - const char *name; - const char *id; - TDECmdLineParsedOptions *parsedOptionList; - TDECmdLineParsedArgs *parsedArgList; - bool isQt; - - static TDECmdLineArgsList *argsList; // All options. - static const TDEAboutData *about; - - static int argc; // The original argc - static char **argv; // The original argv - static bool parsed; // Whether we have parsed the arguments since calling init - static bool ignoreUnknown; // Ignore unknown options and arguments - static char *mCwd; // Current working directory. Important for KUnqiueApp! - static bool parseArgs; - - TDECmdLineArgsPrivate *d; -}; - -#endif - diff --git a/tdecore/kcompletion.cpp b/tdecore/kcompletion.cpp index 730eadbf9..a5349b3ee 100644 --- a/tdecore/kcompletion.cpp +++ b/tdecore/kcompletion.cpp @@ -18,7 +18,7 @@ */ -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> #include <knotifyclient.h> diff --git a/tdecore/kcrash.cpp b/tdecore/kcrash.cpp index 05f502311..2eed7c282 100644 --- a/tdecore/kcrash.cpp +++ b/tdecore/kcrash.cpp @@ -46,9 +46,9 @@ #include <tqwindowdefs.h> #include <kglobal.h> #include <kinstance.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <../kinit/tdelauncher_cmds.h> diff --git a/tdecore/kdebug.cpp b/tdecore/kdebug.cpp index 27dcf1418..062864fca 100644 --- a/tdecore/kdebug.cpp +++ b/tdecore/kdebug.cpp @@ -27,7 +27,7 @@ #include "kdebugdcopiface.h" -#include "kapplication.h" +#include "tdeapplication.h" #include "kglobal.h" #include "kinstance.h" #include "kstandarddirs.h" diff --git a/tdecore/kdesktopfile.cpp b/tdecore/kdesktopfile.cpp index 41d7a3d41..a5a57cdd8 100644 --- a/tdecore/kdesktopfile.cpp +++ b/tdecore/kdesktopfile.cpp @@ -31,7 +31,7 @@ #include <kdebug.h> #include "kurl.h" #include "tdeconfigbackend.h" -#include "kapplication.h" +#include "tdeapplication.h" #include "kstandarddirs.h" #include "kmountpoint.h" #include "kcatalogue.h" diff --git a/tdecore/kdetcompmgr.cpp b/tdecore/kdetcompmgr.cpp index 1c7a6f1c3..d78d76b34 100644 --- a/tdecore/kdetcompmgr.cpp +++ b/tdecore/kdetcompmgr.cpp @@ -21,9 +21,9 @@ #include <stdio.h> #include <stdlib.h> -#include <kapplication.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> #include <klocale.h> #include <kdebug.h> #include <tdeconfig.h> diff --git a/tdecore/kglobal.cpp b/tdecore/kglobal.cpp index 107d3317e..965a537a3 100644 --- a/tdecore/kglobal.cpp +++ b/tdecore/kglobal.cpp @@ -27,8 +27,8 @@ #include <tqptrlist.h> #include "kglobal.h" -#include <kapplication.h> -#include <kaboutdata.h> +#include <tdeapplication.h> +#include <tdeaboutdata.h> #include <kdebug.h> #include <tdeconfig.h> #include <klocale.h> diff --git a/tdecore/kglobalaccel_win.cpp b/tdecore/kglobalaccel_win.cpp index 0393bdd8d..09c216b99 100644 --- a/tdecore/kglobalaccel_win.cpp +++ b/tdecore/kglobalaccel_win.cpp @@ -31,7 +31,7 @@ #include <tqwidget.h> #include <tqmetaobject.h> #include <private/qucomextra_p.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kkeynative.h> diff --git a/tdecore/kglobalaccel_x11.cpp b/tdecore/kglobalaccel_x11.cpp index 64af90572..2a67c73b5 100644 --- a/tdecore/kglobalaccel_x11.cpp +++ b/tdecore/kglobalaccel_x11.cpp @@ -31,7 +31,7 @@ #include <tqwidget.h> #include <tqmetaobject.h> #include <tqucomextra_p.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kkeynative.h> diff --git a/tdecore/kglobalsettings.cpp b/tdecore/kglobalsettings.cpp index d7006b37a..a103c4652 100644 --- a/tdecore/kglobalsettings.cpp +++ b/tdecore/kglobalsettings.cpp @@ -25,7 +25,7 @@ #include <tdeconfig.h> #include <ksimpleconfig.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kipc.h> diff --git a/tdecore/kiconloader.cpp b/tdecore/kiconloader.cpp index 5938331cd..be44a921f 100644 --- a/tdecore/kiconloader.cpp +++ b/tdecore/kiconloader.cpp @@ -26,7 +26,7 @@ #include <tqmovie.h> #include <tqbitmap.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kipc.h> #include <kdebug.h> #include <kstandarddirs.h> diff --git a/tdecore/kinstance.cpp b/tdecore/kinstance.cpp index 749979750..cf0b35791 100644 --- a/tdecore/kinstance.cpp +++ b/tdecore/kinstance.cpp @@ -26,7 +26,7 @@ #include "kiconloader.h" #include "tdehardwaredevices.h" #include "tdenetworkconnections.h" -#include "kaboutdata.h" +#include "tdeaboutdata.h" #include "kstandarddirs.h" #include "kdebug.h" #include "kglobal.h" diff --git a/tdecore/klibloader.cpp b/tdecore/klibloader.cpp index b7cad0fbe..f7e63c215 100644 --- a/tdecore/klibloader.cpp +++ b/tdecore/klibloader.cpp @@ -25,7 +25,7 @@ #include <tqtimer.h> #include <tqobjectdict.h> -#include "kapplication.h" +#include "tdeapplication.h" #include "klibloader.h" #include "kstandarddirs.h" #include "kdebug.h" diff --git a/tdecore/klockfile.cpp b/tdecore/klockfile.cpp index 8b4a991ce..ee09a06c8 100644 --- a/tdecore/klockfile.cpp +++ b/tdecore/klockfile.cpp @@ -37,8 +37,8 @@ #include <tqtextstream.h> #include <kde_file.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kglobal.h> #include <ktempfile.h> diff --git a/tdecore/kmanagerselection.cpp b/tdecore/kmanagerselection.cpp index 15e273d6d..2e019f73e 100644 --- a/tdecore/kmanagerselection.cpp +++ b/tdecore/kmanagerselection.cpp @@ -47,7 +47,7 @@ DEALINGS IN THE SOFTWARE. #include <kdebug.h> #include <tqwidget.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kxerrorhandler.h> #include <X11/Xatom.h> diff --git a/tdecore/knotifyclient.cpp b/tdecore/knotifyclient.cpp index 309be40f0..b6f70bd23 100644 --- a/tdecore/knotifyclient.cpp +++ b/tdecore/knotifyclient.cpp @@ -23,9 +23,9 @@ #include <tqdatastream.h> #include <tqptrstack.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <dcopclient.h> #include <kdebug.h> diff --git a/tdecore/kprotocolinfo_tdecore.cpp b/tdecore/kprotocolinfo_tdecore.cpp index 088ea0363..8cc5091c5 100644 --- a/tdecore/kprotocolinfo_tdecore.cpp +++ b/tdecore/kprotocolinfo_tdecore.cpp @@ -27,7 +27,7 @@ #include <kstandarddirs.h> #include <kglobal.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <ksimpleconfig.h> #include <tdeconfig.h> diff --git a/tdecore/kprotocolinfofactory.cpp b/tdecore/kprotocolinfofactory.cpp index c651024ef..4daab08dd 100644 --- a/tdecore/kprotocolinfofactory.cpp +++ b/tdecore/kprotocolinfofactory.cpp @@ -19,7 +19,7 @@ #include <kstandarddirs.h> #include <kglobal.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tdesycoca.h> #include <tdesycocadict.h> diff --git a/tdecore/krandomsequence.cpp b/tdecore/krandomsequence.cpp index 9529ccabb..8896db70b 100644 --- a/tdecore/krandomsequence.cpp +++ b/tdecore/krandomsequence.cpp @@ -21,7 +21,7 @@ #include <tqptrlist.h> #include "krandomsequence.h" -#include "kapplication.h" +#include "tdeapplication.h" const int KRandomSequence::m_nShuffleTableSize = 32; diff --git a/tdecore/krootprop.cpp b/tdecore/krootprop.cpp index cb0200c99..bb15462dd 100644 --- a/tdecore/krootprop.cpp +++ b/tdecore/krootprop.cpp @@ -26,7 +26,7 @@ #include "kglobal.h" #include "klocale.h" #include "kcharsets.h" -#include "kapplication.h" +#include "tdeapplication.h" #include <tqtextstream.h> #include <X11/Xlib.h> diff --git a/tdecore/ksavefile.cpp b/tdecore/ksavefile.cpp index fdf47daf9..4ad96c0f2 100644 --- a/tdecore/ksavefile.cpp +++ b/tdecore/ksavefile.cpp @@ -36,7 +36,7 @@ #include <tqdir.h> #include <kde_file.h> -#include "kapplication.h" +#include "tdeapplication.h" #include "ksavefile.h" #include "kstandarddirs.h" diff --git a/tdecore/ksimpledirwatch.cpp b/tdecore/ksimpledirwatch.cpp index 8454c7a74..f39a94221 100644 --- a/tdecore/ksimpledirwatch.cpp +++ b/tdecore/ksimpledirwatch.cpp @@ -43,7 +43,7 @@ #include <tqstringlist.h> #include <tqtimer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tdeconfig.h> #include <kglobal.h> diff --git a/tdecore/ksocks.cpp b/tdecore/ksocks.cpp index cc0cde8ca..95e36dc15 100644 --- a/tdecore/ksocks.cpp +++ b/tdecore/ksocks.cpp @@ -30,7 +30,7 @@ #include <kdebug.h> #include "klibloader.h" #include <tdeconfig.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <sys/types.h> #include <sys/socket.h> diff --git a/tdecore/kstartupinfo.cpp b/tdecore/kstartupinfo.cpp index 0eb0e91de..a472de5fd 100644 --- a/tdecore/kstartupinfo.cpp +++ b/tdecore/kstartupinfo.cpp @@ -55,7 +55,7 @@ DEALINGS IN THE SOFTWARE. #include <netwm.h> #endif #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <signal.h> #ifdef Q_WS_X11 #include <twinmodule.h> diff --git a/tdecore/ktempdir.cpp b/tdecore/ktempdir.cpp index 69554fd86..53cc83f99 100644 --- a/tdecore/ktempdir.cpp +++ b/tdecore/ktempdir.cpp @@ -48,7 +48,7 @@ #include <tqdir.h> #include "kglobal.h" -#include "kapplication.h" +#include "tdeapplication.h" #include "kinstance.h" #include "ktempdir.h" #include "kstandarddirs.h" diff --git a/tdecore/ktempfile.cpp b/tdecore/ktempfile.cpp index 35d66f81c..973e14070 100644 --- a/tdecore/ktempfile.cpp +++ b/tdecore/ktempfile.cpp @@ -49,7 +49,7 @@ #include <tqtextstream.h> #include "kglobal.h" -#include "kapplication.h" +#include "tdeapplication.h" #include "kinstance.h" #include "ktempfile.h" #include "kstandarddirs.h" diff --git a/tdecore/kuniqueapplication.cpp b/tdecore/kuniqueapplication.cpp index fb8cda9fd..964c7c8c7 100644 --- a/tdecore/kuniqueapplication.cpp +++ b/tdecore/kuniqueapplication.cpp @@ -34,9 +34,9 @@ #include <tqtimer.h> #include <dcopclient.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <kstandarddirs.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #if defined Q_WS_X11 #include <twin.h> diff --git a/tdecore/kuniqueapplication.h b/tdecore/kuniqueapplication.h index ede89ef19..3b7bd8d6e 100644 --- a/tdecore/kuniqueapplication.h +++ b/tdecore/kuniqueapplication.h @@ -21,7 +21,7 @@ #ifndef _KUNIQUEAPP_H #define _KUNIQUEAPP_H -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopobject.h> class KUniqueApplicationPrivate; @@ -36,7 +36,7 @@ class KUniqueApplicationPrivate; * the information to the first instance and then quit. * * The .desktop file for the application should state X-DCOP-ServiceType=Unique, - * see kapplication.h + * see tdeapplication.h * * If your application is used to open files, it should also support the --tempfile * option (see TDECmdLineArgs::addTempFileOption()), to delete tempfiles after use. diff --git a/tdecore/kxmessages.cpp b/tdecore/kxmessages.cpp index 52781188f..116c74d1c 100644 --- a/tdecore/kxmessages.cpp +++ b/tdecore/kxmessages.cpp @@ -26,7 +26,7 @@ DEALINGS IN THE SOFTWARE. #include "kxmessages.h" -#include <kapplication.h> +#include <tdeapplication.h> #ifdef Q_WS_X11 // FIXME(E): Figure out what parts we can/should emulate in QT/E diff --git a/tdecore/network/kresolverstandardworkers.cpp b/tdecore/network/kresolverstandardworkers.cpp index dd5e33f23..cde24f752 100644 --- a/tdecore/network/kresolverstandardworkers.cpp +++ b/tdecore/network/kresolverstandardworkers.cpp @@ -46,7 +46,7 @@ #include "kdebug.h" #include "kglobal.h" #include "kstandarddirs.h" -#include "kapplication.h" +#include "tdeapplication.h" #include "kresolver.h" #include "tdesocketaddress.h" diff --git a/tdecore/network/ksockssocketdevice.cpp b/tdecore/network/ksockssocketdevice.cpp index c1649c340..69c674438 100644 --- a/tdecore/network/ksockssocketdevice.cpp +++ b/tdecore/network/ksockssocketdevice.cpp @@ -32,7 +32,7 @@ #define kde_socklen_t ksocklen_t #endif -#include "kapplication.h" +#include "tdeapplication.h" #include "ksocks.h" #include "tdesocketaddress.h" diff --git a/tdecore/tde-config.cpp.cmake b/tdecore/tde-config.cpp.cmake index e235c4f8c..98481cefe 100644 --- a/tdecore/tde-config.cpp.cmake +++ b/tdecore/tde-config.cpp.cmake @@ -1,15 +1,15 @@ // -*- c++ -*- -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <klocale.h> #include <kinstance.h> #include <kstandarddirs.h> #include <kglobal.h> #include <kglobalsettings.h> #include <stdio.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <config.h> -#include <kapplication.h> +#include <tdeapplication.h> static const char *description = I18N_NOOP("A little program to output installation paths"); diff --git a/tdecore/tde-config.cpp.in b/tdecore/tde-config.cpp.in index d44ccd6b5..ac49e5c41 100644 --- a/tdecore/tde-config.cpp.in +++ b/tdecore/tde-config.cpp.in @@ -1,15 +1,15 @@ // -*- c++ -*- -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <klocale.h> #include <kinstance.h> #include <kstandarddirs.h> #include <kglobal.h> #include <kglobalsettings.h> #include <stdio.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <config.h> -#include <kapplication.h> +#include <tdeapplication.h> static const char *description = I18N_NOOP("A little program to output installation paths"); diff --git a/tdecore/tdeaboutdata.cpp b/tdecore/tdeaboutdata.cpp new file mode 100644 index 000000000..bf8538152 --- /dev/null +++ b/tdecore/tdeaboutdata.cpp @@ -0,0 +1,512 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Espen Sand (espen@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 <tdeaboutdata.h> +#include <kstandarddirs.h> +#include <tqfile.h> +#include <tqtextstream.h> + +TQString +TDEAboutPerson::name() const +{ + return TQString::fromUtf8(mName); +} + +TQString +TDEAboutPerson::task() const +{ + if (mTask && *mTask) + return i18n(mTask); + else + return TQString::null; +} + +TQString +TDEAboutPerson::emailAddress() const +{ + return TQString::fromUtf8(mEmailAddress); +} + + +TQString +TDEAboutPerson::webAddress() const +{ + return TQString::fromUtf8(mWebAddress); +} + + +TDEAboutTranslator::TDEAboutTranslator(const TQString & name, + const TQString & emailAddress) +{ + mName=name; + mEmail=emailAddress; +} + +TQString TDEAboutTranslator::name() const +{ + return mName; +} + +TQString TDEAboutTranslator::emailAddress() const +{ + return mEmail; +} + +class TDEAboutDataPrivate +{ +public: + TDEAboutDataPrivate() + : translatorName("_: NAME OF TRANSLATORS\nYour names") + , translatorEmail("_: EMAIL OF TRANSLATORS\nYour emails") + , productName(0) + , programLogo(0) + , customAuthorTextEnabled(false) + , mTranslatedProgramName( 0 ) + {} + ~TDEAboutDataPrivate() + { + delete programLogo; + delete[] mTranslatedProgramName; + } + const char *translatorName; + const char *translatorEmail; + const char *productName; + TQImage* programLogo; + TQString customAuthorPlainText, customAuthorRichText; + bool customAuthorTextEnabled; + const char *mTranslatedProgramName; +}; + +const char *TDEAboutData::defaultBugTracker = "http://bugs.trinitydesktop.org"; + +TDEAboutData::TDEAboutData( const char *appName, + const char *programName, + const char *version, + const char *shortDescription, + int licenseType, + const char *copyrightStatement, + const char *text, + const char *homePageAddress, + const char *bugsEmailAddress + ) : + mProgramName( programName ), + mVersion( version ), + mShortDescription( shortDescription ), + mLicenseKey( licenseType ), + mCopyrightStatement( copyrightStatement ), + mOtherText( text ), + mHomepageAddress( homePageAddress ), + mBugEmailAddress( (bugsEmailAddress!=0)?bugsEmailAddress:defaultBugTracker ), + mLicenseText (0) +{ + d = new TDEAboutDataPrivate; + + if( appName ) { + const char *p = strrchr(appName, '/'); + if( p ) + mAppName = p+1; + else + mAppName = appName; + } else + mAppName = 0; +} + +TDEAboutData::~TDEAboutData() +{ + if (mLicenseKey == License_File) + delete [] mLicenseText; + delete d; +} + +void +TDEAboutData::addAuthor( const char *name, const char *task, + const char *emailAddress, const char *webAddress ) +{ + mAuthorList.append(TDEAboutPerson(name,task,emailAddress,webAddress)); +} + +void +TDEAboutData::addCredit( const char *name, const char *task, + const char *emailAddress, const char *webAddress ) +{ + mCreditList.append(TDEAboutPerson(name,task,emailAddress,webAddress)); +} + +void +TDEAboutData::setTranslator( const char *name, const char *emailAddress) +{ + d->translatorName=name; + d->translatorEmail=emailAddress; +} + +void +TDEAboutData::setLicenseText( const char *licenseText ) +{ + mLicenseText = licenseText; + mLicenseKey = License_Custom; +} + +void +TDEAboutData::setLicenseTextFile( const TQString &file ) +{ + mLicenseText = tqstrdup(TQFile::encodeName(file)); + mLicenseKey = License_File; +} + +void +TDEAboutData::setAppName( const char *appName ) +{ + mAppName = appName; +} + +void +TDEAboutData::setProgramName( const char* programName ) +{ + mProgramName = programName; + translateInternalProgramName(); +} + +void +TDEAboutData::setVersion( const char* version ) +{ + mVersion = version; +} + +void +TDEAboutData::setShortDescription( const char *shortDescription ) +{ + mShortDescription = shortDescription; +} + +void +TDEAboutData::setLicense( LicenseKey licenseKey) +{ + mLicenseKey = licenseKey; +} + +void +TDEAboutData::setCopyrightStatement( const char *copyrightStatement ) +{ + mCopyrightStatement = copyrightStatement; +} + +void +TDEAboutData::setOtherText( const char *otherText ) +{ + mOtherText = otherText; +} + +void +TDEAboutData::setHomepage( const char *homepage ) +{ + mHomepageAddress = homepage; +} + +void +TDEAboutData::setBugAddress( const char *bugAddress ) +{ + mBugEmailAddress = bugAddress; +} + +void +TDEAboutData::setProductName( const char *productName ) +{ + d->productName = productName; +} + +const char * +TDEAboutData::appName() const +{ + return mAppName; +} + +const char * +TDEAboutData::productName() const +{ + if (d->productName) + return d->productName; + else + return appName(); +} + +TQString +TDEAboutData::programName() const +{ + if (mProgramName && *mProgramName) + return i18n(mProgramName); + else + return TQString::null; +} + +const char* +TDEAboutData::internalProgramName() const +{ + if (d->mTranslatedProgramName) + return d->mTranslatedProgramName; + else + return mProgramName; +} + +// TDECrash should call as few things as possible and should avoid e.g. malloc() +// because it may deadlock. Since i18n() needs it, when TDELocale is available +// the i18n() call will be done here in advance. +void +TDEAboutData::translateInternalProgramName() const +{ + delete[] d->mTranslatedProgramName; + d->mTranslatedProgramName = 0; + if( TDEGlobal::locale() ) + d->mTranslatedProgramName = tqstrdup( programName().utf8()); +} + +TQImage +TDEAboutData::programLogo() const +{ + return d->programLogo ? (*d->programLogo) : TQImage(); +} + +void +TDEAboutData::setProgramLogo(const TQImage& image) +{ + if (!d->programLogo) + d->programLogo = new TQImage( image ); + else + *d->programLogo = image; +} + +TQString +TDEAboutData::version() const +{ + return TQString::fromLatin1(mVersion); +} + +TQString +TDEAboutData::shortDescription() const +{ + if (mShortDescription && *mShortDescription) + return i18n(mShortDescription); + else + return TQString::null; +} + +TQString +TDEAboutData::homepage() const +{ + return TQString::fromLatin1(mHomepageAddress); +} + +TQString +TDEAboutData::bugAddress() const +{ + return TQString::fromLatin1(mBugEmailAddress); +} + +const TQValueList<TDEAboutPerson> +TDEAboutData::authors() const +{ + return mAuthorList; +} + +const TQValueList<TDEAboutPerson> +TDEAboutData::credits() const +{ + return mCreditList; +} + +const TQValueList<TDEAboutTranslator> +TDEAboutData::translators() const +{ + TQValueList<TDEAboutTranslator> personList; + + if(d->translatorName == 0) + return personList; + + TQStringList nameList; + TQStringList emailList; + + TQString names = i18n(d->translatorName); + if(names != TQString::fromUtf8(d->translatorName)) + { + nameList = TQStringList::split(',',names); + } + + + if(d->translatorEmail) + { + TQString emails = i18n(d->translatorEmail); + + if(emails != TQString::fromUtf8(d->translatorEmail)) + { + emailList = TQStringList::split(',',emails,true); + } + } + + + TQStringList::Iterator nit; + TQStringList::Iterator eit=emailList.begin(); + + for(nit = nameList.begin(); nit != nameList.end(); ++nit) + { + TQString email; + if(eit != emailList.end()) + { + email=*eit; + ++eit; + } + + TQString name=*nit; + + personList.append(TDEAboutTranslator(name.stripWhiteSpace(), email.stripWhiteSpace())); + } + + return personList; +} + +TQString +TDEAboutData::aboutTranslationTeam() +{ + return i18n("replace this with information about your translation team", + "<p>KDE is translated into many languages thanks to the work " + "of the translation teams all over the world.</p>" + "<p>For more information on KDE internationalization " + "visit <a href=\"http://l10n.kde.org\">http://l10n.kde.org</a></p>" + ); +} + +TQString +TDEAboutData::otherText() const +{ + if (mOtherText && *mOtherText) + return i18n(mOtherText); + else + return TQString::null; +} + + +TQString +TDEAboutData::license() const +{ + TQString result; + if (!copyrightStatement().isEmpty()) + result = copyrightStatement() + "\n\n"; + + TQString l; + TQString f; + switch ( mLicenseKey ) + { + case License_File: + f = TQFile::decodeName(mLicenseText); + break; + case License_GPL_V2: + l = "GPL v2"; + f = locate("data", "LICENSES/GPL_V2"); + break; + case License_LGPL_V2: + l = "LGPL v2"; + f = locate("data", "LICENSES/LGPL_V2"); + break; + case License_BSD: + l = "BSD License"; + f = locate("data", "LICENSES/BSD"); + break; + case License_Artistic: + l = "Artistic License"; + f = locate("data", "LICENSES/ARTISTIC"); + break; + case License_QPL_V1_0: + l = "QPL v1.0"; + f = locate("data", "LICENSES/QPL_V1.0"); + break; + case License_Custom: + if (mLicenseText && *mLicenseText) + return( i18n(mLicenseText) ); + // fall through + default: + result += i18n("No licensing terms for this program have been specified.\n" + "Please check the documentation or the source for any\n" + "licensing terms.\n"); + return result; + } + + if (!l.isEmpty()) + result += i18n("This program is distributed under the terms of the %1.").arg( l ); + + if (!f.isEmpty()) + { + TQFile file(f); + if (file.open(IO_ReadOnly)) + { + result += '\n'; + result += '\n'; + TQTextStream str(&file); + result += str.read(); + } + } + + return result; +} + +TQString +TDEAboutData::copyrightStatement() const +{ + if (mCopyrightStatement && *mCopyrightStatement) + return i18n(mCopyrightStatement); + else + return TQString::null; +} + +TQString +TDEAboutData::customAuthorPlainText() const +{ + return d->customAuthorPlainText; +} + +TQString +TDEAboutData::customAuthorRichText() const +{ + return d->customAuthorRichText; +} + +bool +TDEAboutData::customAuthorTextEnabled() const +{ + return d->customAuthorTextEnabled; +} + +void +TDEAboutData::setCustomAuthorText(const TQString &plainText, const TQString &richText) +{ + d->customAuthorPlainText = plainText; + d->customAuthorRichText = richText; + + d->customAuthorTextEnabled = true; +} + +void +TDEAboutData::unsetCustomAuthorText() +{ + d->customAuthorPlainText = TQString::null; + d->customAuthorRichText = TQString::null; + + d->customAuthorTextEnabled = false; +} + diff --git a/tdecore/tdeaboutdata.h b/tdecore/tdeaboutdata.h new file mode 100644 index 000000000..d5addac0a --- /dev/null +++ b/tdecore/tdeaboutdata.h @@ -0,0 +1,630 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Espen Sand (espen@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 <tqvaluelist.h> +#include <tqstring.h> +#include <tqimage.h> +#include <klocale.h> + +#ifndef _KABOUTDATA_H_ +#define _KABOUTDATA_H_ + +class TDEAboutPersonPrivate; +class TDEAboutDataPrivate; + +/** + * This structure is used to store information about a person or developer. + * It can store the person's name, a task, an email address and a + * link to a home page. This class is intended for use in the + * TDEAboutData class, but it can be used elsewhere as well. + * Normally you should at least define the person's name. + * + * Example Usage within a main(): + * + * \code + * TDEAboutData about("khello", I18N_NOOP("KHello"), "0.1", + * I18N_NOOP("A TDE version of Hello, world!"), + * TDEAboutData::License_LGPL, + * I18N_NOOP("Copyright (c) 2003 Developer")); + * + * about.addAuthor("Joe Developer", I18N_NOOP("developer"), "joe@host.com", 0); + * about.addCredit("Joe User", I18N_NOOP("A lot of bug reports"), + * "joe.user@host.org", 0); + * TDECmdLineArgs::init(argc, argv, &about); + * \endcode + */ +class TDECORE_EXPORT TDEAboutPerson +{ +public: + /** + * Convenience constructor + * + * @param name The name of the person. + * + * @param task The task of this person. This string should be + * marked for translation, e.g. + * I18N_NOOP("Task description....") + * + * @param emailAddress The email address of the person. + * + * @param webAddress Home page of the person. + */ + TDEAboutPerson( const char *name, const char *task, + const char *emailAddress, const char *webAddress ) + { + mName = name; + mTask = task; + mEmailAddress = emailAddress; + mWebAddress = webAddress; + } + /** + * @internal + * Don't use. Required by QValueList + */ + TDEAboutPerson() {} + + /** + * The person's name + * @return the person's name (can be TQString::null, if it has been + * constructed with a null name) + */ + TQString name() const; + + /** + * The person's task + * @return the person's task (can be TQString::null, if it has been + * constructed with a null task) + */ + TQString task() const; + + /** + * The person's email address + * @return the person's email address (can be TQString::null, if it has been + * constructed with a null email) + */ + TQString emailAddress() const; + + /** + * The home page or a relevant link + * @return the persons home page (can be TQString::null, if it has been + * constructed with a null home page) + */ + TQString webAddress() const; + +private: + const char *mName; + const char *mTask; + const char *mEmailAddress; + const char *mWebAddress; + + TDEAboutPersonPrivate *d; +}; + +class TDEAboutTranslatorPrivate; +/** + * This structure is used to store information about a translator. + * It can store the translator's name and an email address. + * This class is intended for use in the TDEAboutData class, + * but it can be used elsewhere as well. + * Normally you should at least define the translator's name. + * + * It's not possible to use TDEAboutPerson for this, because + * TDEAboutPerson stores internally only const char* pointers, but the + * translator information is generated dynamically from the translation + * of a dummy string. +*/ +class TDECORE_EXPORT TDEAboutTranslator +{ +public: + /** + * Convenience constructor + * + * @param name The name of the person. + * + * @param emailAddress The email address of the person. + */ + TDEAboutTranslator(const TQString & name=TQString::null, + const TQString & emailAddress=TQString::null); + + /** + * The translator's name + * @return the translators's name (can be TQString::null, if it has been + * constructed with a null name) + */ + TQString name() const; + + /** + * The translator's email + * @return the translator's email address (can be TQString::null, if it has been + * constructed with a null email) + */ + TQString emailAddress() const; + +private: + TQString mName; + TQString mEmail; + TDEAboutTranslatorPrivate* d; +}; + + +/** + * This class is used to store information about a program. It can store + * such values as version number, program name, home page, email address + * for bug reporting, multiple authors and contributors + * (using TDEAboutPerson), license and copyright information. + * + * Currently, the values set here are shown by the "About" box + * (see TDEAboutDialog), used by the bug report dialog (see KBugReport), + * and by the help shown on command line (see TDECmdLineArgs). + * + * @short Holds information needed by the "About" box and other + * classes. + * @author Espen Sand (espen@kde.org), David Faure (faure@kde.org) + */ +class TDECORE_EXPORT TDEAboutData +{ + public: + /** + * Descibes the license of the software. + */ + enum LicenseKey + { + License_Custom = -2, + License_File = -1, + License_Unknown = 0, + License_GPL = 1, + License_GPL_V2 = 1, + License_LGPL = 2, + License_LGPL_V2 = 2, + License_BSD = 3, + License_Artistic = 4, + License_QPL = 5, + License_QPL_V1_0 = 5 + }; + + public: + /** + * Constructor. + * + * @param appName The program name used internally. Example: "kedit" + * + * @param programName A displayable program name string. This string + * should be marked for translation. Example: I18N_NOOP("KEdit") + * + * @param version The program version string. + * + * @param shortDescription A short description of what the program does. + * This string should be marked for translation. + * Example: I18N_NOOP("A simple text editor.") + * + * @param licenseType The license identifier. Use setLicenseText if + * you use a license not predefined here. + * + * @param copyrightStatement A copyright statement, that can look like this: + * "(c) 1999-2000, Name". The string specified here is not modified + * in any manner. The author information from addAuthor is not + * used. + * + * @param text Some free form text, that can contain any kind of + * information. The text can contain newlines. This string + * should be marked for translation. + * + * @param homePageAddress The program homepage string. + * Start the address with "http://". "http://some.domain" is + * is correct, "some.domain" is not. + * + * @param bugsEmailAddress The bug report email address string. + * This defaults to the trinitydesktop.org bug system. + * + */ + TDEAboutData( const char *appName, + const char *programName, + const char *version, + const char *shortDescription = 0, + int licenseType = License_Unknown, + const char *copyrightStatement = 0, + const char *text = 0, + const char *homePageAddress = 0, + const char *bugsEmailAddress = 0 + ); + + ~TDEAboutData(); + + /** + * Defines an author. You can call this function as many times you + * need. Each entry is appended to a list. The person in the first entry + * is assumed to be the leader of the project. + * + * @param name The developer's name in UTF-8 encoding. + * + * @param task What the person is responsible for. This text can contain + * newlines. It should be marked for translation like this: + * I18N_NOOP("Task description..."). Can be 0. + * + * @param emailAddress An Email address where the person can be reached. + * Can be 0. + * + * @param webAddress The person's homepage or a relevant link. + * Start the address with "http://". "http://some.domain" is + * correct, "some.domain" is not. Can be 0. + * + */ + void addAuthor( const char *name, + const char *task=0, + const char *emailAddress=0, + const char *webAddress=0 ); + + /** + * Defines a person that deserves credit. You can call this function + * as many times you need. Each entry is appended to a list. + * + * @param name The person's name in UTF-8 encoding. + * + * @param task What the person has done to deserve the honor. The + * text can contain newlines. It should be marked for + * translation like this: I18N_NOOP("Task description...") + * Can be 0. + * + * @param emailAddress An Email address when the person can be reached. + * Can be 0. + * + * @param webAddress The person's homepage or a relevant link. + * Start the address with "http://". "http://some.domain" is + * is correct, "some.domain" is not. Can be 0. + * + */ + void addCredit( const char *name, + const char *task=0, + const char *emailAddress=0, + const char *webAddress=0 ); + + /** + * Sets the name of the translator of the gui. Since this depends + * on the language, just use a dummy text marked for translation. + * + * For example: + * \code + * setTranslator(I18N_NOOP("_: NAME OF TRANSLATORS\\nYour names") + * ,I18N_NOOP("_: EMAIL OF TRANSLATORS\\nYour emails")); + * \endcode + * + * The translator can then translate this dummy text with his name + * or with a list of names separated with ",". + * If there is no translation or the application is used with the + * default language, this function call is ignored. + * + * Note: If you are using the default KDE automake environment, + * there is no need to use this function, because the two + * default strings above are added to the applications po file + * automatically. + * + * @param name the name of the translator + * @param emailAddress the email address of the translator + * @see TDEAboutTranslator + */ + void setTranslator(const char* name, const char* emailAddress); + + /** + * Defines a license text. + * + * The text will be translated if it got marked for + * translations with the I18N_NOOP() macro. + * + * Example: + * \code + * setLicenseText( I18N_NOOP("This is my license")); + * \endcode + * + * NOTE: No copy of the text is made. + * + * @param license The license text in utf8 encoding. + */ + void setLicenseText( const char *license ); + + /** + * Defines a license text. + * + * @param file File containing the license text. + */ + void setLicenseTextFile( const TQString &file ); + + /** + * Defines the program name used internally. + * + * @param appName The application name. Example: "kate". + */ + void setAppName( const char *appName ); + + /** + * Defines the displayable program name string. + * + * @param programName The program name. This string should be + * marked for translation. + * Example: I18N_NOOP("Advanced Text Editor"). + * @since 3.2 + */ + void setProgramName( const char* programName ); + + /** + * Defines the program logo. + * Use this if you need to have application logo + * in AboutData other than application icon. + * + * @param image logo image. + * @see programLogo() + * @since 3.4 + */ + void setProgramLogo(const TQImage& image); + + /** + * Defines the program version string. + * + * @param version The program version. + */ + void setVersion( const char* version ); + + /** + * Defines a short description of what the program does. + * + * @param shortDescription The program description This string should be marked + * for translation. Example: I18N_NOOP("An advanced text editor + * with syntax highlithing support."). + */ + void setShortDescription( const char *shortDescription ); + + /** + * Defines the license identifier. + * + * @param licenseKey The license identifier. + */ + void setLicense( LicenseKey licenseKey); + + /** + * Defines the copyright statement to show when displaying the license. + * + * @param copyrightStatement A copyright statement, that can look like + * this: "(c) 1999-2000, Name". The string specified here is not + * modified in any manner. The author information from addAuthor + * is not used. + */ + void setCopyrightStatement( const char *copyrightStatement ); + + /** + * Defines the additional text to show in the about dialog. + * + * @param otherText Some free form text, that can contain any kind of + * information. The text can contain newlines. This string + * should be marked for translation. + */ + void setOtherText( const char *otherText ); + + /** + * Defines the program homepage. + * + * @param homepage The program homepage string. + * Start the address with "http://". "http://kate.kde.org" is + * is correct, "kde.kde.org" is not. + */ + void setHomepage( const char *homepage ); + + /** + * Defines the address where bug reports should be sent. + * + * @param bugAddress The bug report email address string. + * This defaults to the kde.org bug system. + */ + void setBugAddress( const char *bugAddress ); + + /** + * Defines the product name wich will be used in the KBugReport dialog. + * By default it's the appName, but you can overwrite it here to provide + * support for special components e.g. 'product/component' like + * 'kontact/summary'. + * + * @param name The name of product + */ + void setProductName( const char *name ); + + /** + * Returns the application's internal name. + * @return the internal program name. + */ + const char *appName() const; + + /** + * Returns the application's product name, which will be used in KBugReport + * dialog. By default it returns appName(), otherwise the one which is set + * with setProductName() + * + * @return the product name. + */ + const char *productName() const; + + /** + * Returns the translated program name. + * @return the program name (translated). + */ + TQString programName() const; + + /** + * @internal + */ + const char* internalProgramName() const; + /** + * @internal + */ + void translateInternalProgramName() const; + + /** + * Returns the program logo image. + * @return the program logo data or null image if there is + * no custom application logo defined. + * @since 3.4 + */ + TQImage programLogo() const; + + /** + * Returns the program's version. + * @return the version string. + */ + TQString version() const; + + /** + * @internal + */ + const char* internalVersion() const { return mVersion; } + + /** + * Returns a short, translated description. + * @return the short description (translated). Can be + * TQString::null if not set. + */ + TQString shortDescription() const; + + /** + * Returns the application homepage. + * @return the application homepage URL. Can be TQString::null if + * not set. + */ + TQString homepage() const; + + /** + * Returns the email address for bugs. + * @return the email address where to report bugs. + */ + TQString bugAddress() const; + + /** + * @internal + */ + const char* internalBugAddress() const { return mBugEmailAddress; } + + /** + * Returns a list of authors. + * @return author information (list of persons). + */ + const TQValueList<TDEAboutPerson> authors() const; + + /** + * Returns a list of persons who contributed. + * @return credit information (list of persons). + */ + const TQValueList<TDEAboutPerson> credits() const; + + /** + * Returns a list of translators. + * @return translators information (list of persons) + */ + const TQValueList<TDEAboutTranslator> translators() const; + + /** + * Returns a message about the translation team. + * @return a message about the translation team + */ + static TQString aboutTranslationTeam(); + + /** + * Returns a translated, free form text. + * @return the free form text (translated). Can be TQString::null if not set. + */ + TQString otherText() const; + + /** + * Returns the license. If the licenseType argument of the constructor has been + * used, any text defined by setLicenseText is ignored, + * and the standard text for the chosen license will be returned. + * + * @return The license text. + */ + TQString license() const; + + /** + * Returns the copyright statement. + * @return the copyright statement. Can be TQString::null if not set. + */ + TQString copyrightStatement() const; + + /** + * Returns the plain text displayed around the list of authors instead + * of the default message telling users to send bug reports to bugAddress(). + * + * @return the plain text displayed around the list of authors instead + * of the default message. Can be TQString::null. + */ + TQString customAuthorPlainText() const; + + /** + * Returns the rich text displayed around the list of authors instead + * of the default message telling users to send bug reports to bugAddress(). + * + * @return the rich text displayed around the list of authors instead + * of the default message. Can be TQString::null. + */ + TQString customAuthorRichText() const; + + /** + * Returns whether custom text should be displayed around the list of + * authors. + * + * @return whether custom text should be displayed around the list of + * authors. + */ + bool customAuthorTextEnabled() const; + + /** + * Sets the custom text displayed around the list of authors instead + * of the default message telling users to send bug reports to bugAddress(). + * + * @param plainText The plain text. + * @param richText The rich text. + * + * Both parameters can be TQString::null to not display any message at + * all. Call unsetCustomAuthorText() to revert to the default mesage. + */ + void setCustomAuthorText(const TQString &plainText, const TQString &richText); + + /** + * Clears any custom text displayed around the list of authors and falls + * back to the default message telling users to send bug reports to + * bugAddress(). + */ + void unsetCustomAuthorText(); + + private: + const char *mAppName; + const char *mProgramName; + const char *mVersion; + const char *mShortDescription; + int mLicenseKey; + const char *mCopyrightStatement; + const char *mOtherText; + const char *mHomepageAddress; + const char *mBugEmailAddress; + TQValueList<TDEAboutPerson> mAuthorList; + TQValueList<TDEAboutPerson> mCreditList; + const char *mLicenseText; + static const char *defaultBugTracker; + + TDEAboutDataPrivate *d; +}; + +#endif + diff --git a/tdecore/tdeaccel.cpp b/tdecore/tdeaccel.cpp index be8fba51b..e019baafc 100644 --- a/tdecore/tdeaccel.cpp +++ b/tdecore/tdeaccel.cpp @@ -27,7 +27,7 @@ #include <tqtimer.h> #include "tdeaccelbase.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> #include <tdeshortcut.h> diff --git a/tdecore/tdeapplication.cpp b/tdecore/tdeapplication.cpp new file mode 100644 index 000000000..24c77826b --- /dev/null +++ b/tdecore/tdeapplication.cpp @@ -0,0 +1,3638 @@ +/* This file is part of the KDE libraries + Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) + Copyright (C) 1998, 1999, 2000 KDE Team + + 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 "config.h" + +#ifdef HAVE_XCOMPOSITE +#define COMPOSITE +#endif + +// #ifdef QTRANSLATOR_H +// #error qtranslator.h was already included +// #endif // QTRANSLATOR_H +// +// #ifdef TQTRANSLATOR_H +// #error tqtranslator.h was already included +// #endif // TQTRANSLATOR_H + +#undef QT_NO_TRANSLATION +#undef TQT_NO_TRANSLATION +#include <tqtranslator.h> +#include "tdeapplication.h" +#define QT_NO_TRANSLATION +#define TQT_NO_TRANSLATION +#include <tqdir.h> +#include <tqptrcollection.h> +#include <tqwidgetlist.h> +#include <tqstrlist.h> +#include <tqfile.h> +#include <tqmessagebox.h> +#include <tqtextstream.h> +#include <tqregexp.h> +#include <tqlineedit.h> +#include <tqtextedit.h> +#include <tqsessionmanager.h> +#include <tqptrlist.h> +#include <tqtimer.h> +#include <tqstylesheet.h> +#include <tqpixmapcache.h> +#include <tqtooltip.h> +#include <tqstylefactory.h> +#include <tqmetaobject.h> +#include <tqimage.h> +#ifndef QT_NO_SQL +#include <tqsqlpropertymap.h> +#endif + +#include <kglobal.h> +#include <kstandarddirs.h> +#include <kdebug.h> +#include <klocale.h> +#include <tdestyle.h> +#include <kiconloader.h> +#include <kclipboard.h> +#include <tdeconfig.h> +#include <ksimpleconfig.h> +#include <tdecmdlineargs.h> +#include <tdeaboutdata.h> +#include <kglobalsettings.h> +#include <kcrash.h> +#include <kdatastream.h> +#include <klibloader.h> +#include <kmimesourcefactory.h> +#include <tdestdaccel.h> +#include <tdeaccel.h> +#include "kcheckaccelerators.h" +#include <tqptrdict.h> +#include <kmacroexpander.h> +#include <kshell.h> +#include <kprotocolinfo.h> +#include <kkeynative.h> +#include <kmdcodec.h> +#include <kglobalaccel.h> + +#if defined Q_WS_X11 +#include <kstartupinfo.h> +#endif + +#include <dcopclient.h> +#include <dcopref.h> + +#include <sys/types.h> +#ifdef HAVE_SYS_STAT_H +#include <sys/stat.h> +#endif +#include <sys/wait.h> +#include <grp.h> +#include <sys/types.h> + +#ifndef Q_WS_WIN +#include "twin.h" +#endif + +#include <fcntl.h> +#include <stdlib.h> // getenv(), srand(), rand() +#include <signal.h> +#include <unistd.h> +#include <time.h> +#include <sys/time.h> +#include <errno.h> +#include <string.h> +#include <netdb.h> +#if defined Q_WS_X11 +//#ifndef Q_WS_QWS //FIXME(E): NetWM should talk to QWS... +#include <netwm.h> +#endif + +#include "kprocctrl.h" + +#ifdef HAVE_PATHS_H +#include <paths.h> +#endif + +#ifdef Q_WS_X11 +#include <X11/Xlib.h> +#ifdef COMPOSITE +#include <X11/extensions/Xrender.h> +#include <X11/extensions/Xcomposite.h> +#include <dlfcn.h> +#endif +#include <X11/Xutil.h> +#include <X11/Xatom.h> +#include <X11/SM/SMlib.h> +#include <fixx11h.h> +#endif + +#include <pwd.h> + +#ifndef Q_WS_WIN +#include <KDE-ICE/ICElib.h> +#else +typedef void* IceIOErrorHandler; +#include <windows.h> +//KDE4: remove +#define Button1Mask (1<<8) +#define Button2Mask (1<<9) +#define Button3Mask (1<<10) +#endif + +#ifdef Q_WS_X11 +#define DISPLAY "DISPLAY" +#elif defined(Q_WS_QWS) +#define DISPLAY "QWS_DISPLAY" +#endif + +#if defined Q_WS_X11 +#include <kipc.h> +#endif + +#ifdef Q_WS_MACX +#include <Carbon/Carbon.h> +#include <tqimage.h> +#endif + +#include "kappdcopiface.h" + +// exported for tdm kfrontend +KDE_EXPORT bool kde_have_kipc = true; // magic hook to disable kipc in tdm +bool kde_kiosk_exception = false; // flag to disable kiosk restrictions +bool kde_kiosk_admin = false; + +TDEApplication* TDEApplication::KApp = 0L; +bool TDEApplication::loadedByKdeinit = false; +DCOPClient *TDEApplication::s_DCOPClient = 0L; +bool TDEApplication::s_dcopClientNeedsPostInit = false; + +#ifdef Q_WS_X11 +static Atom atom_DesktopWindow; +static Atom atom_NetSupported; +static Atom kde_xdnd_drop; +#endif + +#ifdef Q_WS_X11 +static int composite_event, composite_error, composite_opcode; +static bool x11_composite_error_generated; +static int x11_error(Display *dpy, XErrorEvent *ev) { + if (ev->request_code == composite_opcode && ev->minor_code == X_CompositeRedirectSubwindows) + { + x11_composite_error_generated = true; + return 0; + } + return 1; +} +#endif + +// duplicated from patched Qt, so that there won't be unresolved symbols if Qt gets +// replaced by unpatched one +TDECORE_EXPORT bool tqt_qclipboard_bailout_hack = false; + +template class TQPtrList<KSessionManaged>; + +#ifdef Q_WS_X11 +extern "C" { +static int kde_xio_errhandler( Display * dpy ) +{ + return kapp->xioErrhandler( dpy ); +} + +static int kde_x_errhandler( Display *dpy, XErrorEvent *err ) +{ + return kapp->xErrhandler( dpy, err ); +} + +} + +extern "C" { +static void kde_ice_ioerrorhandler( IceConn conn ) +{ + if(kapp) + kapp->iceIOErrorHandler( conn ); + // else ignore the error for now +} +} +#endif + +#ifdef Q_WS_WIN +void TDEApplication_init_windows(bool GUIenabled); + +class QAssistantClient; +#endif + +/* + Private data to make keeping binary compatibility easier + */ +class TDEApplicationPrivate +{ +public: + TDEApplicationPrivate() + : actionRestrictions( false ), + refCount( 1 ), + oldIceIOErrorHandler( 0 ), + checkAccelerators( 0 ), + overrideStyle( TQString::null ), + startup_id( "0" ), + app_started_timer( NULL ), + m_KAppDCOPInterface( 0L ), + session_save( false ) +#ifdef Q_WS_X11 + ,oldXErrorHandler( NULL ) + ,oldXIOErrorHandler( NULL ) +#elif defined Q_WS_WIN + ,qassistantclient( 0 ) +#endif + { + } + + ~TDEApplicationPrivate() + { +#ifdef Q_WS_WIN + delete qassistantclient; +#endif + } + + + bool actionRestrictions : 1; + bool guiEnabled : 1; + /** + * This counter indicates when to exit the application. + * It starts at 1, is decremented in TDEMainWindow when the last window is closed, but + * is incremented by operations that should outlive the last window closed + * (e.g. a file copy for a file manager, or 'compacting folders on exit' for a mail client). + */ + int refCount; + IceIOErrorHandler oldIceIOErrorHandler; + KCheckAccelerators* checkAccelerators; + TQString overrideStyle; + TQString geometry_arg; + TQCString startup_id; + TQTimer* app_started_timer; + KAppDCOPInterface *m_KAppDCOPInterface; + bool session_save; +#ifdef Q_WS_X11 + int (*oldXErrorHandler)(Display*,XErrorEvent*); + int (*oldXIOErrorHandler)(Display*); +#elif defined Q_WS_WIN + QAssistantClient* qassistantclient; +#endif + + class URLActionRule + { + public: +#define checkExactMatch(s, b) \ + if (s.isEmpty()) b = true; \ + else if (s[s.length()-1] == '!') \ + { b = false; s.truncate(s.length()-1); } \ + else b = true; +#define checkStartWildCard(s, b) \ + if (s.isEmpty()) b = true; \ + else if (s[0] == '*') \ + { b = true; s = s.mid(1); } \ + else b = false; +#define checkEqual(s, b) \ + b = (s == "="); + + URLActionRule(const TQString &act, + const TQString &bProt, const TQString &bHost, const TQString &bPath, + const TQString &dProt, const TQString &dHost, const TQString &dPath, + bool perm) + : action(act), + baseProt(bProt), baseHost(bHost), basePath(bPath), + destProt(dProt), destHost(dHost), destPath(dPath), + permission(perm) + { + checkExactMatch(baseProt, baseProtWildCard); + checkStartWildCard(baseHost, baseHostWildCard); + checkExactMatch(basePath, basePathWildCard); + checkExactMatch(destProt, destProtWildCard); + checkStartWildCard(destHost, destHostWildCard); + checkExactMatch(destPath, destPathWildCard); + checkEqual(destProt, destProtEqual); + checkEqual(destHost, destHostEqual); + } + + bool baseMatch(const KURL &url, const TQString &protClass) + { + if (baseProtWildCard) + { + if ( !baseProt.isEmpty() && !url.protocol().startsWith(baseProt) && + (protClass.isEmpty() || (protClass != baseProt)) ) + return false; + } + else + { + if ( (url.protocol() != baseProt) && + (protClass.isEmpty() || (protClass != baseProt)) ) + return false; + } + if (baseHostWildCard) + { + if (!baseHost.isEmpty() && !url.host().endsWith(baseHost)) + return false; + } + else + { + if (url.host() != baseHost) + return false; + } + if (basePathWildCard) + { + if (!basePath.isEmpty() && !url.path().startsWith(basePath)) + return false; + } + else + { + if (url.path() != basePath) + return false; + } + return true; + } + + bool destMatch(const KURL &url, const TQString &protClass, const KURL &base, const TQString &baseClass) + { + if (destProtEqual) + { + if ( (url.protocol() != base.protocol()) && + (protClass.isEmpty() || baseClass.isEmpty() || protClass != baseClass) ) + return false; + } + else if (destProtWildCard) + { + if ( !destProt.isEmpty() && !url.protocol().startsWith(destProt) && + (protClass.isEmpty() || (protClass != destProt)) ) + return false; + } + else + { + if ( (url.protocol() != destProt) && + (protClass.isEmpty() || (protClass != destProt)) ) + return false; + } + if (destHostWildCard) + { + if (!destHost.isEmpty() && !url.host().endsWith(destHost)) + return false; + } + else if (destHostEqual) + { + if (url.host() != base.host()) + return false; + } + else + { + if (url.host() != destHost) + return false; + } + if (destPathWildCard) + { + if (!destPath.isEmpty() && !url.path().startsWith(destPath)) + return false; + } + else + { + if (url.path() != destPath) + return false; + } + return true; + } + + TQString action; + TQString baseProt; + TQString baseHost; + TQString basePath; + TQString destProt; + TQString destHost; + TQString destPath; + bool baseProtWildCard : 1; + bool baseHostWildCard : 1; + bool basePathWildCard : 1; + bool destProtWildCard : 1; + bool destHostWildCard : 1; + bool destPathWildCard : 1; + bool destProtEqual : 1; + bool destHostEqual : 1; + bool permission; + }; + TQPtrList<URLActionRule> urlActionRestrictions; + + TQString sessionKey; + TQString pSessionConfigFile; +}; + + +static TQPtrList<TQWidget>*x11Filter = 0; +static bool autoDcopRegistration = true; + +void TDEApplication::installX11EventFilter( TQWidget* filter ) +{ + if ( !filter ) + return; + if (!x11Filter) + x11Filter = new TQPtrList<TQWidget>; + connect ( filter, TQT_SIGNAL( destroyed() ), this, TQT_SLOT( x11FilterDestroyed() ) ); + x11Filter->append( filter ); +} + +void TDEApplication::x11FilterDestroyed() +{ + removeX11EventFilter( static_cast< const TQWidget* >( sender())); +} + +void TDEApplication::removeX11EventFilter( const TQWidget* filter ) +{ + if ( !x11Filter || !filter ) + return; + x11Filter->removeRef( filter ); + if ( x11Filter->isEmpty() ) { + delete x11Filter; + x11Filter = 0; + } +} + +// FIXME: remove this when we've get a better method of +// customizing accelerator handling -- hopefully in Qt. +// For now, this is set whenever an accelerator is overridden +// in TDEAccelEventHandler so that the AccelOverride isn't sent twice. -- ellis, 19/10/02 +extern bool kde_g_bKillAccelOverride; + +bool TDEApplication::notify(TQObject *receiver, TQEvent *event) +{ + TQEvent::Type t = event->type(); + if (kde_g_bKillAccelOverride) + { + kde_g_bKillAccelOverride = false; + // Indicate that the accelerator has been overridden. + if (t == TQEvent::AccelOverride) + { + TQT_TQKEYEVENT(event)->accept(); + return true; + } + else + kdWarning(125) << "kde_g_bKillAccelOverride set, but received an event other than AccelOverride." << endl; + } + + if ((t == TQEvent::AccelOverride) || (t == TQEvent::KeyPress)) + { + static const TDEShortcut& _selectAll = TDEStdAccel::selectAll(); + TQLineEdit *edit = ::tqqt_cast<TQLineEdit *>(receiver); + if (edit) + { + // We have a keypress for a lineedit... + TQKeyEvent *kevent = TQT_TQKEYEVENT(event); + KKey key(kevent); + if (_selectAll.contains(key)) + { + if (t == TQEvent::KeyPress) + { + edit->selectAll(); + return true; + } + else + { + kevent->accept(); + } + } + // Ctrl-U deletes from start of line. + if (key == KKey(Qt::CTRL + Qt::Key_U)) + { + if (t == TQEvent::KeyPress) + { + if (!edit->isReadOnly()) + { + TQString t(edit->text()); + t = t.mid(edit->cursorPosition()); + edit->validateAndSet(t, 0, 0, 0); + } + return true; + } + else + { + kevent->accept(); + } + + } + } + TQTextEdit *medit = ::tqqt_cast<TQTextEdit *>(receiver); + if (medit) + { + // We have a keypress for a multilineedit... + TQKeyEvent *kevent = TQT_TQKEYEVENT(event); + if (_selectAll.contains(KKey(kevent))) + { + if (t == TQEvent::KeyPress) + { + medit->selectAll(); + return true; + } + else + { + kevent->accept(); + } + } + } + } + if( t == TQEvent::Show && receiver->isWidgetType()) + { + TQWidget* w = TQT_TQWIDGET( receiver ); +#if defined Q_WS_X11 + if( w->isTopLevel() && !startupId().isEmpty() && !TQT_TQSHOWEVENT(event)->spontaneous()) // TODO better done using window group leader? + TDEStartupInfo::setWindowStartupId( w->winId(), startupId()); +#endif + if( w->isTopLevel() && !w->testWFlags( WX11BypassWM ) && !w->isPopup() && !event->spontaneous()) + { + if( d->app_started_timer == NULL ) + { + d->app_started_timer = new TQTimer( this, "app_started_timer" ); + connect( d->app_started_timer, TQT_SIGNAL( timeout()), TQT_SLOT( checkAppStartedSlot())); + } + if( !d->app_started_timer->isActive()) + d->app_started_timer->start( 0, true ); + } + if( w->isTopLevel() && ( w->icon() == NULL || w->icon()->isNull())) + { + // icon() cannot be null pixmap, it'll be the "unknown" icon - so check if there is this application icon + static TQPixmap* ic = NULL; + if( ic == NULL ) + ic = new TQPixmap( TDEGlobal::iconLoader()->loadIcon( iconName(), + TDEIcon::NoGroup, 0, TDEIcon::DefaultState, NULL, true )); + if( !ic->isNull()) + { + w->setIcon( *ic ); +#if defined Q_WS_X11 + KWin::setIcons( w->winId(), *ic, miniIcon()); +#endif + } + } + } + return TQApplication::notify(receiver, event); +} + +void TDEApplication::checkAppStartedSlot() +{ +#if defined Q_WS_X11 + TDEStartupInfo::handleAutoAppStartedSending(); +#endif +} + +// the help class for session management communication +static TQPtrList<KSessionManaged>* sessionClients() +{ + static TQPtrList<KSessionManaged>* session_clients = 0L; + if ( !session_clients ) + session_clients = new TQPtrList<KSessionManaged>; + return session_clients; +} + +/* + Auxiliary function to calculate a a session config name used for the + instance specific config object. + Syntax: "session/<appname>_<sessionId>" + */ +TQString TDEApplication::sessionConfigName() const +{ + TQString sessKey = sessionKey(); + if ( sessKey.isEmpty() && !d->sessionKey.isEmpty() ) + sessKey = d->sessionKey; + return TQString("session/%1_%2_%3").arg(name()).arg(sessionId()).arg(sessKey); +} + +#ifdef Q_WS_X11 +static SmcConn mySmcConnection = 0; +static SmcConn tmpSmcConnection = 0; +#else +// FIXME(E): Implement for Qt Embedded +// Possibly "steal" XFree86's libSM? +#endif +static TQTime* smModificationTime = 0; + +TDEApplication::TDEApplication( int& argc, char** argv, const TQCString& rAppName, + bool allowStyles, bool GUIenabled ) : + TQApplication( argc, argv, GUIenabled ), TDEInstance(rAppName), +#ifdef Q_WS_X11 + display(0L), + argb_visual(false), +#endif + d (new TDEApplicationPrivate()) +{ + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + if (!GUIenabled) + allowStyles = false; + useStyles = allowStyles; + Q_ASSERT (!rAppName.isEmpty()); + setName(rAppName); + + installSigpipeHandler(); + TDECmdLineArgs::initIgnore(argc, argv, rAppName.data()); + parseCommandLine( ); + init(GUIenabled); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} + +TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled ) : +// TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), TRUE ), // Qt4 requires that there always be a GUI + TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), GUIenabled ), // We need to be able to run command line apps + TDEInstance( TDECmdLineArgs::about), +#ifdef Q_WS_X11 + display(0L), + argb_visual(false), +#endif + d (new TDEApplicationPrivate) +{ + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + if (!GUIenabled) + allowStyles = false; + useStyles = allowStyles; + setName( instanceName() ); + + installSigpipeHandler(); + parseCommandLine( ); + init(GUIenabled); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} + +#ifdef Q_WS_X11 +TDEApplication::TDEApplication( Display *dpy, bool allowStyles ) : + TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), + getX11RGBAVisual(dpy), getX11RGBAColormap(dpy) ), + TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate) +{ + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + useStyles = allowStyles; + setName( instanceName() ); + installSigpipeHandler(); + parseCommandLine( ); + init( true ); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} + +TDEApplication::TDEApplication( Display *dpy, bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap, bool allowStyles ) : + TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), + disable_argb?visual:getX11RGBAVisual(dpy), disable_argb?colormap:getX11RGBAColormap(dpy) ), + TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate) +{ + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + useStyles = allowStyles; + if (disable_argb) argb_visual = false; + setName( instanceName() ); + installSigpipeHandler(); + parseCommandLine( ); + init( true ); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} + +TDEApplication::TDEApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, + bool allowStyles ) : + TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), + visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ), + TDEInstance( TDECmdLineArgs::about), display(0L), d (new TDEApplicationPrivate) +{ + if ((visual) && (colormap)) + getX11RGBAInformation(dpy); + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + useStyles = allowStyles; + setName( instanceName() ); + installSigpipeHandler(); + parseCommandLine( ); + init( true ); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} + +TDEApplication::TDEApplication( Display *dpy, Qt::HANDLE visual, Qt::HANDLE colormap, + bool allowStyles, TDEInstance * _instance ) : + TQApplication( dpy, *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), + visual?visual:getX11RGBAVisual(dpy), colormap?colormap:getX11RGBAColormap(dpy) ), + TDEInstance( _instance ), display(0L), d (new TDEApplicationPrivate) +{ + if ((visual) && (colormap)) + getX11RGBAInformation(dpy); + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + useStyles = allowStyles; + setName( instanceName() ); + installSigpipeHandler(); + parseCommandLine( ); + init( true ); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} +#endif + +TDEApplication::TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance* _instance ) : + TQApplication( *TDECmdLineArgs::tqt_argc(), *TDECmdLineArgs::tqt_argv(), + GUIenabled ), + TDEInstance( _instance ), +#ifdef Q_WS_X11 + display(0L), +#endif + argb_visual(false), + d (new TDEApplicationPrivate) +{ + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + if (!GUIenabled) + allowStyles = false; + useStyles = allowStyles; + setName( instanceName() ); + + installSigpipeHandler(); + parseCommandLine( ); + init(GUIenabled); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} + +#ifdef Q_WS_X11 +TDEApplication::TDEApplication(Display *display, int& argc, char** argv, const TQCString& rAppName, + bool allowStyles, bool GUIenabled ) : + TQApplication( display ), TDEInstance(rAppName), + display(0L), + argb_visual(false), + d (new TDEApplicationPrivate()) +{ + aIconPixmap.pm.icon = 0L; + aIconPixmap.pm.miniIcon = 0L; + read_app_startup_id(); + if (!GUIenabled) + allowStyles = false; + useStyles = allowStyles; + + Q_ASSERT (!rAppName.isEmpty()); + setName(rAppName); + + installSigpipeHandler(); + TDECmdLineArgs::initIgnore(argc, argv, rAppName.data()); + parseCommandLine( ); + init(GUIenabled); + d->m_KAppDCOPInterface = new KAppDCOPInterface(this); +} +#endif + +int TDEApplication::xioErrhandler( Display* dpy ) +{ + if(kapp) + { + emit shutDown(); +#ifdef Q_WS_X11 + d->oldXIOErrorHandler( dpy ); +#else + Q_UNUSED(dpy); +#endif + } + exit( 1 ); + return 0; +} + +int TDEApplication::xErrhandler( Display* dpy, void* err_ ) +{ // no idea how to make forward decl. for XErrorEvent +#ifdef Q_WS_X11 + XErrorEvent* err = static_cast< XErrorEvent* >( err_ ); + if(kapp) + { + // add KDE specific stuff here + d->oldXErrorHandler( dpy, err ); + } +#endif + return 0; +} + +void TDEApplication::iceIOErrorHandler( _IceConn *conn ) +{ + emit shutDown(); + +#ifdef Q_WS_X11 + if ( d->oldIceIOErrorHandler != NULL ) + (*d->oldIceIOErrorHandler)( conn ); +#endif + exit( 1 ); +} + +class KDETranslator : public TQTranslator +{ +public: + KDETranslator(TQObject *parent) : TQTranslator(parent, "kdetranslator") {} + virtual TQTranslatorMessage findMessage(const char* context, + const char *sourceText, + const char* message) const + { + TQTranslatorMessage res; + res.setTranslation(TDEGlobal::locale()->translateQt(context, sourceText, message)); + return res; + } +}; + +void TDEApplication::init(bool GUIenabled) +{ + d->guiEnabled = GUIenabled; + if ((getuid() != geteuid()) || + (getgid() != getegid()) ) + { + // man permissions are not exploitable and better than + // world writable directories + struct group *man = getgrnam("man"); + if ( !man || man->gr_gid != getegid() ){ + fprintf(stderr, "The TDE libraries are not designed to run with suid privileges.\n"); + ::exit(127); + } + } + + TDEProcessController::ref(); + + (void) TDEClipboardSynchronizer::self(); + + TQApplication::setDesktopSettingsAware( false ); + + KApp = this; + + +#ifdef Q_WS_X11 //FIXME(E) + // create all required atoms in _one_ roundtrip to the X server + if ( GUIenabled ) { + const int max = 20; + Atom* atoms[max]; + char* names[max]; + Atom atoms_return[max]; + int n = 0; + + atoms[n] = &kipcCommAtom; + names[n++] = (char *) "KIPC_COMM_ATOM"; + + atoms[n] = &atom_DesktopWindow; + names[n++] = (char *) "KDE_DESKTOP_WINDOW"; + + atoms[n] = &atom_NetSupported; + names[n++] = (char *) "_NET_SUPPORTED"; + + atoms[n] = &kde_xdnd_drop; + names[n++] = (char *) "XdndDrop"; + + XInternAtoms( tqt_xdisplay(), names, n, false, atoms_return ); + + for (int i = 0; i < n; i++ ) + *atoms[i] = atoms_return[i]; + } +#endif + + dcopAutoRegistration(); + dcopClientPostInit(); + + smw = 0; + + // Initial KIPC event mask. +#if defined Q_WS_X11 + kipcEventMask = (1 << KIPC::StyleChanged) | (1 << KIPC::PaletteChanged) | + (1 << KIPC::FontChanged) | (1 << KIPC::BackgroundChanged) | + (1 << KIPC::ToolbarStyleChanged) | (1 << KIPC::SettingsChanged) | + (1 << KIPC::ClipboardConfigChanged) | (1 << KIPC::BlockShortcuts); +#endif + + // Trigger creation of locale. + (void) TDEGlobal::locale(); + + TDEConfig* config = TDEGlobal::config(); + d->actionRestrictions = config->hasGroup("KDE Action Restrictions" ) && !kde_kiosk_exception; + // For brain-dead configurations where the user's local config file is not writable. + // * We use kdialog to warn the user, so we better not generate warnings from + // kdialog itself. + // * Don't warn if we run with a read-only $HOME + TQCString readOnly = getenv("TDE_HOME_READONLY"); + if (readOnly.isEmpty() && (tqstrcmp(name(), "kdialog") != 0)) + { + TDEConfigGroupSaver saver(config, "KDE Action Restrictions"); + if (config->readBoolEntry("warn_unwritable_config",true)) + config->checkConfigFilesWritable(true); + } + + if (GUIenabled) + { +#ifdef Q_WS_X11 + // this is important since we fork() to launch the help (Matthias) + fcntl(ConnectionNumber(tqt_xdisplay()), F_SETFD, FD_CLOEXEC); + // set up the fancy (=robust and error ignoring ) KDE xio error handlers (Matthias) + d->oldXErrorHandler = XSetErrorHandler( kde_x_errhandler ); + d->oldXIOErrorHandler = XSetIOErrorHandler( kde_xio_errhandler ); +#endif + + connect( this, TQT_SIGNAL( aboutToQuit() ), this, TQT_SIGNAL( shutDown() ) ); + +#ifdef Q_WS_X11 //FIXME(E) + display = desktop()->x11Display(); +#endif + + { + TQStringList plugins = TDEGlobal::dirs()->resourceDirs( "qtplugins" ); + TQStringList::Iterator it = plugins.begin(); + while (it != plugins.end()) { + addLibraryPath( *it ); + ++it; + } + + } + tdedisplaySetStyle(); + tdedisplaySetFont(); +// tdedisplaySetPalette(); done by tdedisplaySetStyle + propagateSettings(SETTINGS_QT); + + // Set default mime-source factory + // XXX: This is a hack. Make our factory the default factory, but add the + // previous default factory to the list of factories. Why? When the default + // factory can't resolve something, it iterates in the list of factories. + // But it TQWhatsThis only uses the default factory. So if there was already + // a default factory (which happens when using an image library using uic), + // we prefer KDE's factory and so we put that old default factory in the + // list and use KDE as the default. This may speed up things as well. + TQMimeSourceFactory* oldDefaultFactory = TQMimeSourceFactory::takeDefaultFactory(); + TQMimeSourceFactory::setDefaultFactory( mimeSourceFactory() ); + if ( oldDefaultFactory ) { + TQMimeSourceFactory::addFactory( oldDefaultFactory ); + } + + d->checkAccelerators = new KCheckAccelerators( TQT_TQOBJECT(this) ); + } + +#ifdef Q_WS_MACX + if (GUIenabled) { + TQPixmap pixmap = TDEGlobal::iconLoader()->loadIcon( TDECmdLineArgs::appName(), + TDEIcon::NoGroup, TDEIcon::SizeLarge, TDEIcon::DefaultState, 0L, false ); + if (!pixmap.isNull()) { + TQImage i = pixmap.convertToImage().convertDepth(32).smoothScale(40, 40); + for(int y = 0; y < i.height(); y++) { + uchar *l = i.scanLine(y); + for(int x = 0; x < i.width(); x+=4) + *(l+x) = 255; + } + CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); + CGDataProviderRef dp = CGDataProviderCreateWithData(NULL, + i.bits(), i.numBytes(), NULL); + CGImageRef ir = CGImageCreate(i.width(), i.height(), 8, 32, i.bytesPerLine(), + cs, kCGImageAlphaNoneSkipFirst, dp, + 0, 0, kCGRenderingIntentDefault); + //cleanup + SetApplicationDockTileImage(ir); + CGImageRelease(ir); + CGColorSpaceRelease(cs); + CGDataProviderRelease(dp); + } + } +#endif + + + // save and restore the RTL setting, as installTranslator calls qt_detectRTLLanguage, + // which makes it impossible to use the -reverse cmdline switch with KDE apps + bool rtl = reverseLayout(); + installTranslator(new KDETranslator(TQT_TQOBJECT(this))); + setReverseLayout( rtl ); + if (i18n( "_: Dear Translator! Translate this string to the string 'LTR' in " + "left-to-right languages (as english) or to 'RTL' in right-to-left " + "languages (such as Hebrew and Arabic) to get proper widget layout." ) == "RTL") + setReverseLayout( !rtl ); + + // install appdata resource type + TDEGlobal::dirs()->addResourceType("appdata", TDEStandardDirs::kde_default("data") + + TQString::fromLatin1(name()) + '/'); + pSessionConfig = 0L; + bSessionManagement = true; + +#ifdef Q_WS_X11 + // register a communication window for desktop changes (Matthias) + if (GUIenabled && kde_have_kipc ) + { + smw = new TQWidget(0,0); + long data = 1; + XChangeProperty(tqt_xdisplay(), smw->winId(), + atom_DesktopWindow, atom_DesktopWindow, + 32, PropModeReplace, (unsigned char *)&data, 1); + } + d->oldIceIOErrorHandler = IceSetIOErrorHandler( kde_ice_ioerrorhandler ); +#elif defined(Q_WS_WIN) + TDEApplication_init_windows(GUIenabled); +#else + // FIXME(E): Implement for Qt Embedded +#endif +} + +static int my_system (const char *command) { + int pid, status; + + pid = fork(); + if (pid == -1) + return -1; + if (pid == 0) { + const char* shell = "/bin/sh"; + execl(shell, shell, "-c", command, (void *)0); + ::_exit(127); + } + do { + if (waitpid(pid, &status, 0) == -1) { + if (errno != EINTR) + return -1; + } else + return status; + } while(1); +} + + +DCOPClient *TDEApplication::dcopClient() +{ + if (s_DCOPClient) + return s_DCOPClient; + + s_DCOPClient = new DCOPClient(); + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs("tde"); + if (args && args->isSet("dcopserver")) + { + s_DCOPClient->setServerAddress( args->getOption("dcopserver")); + } + if( kapp ) { + connect(s_DCOPClient, TQT_SIGNAL(attachFailed(const TQString &)), + kapp, TQT_SLOT(dcopFailure(const TQString &))); + connect(s_DCOPClient, TQT_SIGNAL(blockUserInput(bool) ), + kapp, TQT_SLOT(dcopBlockUserInput(bool)) ); + } + else + s_dcopClientNeedsPostInit = true; + + DCOPClient::setMainClient( s_DCOPClient ); + return s_DCOPClient; +} + +void TDEApplication::dcopClientPostInit() +{ + if( s_dcopClientNeedsPostInit ) + { + s_dcopClientNeedsPostInit = false; + connect(s_DCOPClient, TQT_SIGNAL(blockUserInput(bool) ), + TQT_SLOT(dcopBlockUserInput(bool)) ); + s_DCOPClient->bindToApp(); // Make sure we get events from the DCOPClient. + } +} + +void TDEApplication::dcopAutoRegistration() +{ + if (autoDcopRegistration) + { + ( void ) dcopClient(); + if( dcopClient()->appId().isEmpty()) + dcopClient()->registerAs(name()); + } +} + +void TDEApplication::disableAutoDcopRegistration() +{ + autoDcopRegistration = false; +} + +TDEConfig* TDEApplication::sessionConfig() +{ + if (pSessionConfig) + return pSessionConfig; + + // create an instance specific config object + pSessionConfig = new TDEConfig( sessionConfigName(), false, false); + return pSessionConfig; +} + +void TDEApplication::ref() +{ + d->refCount++; + //kdDebug() << "TDEApplication::ref() : refCount = " << d->refCount << endl; +} + +void TDEApplication::deref() +{ + d->refCount--; + //kdDebug() << "TDEApplication::deref() : refCount = " << d->refCount << endl; + if ( d->refCount <= 0 ) + quit(); +} + +KSessionManaged::KSessionManaged() +{ + sessionClients()->remove( this ); + sessionClients()->append( this ); +} + +KSessionManaged::~KSessionManaged() +{ + sessionClients()->remove( this ); +} + +bool KSessionManaged::saveState(TQSessionManager&) +{ + return true; +} + +bool KSessionManaged::commitData(TQSessionManager&) +{ + return true; +} + + +void TDEApplication::disableSessionManagement() { + bSessionManagement = false; +} + +void TDEApplication::enableSessionManagement() { + bSessionManagement = true; +#ifdef Q_WS_X11 + // Session management support in Qt/TDE is awfully broken. + // If konqueror disables session management right after its startup, + // and enables it later (preloading stuff), it won't be properly + // saved on session shutdown. + // I'm not actually sure why it doesn't work, but saveState() + // doesn't seem to be called on session shutdown, possibly + // because disabling session management after konqueror startup + // disabled it somehow. Forcing saveState() here for this application + // seems to fix it. + if( mySmcConnection ) { + SmcRequestSaveYourself( mySmcConnection, SmSaveLocal, False, + SmInteractStyleAny, + False, False ); + + // flush the request + IceFlush(SmcGetIceConnection(mySmcConnection)); + } +#endif +} + + +bool TDEApplication::requestShutDown( + ShutdownConfirm confirm, ShutdownType sdtype, ShutdownMode sdmode ) +{ +#ifdef Q_WS_X11 + TQApplication::syncX(); + /* use ksmserver's dcop interface if necessary */ + if ( confirm == ShutdownConfirmYes || + sdtype != ShutdownTypeDefault || + sdmode != ShutdownModeDefault ) + { + TQByteArray data; + TQDataStream arg(data, IO_WriteOnly); + arg << (int)confirm << (int)sdtype << (int)sdmode; + return dcopClient()->send( "ksmserver", "ksmserver", + "logout(int,int,int)", data ); + } + + if ( mySmcConnection ) { + // we already have a connection to the session manager, use it. + SmcRequestSaveYourself( mySmcConnection, SmSaveBoth, True, + SmInteractStyleAny, + confirm == ShutdownConfirmNo, True ); + + // flush the request + IceFlush(SmcGetIceConnection(mySmcConnection)); + return true; + } + + // open a temporary connection, if possible + + propagateSessionManager(); + TQCString smEnv = ::getenv("SESSION_MANAGER"); + if (smEnv.isEmpty()) + return false; + + if (! tmpSmcConnection) { + char cerror[256]; + char* myId = 0; + char* prevId = 0; + SmcCallbacks cb; + tmpSmcConnection = SmcOpenConnection( 0, 0, 1, 0, + 0, &cb, + prevId, + &myId, + 255, + cerror ); + ::free( myId ); // it was allocated by C + if (!tmpSmcConnection ) + return false; + } + + SmcRequestSaveYourself( tmpSmcConnection, SmSaveBoth, True, + SmInteractStyleAny, False, True ); + + // flush the request + IceFlush(SmcGetIceConnection(tmpSmcConnection)); + return true; +#else + // FIXME(E): Implement for Qt Embedded + return false; +#endif +} + +void TDEApplication::propagateSessionManager() +{ +#ifdef Q_WS_X11 + TQCString fName = TQFile::encodeName(locateLocal("socket", "KSMserver")); + TQCString display = ::getenv(DISPLAY); + // strip the screen number from the display + display.replace(TQRegExp("\\.[0-9]+$"), ""); + int i; + while( (i = display.find(':')) >= 0) + display[i] = '_'; + + fName += "_"+display; + TQCString smEnv = ::getenv("SESSION_MANAGER"); + bool check = smEnv.isEmpty(); + if ( !check && smModificationTime ) { + TQFileInfo info( fName ); + TQTime current = TQT_TQTIME_OBJECT(info.lastModified().time()); + check = current > *smModificationTime; + } + if ( check ) { + delete smModificationTime; + TQFile f( fName ); + if ( !f.open( IO_ReadOnly ) ) + return; + TQFileInfo info ( f ); + smModificationTime = new TQTime( TQT_TQTIME_OBJECT(info.lastModified().time()) ); + TQTextStream t(&f); + t.setEncoding( TQTextStream::Latin1 ); + TQString s = t.readLine(); + f.close(); + ::setenv( "SESSION_MANAGER", s.latin1(), true ); + } +#endif +} + +void TDEApplication::commitData( TQSessionManager& sm ) +{ + d->session_save = true; + bool canceled = false; + for (KSessionManaged* it = sessionClients()->first(); + it && !canceled; + it = sessionClients()->next() ) { + canceled = !it->commitData( sm ); + } + if ( canceled ) + sm.cancel(); + + if ( sm.allowsInteraction() ) { + TQWidgetList done; + TQWidgetList *list = TQApplication::topLevelWidgets(); + bool canceled = false; + TQWidget* w = list->first(); + while ( !canceled && w ) { + if ( !w->testWState( WState_ForceHide ) && !w->inherits("TDEMainWindow") ) { + TQCloseEvent e; + sendEvent( w, &e ); + canceled = !e.isAccepted(); + if ( !canceled ) + done.append( w ); + delete list; // one never knows... + list = TQApplication::topLevelWidgets(); + w = list->first(); + } else { + w = list->next(); + } + while ( w && done.containsRef( w ) ) + w = list->next(); + } + delete list; + } + + + if ( !bSessionManagement ) + sm.setRestartHint( TQSessionManager::RestartNever ); + else + sm.setRestartHint( TQSessionManager::RestartIfRunning ); + d->session_save = false; +} + +static void checkRestartVersion( TQSessionManager& sm ) +{ + Display* dpy = tqt_xdisplay(); + Atom type; + int format; + unsigned long nitems, after; + unsigned char* data; + if( XGetWindowProperty( dpy, RootWindow( dpy, 0 ), XInternAtom( dpy, "TDE_FULL_SESSION", False ), + 0, 1, False, AnyPropertyType, &type, &format, &nitems, &after, &data ) == Success ) { + if( data != NULL ) + XFree( data ); + if( type == XA_STRING && format == 8 ) { // session set, check if TDE_SESSION_VERSION is not set (meaning KDE3) + if( XGetWindowProperty( dpy, RootWindow( dpy, 0 ), XInternAtom( dpy, "TDE_SESSION_VERSION", False ), + 0, 1, False, AnyPropertyType, &type, &format, &nitems, &after, &data ) == Success ) { + if( data != NULL ) + XFree( data ); // KDE4 or newer + if( type == None ) + return; // we run in our native session, no need to wrap + } else { + return; // we run in our native session, no need to wrap + } + } + } + TQString wrapper = TDEStandardDirs::findExe( "trinity" ); + TQStringList restartCommand = sm.restartCommand(); + restartCommand.prepend( wrapper ); + sm.setRestartCommand( restartCommand ); +} + +void TDEApplication::saveState( TQSessionManager& sm ) +{ + d->session_save = true; +#ifdef Q_WS_X11 + static bool firstTime = true; + mySmcConnection = (SmcConn) sm.handle(); + + if ( !bSessionManagement ) { + sm.setRestartHint( TQSessionManager::RestartNever ); + d->session_save = false; + return; + } + else + sm.setRestartHint( TQSessionManager::RestartIfRunning ); + + if ( firstTime ) { + firstTime = false; + d->session_save = false; + return; // no need to save the state. + } + + // remove former session config if still existing, we want a new + // and fresh one. Note that we do not delete the config file here, + // this is done by the session manager when it executes the + // discard commands. In fact it would be harmful to remove the + // file here, as the session might be stored under a different + // name, meaning the user still might need it eventually. + if ( pSessionConfig ) { + delete pSessionConfig; + pSessionConfig = 0; + } + + // tell the session manager about our new lifecycle + TQStringList restartCommand = sm.restartCommand(); + + TQCString multiHead = getenv("TDE_MULTIHEAD"); + if (multiHead.lower() == "true") { + // if multihead is enabled, we save our -display argument so that + // we are restored onto the correct head... one problem with this + // is that the display is hard coded, which means we cannot restore + // to a different display (ie. if we are in a university lab and try, + // try to restore a multihead session, our apps could be started on + // someone else's display instead of our own) + TQCString displayname = getenv(DISPLAY); + if (! displayname.isNull()) { + // only store the command if we actually have a DISPLAY + // environment variable + restartCommand.append("-display"); + restartCommand.append(displayname); + } + sm.setRestartCommand( restartCommand ); + } + + checkRestartVersion( sm ); + + // finally: do session management + emit saveYourself(); // for compatibility + bool canceled = false; + for (KSessionManaged* it = sessionClients()->first(); + it && !canceled; + it = sessionClients()->next() ) { + canceled = !it->saveState( sm ); + } + + // if we created a new session config object, register a proper discard command + if ( pSessionConfig ) { + pSessionConfig->sync(); + TQStringList discard; + discard << "rm" << locateLocal("config", sessionConfigName()); + sm.setDiscardCommand( discard ); + } else { + sm.setDiscardCommand( TQStringList("") ); + } + + if ( canceled ) + sm.cancel(); +#else + // FIXME(E): Implement for Qt Embedded +#endif + d->session_save = false; +} + +bool TDEApplication::sessionSaving() const +{ + return d->session_save; +} + +void TDEApplication::startKdeinit() +{ +#ifndef Q_WS_WIN //TODO + TDEInstance inst( "starttdeinitlock" ); + TDELockFile lock( locateLocal( "tmp", "starttdeinitlock", &inst )); + if( lock.lock( TDELockFile::LockNoBlock ) != TDELockFile::LockOK ) { + lock.lock(); + DCOPClient cl; + if( cl.attach()) + return; // whoever held the lock has already started dcopserver + } + // Try to launch tdeinit. + TQString srv = TDEStandardDirs::findExe(TQString::fromLatin1("tdeinit")); + if (srv.isEmpty()) + srv = TDEStandardDirs::findExe(TQString::fromLatin1("tdeinit"), TDEGlobal::dirs()->kfsstnd_defaultbindir()); + if (srv.isEmpty()) + return; + if (kapp && (Tty != kapp->type())) + setOverrideCursor( tqwaitCursor ); + my_system(TQFile::encodeName(srv)+" --suicide"+" --new-startup"); + if (kapp && (Tty != kapp->type())) + restoreOverrideCursor(); +#endif +} + +void TDEApplication::dcopFailure(const TQString &msg) +{ + static int failureCount = 0; + failureCount++; + if (failureCount == 1) + { + startKdeinit(); + return; + } + if (failureCount == 2) + { +#ifdef Q_WS_WIN + TDEGlobal::config()->setGroup("General"); + if (TDEGlobal::config()->readBoolEntry("ignoreDCOPFailures", false)) + return; +#endif + TQString msgStr(i18n("There was an error setting up inter-process " + "communications for TDE. The message returned " + "by the system was:\n\n")); + msgStr += msg; + msgStr += i18n("\n\nPlease check that the \"dcopserver\" program is running!"); + + if (Tty != kapp->type()) + { + TQMessageBox::critical + ( + kapp->mainWidget(), + i18n("DCOP communications error (%1)").arg(kapp->caption()), + msgStr, + i18n("&OK") + ); + } + else + { + fprintf(stderr, "%s\n", msgStr.local8Bit().data()); + } + + return; + } +} + +static const TDECmdLineOptions qt_options[] = +{ + //FIXME: Check if other options are specific to Qt/X11 +#ifdef Q_WS_X11 + { "display <displayname>", I18N_NOOP("Use the X-server display 'displayname'"), 0}, +#else + { "display <displayname>", I18N_NOOP("Use the QWS display 'displayname'"), 0}, +#endif + { "session <sessionId>", I18N_NOOP("Restore the application for the given 'sessionId'"), 0}, + { "cmap", I18N_NOOP("Causes the application to install a private color\nmap on an 8-bit display"), 0}, + { "ncols <count>", I18N_NOOP("Limits the number of colors allocated in the color\ncube on an 8-bit display, if the application is\nusing the TQApplication::ManyColor color\nspecification"), 0}, + { "nograb", I18N_NOOP("tells Qt to never grab the mouse or the keyboard"), 0}, + { "dograb", I18N_NOOP("running under a debugger can cause an implicit\n-nograb, use -dograb to override"), 0}, + { "sync", I18N_NOOP("switches to synchronous mode for debugging"), 0}, + { "fn", 0, 0}, + { "font <fontname>", I18N_NOOP("defines the application font"), 0}, + { "bg", 0, 0}, + { "background <color>", I18N_NOOP("sets the default background color and an\napplication palette (light and dark shades are\ncalculated)"), 0}, + { "fg", 0, 0}, + { "foreground <color>", I18N_NOOP("sets the default foreground color"), 0}, + { "btn", 0, 0}, + { "button <color>", I18N_NOOP("sets the default button color"), 0}, + { "name <name>", I18N_NOOP("sets the application name"), 0}, + { "title <title>", I18N_NOOP("sets the application title (caption)"), 0}, +#ifdef Q_WS_X11 + { "visual TrueColor", I18N_NOOP("forces the application to use a TrueColor visual on\nan 8-bit display"), 0}, + { "inputstyle <inputstyle>", I18N_NOOP("sets XIM (X Input Method) input style. Possible\nvalues are onthespot, overthespot, offthespot and\nroot"), 0 }, + { "im <XIM server>", I18N_NOOP("set XIM server"),0}, + { "noxim", I18N_NOOP("disable XIM"), 0 }, +#endif +#ifdef Q_WS_QWS + { "qws", I18N_NOOP("forces the application to run as QWS Server"), 0}, +#endif + { "reverse", I18N_NOOP("mirrors the whole layout of widgets"), 0}, + TDECmdLineLastOption +}; + +static const TDECmdLineOptions kde_options[] = +{ + { "caption <caption>", I18N_NOOP("Use 'caption' as name in the titlebar"), 0}, + { "icon <icon>", I18N_NOOP("Use 'icon' as the application icon"), 0}, + { "miniicon <icon>", I18N_NOOP("Use 'icon' as the icon in the titlebar"), 0}, + { "config <filename>", I18N_NOOP("Use alternative configuration file"), 0}, + { "dcopserver <server>", I18N_NOOP("Use the DCOP Server specified by 'server'"), 0}, + { "nocrashhandler", I18N_NOOP("Disable crash handler, to get core dumps"), 0}, + { "waitforwm", I18N_NOOP("Waits for a WM_NET compatible windowmanager"), 0}, + { "style <style>", I18N_NOOP("sets the application GUI style"), 0}, + { "geometry <geometry>", I18N_NOOP("sets the client geometry of the main widget - see man X for the argument format"), 0}, + { "smkey <sessionKey>", 0, 0}, // this option is obsolete and exists only to allow smooth upgrades from sessions + // saved under Qt 3.0.x -- Qt 3.1.x includes the session key now automatically in + // the session id (Simon) + TDECmdLineLastOption +}; + +void +TDEApplication::addCmdLineOptions() +{ + TDECmdLineArgs::addCmdLineOptions(qt_options, "Qt", "qt"); + TDECmdLineArgs::addCmdLineOptions(kde_options, "TDE", "tde"); +} + +void TDEApplication::parseCommandLine( ) +{ + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs("tde"); + + if ( !args ) return; + + if (args->isSet("config")) + { + TQString config = TQString::fromLocal8Bit(args->getOption("config")); + setConfigName(config); + } + + if (args->isSet("style")) + { + + TQStringList plugins = TDEGlobal::dirs()->resourceDirs( "qtplugins" ); + TQStringList::Iterator itp = plugins.begin(); + while (itp != plugins.end()) { + addLibraryPath( *itp ); + ++itp; + } + + TQStringList styles = TQStyleFactory::keys(); + TQString reqStyle(args->getOption("style").lower()); + + TQStringList list = libraryPaths(); + TQStringList::Iterator it = list.begin(); + while( it != list.end() ) { + ++it; + } + + for (TQStringList::ConstIterator it = styles.begin(); it != styles.end(); ++it) { + if ((*it).lower() == reqStyle) + { + d->overrideStyle = *it; + break; + } + } + + if (d->overrideStyle.isEmpty()) + fprintf(stderr, "%s", TQString(i18n("The style %1 was not found\n").arg(reqStyle)).local8Bit().data()); + } + + if (args->isSet("caption")) + { + aCaption = TQString::fromLocal8Bit(args->getOption("caption")); + } + + if (args->isSet("miniicon")) + { + const char *tmp = args->getOption("miniicon"); + if (!aIconPixmap.pm.miniIcon) { + aIconPixmap.pm.miniIcon = new TQPixmap; + } + *aIconPixmap.pm.miniIcon = SmallIcon(tmp); + aMiniIconName = tmp; + } + + if (args->isSet("icon")) + { + const char *tmp = args->getOption("icon"); + if (!aIconPixmap.pm.icon) { + aIconPixmap.pm.icon = new TQPixmap; + } + *aIconPixmap.pm.icon = DesktopIcon( tmp ); + aIconName = tmp; + if (!aIconPixmap.pm.miniIcon) { + aIconPixmap.pm.miniIcon = new TQPixmap; + } + if (aIconPixmap.pm.miniIcon->isNull()) + { + *aIconPixmap.pm.miniIcon = SmallIcon( tmp ); + aMiniIconName = tmp; + } + } + + bool nocrashhandler = (getenv("TDE_DEBUG") != NULL); + if (!nocrashhandler && args->isSet("crashhandler")) + { + // set default crash handler / set emergency save function to nothing + TDECrash::setCrashHandler(TDECrash::defaultCrashHandler); + TDECrash::setEmergencySaveFunction(NULL); + + TDECrash::setApplicationName(TQString(args->appName())); + } + +#ifdef Q_WS_X11 + if ( args->isSet( "waitforwm" ) ) { + Atom type; + (void) desktop(); // trigger desktop creation, we need PropertyNotify events for the root window + int format; + unsigned long length, after; + unsigned char *data; + while ( XGetWindowProperty( tqt_xdisplay(), tqt_xrootwin(), atom_NetSupported, + 0, 1, false, AnyPropertyType, &type, &format, + &length, &after, &data ) != Success || !length ) { + if ( data ) + XFree( data ); + XEvent event; + XWindowEvent( tqt_xdisplay(), tqt_xrootwin(), PropertyChangeMask, &event ); + } + if ( data ) + XFree( data ); + } +#else + // FIXME(E): Implement for Qt Embedded +#endif + + if (args->isSet("geometry")) + { + d->geometry_arg = args->getOption("geometry"); + } + + if (args->isSet("smkey")) + { + d->sessionKey = args->getOption("smkey"); + } + +} + +TQString TDEApplication::geometryArgument() const +{ + return d->geometry_arg; +} + +TQPixmap TDEApplication::icon() const +{ + if( !aIconPixmap.pm.icon) { + aIconPixmap.pm.icon = new TQPixmap; + } + if( aIconPixmap.pm.icon->isNull()) { + *aIconPixmap.pm.icon = DesktopIcon( instanceName() ); + } + return *aIconPixmap.pm.icon; +} + +TQString TDEApplication::iconName() const +{ + return aIconName.isNull() ? (TQString)instanceName() : aIconName; +} + +TQPixmap TDEApplication::miniIcon() const +{ + if (!aIconPixmap.pm.miniIcon) { + aIconPixmap.pm.miniIcon = new TQPixmap; + } + if (aIconPixmap.pm.miniIcon->isNull()) { + *aIconPixmap.pm.miniIcon = SmallIcon( instanceName() ); + } + return *aIconPixmap.pm.miniIcon; +} + +TQString TDEApplication::miniIconName() const +{ + return aMiniIconName.isNull() ? (TQString)instanceName() : aMiniIconName; +} + +extern void kDebugCleanup(); + +TDEApplication::~TDEApplication() +{ + delete aIconPixmap.pm.miniIcon; + aIconPixmap.pm.miniIcon = 0L; + delete aIconPixmap.pm.icon; + aIconPixmap.pm.icon = 0L; + delete d->m_KAppDCOPInterface; + + // First call the static deleters and then call KLibLoader::cleanup() + // The static deleters may delete libraries for which they need KLibLoader. + // KLibLoader will take care of the remaining ones. + TDEGlobal::deleteStaticDeleters(); + KLibLoader::cleanUp(); + + delete smw; + + // close down IPC + delete s_DCOPClient; + s_DCOPClient = 0L; + + TDEProcessController::deref(); + +#ifdef Q_WS_X11 + if ( d->oldXErrorHandler != NULL ) + XSetErrorHandler( d->oldXErrorHandler ); + if ( d->oldXIOErrorHandler != NULL ) + XSetIOErrorHandler( d->oldXIOErrorHandler ); + if ( d->oldIceIOErrorHandler != NULL ) + IceSetIOErrorHandler( d->oldIceIOErrorHandler ); +#endif + + delete d; + KApp = 0; + +#ifdef Q_WS_X11 + mySmcConnection = 0; + delete smModificationTime; + smModificationTime = 0; + + // close the temporary smc connection + if (tmpSmcConnection) { + SmcCloseConnection( tmpSmcConnection, 0, 0 ); + tmpSmcConnection = 0; + } +#else + // FIXME(E): Implement for Qt Embedded +#endif +} + + +#ifdef Q_WS_X11 +class KAppX11HackWidget: public TQWidget +{ +public: + bool publicx11Event( XEvent * e) { return x11Event( e ); } +}; +#endif + +#if defined(Q_WS_X11) && defined(COMPOSITE) +bool TDEApplication::isCompositionManagerAvailable() { + bool have_manager = false; + const char *home; + struct passwd *p; + p = getpwuid(getuid()); + if (p) + home = p->pw_dir; + else + home = getenv("HOME"); + + char *filename; + const char *configfile = "/.kompmgr.available"; + int n = strlen(home)+strlen(configfile)+1; + filename = (char*)malloc(n*sizeof(char)); + memset(filename,0,n); + strcat(filename, home); + strcat(filename, configfile); + + // Now that we did all that by way of introduction...read the file! + FILE *pFile; + pFile = fopen(filename, "r"); + if (pFile) { + have_manager = true; + fclose(pFile); + } + + free(filename); + filename = NULL; + + return have_manager; +} + +bool TDEApplication::detectCompositionManagerAvailable(bool force_available, bool available) { + bool compositing_manager_available; + if (force_available) { + compositing_manager_available = available; + } + else { + // See if compositing has been enabled + TDECmdLineArgs *qtargs = TDECmdLineArgs::parsedArgs("qt"); + char *displayname = 0; + if ( qtargs->isSet("display")) + displayname = qtargs->getOption( "display" ).data(); + + Display *dpy = XOpenDisplay( displayname ); + + x11_composite_error_generated = false; + compositing_manager_available = false; + XSetErrorHandler(x11_error); + if (!XQueryExtension (dpy, COMPOSITE_NAME, &composite_opcode, &composite_event, &composite_error)) { + XSetErrorHandler(NULL); + compositing_manager_available = false; + } + else { + if (available) { // FIXME This variable does double duty to avoid breaking the ABI for R14.0. In reality it should be called perform_deep_check + Window root_window = XDefaultRootWindow(dpy); + XCompositeRedirectSubwindows(dpy, root_window, CompositeRedirectManual); + XSync(dpy, false); + if (x11_composite_error_generated == true) { + compositing_manager_available = true; + } + else { + XCompositeUnredirectSubwindows(dpy, root_window, CompositeRedirectManual); + compositing_manager_available = false; + } + XSetErrorHandler(NULL); + XCloseDisplay(dpy); + } + else { + compositing_manager_available = true; + } + } + } + + const char *home; + struct passwd *p; + p = getpwuid(getuid()); + if (p) + home = p->pw_dir; + else + home = getenv("HOME"); + + char *filename; + const char *configfile = "/.kompmgr.available"; + int n = strlen(home)+strlen(configfile)+1; + filename = (char*)malloc(n*sizeof(char)); + memset(filename,0,n); + strcat(filename, home); + strcat(filename, configfile); + + /* now that we did all that by way of introduction...create or remove the file! */ + if (compositing_manager_available) { + FILE *pFile; + char buffer[255]; + sprintf(buffer, "available"); + pFile = fopen(filename, "w"); + if (pFile) { + fwrite(buffer,1,strlen(buffer), pFile); + fclose(pFile); + } + } + else { + unlink(filename); + } + + free(filename); + filename = NULL; + + return compositing_manager_available; +} + +Display* TDEApplication::openX11RGBADisplay() { + TDECmdLineArgs *qtargs = TDECmdLineArgs::parsedArgs("qt"); + char *display = 0; + if ( qtargs->isSet("display")) + display = qtargs->getOption( "display" ).data(); + + Display *dpy = XOpenDisplay( display ); + if ( !dpy ) { + kdError() << "cannot connect to X server " << display << endl; + exit( 1 ); + } + + return dpy; +} + +Qt::HANDLE TDEApplication::getX11RGBAVisual(Display *dpy) { + getX11RGBAInformation(dpy); + if (TDEApplication::isCompositionManagerAvailable() == true) { + return argb_x11_visual; + } + else { + return (Qt::HANDLE)NULL; + } +} + +Qt::HANDLE TDEApplication::getX11RGBAColormap(Display *dpy) { + getX11RGBAInformation(dpy); + if (TDEApplication::isCompositionManagerAvailable() == true) { + return argb_x11_colormap; + } + else { + return (Qt::HANDLE)NULL; + } +} + +bool TDEApplication::isX11CompositionAvailable() { + return (argb_visual & isCompositionManagerAvailable()); +} + +void TDEApplication::getX11RGBAInformation(Display *dpy) { + if ( !dpy ) { + argb_visual = false; + return; + } + + int screen = DefaultScreen( dpy ); + Colormap colormap = 0; + Visual *visual = 0; + int event_base, error_base; + + if ( XRenderQueryExtension( dpy, &event_base, &error_base ) ) { + int nvi; + XVisualInfo templ; + templ.screen = screen; + templ.depth = 32; + templ.c_class = TrueColor; + XVisualInfo *xvi = XGetVisualInfo( dpy, VisualScreenMask | VisualDepthMask + | VisualClassMask, &templ, &nvi ); + + for ( int i = 0; i < nvi; i++ ) { + XRenderPictFormat *format = XRenderFindVisualFormat( dpy, xvi[i].visual ); + if ( format->type == PictTypeDirect && format->direct.alphaMask ) { + visual = xvi[i].visual; + colormap = XCreateColormap( dpy, RootWindow( dpy, screen ), visual, AllocNone ); + kdDebug() << "found visual with alpha support" << endl; + argb_visual = true; + break; + } + } + } + + if( argb_visual ) { + argb_x11_visual = Qt::HANDLE( visual ); + argb_x11_colormap = Qt::HANDLE( colormap ); + argb_visual = true; + return; + } + argb_visual = false; + return; +} +#else +void TDEApplication::getX11RGBAInformation(Display *dpy) { +} + +bool TDEApplication::isCompositionManagerAvailable() { + return false; +} + +bool TDEApplication::detectCompositionManagerAvailable(bool force_available) { + const char *home; + struct passwd *p; + p = getpwuid(getuid()); + if (p) + home = p->pw_dir; + else + home = getenv("HOME"); + + char *filename; + const char *configfile = "/.kompmgr.available"; + int n = strlen(home)+strlen(configfile)+1; + filename = (char*)malloc(n*sizeof(char)); + memset(filename,0,n); + strcat(filename, home); + strcat(filename, configfile); + + /* now that we did all that by way of introduction...create or remove the file! */ + if (force_available) { + FILE *pFile; + char buffer[255]; + sprintf(buffer, "available"); + pFile = fopen(filename, "w"); + if (pFile) { + fwrite(buffer,1,strlen(buffer), pFile); + fclose(pFile); + } + } + else { + unlink(filename); + } + + free(filename); + filename = NULL; + + return false; +} + +Display* TDEApplication::openX11RGBADisplay() { + return 0; +} + +Qt::HANDLE TDEApplication::getX11RGBAVisual(char *display) { + return 0; +} + +Qt::HANDLE TDEApplication::getX11RGBAColormap(char *display) { + return 0; +} + +bool TDEApplication::isX11CompositionAvailable() { + return false; +} + +TDEApplication TDEApplication::KARGBApplication( bool allowStyles ) { + return TDEApplication::TDEApplication(allowStyles, true); +} +#endif + +static bool kapp_block_user_input = false; + +void TDEApplication::dcopBlockUserInput( bool b ) +{ + kapp_block_user_input = b; +} + +#ifdef Q_WS_X11 +bool TDEApplication::x11EventFilter( XEvent *_event ) +{ + switch ( _event->type ) { + case ClientMessage: + { +#if KDE_IS_VERSION( 3, 90, 90 ) +#warning This should be already in Qt, check. +#endif + // Workaround for focus stealing prevention not working when dragging e.g. text from KWrite + // to KDesktop -> the dialog asking for filename doesn't get activated. This is because + // Qt-3.2.x doesn't have concept of tqt_x_user_time at all, and Qt-3.3.0b1 passes the timestamp + // in the XdndDrop message in incorrect field (and doesn't update tqt_x_user_time either). + // Patch already sent, future Qt version should have this fixed. + if( _event->xclient.message_type == kde_xdnd_drop ) + { // if the message is XdndDrop + if( _event->xclient.data.l[ 1 ] == 1 << 24 // and it's broken the way it's in Qt-3.2.x + && _event->xclient.data.l[ 2 ] == 0 + && _event->xclient.data.l[ 4 ] == 0 + && _event->xclient.data.l[ 3 ] != 0 ) + { + if( GET_QT_X_USER_TIME() == 0 + || NET::timestampCompare( _event->xclient.data.l[ 3 ], GET_QT_X_USER_TIME() ) > 0 ) + { // and the timestamp looks reasonable + SET_QT_X_USER_TIME(_event->xclient.data.l[ 3 ]); // update our tqt_x_user_time from it + } + } + else // normal DND, only needed until Qt updates tqt_x_user_time from XdndDrop + { + if( GET_QT_X_USER_TIME() == 0 + || NET::timestampCompare( _event->xclient.data.l[ 2 ], GET_QT_X_USER_TIME() ) > 0 ) + { // the timestamp looks reasonable + SET_QT_X_USER_TIME(_event->xclient.data.l[ 2 ]); // update our tqt_x_user_time from it + } + } + } + } + default: break; + } + + if ( kapp_block_user_input ) { + switch ( _event->type ) { + case ButtonPress: + case ButtonRelease: + case XKeyPress: + case XKeyRelease: + case MotionNotify: + case EnterNotify: + case LeaveNotify: + return true; + default: + break; + } + } + + if (x11Filter) { + for (TQWidget *w=x11Filter->first(); w; w=x11Filter->next()) { + if (((KAppX11HackWidget*) w)->publicx11Event(_event)) + return true; + } + } + + if ((_event->type == ClientMessage) && + (_event->xclient.message_type == kipcCommAtom)) + { + XClientMessageEvent *cme = (XClientMessageEvent *) _event; + + int id = cme->data.l[0]; + int arg = cme->data.l[1]; + if ((id < 32) && (kipcEventMask & (1 << id))) + { + switch (id) + { + case KIPC::StyleChanged: + TDEGlobal::config()->reparseConfiguration(); + tdedisplaySetStyle(); + break; + + case KIPC::ToolbarStyleChanged: + TDEGlobal::config()->reparseConfiguration(); + if (useStyles) + emit toolbarAppearanceChanged(arg); + break; + + case KIPC::PaletteChanged: + TDEGlobal::config()->reparseConfiguration(); + tdedisplaySetPalette(); + break; + + case KIPC::FontChanged: + TDEGlobal::config()->reparseConfiguration(); + TDEGlobalSettings::rereadFontSettings(); + tdedisplaySetFont(); + break; + + case KIPC::BackgroundChanged: + emit backgroundChanged(arg); + break; + + case KIPC::SettingsChanged: + TDEGlobal::config()->reparseConfiguration(); + if (arg == SETTINGS_PATHS) + TDEGlobalSettings::rereadPathSettings(); + else if (arg == SETTINGS_MOUSE) + TDEGlobalSettings::rereadMouseSettings(); + propagateSettings((SettingsCategory)arg); + break; + + case KIPC::IconChanged: + TQPixmapCache::clear(); + TDEGlobal::config()->reparseConfiguration(); + TDEGlobal::instance()->newIconLoader(); + emit updateIconLoaders(); + emit iconChanged(arg); + break; + + case KIPC::ClipboardConfigChanged: + TDEClipboardSynchronizer::newConfiguration(arg); + break; + + case KIPC::BlockShortcuts: + TDEGlobalAccel::blockShortcuts(arg); + emit kipcMessage(id, arg); // some apps may do additional things + break; + } + } + else if (id >= 32) + { + emit kipcMessage(id, arg); + } + return true; + } + return false; +} +#endif // Q_WS_X11 + +void TDEApplication::updateUserTimestamp( unsigned long time ) +{ +#if defined Q_WS_X11 + if( time == 0 ) + { // get current X timestamp + Window w = XCreateSimpleWindow( tqt_xdisplay(), tqt_xrootwin(), 0, 0, 1, 1, 0, 0, 0 ); + XSelectInput( tqt_xdisplay(), w, PropertyChangeMask ); + unsigned char data[ 1 ]; + XChangeProperty( tqt_xdisplay(), w, XA_ATOM, XA_ATOM, 8, PropModeAppend, data, 1 ); + XEvent ev; + XWindowEvent( tqt_xdisplay(), w, PropertyChangeMask, &ev ); + time = ev.xproperty.time; + XDestroyWindow( tqt_xdisplay(), w ); + } + if( GET_QT_X_USER_TIME() == 0 + || NET::timestampCompare( time, GET_QT_X_USER_TIME() ) > 0 ) // check time > tqt_x_user_time + SET_QT_X_USER_TIME(time); +#endif +} + +unsigned long TDEApplication::userTimestamp() const +{ +#if defined Q_WS_X11 + return GET_QT_X_USER_TIME(); +#else + return 0; +#endif +} + +void TDEApplication::updateRemoteUserTimestamp( const TQCString& dcopId, unsigned long time ) +{ +#if defined Q_WS_X11 + if( time == 0 ) + time = GET_QT_X_USER_TIME(); + DCOPRef( dcopId, "MainApplication-Interface" ).call( "updateUserTimestamp", time ); +#endif +} + +void TDEApplication::invokeEditSlot( const char *slot ) +{ + TQObject *object = TQT_TQOBJECT(focusWidget()); + if( !object ) + return; + + TQMetaObject *meta = object->metaObject(); + + int idx = meta->findSlot( slot + 1, true ); + if( idx < 0 ) + return; + + object->tqt_invoke( idx, 0 ); +} + +void TDEApplication::addKipcEventMask(int id) +{ + if (id >= 32) + { + kdDebug(101) << "Cannot use KIPC event mask for message IDs >= 32\n"; + return; + } + kipcEventMask |= (1 << id); +} + +void TDEApplication::removeKipcEventMask(int id) +{ + if (id >= 32) + { + kdDebug(101) << "Cannot use KIPC event mask for message IDs >= 32\n"; + return; + } + kipcEventMask &= ~(1 << id); +} + +void TDEApplication::enableStyles() +{ + if (!useStyles) + { + useStyles = true; + applyGUIStyle(); + } +} + +void TDEApplication::disableStyles() +{ + useStyles = false; +} + +void TDEApplication::applyGUIStyle() +{ + if ( !useStyles ) return; + + TDEConfigGroup pConfig (TDEGlobal::config(), "General"); + TQString defaultStyle = TDEStyle::defaultStyle(); + TQString styleStr = pConfig.readEntry("widgetStyle", defaultStyle); + + if (d->overrideStyle.isEmpty()) { + // ### add check whether we already use the correct style to return then + // (workaround for Qt misbehavior to avoid double style initialization) + + TQStyle* sp = TQStyleFactory::create( styleStr ); + + // If there is no default style available, try falling back any available style + if ( !sp && styleStr != defaultStyle) + sp = TQStyleFactory::create( defaultStyle ); + if ( !sp ) + sp = TQStyleFactory::create( *(TQStyleFactory::keys().begin()) ); + setStyle(sp); + } + else + setStyle(d->overrideStyle); + // Reread palette from config file. + tdedisplaySetPalette(); +} + +TQString TDEApplication::caption() const +{ + // Caption set from command line ? + if( !aCaption.isNull() ) + return aCaption; + else + // We have some about data ? + if ( TDEGlobal::instance()->aboutData() ) + return TDEGlobal::instance()->aboutData()->programName(); + else + // Last resort : application name + return name(); +} + + +// +// 1999-09-20: Espen Sand +// An attempt to simplify consistent captions. +// +TQString TDEApplication::makeStdCaption( const TQString &userCaption, + bool withAppName, bool modified ) const +{ + TQString s = userCaption.isEmpty() ? caption() : userCaption; + + // If the document is modified, add '[modified]'. + if (modified) + s += TQString::fromUtf8(" [") + i18n("modified") + TQString::fromUtf8("]"); + + if ( !userCaption.isEmpty() ) { + // Add the application name if: + // User asked for it, it's not a duplication and the app name (caption()) is not empty + if ( withAppName && !caption().isNull() && !userCaption.endsWith(caption()) ) + s += TQString::fromUtf8(" - ") + caption(); + } + + return s; +} + +TQPalette TDEApplication::createApplicationPalette() +{ + TDEConfig *config = TDEGlobal::config(); + TDEConfigGroupSaver saver( config, "General" ); + return createApplicationPalette( config, TDEGlobalSettings::contrast() ); +} + +TQPalette TDEApplication::createApplicationPalette( TDEConfig *config, int contrast_ ) +{ + TQColor trinity4Background( 239, 239, 239 ); + TQColor trinity4Blue( 103,141,178 ); + + TQColor trinity4Button; + if ( TQPixmap::defaultDepth() > 8 ) + trinity4Button.setRgb( 221, 223, 228 ); + else + trinity4Button.setRgb( 220, 220, 220 ); + + TQColor trinity4Link( 0, 0, 238 ); + TQColor trinity4VisitedLink( 82, 24, 139 ); + + TQColor background = config->readColorEntry( "background", &trinity4Background ); + TQColor foreground = config->readColorEntry( "foreground", tqblackptr ); + TQColor button = config->readColorEntry( "buttonBackground", &trinity4Button ); + TQColor buttonText = config->readColorEntry( "buttonForeground", tqblackptr ); + TQColor highlight = config->readColorEntry( "selectBackground", &trinity4Blue ); + TQColor highlightedText = config->readColorEntry( "selectForeground", tqwhiteptr ); + TQColor base = config->readColorEntry( "windowBackground", tqwhiteptr ); + TQColor baseText = config->readColorEntry( "windowForeground", tqblackptr ); + TQColor link = config->readColorEntry( "linkColor", &trinity4Link ); + TQColor visitedLink = config->readColorEntry( "visitedLinkColor", &trinity4VisitedLink ); + + int highlightVal, lowlightVal; + highlightVal = 100 + (2*contrast_+4)*16/10; + lowlightVal = 100 + (2*contrast_+4)*10; + + TQColor disfg = foreground; + + int h, s, v; + disfg.hsv( &h, &s, &v ); + if (v > 128) + // dark bg, light fg - need a darker disabled fg + disfg = disfg.dark(lowlightVal); + else if (disfg != Qt::black) + // light bg, dark fg - need a lighter disabled fg - but only if !black + disfg = disfg.light(highlightVal); + else + // black fg - use darkgray disabled fg + disfg = Qt::darkGray; + + + TQColorGroup disabledgrp(disfg, background, + background.light(highlightVal), + background.dark(lowlightVal), + background.dark(120), + background.dark(120), base); + + TQColorGroup colgrp(foreground, background, background.light(highlightVal), + background.dark(lowlightVal), + background.dark(120), + baseText, base); + + int inlowlightVal = lowlightVal-25; + if(inlowlightVal < 120) + inlowlightVal = 120; + + colgrp.setColor(TQColorGroup::Highlight, highlight); + colgrp.setColor(TQColorGroup::HighlightedText, highlightedText); + colgrp.setColor(TQColorGroup::Button, button); + colgrp.setColor(TQColorGroup::ButtonText, buttonText); + colgrp.setColor(TQColorGroup::Midlight, background.light(110)); + colgrp.setColor(TQColorGroup::Link, link); + colgrp.setColor(TQColorGroup::LinkVisited, visitedLink); + + disabledgrp.setColor(TQColorGroup::Button, button); + + TQColor disbtntext = buttonText; + disbtntext.hsv( &h, &s, &v ); + if (v > 128) + // dark button, light buttonText - need a darker disabled buttonText + disbtntext = disbtntext.dark(lowlightVal); + else if (disbtntext != Qt::black) + // light buttonText, dark button - need a lighter disabled buttonText - but only if !black + disbtntext = disbtntext.light(highlightVal); + else + // black button - use darkgray disabled buttonText + disbtntext = Qt::darkGray; + + disabledgrp.setColor(TQColorGroup::ButtonText, disbtntext); + disabledgrp.setColor(TQColorGroup::Midlight, background.light(110)); + disabledgrp.setColor(TQColorGroup::Highlight, highlight.dark(120)); + disabledgrp.setColor(TQColorGroup::Link, link); + disabledgrp.setColor(TQColorGroup::LinkVisited, visitedLink); + + return TQPalette(colgrp, disabledgrp, colgrp); +} + + +void TDEApplication::tdedisplaySetPalette() +{ +#ifdef Q_WS_MACX + //Can I have this on other platforms, please!? --Sam + { + TDEConfig *config = TDEGlobal::config(); + TDEConfigGroupSaver saver( config, "General" ); + bool do_not_set_palette = FALSE; + if(config->readBoolEntry("nopaletteChange", &do_not_set_palette)) + return; + } +#endif + TQApplication::setPalette( createApplicationPalette(), true); + emit tdedisplayPaletteChanged(); + emit appearanceChanged(); +} + + +void TDEApplication::tdedisplaySetFont() +{ + TQApplication::setFont(TDEGlobalSettings::generalFont(), true); + TQApplication::setFont(TDEGlobalSettings::menuFont(), true, TQMENUBAR_OBJECT_NAME_STRING); + TQApplication::setFont(TDEGlobalSettings::menuFont(), true, TQPOPUPMENU_OBJECT_NAME_STRING); + TQApplication::setFont(TDEGlobalSettings::menuFont(), true, "TDEPopupTitle"); + + // "patch" standard TQStyleSheet to follow our fonts + TQStyleSheet* sheet = TQStyleSheet::defaultSheet(); + sheet->item ("pre")->setFontFamily (TDEGlobalSettings::fixedFont().family()); + sheet->item ("code")->setFontFamily (TDEGlobalSettings::fixedFont().family()); + sheet->item ("tt")->setFontFamily (TDEGlobalSettings::fixedFont().family()); + + emit tdedisplayFontChanged(); + emit appearanceChanged(); +} + + +void TDEApplication::tdedisplaySetStyle() +{ + if (useStyles) + { + applyGUIStyle(); + emit tdedisplayStyleChanged(); + emit appearanceChanged(); + } +} + + +void TDEApplication::propagateSettings(SettingsCategory arg) +{ + TDEConfigBase* config = TDEGlobal::config(); + TDEConfigGroupSaver saver( config, "KDE" ); + +#ifdef QT_HAVE_MAX_IMAGE_SIZE + TQSize maxImageSize(4096, 4096); + maxImageSize = config->readSizeEntry("MaxImageSize", &maxImageSize); + TQImage::setMaxImageSize(maxImageSize); +#endif + + int num = config->readNumEntry("CursorBlinkRate", TQApplication::cursorFlashTime()); + if ((num != 0) && (num < 200)) + num = 200; + if (num > 2000) + num = 2000; + TQApplication::setCursorFlashTime(num); + num = config->readNumEntry("DoubleClickInterval", TQApplication::doubleClickInterval()); + TQApplication::setDoubleClickInterval(num); + num = config->readNumEntry("StartDragTime", TQApplication::startDragTime()); + TQApplication::setStartDragTime(num); + num = config->readNumEntry("StartDragDist", TQApplication::startDragDistance()); + TQApplication::setStartDragDistance(num); + num = config->readNumEntry("WheelScrollLines", TQApplication::wheelScrollLines()); + TQApplication::setWheelScrollLines(num); + + bool b = config->readBoolEntry("EffectAnimateMenu", false); + TQApplication::setEffectEnabled( Qt::UI_AnimateMenu, b); + b = config->readBoolEntry("EffectFadeMenu", false); + TQApplication::setEffectEnabled( Qt::UI_FadeMenu, b); + b = config->readBoolEntry("EffectAnimateCombo", false); + TQApplication::setEffectEnabled( Qt::UI_AnimateCombo, b); + b = config->readBoolEntry("EffectAnimateTooltip", false); + TQApplication::setEffectEnabled( Qt::UI_AnimateTooltip, b); + b = config->readBoolEntry("EffectFadeTooltip", false); + TQApplication::setEffectEnabled( Qt::UI_FadeTooltip, b); + b = !config->readBoolEntry("EffectNoTooltip", false); + TQToolTip::setGloballyEnabled( b ); + + emit settingsChanged(arg); +} + +void TDEApplication::installKDEPropertyMap() +{ +#ifndef QT_NO_SQL + static bool installed = false; + if (installed) return; + installed = true; + /** + * If you are adding a widget that was missing please + * make sure to also add it to TDEConfigDialogManager's retrieveSettings() + * function. + * Thanks. + */ + // TQSqlPropertyMap takes ownership of the new default map. + TQSqlPropertyMap *kdeMap = new TQSqlPropertyMap; + kdeMap->insert( "KColorButton", "color" ); + kdeMap->insert( "KComboBox", "currentItem" ); + kdeMap->insert( "KDatePicker", "date" ); + kdeMap->insert( "KDateWidget", "date" ); + kdeMap->insert( "KDateTimeWidget", "dateTime" ); + kdeMap->insert( "KEditListBox", "items" ); + kdeMap->insert( "TDEFontCombo", "family" ); + kdeMap->insert( "TDEFontRequester", "font" ); + kdeMap->insert( "TDEFontChooser", "font" ); + kdeMap->insert( "KHistoryCombo", "currentItem" ); + kdeMap->insert( "TDEListBox", "currentItem" ); + kdeMap->insert( "KLineEdit", "text" ); + kdeMap->insert( "KRestrictedLine", "text" ); + kdeMap->insert( "KSqueezedTextLabel", "text" ); + kdeMap->insert( "KTextBrowser", "source" ); + kdeMap->insert( "KTextEdit", "text" ); + kdeMap->insert( "KURLRequester", "url" ); + kdeMap->insert( "KPasswordEdit", "password" ); + kdeMap->insert( "KIntNumInput", "value" ); + kdeMap->insert( "KIntSpinBox", "value" ); + kdeMap->insert( "KDoubleNumInput", "value" ); + // Temp til fixed in QT then enable ifdef with the correct version num + kdeMap->insert( TQGROUPBOX_OBJECT_NAME_STRING, "checked" ); + kdeMap->insert( TQTABWIDGET_OBJECT_NAME_STRING, "currentPage" ); + TQSqlPropertyMap::installDefaultMap( kdeMap ); +#endif +} + +void TDEApplication::invokeHelp( const TQString& anchor, + const TQString& _appname) const +{ + return invokeHelp( anchor, _appname, "" ); +} + +#ifndef Q_WS_WIN +// for win32 we're using simple help tools like Qt Assistant, +// see kapplication_win.cpp +void TDEApplication::invokeHelp( const TQString& anchor, + const TQString& _appname, + const TQCString& startup_id ) const +{ + TQString url; + TQString appname; + if (_appname.isEmpty()) + appname = name(); + else + appname = _appname; + + if (!anchor.isEmpty()) + url = TQString("help:/%1?anchor=%2").arg(appname).arg(anchor); + else + url = TQString("help:/%1/index.html").arg(appname); + + TQString error; + if ( !dcopClient()->isApplicationRegistered("khelpcenter") ) + { + if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, startup_id, false)) + { + if (Tty != kapp->type()) + TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Help Center"), + i18n("Could not launch the TDE Help Center:\n\n%1").arg(error), i18n("&OK")); + else + kdWarning() << "Could not launch help:\n" << error << endl; + return; + } + } + else + DCOPRef( "khelpcenter", "KHelpCenterIface" ).send( "openUrl", url, startup_id ); +} +#endif + +void TDEApplication::invokeHTMLHelp( const TQString& _filename, const TQString& topic ) const +{ + kdWarning() << "invoking HTML help is deprecated! use docbook and invokeHelp!\n"; + + TQString filename; + + if( _filename.isEmpty() ) + filename = TQString(name()) + "/index.html"; + else + filename = _filename; + + TQString url; + if (!topic.isEmpty()) + url = TQString("help:/%1#%2").arg(filename).arg(topic); + else + url = TQString("help:/%1").arg(filename); + + TQString error; + if ( !dcopClient()->isApplicationRegistered("khelpcenter") ) + { + if (startServiceByDesktopName("khelpcenter", url, &error, 0, 0, "", false)) + { + if (Tty != kapp->type()) + TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Help Center"), + i18n("Could not launch the TDE Help Center:\n\n%1").arg(error), i18n("&OK")); + else + kdWarning() << "Could not launch help:\n" << error << endl; + return; + } + } + else + DCOPRef( "khelpcenter", "KHelpCenterIface" ).send( "openUrl", url ); +} + + +void TDEApplication::invokeMailer(const TQString &address, const TQString &subject) +{ + return invokeMailer(address,subject,""); +} + +void TDEApplication::invokeMailer(const TQString &address, const TQString &subject, const TQCString& startup_id) +{ + invokeMailer(address, TQString::null, TQString::null, subject, TQString::null, TQString::null, + TQStringList(), startup_id ); +} + +void TDEApplication::invokeMailer(const KURL &mailtoURL) +{ + return invokeMailer( mailtoURL, "" ); +} + +void TDEApplication::invokeMailer(const KURL &mailtoURL, const TQCString& startup_id ) +{ + return invokeMailer( mailtoURL, startup_id, false); +} + +void TDEApplication::invokeMailer(const KURL &mailtoURL, const TQCString& startup_id, bool allowAttachments ) +{ + TQString address = KURL::decode_string(mailtoURL.path()), subject, cc, bcc, body; + TQStringList queries = TQStringList::split('&', mailtoURL.query().mid(1)); + TQStringList attachURLs; + for (TQStringList::Iterator it = queries.begin(); it != queries.end(); ++it) + { + TQString q = (*it).lower(); + if (q.startsWith("subject=")) + subject = KURL::decode_string((*it).mid(8)); + else + if (q.startsWith("cc=")) + cc = cc.isEmpty()? KURL::decode_string((*it).mid(3)): cc + ',' + KURL::decode_string((*it).mid(3)); + else + if (q.startsWith("bcc=")) + bcc = bcc.isEmpty()? KURL::decode_string((*it).mid(4)): bcc + ',' + KURL::decode_string((*it).mid(4)); + else + if (q.startsWith("body=")) + body = KURL::decode_string((*it).mid(5)); + else + if (allowAttachments && q.startsWith("attach=")) + attachURLs.push_back(KURL::decode_string((*it).mid(7))); + else + if (allowAttachments && q.startsWith("attachment=")) + attachURLs.push_back(KURL::decode_string((*it).mid(11))); + else + if (q.startsWith("to=")) + address = address.isEmpty()? KURL::decode_string((*it).mid(3)): address + ',' + KURL::decode_string((*it).mid(3)); + } + + invokeMailer( address, cc, bcc, subject, body, TQString::null, attachURLs, startup_id ); +} + +void TDEApplication::invokeMailer(const TQString &to, const TQString &cc, const TQString &bcc, + const TQString &subject, const TQString &body, + const TQString & messageFile, const TQStringList &attachURLs) +{ + return invokeMailer(to,cc,bcc,subject,body,messageFile,attachURLs,""); +} + +#ifndef Q_WS_WIN +// on win32, for invoking browser we're using win32 API +// see kapplication_win.cpp + +static TQStringList splitEmailAddressList( const TQString & aStr ) +{ + // This is a copy of KPIM::splitEmailAddrList(). + // Features: + // - always ignores quoted characters + // - ignores everything (including parentheses and commas) + // inside quoted strings + // - supports nested comments + // - ignores everything (including double quotes and commas) + // inside comments + + TQStringList list; + + if (aStr.isEmpty()) + return list; + + TQString addr; + uint addrstart = 0; + int commentlevel = 0; + bool insidequote = false; + + for (uint index=0; index<aStr.length(); index++) { + // the following conversion to latin1 is o.k. because + // we can safely ignore all non-latin1 characters + switch (aStr[index].latin1()) { + case '"' : // start or end of quoted string + if (commentlevel == 0) + insidequote = !insidequote; + break; + case '(' : // start of comment + if (!insidequote) + commentlevel++; + break; + case ')' : // end of comment + if (!insidequote) { + if (commentlevel > 0) + commentlevel--; + else { + //kdDebug() << "Error in address splitting: Unmatched ')'" + // << endl; + return list; + } + } + break; + case '\\' : // quoted character + index++; // ignore the quoted character + break; + case ',' : + if (!insidequote && (commentlevel == 0)) { + addr = aStr.mid(addrstart, index-addrstart); + if (!addr.isEmpty()) + list += addr.simplifyWhiteSpace(); + addrstart = index+1; + } + break; + } + } + // append the last address to the list + if (!insidequote && (commentlevel == 0)) { + addr = aStr.mid(addrstart, aStr.length()-addrstart); + if (!addr.isEmpty()) + list += addr.simplifyWhiteSpace(); + } + //else + // kdDebug() << "Error in address splitting: " + // << "Unexpected end of address list" + // << endl; + + return list; +} + +void TDEApplication::invokeMailer(const TQString &_to, const TQString &_cc, const TQString &_bcc, + const TQString &subject, const TQString &body, + const TQString & /*messageFile TODO*/, const TQStringList &attachURLs, + const TQCString& startup_id ) +{ + TDEConfig config("emaildefaults"); + + config.setGroup("Defaults"); + TQString group = config.readEntry("Profile","Default"); + + config.setGroup( TQString("PROFILE_%1").arg(group) ); + TQString command = config.readPathEntry("EmailClient"); + + TQString to, cc, bcc; + if (command.isEmpty() || command == TQString::fromLatin1("kmail") + || command.endsWith("/kmail")) + { + command = TQString::fromLatin1("kmail --composer -s %s -c %c -b %b --body %B --attach %A -- %t"); + if ( !_to.isEmpty() ) + { + // put the whole address lists into RFC2047 encoded blobs; technically + // this isn't correct, but KMail understands it nonetheless + to = TQString( "=?utf8?b?%1?=" ) + .arg( TQString(KCodecs::base64Encode( _to.utf8(), false )) ); + } + if ( !_cc.isEmpty() ) + cc = TQString( "=?utf8?b?%1?=" ) + .arg( TQString(KCodecs::base64Encode( _cc.utf8(), false )) ); + if ( !_bcc.isEmpty() ) + bcc = TQString( "=?utf8?b?%1?=" ) + .arg( TQString(KCodecs::base64Encode( _bcc.utf8(), false )) ); + } else { + to = _to; + cc = _cc; + bcc = _bcc; + if( !command.contains( '%' )) + command += " %u"; + } + + if (config.readBoolEntry("TerminalClient", false)) + { + TDEConfigGroup confGroup( TDEGlobal::config(), "General" ); + TQString preferredTerminal = confGroup.readPathEntry("TerminalApplication", "konsole"); + command = preferredTerminal + " -e " + command; + } + + TQStringList cmdTokens = KShell::splitArgs(command); + TQString cmd = cmdTokens[0]; + cmdTokens.remove(cmdTokens.begin()); + + KURL url; + TQStringList qry; + if (!to.isEmpty()) + { + TQStringList tos = splitEmailAddressList( to ); + url.setPath( tos.first() ); + tos.remove( tos.begin() ); + for (TQStringList::ConstIterator it = tos.begin(); it != tos.end(); ++it) + qry.append( "to=" + KURL::encode_string( *it ) ); + } + const TQStringList ccs = splitEmailAddressList( cc ); + for (TQStringList::ConstIterator it = ccs.begin(); it != ccs.end(); ++it) + qry.append( "cc=" + KURL::encode_string( *it ) ); + const TQStringList bccs = splitEmailAddressList( bcc ); + for (TQStringList::ConstIterator it = bccs.begin(); it != bccs.end(); ++it) + qry.append( "bcc=" + KURL::encode_string( *it ) ); + for (TQStringList::ConstIterator it = attachURLs.begin(); it != attachURLs.end(); ++it) + qry.append( "attach=" + KURL::encode_string( *it ) ); + if (!subject.isEmpty()) + qry.append( "subject=" + KURL::encode_string( subject ) ); + if (!body.isEmpty()) + qry.append( "body=" + KURL::encode_string( body ) ); + url.setQuery( qry.join( "&" ) ); + if ( ! (to.isEmpty() && qry.isEmpty()) ) + url.setProtocol("mailto"); + + TQMap<TQChar, TQString> keyMap; + keyMap.insert('t', to); + keyMap.insert('s', subject); + keyMap.insert('c', cc); + keyMap.insert('b', bcc); + keyMap.insert('B', body); + keyMap.insert('u', url.url()); + + TQString attachlist = attachURLs.join(","); + attachlist.prepend('\''); + attachlist.append('\''); + keyMap.insert('A', attachlist); + + for (TQStringList::Iterator it = cmdTokens.begin(); it != cmdTokens.end(); ) + { + if (*it == "%A") + { + if (it == cmdTokens.begin()) // better safe than sorry ... + continue; + TQStringList::ConstIterator urlit = attachURLs.begin(); + TQStringList::ConstIterator urlend = attachURLs.end(); + if ( urlit != urlend ) + { + TQStringList::Iterator previt = it; + --previt; + *it = *urlit; + ++it; + while ( ++urlit != urlend ) + { + cmdTokens.insert( it, *previt ); + cmdTokens.insert( it, *urlit ); + } + } else { + --it; + it = cmdTokens.remove( cmdTokens.remove( it ) ); + } + } else { + *it = KMacroExpander::expandMacros(*it, keyMap); + ++it; + } + } + + TQString error; + // TODO this should check if cmd has a .desktop file, and use data from it, together + // with sending more ASN data + if (tdeinitExec(cmd, cmdTokens, &error, NULL, startup_id )) { + if (Tty != kapp->type()) { + TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Mail Client"), + i18n("Could not launch the mail client:\n\n%1").arg(error), i18n("&OK")); + } + else { + kdWarning() << "Could not launch mail client:\n" << error << endl; + } + } +} +#endif + +void TDEApplication::invokeBrowser( const TQString &url ) +{ + return invokeBrowser( url, "" ); +} + +#ifndef Q_WS_WIN +// on win32, for invoking browser we're using win32 API +// see kapplication_win.cpp +void TDEApplication::invokeBrowser( const TQString &url, const TQCString& startup_id ) +{ + TQString error; + + if (startServiceByDesktopName("kfmclient", url, &error, 0, 0, startup_id, false)) + { + if (Tty != kapp->type()) + TQMessageBox::critical(kapp->mainWidget(), i18n("Could not Launch Browser"), + i18n("Could not launch the browser:\n\n%1").arg(error), i18n("&OK")); + else + kdWarning() << "Could not launch browser:\n" << error << endl; + return; + } +} +#endif + +void TDEApplication::cut() +{ + invokeEditSlot( TQT_SLOT( cut() ) ); +} + +void TDEApplication::copy() +{ + invokeEditSlot( TQT_SLOT( copy() ) ); +} + +void TDEApplication::paste() +{ + invokeEditSlot( TQT_SLOT( paste() ) ); +} + +void TDEApplication::clear() +{ + invokeEditSlot( TQT_SLOT( clear() ) ); +} + +void TDEApplication::selectAll() +{ + invokeEditSlot( TQT_SLOT( selectAll() ) ); +} + +void TDEApplication::broadcastKeyCode(unsigned int keyCode) +{ + emit coreFakeKeyPress(keyCode); +} + +TQCString +TDEApplication::launcher() +{ + return "tdelauncher"; +} + +static int +startServiceInternal( const TQCString &function, + const TQString& _name, const TQStringList &URLs, + TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) +{ + struct serviceResult + { + int result; + TQCString dcopName; + TQString error; + pid_t pid; + }; + + // Register app as able to send DCOP messages + DCOPClient *dcopClient; + if (kapp) + dcopClient = kapp->dcopClient(); + else + dcopClient = new DCOPClient; + + if (!dcopClient->isAttached()) + { + if (!dcopClient->attach()) + { + if (error) + *error = i18n("Could not register with DCOP.\n"); + if (!kapp) + delete dcopClient; + + return -1; + } + } + TQByteArray params; + TQDataStream stream(params, IO_WriteOnly); + stream << _name << URLs; + TQCString replyType; + TQByteArray replyData; + TQCString _launcher = TDEApplication::launcher(); + TQValueList<TQCString> envs; +#ifdef Q_WS_X11 + if (tqt_xdisplay()) { + TQCString dpystring(XDisplayString(tqt_xdisplay())); + envs.append( TQCString("DISPLAY=") + dpystring ); + } else if( getenv( "DISPLAY" )) { + TQCString dpystring( getenv( "DISPLAY" )); + envs.append( TQCString("DISPLAY=") + dpystring ); + } +#endif + stream << envs; +#if defined Q_WS_X11 + // make sure there is id, so that user timestamp exists + stream << ( startup_id.isEmpty() ? TDEStartupInfo::createNewStartupId() : startup_id ); +#endif + if( function.left( 12 ) != "tdeinit_exec" ) + stream << noWait; + + if (!dcopClient->call(_launcher, _launcher, + function, params, replyType, replyData)) + { + if (error) + *error = i18n("TDELauncher could not be reached via DCOP.\n"); + if (!kapp) + delete dcopClient; + return -1; + } + if (!kapp) + delete dcopClient; + + if (noWait) + return 0; + + TQDataStream stream2(replyData, IO_ReadOnly); + serviceResult result; + stream2 >> result.result >> result.dcopName >> result.error >> result.pid; + if (dcopService) + *dcopService = result.dcopName; + if (error) + *error = result.error; + if (pid) + *pid = result.pid; + return result.result; +} + +int +TDEApplication::startServiceByName( const TQString& _name, const TQString &URL, + TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) +{ + TQStringList URLs; + if (!URL.isEmpty()) + URLs.append(URL); + return startServiceInternal( + "start_service_by_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", + _name, URLs, error, dcopService, pid, startup_id, noWait); +} + +int +TDEApplication::startServiceByName( const TQString& _name, const TQStringList &URLs, + TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) +{ + return startServiceInternal( + "start_service_by_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", + _name, URLs, error, dcopService, pid, startup_id, noWait); +} + +int +TDEApplication::startServiceByDesktopPath( const TQString& _name, const TQString &URL, + TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) +{ + TQStringList URLs; + if (!URL.isEmpty()) + URLs.append(URL); + return startServiceInternal( + "start_service_by_desktop_path(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", + _name, URLs, error, dcopService, pid, startup_id, noWait); +} + +int +TDEApplication::startServiceByDesktopPath( const TQString& _name, const TQStringList &URLs, + TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) +{ + return startServiceInternal( + "start_service_by_desktop_path(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", + _name, URLs, error, dcopService, pid, startup_id, noWait); +} + +int +TDEApplication::startServiceByDesktopName( const TQString& _name, const TQString &URL, + TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) +{ + TQStringList URLs; + if (!URL.isEmpty()) + URLs.append(URL); + return startServiceInternal( + "start_service_by_desktop_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", + _name, URLs, error, dcopService, pid, startup_id, noWait); +} + +int +TDEApplication::startServiceByDesktopName( const TQString& _name, const TQStringList &URLs, + TQString *error, TQCString *dcopService, int *pid, const TQCString& startup_id, bool noWait ) +{ + return startServiceInternal( + "start_service_by_desktop_name(TQString,TQStringList,TQValueList<TQCString>,TQCString,bool)", + _name, URLs, error, dcopService, pid, startup_id, noWait); +} + +int +TDEApplication::tdeinitExec( const TQString& name, const TQStringList &args, + TQString *error, int *pid ) +{ + return tdeinitExec( name, args, error, pid, "" ); +} + +int +TDEApplication::tdeinitExec( const TQString& name, const TQStringList &args, + TQString *error, int *pid, const TQCString& startup_id ) +{ + return startServiceInternal("tdeinit_exec(TQString,TQStringList,TQValueList<TQCString>,TQCString)", + name, args, error, 0, pid, startup_id, false); +} + +int +TDEApplication::tdeinitExecWait( const TQString& name, const TQStringList &args, + TQString *error, int *pid ) +{ + return tdeinitExecWait( name, args, error, pid, "" ); +} + +int +TDEApplication::tdeinitExecWait( const TQString& name, const TQStringList &args, + TQString *error, int *pid, const TQCString& startup_id ) +{ + return startServiceInternal("tdeinit_exec_wait(TQString,TQStringList,TQValueList<TQCString>,TQCString)", + name, args, error, 0, pid, startup_id, false); +} + +TQString TDEApplication::tempSaveName( const TQString& pFilename ) const +{ + TQString aFilename; + + if( TQDir::isRelativePath(pFilename) ) + { + kdWarning(101) << "Relative filename passed to TDEApplication::tempSaveName" << endl; + aFilename = TQFileInfo( TQDir( "." ), pFilename ).absFilePath(); + } + else + aFilename = pFilename; + + TQDir aAutosaveDir( TQDir::homeDirPath() + "/autosave/" ); + if( !aAutosaveDir.exists() ) + { + if( !aAutosaveDir.mkdir( aAutosaveDir.absPath() ) ) + { + // Last chance: use temp dir + aAutosaveDir.setPath( TDEGlobal::dirs()->saveLocation("tmp") ); + } + } + + aFilename.replace( "/", "\\!" ).prepend( "#" ).append( "#" ).prepend( "/" ).prepend( aAutosaveDir.absPath() ); + + return aFilename; +} + + +TQString TDEApplication::checkRecoverFile( const TQString& pFilename, + bool& bRecover ) const +{ + TQString aFilename; + + if( TQDir::isRelativePath(pFilename) ) + { + kdWarning(101) << "Relative filename passed to TDEApplication::tempSaveName" << endl; + aFilename = TQFileInfo( TQDir( "." ), pFilename ).absFilePath(); + } + else + aFilename = pFilename; + + TQDir aAutosaveDir( TQDir::homeDirPath() + "/autosave/" ); + if( !aAutosaveDir.exists() ) + { + if( !aAutosaveDir.mkdir( aAutosaveDir.absPath() ) ) + { + // Last chance: use temp dir + aAutosaveDir.setPath( TDEGlobal::dirs()->saveLocation("tmp") ); + } + } + + aFilename.replace( "/", "\\!" ).prepend( "#" ).append( "#" ).prepend( "/" ).prepend( aAutosaveDir.absPath() ); + + if( TQFile( aFilename ).exists() ) + { + bRecover = true; + return aFilename; + } + else + { + bRecover = false; + return pFilename; + } +} + + +bool checkAccess(const TQString& pathname, int mode) +{ + int accessOK = access( TQFile::encodeName(pathname), mode ); + if ( accessOK == 0 ) + return true; // OK, I can really access the file + + // else + // if we want to write the file would be created. Check, if the + // user may write to the directory to create the file. + if ( (mode & W_OK) == 0 ) + return false; // Check for write access is not part of mode => bail out + + + if (!access( TQFile::encodeName(pathname), F_OK)) // if it already exists + return false; + + //strip the filename (everything until '/' from the end + TQString dirName(pathname); + int pos = dirName.findRev('/'); + if ( pos == -1 ) + return false; // No path in argument. This is evil, we won't allow this + else if ( pos == 0 ) // don't turn e.g. /root into an empty string + pos = 1; + + dirName.truncate(pos); // strip everything starting from the last '/' + + accessOK = access( TQFile::encodeName(dirName), W_OK ); + // -?- Can I write to the accessed diretory + if ( accessOK == 0 ) + return true; // Yes + else + return false; // No +} + +void TDEApplication::setTopWidget( TQWidget *topWidget ) +{ + if( !topWidget ) + return; + + // set the specified caption + if ( !topWidget->inherits("TDEMainWindow") ) { // TDEMainWindow does this already for us + topWidget->setCaption( caption() ); + } + + // set the specified icons + topWidget->setIcon( icon() ); //standard X11 +#if defined Q_WS_X11 +//#ifdef Q_WS_X11 // FIXME(E): Implement for Qt/Embedded + KWin::setIcons(topWidget->winId(), icon(), miniIcon() ); // NET_WM hints for KWin + + // set the app startup notification window property + TDEStartupInfo::setWindowStartupId( topWidget->winId(), startupId()); +#endif +} + +TQCString TDEApplication::startupId() const +{ + return d->startup_id; +} + +void TDEApplication::setStartupId( const TQCString& startup_id ) +{ + if( startup_id == d->startup_id ) + return; +#if defined Q_WS_X11 + TDEStartupInfo::handleAutoAppStartedSending(); // finish old startup notification if needed +#endif + if( startup_id.isEmpty()) + d->startup_id = "0"; + else + { + d->startup_id = startup_id; +#if defined Q_WS_X11 + TDEStartupInfoId id; + id.initId( startup_id ); + long timestamp = id.timestamp(); + if( timestamp != 0 ) + updateUserTimestamp( timestamp ); +#endif + } +} + +// read the startup notification env variable, save it and unset it in order +// not to propagate it to processes started from this app +void TDEApplication::read_app_startup_id() +{ +#if defined Q_WS_X11 + TDEStartupInfoId id = TDEStartupInfo::currentStartupIdEnv(); + TDEStartupInfo::resetStartupEnv(); + d->startup_id = id.id(); +#endif +} + +int TDEApplication::random() +{ + static bool init = false; + if (!init) + { + unsigned int seed; + init = true; + int fd = open("/dev/urandom", O_RDONLY); + if (fd < 0 || ::read(fd, &seed, sizeof(seed)) != sizeof(seed)) + { + // No /dev/urandom... try something else. + srand(getpid()); + seed = rand()+time(0); + } + if (fd >= 0) close(fd); + srand(seed); + } + return rand(); +} + +TQString TDEApplication::randomString(int length) +{ + if (length <=0 ) return TQString::null; + + TQString str; str.setLength( length ); + int i = 0; + while (length--) + { + int r=random() % 62; + r+=48; + if (r>57) r+=7; + if (r>90) r+=6; + str[i++] = char(r); + // so what if I work backwards? + } + return str; +} + +bool TDEApplication::authorize(const TQString &genericAction) +{ + if (!d->actionRestrictions) + return true; + + TDEConfig *config = TDEGlobal::config(); + TDEConfigGroupSaver saver( config, "KDE Action Restrictions" ); + return config->readBoolEntry(genericAction, true); +} + +bool TDEApplication::authorizeTDEAction(const char *action) +{ + if (!d->actionRestrictions || !action) + return true; + + static const TQString &action_prefix = TDEGlobal::staticQString( "action/" ); + + return authorize(action_prefix + action); +} + +bool TDEApplication::authorizeControlModule(const TQString &menuId) +{ + if (menuId.isEmpty() || kde_kiosk_exception) + return true; + TDEConfig *config = TDEGlobal::config(); + TDEConfigGroupSaver saver( config, "TDE Control Module Restrictions" ); + return config->readBoolEntry(menuId, true); +} + +TQStringList TDEApplication::authorizeControlModules(const TQStringList &menuIds) +{ + TDEConfig *config = TDEGlobal::config(); + TDEConfigGroupSaver saver( config, "TDE Control Module Restrictions" ); + TQStringList result; + for(TQStringList::ConstIterator it = menuIds.begin(); + it != menuIds.end(); ++it) + { + if (config->readBoolEntry(*it, true)) + result.append(*it); + } + return result; +} + +void TDEApplication::initUrlActionRestrictions() +{ + d->urlActionRestrictions.setAutoDelete(true); + d->urlActionRestrictions.clear(); + d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule + ("open", TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, true)); + d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule + ("list", TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, true)); +// TEST: +// d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule +// ("list", TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, false)); +// d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule +// ("list", TQString::null, TQString::null, TQString::null, "file", TQString::null, TQDir::homeDirPath(), true)); + d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule + ("link", TQString::null, TQString::null, TQString::null, ":internet", TQString::null, TQString::null, true)); + d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule + ("redirect", TQString::null, TQString::null, TQString::null, ":internet", TQString::null, TQString::null, true)); + + // We allow redirections to file: but not from internet protocols, redirecting to file: + // is very popular among io-slaves and we don't want to break them + d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule + ("redirect", TQString::null, TQString::null, TQString::null, "file", TQString::null, TQString::null, true)); + d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule + ("redirect", ":internet", TQString::null, TQString::null, "file", TQString::null, TQString::null, false)); + + // local protocols may redirect everywhere + d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule + ("redirect", ":local", TQString::null, TQString::null, TQString::null, TQString::null, TQString::null, true)); + + // Anyone may redirect to about: + d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule + ("redirect", TQString::null, TQString::null, TQString::null, "about", TQString::null, TQString::null, true)); + + // Anyone may redirect to itself, cq. within it's own group + d->urlActionRestrictions.append( new TDEApplicationPrivate::URLActionRule + ("redirect", TQString::null, TQString::null, TQString::null, "=", TQString::null, TQString::null, true)); + + TDEConfig *config = TDEGlobal::config(); + TDEConfigGroupSaver saver( config, "KDE URL Restrictions" ); + int count = config->readNumEntry("rule_count"); + TQString keyFormat = TQString("rule_%1"); + for(int i = 1; i <= count; i++) + { + TQString key = keyFormat.arg(i); + TQStringList rule = config->readListEntry(key); + if (rule.count() != 8) + continue; + TQString action = rule[0]; + TQString refProt = rule[1]; + TQString refHost = rule[2]; + TQString refPath = rule[3]; + TQString urlProt = rule[4]; + TQString urlHost = rule[5]; + TQString urlPath = rule[6]; + TQString strEnabled = rule[7].lower(); + + bool bEnabled = (strEnabled == "true"); + + if (refPath.startsWith("$HOME")) + refPath.replace(0, 5, TQDir::homeDirPath()); + else if (refPath.startsWith("~")) + refPath.replace(0, 1, TQDir::homeDirPath()); + if (urlPath.startsWith("$HOME")) + urlPath.replace(0, 5, TQDir::homeDirPath()); + else if (urlPath.startsWith("~")) + urlPath.replace(0, 1, TQDir::homeDirPath()); + + if (refPath.startsWith("$TMP")) + refPath.replace(0, 4, TDEGlobal::dirs()->saveLocation("tmp")); + if (urlPath.startsWith("$TMP")) + urlPath.replace(0, 4, TDEGlobal::dirs()->saveLocation("tmp")); + + d->urlActionRestrictions.append(new TDEApplicationPrivate::URLActionRule + ( action, refProt, refHost, refPath, urlProt, urlHost, urlPath, bEnabled)); + } +} + +void TDEApplication::allowURLAction(const TQString &action, const KURL &_baseURL, const KURL &_destURL) +{ + if (authorizeURLAction(action, _baseURL, _destURL)) + return; + + d->urlActionRestrictions.append(new TDEApplicationPrivate::URLActionRule + ( action, _baseURL.protocol(), _baseURL.host(), _baseURL.path(-1), + _destURL.protocol(), _destURL.host(), _destURL.path(-1), true)); +} + +bool TDEApplication::authorizeURLAction(const TQString &action, const KURL &_baseURL, const KURL &_destURL) +{ + if (_destURL.isEmpty()) + return true; + + bool result = false; + if (d->urlActionRestrictions.isEmpty()) + initUrlActionRestrictions(); + + KURL baseURL(_baseURL); + baseURL.setPath(TQDir::cleanDirPath(baseURL.path())); + TQString baseClass = KProtocolInfo::protocolClass(baseURL.protocol()); + KURL destURL(_destURL); + destURL.setPath(TQDir::cleanDirPath(destURL.path())); + TQString destClass = KProtocolInfo::protocolClass(destURL.protocol()); + + for(TDEApplicationPrivate::URLActionRule *rule = d->urlActionRestrictions.first(); + rule; rule = d->urlActionRestrictions.next()) + { + if ((result != rule->permission) && // No need to check if it doesn't make a difference + (action == rule->action) && + rule->baseMatch(baseURL, baseClass) && + rule->destMatch(destURL, destClass, baseURL, baseClass)) + { + result = rule->permission; + } + } + return result; +} + + +uint TDEApplication::keyboardModifiers() +{ +#ifdef Q_WS_X11 + Window root; + Window child; + int root_x, root_y, win_x, win_y; + uint keybstate; + XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child, + &root_x, &root_y, &win_x, &win_y, &keybstate ); + return keybstate & 0x00ff; +#elif defined W_WS_MACX + return GetCurrentEventKeyModifiers() & 0x00ff; +#else + //TODO for win32 + return 0; +#endif +} + +uint TDEApplication::mouseState() +{ + uint mousestate; +#ifdef Q_WS_X11 + Window root; + Window child; + int root_x, root_y, win_x, win_y; + XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child, + &root_x, &root_y, &win_x, &win_y, &mousestate ); +#elif defined(Q_WS_WIN) + const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON); + if (GetAsyncKeyState(VK_LBUTTON)) + mousestate |= (mousebtn_swapped ? Button3Mask : Button1Mask); + if (GetAsyncKeyState(VK_MBUTTON)) + mousestate |= Button2Mask; + if (GetAsyncKeyState(VK_RBUTTON)) + mousestate |= (mousebtn_swapped ? Button1Mask : Button3Mask); +#elif defined(Q_WS_MACX) + mousestate = GetCurrentEventButtonState(); +#else + //TODO: other platforms +#endif + return mousestate & 0xff00; +} + +TQ_ButtonState TDEApplication::keyboardMouseState() +{ + int ret = 0; +#ifdef Q_WS_X11 + Window root; + Window child; + int root_x, root_y, win_x, win_y; + uint state; + XQueryPointer( tqt_xdisplay(), tqt_xrootwin(), &root, &child, + &root_x, &root_y, &win_x, &win_y, &state ); + // transform the same way like Qt's qt_x11_translateButtonState() + if( state & Button1Mask ) + ret |= TQ_LeftButton; + if( state & Button2Mask ) + ret |= TQ_MidButton; + if( state & Button3Mask ) + ret |= TQ_RightButton; + if( state & ShiftMask ) + ret |= TQ_ShiftButton; + if( state & ControlMask ) + ret |= TQ_ControlButton; + if( state & KKeyNative::modX( KKey::ALT )) + ret |= TQ_AltButton; + if( state & KKeyNative::modX( KKey::WIN )) + ret |= TQ_MetaButton; +#elif defined(Q_WS_WIN) + const bool mousebtn_swapped = GetSystemMetrics(SM_SWAPBUTTON); + if (GetAsyncKeyState(VK_LBUTTON)) + ret |= (mousebtn_swapped ? RightButton : LeftButton); + if (GetAsyncKeyState(VK_MBUTTON)) + ret |= TQ_MidButton; + if (GetAsyncKeyState(VK_RBUTTON)) + ret |= (mousebtn_swapped ? TQ_LeftButton : TQ_RightButton); + if (GetAsyncKeyState(VK_SHIFT)) + ret |= TQ_ShiftButton; + if (GetAsyncKeyState(VK_CONTROL)) + ret |= TQ_ControlButton; + if (GetAsyncKeyState(VK_MENU)) + ret |= TQ_AltButton; + if (GetAsyncKeyState(VK_LWIN) || GetAsyncKeyState(VK_RWIN)) + ret |= TQ_MetaButton; +#else + //TODO: other platforms +#endif + return static_cast< ButtonState >( ret ); +} + +void TDEApplication::installSigpipeHandler() +{ +#ifdef Q_OS_UNIX + struct sigaction act; + act.sa_handler = SIG_IGN; + sigemptyset( &act.sa_mask ); + act.sa_flags = 0; + sigaction( SIGPIPE, &act, 0 ); +#endif +} + +void TDEApplication::sigpipeHandler(int) +{ + int saved_errno = errno; + // Using kdDebug from a signal handler is not a good idea. +#ifndef NDEBUG + char msg[1000]; + sprintf(msg, "*** SIGPIPE *** (ignored, pid = %ld)\n", (long) getpid()); + if (write(2, msg, strlen(msg)) < 0) { + // ERROR + } +#endif + + // Do nothing. + errno = saved_errno; +} + +bool TDEApplication::guiEnabled() +{ + return kapp && kapp->d->guiEnabled; +} + +void TDEApplication::virtual_hook( int id, void* data ) +{ TDEInstance::virtual_hook( id, data ); } + +void KSessionManaged::virtual_hook( int, void* ) +{ /*BASE::virtual_hook( id, data );*/ } + +#include "tdeapplication.moc" diff --git a/tdecore/tdeapplication.h b/tdecore/tdeapplication.h new file mode 100644 index 000000000..5ab8d7ee7 --- /dev/null +++ b/tdecore/tdeapplication.h @@ -0,0 +1,1620 @@ +/* This file is part of the KDE libraries + Copyright (C) 1997 Matthias Kalle Dalheimer (kalle@kde.org) + Copyright (c) 1998, 1999 KDE Team + + 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 _KAPP_H +#define _KAPP_H + +// Version macros. Never put this further down. +#include "tdeversion.h" +#include "tdelibs_export.h" + +class TDEConfig; +class KCharsets; +class DCOPClient; +class DCOPObject; + +#include <tqtglobaldefines.h> + +typedef unsigned long Atom; +#if !defined(Q_WS_X11) +typedef void Display; +#endif + +#include <tqapplication.h> +#include <tqpixmap.h> +#include <kinstance.h> + +struct _IceConn; +class TQPopupMenu; +class TQStrList; +class KSessionManaged; +class TDEStyle; +class KURL; + +#define kapp TDEApplication::kApplication() + +class TDEApplicationPrivate; + +/** +* Controls and provides information to all KDE applications. +* +* Only one object of this class can be instantiated in a single app. +* This instance is always accessible via the 'kapp' global variable. +* See cut() for an example. +* +* This class provides the following services to all KDE applications. +* +* @li It controls the event queue (see TQApplication ). +* @li It provides the application with KDE resources such as +* accelerators, common menu entries, a TDEConfig object. session +* management events, help invocation etc. +* @li Installs a signal handler for the SIGCHLD signal in order to +* avoid zombie children. If you want to catch this signal yourself or +* don't want it to be caught at all, you have set a new signal handler +* (or SIG_IGN) after TDEApplication's constructor has run. +* @li Installs an empty signal handler for the SIGPIPE signal using +* installSigpipeHandler(). If you want to catch this signal +* yourself, you have set a new signal handler after TDEApplication's +* constructor has run. +* @li It can start new services +* +* +* The way a service gets started depends on the 'X-DCOP-ServiceType' +* entry in the desktop file of the service: +* +* There are three possibilities: +* @li X-DCOP-ServiceType=None (default) +* Always start a new service, +* don't wait till the service registers with dcop. +* @li X-DCOP-ServiceType=Multi +* Always start a new service, +* wait until the service has registered with dcop. +* @li X-DCOP-ServiceType=Unique +* Only start the service if it isn't already running, +* wait until the service has registered with dcop. +* +* @short Controls and provides information to all KDE applications. +* @author Matthias Kalle Dalheimer <kalle@kde.org> +*/ +class TDECORE_EXPORT TDEApplication : public TQApplication, public TDEInstance +{ + + Q_OBJECT +public: + /** Position of the caption (presumably in the application window's + * title bar). This enum appears to be unused. + * + * @todo Find out if this is used anywhere. + */ + enum CaptionLayout { + CaptionAppLast=1 /**< Display the application name last (before document name). */, + CaptionAppFirst /**< Display the application name first. */ , + CaptionNoApp /**< Do not display application name at all. */ + }; + + /** + * This constructor takes aboutData and command line + * arguments from TDECmdLineArgs. + * + * If ARGB (transparent) widgets are to be used in your application, + * please use + * TDEApplication app(TDEApplication::openX11RGBADisplay()); + * or + * TDEApplication app(TDEApplication::openX11RGBADisplay(), useStyles); + * + * @param allowStyles Set to false to disable the loading on plugin based + * styles. This is only useful to applications that do not display a GUI + * normally. If you do create an application with @p allowStyles set to false + * it normally runs in the background but under special circumstances + * displays widgets. Call enableStyles() before displaying any widgets. + * + * @param GUIenabled Set to false to disable all GUI stuff. This implies + * no styles either. + */ + TDEApplication( bool allowStyles=true, bool GUIenabled=true); + +#ifdef Q_WS_X11 + /** + * Constructor. Parses command-line arguments. Use this constructor when you + * you want ARGB support to be automatically detected and enabled. + * + * @param display Will be passed to Qt as the X display. The display must be + * valid and already opened. + * + * @param allowStyles Set to false to disable the loading on plugin based + * styles. This is only useful to applications that do not display a GUI + * normally. If you do create an application with @p allowStyles set to false + * that normally runs in the background but under special circumstances + * displays widgets call enableStyles() before displaying any widgets. + * + * @since KDE 3.5 + * + * @see RGBADisplay() + */ + TDEApplication(Display *display, bool allowStyles); + + /** + * Constructor. Parses command-line arguments. Use this constructor when you + * you want ARGB support to be automatically detected and enabled. + * + * @param display Will be passed to Qt as the X display. The display must be + * valid and already opened. + * + * @param disable_argb Set to true to disable ARGB visuals in this application. + * + * @param display Will be passed to Qt as the X display. The display must be + * valid and already opened. + * + * @param visual A pointer to the X11 visual that should be used by the + * appliction. Note that only TrueColor visuals are supported on depths + * greater than 8 bpp. If this parameter is NULL, the default visual will + * be used instead. + * + * @param allowStyles Set to false to disable the loading on plugin based + * styles. This is only useful to applications that do not display a GUI + * normally. If you do create an application with @p allowStyles set to false + * that normally runs in the background but under special circumstances + * displays widgets call enableStyles() before displaying any widgets. + * + * @since KDE 3.5 + * + * @see RGBADisplay() + */ + TDEApplication(Display *display, bool disable_argb, Qt::HANDLE visual, Qt::HANDLE colormap, bool allowStyles); + + /** + * Constructor. Parses command-line arguments. Use this constructor when you + * you need to use a non-default visual or colormap. + * + * @param display Will be passed to Qt as the X display. The display must be + * valid and already opened. + * + * @param visual A pointer to the X11 visual that should be used by the + * appliction. Note that only TrueColor visuals are supported on depths + * greater than 8 bpp. If this parameter is NULL, the default visual will + * be used instead. + * + * @param colormap The colormap that should be used by the application. If + * this parameter is 0, the default colormap will be used instead. + * + * @param allowStyles Set to false to disable the loading on plugin based + * styles. This is only useful to applications that do not display a GUI + * normally. If you do create an application with @p allowStyles set to false + * that normally runs in the background but under special circumstances + * displays widgets call enableStyles() before displaying any widgets. + * + * @since KDE 3.3 + */ + TDEApplication(Display *display, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0, + bool allowStyles=true); + + /** + * Constructor. Parses command-line arguments. Use this constructor to use TDEApplication + * in a Motif or Xt program. + * + * @param display Will be passed to Qt as the X display. The display must be valid and already + * opened. + * + * @param argc command line argument count + * + * @param argv command line argument value(s) + * + * @param rAppName application name. Will be used for finding the + * associated message files and icon files, and as the default + * registration name for DCOP. This is a mandatory parameter. + * + * @param allowStyles Set to false to disable the loading on plugin based + * styles. This is only useful to applications that do not display a GUI + * normally. If you do create an application with @p allowStyles set to false + * that normally runs in the background but under special circumstances + * displays widgets call enableStyles() before displaying any widgets. + * + * @param GUIenabled Set to false to disable all GUI stuff. This implies + * no styles either. + */ + TDEApplication(Display *display, int& argc, char** argv, const TQCString& rAppName, + bool allowStyles=true, bool GUIenabled=true); +#endif + + /** + * @deprecated do not use it at all, it will make your application crash, use TDECmdLineArgs + * + * Constructor. Parses command-line arguments. + * + * @param argc command line argument count + * + * @param argv command line argument value(s) + * + * @param rAppName application name. Will be used for finding the + * associated message files and icon files, and as the default + * registration name for DCOP. This is a mandatory parameter. + * + * @param allowStyles Set to false to disable the loading on plugin based + * styles. This is only useful to applications that do not display a GUI + * normally. If you do create an application with @p allowStyles set to false + * that normally runs in the background but under special circumstances + * displays widgets call enableStyles() before displaying any widgets. + * + * @param GUIenabled Set to false to disable all GUI stuff. This implies + * no styles either. + */ + // REMOVE FOR KDE 4.0 - using it only gives crashing applications because + // TDECmdLineArgs::init isn't called + TDEApplication(int& argc, char** argv, + const TQCString& rAppName, bool allowStyles=true, bool GUIenabled=true) KDE_DEPRECATED; + + /** + * Add Qt and KDE command line options to TDECmdLineArgs. + */ + static void addCmdLineOptions(); + + virtual ~TDEApplication(); + + /** + * Returns the current application object. + * + * This is similar to the global TQApplication pointer tqApp. It + * allows access to the single global TDEApplication object, since + * more than one cannot be created in the same application. It + * saves you the trouble of having to pass the pointer explicitly + * to every function that may require it. + * @return the current application object + */ + static TDEApplication* kApplication() { return KApp; } + + /** + * Returns the application session config object. + * + * @return A pointer to the application's instance specific + * TDEConfig object. + * @see TDEConfig + */ + TDEConfig* sessionConfig(); + + /** + * Is the application restored from the session manager? + * + * @return If true, this application was restored by the session manager. + * Note that this may mean the config object returned by + * sessionConfig() contains data saved by a session closedown. + * @see sessionConfig() + */ + bool isRestored() const { return TQApplication::isSessionRestored(); } + + /** + * Disables session management for this application. + * + * Useful in case your application is started by the + * initial "starttde" script. + */ + void disableSessionManagement(); + + /** + * Enables again session management for this application, formerly + * disabled by calling disableSessionManagement(). You usually + * shouldn't call this function, as the session management is enabled + * by default. + */ + void enableSessionManagement(); + + /** + * The possible values for the @p confirm parameter of requestShutDown(). + */ + enum ShutdownConfirm { + /** + * Obey the user's confirmation setting. + */ + ShutdownConfirmDefault = -1, + /** + * Don't confirm, shutdown without asking. + */ + ShutdownConfirmNo = 0, + /** + * Always confirm, ask even if the user turned it off. + */ + ShutdownConfirmYes = 1 + }; + + /** + * The possible values for the @p sdtype parameter of requestShutDown(). + */ + enum ShutdownType { + /** + * Select previous action or the default if it's the first time. + */ + ShutdownTypeDefault = -1, + /** + * Only log out. + */ + ShutdownTypeNone = 0, + /** + * Log out and reboot the machine. + */ + ShutdownTypeReboot = 1, + /** + * Log out and halt the machine. + */ + ShutdownTypeHalt = 2 + }; + + /** + * The possible values for the @p sdmode parameter of requestShutDown(). + */ + enum ShutdownMode { + /** + * Select previous mode or the default if it's the first time. + */ + ShutdownModeDefault = -1, + /** + * Schedule a shutdown (halt or reboot) for the time all active sessions + * have exited. + */ + ShutdownModeSchedule = 0, + /** + * Shut down, if no sessions are active. Otherwise do nothing. + */ + ShutdownModeTryNow = 1, + /** + * Force shutdown. Kill any possibly active sessions. + */ + ShutdownModeForceNow = 2, + /** + * Pop up a dialog asking the user what to do if sessions are still active. + */ + ShutdownModeInteractive = 3 + }; + + /** + * Asks the session manager to shut the session down. + * + * Using @p confirm == ShutdownConfirmYes or @p sdtype != ShutdownTypeDefault or + * @p sdmode != ShutdownModeDefault causes the use of ksmserver's DCOP + * interface. The remaining two combinations use the standard XSMP and + * will work with any session manager compliant with it. + * + * @param confirm Whether to ask the user if he really wants to log out. + * ShutdownConfirm + * @param sdtype The action to take after logging out. ShutdownType + * @param sdmode If/When the action should be taken. ShutdownMode + * @return true on success, false if the session manager could not be + * contacted. + */ + bool requestShutDown( ShutdownConfirm confirm = ShutdownConfirmDefault, + ShutdownType sdtype = ShutdownTypeDefault, + ShutdownMode sdmode = ShutdownModeDefault ); + + /** + * Propagates the network address of the session manager in the + * SESSION_MANAGER environment variable so that child processes can + * pick it up. + * + * If SESSION_MANAGER isn't defined yet, the address is searched in + * $HOME/.KSMserver. + * + * This function is called by clients that are started outside the + * session ( i.e. before ksmserver is started), but want to launch + * other processes that should participate in the session. Examples + * are kdesktop or kicker. + */ + void propagateSessionManager(); + + /** + * Reimplemented for internal purposes, mainly the highlevel + * handling of session management with KSessionManaged. + * @internal + */ + void commitData( TQSessionManager& sm ); + + /** + * Reimplemented for internal purposes, mainly the highlevel + * handling of session management with KSessionManaged. + * @internal + */ + void saveState( TQSessionManager& sm ); + + /** + * Returns true if the application is currently saving its session + * data (most probably before KDE logout). This is intended for use + * mainly in TDEMainWindow::queryClose() and TDEMainWindow::queryExit(). + * + * @see TDEMainWindow::queryClose + * @see TDEMainWindow::queryExit + * @since 3.1.1 + */ + bool sessionSaving() const; + + /** + * Returns a pointer to a DCOPClient for the application. + * If a client does not exist yet, it is created when this + * function is called. + * @return the DCOPClient for the application + */ + static DCOPClient *dcopClient(); + + /** + * Disable automatic dcop registration + * Must be called before creating a TDEApplication instance to have an effect. + */ + static void disableAutoDcopRegistration(); + + /** + * Returns a TQPixmap with the application icon. + * @return the application icon + */ + TQPixmap icon() const; + + /** + * Returns the name of the application icon. + * @return the icon's name + */ + TQString iconName() const; + + /** + * Returns the mini-icon for the application as a TQPixmap. + * @return the application's mini icon + */ + TQPixmap miniIcon() const; + + /** + * Returns the name of the mini-icon for the application. + * @return the mini icon's name + */ + TQString miniIconName() const; + + /** + * Sets the top widget of the application. + * This means basically applying the right window caption and + * icon. An application may have several top widgets. You don't + * need to call this function manually when using TDEMainWindow. + * + * @param topWidget A top widget of the application. + * + * @see icon(), caption() + **/ + void setTopWidget( TQWidget *topWidget ); + + /** + * Invokes the KHelpCenter HTML help viewer from docbook sources. + * + * @param anchor This has to be a defined anchor in your + * docbook sources. If empty the main index + * is loaded + * @param appname This allows you to show the help of another + * application. If empty the current name() is + * used + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + */ + void invokeHelp( const TQString& anchor, + const TQString& appname, + const TQCString& startup_id ) const; + + // KDE4 merge with above with startup_id = "" + void invokeHelp( const TQString& anchor = TQString::null, + const TQString& appname = TQString::null ) const; + + /** + * @deprecated + * Invoke the khelpcenter HTML help viewer from HTML sources. + * Please use invokeHelp() instead. + * + * @param aFilename The filename that is to be loaded. Its + * location is computed automatically + * according to the KFSSTND. If @p aFilename + * is empty, the logical appname with .html + * appended to it is used. + * @param aTopic This allows context-sensitive help. Its + * value will be appended to the filename, + * prefixed with a "#" (hash) character. + */ + void invokeHTMLHelp( const TQString& aFilename, const TQString& aTopic = TQString::null ) const KDE_DEPRECATED; + + /** + * Convenience method; invokes the standard email application. + * + * @param address The destination address + * @param subject Subject string. Can be TQString::null. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + */ + void invokeMailer( const TQString &address, const TQString &subject, const TQCString& startup_id ); + // KDE4 merge with above with startup_id = "" + void invokeMailer( const TQString &address, const TQString &subject ); + + /** + * Invokes the standard email application. + * + * @param mailtoURL A mailto URL. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + * @param allowAttachments whether attachments specified in mailtoURL should be honoured. + The default is false; do not honour requests for attachments. + */ + void invokeMailer( const KURL &mailtoURL, const TQCString& startup_id, bool allowAttachments ); + // KDE4 merge with above with allowAttachments = false + void invokeMailer( const KURL &mailtoURL, const TQCString& startup_id ); + // KDE4 merge with above with startup_id = "" + void invokeMailer( const KURL &mailtoURL ); + + /** + * Convenience method; invokes the standard email application. + * + * All parameters are optional. + * + * @param to The destination address. + * @param cc The Cc field + * @param bcc The Bcc field + * @param subject Subject string + * @param body A string containing the body of the mail (exclusive with messageFile) + * @param messageFile A file (URL) containing the body of the mail (exclusive with body) - currently unsupported + * @param attachURLs List of URLs to be attached to the mail. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + */ + void invokeMailer(const TQString &to, const TQString &cc, const TQString &bcc, + const TQString &subject, const TQString &body, + const TQString &messageFile, const TQStringList &attachURLs, + const TQCString& startup_id ); + // KDE4 merge with above with startup_id = "" + void invokeMailer(const TQString &to, const TQString &cc, const TQString &bcc, + const TQString &subject, const TQString &body, + const TQString &messageFile = TQString::null, const TQStringList &attachURLs = TQStringList()); + +public slots: + /** + * Invokes the standard browser. + * Note that you should only do this when you know for sure that the browser can + * handle the URL (i.e. its mimetype). In doubt, if the URL can point to an image + * or anything else than directory or HTML, prefer to use new KRun( url ). + * + * @param url The destination address + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + */ + void invokeBrowser( const TQString &url, const TQCString& startup_id ); + // KDE4 merge with above with startup_id = "" + /** + * Invoke the standard browser. Uses a @p startup_id of "" (empty) + * and is otherwise the same as the above function. + */ + void invokeBrowser( const TQString &url ); + + /** + * If the widget with focus provides a cut() slot, call that slot. Thus for a + * simple application cut can be implemented as: + * \code + * KStdAction::cut( kapp, TQT_SLOT( cut() ), actionCollection() ); + * \endcode + */ + void cut(); + + /** + * If the widget with focus provides a copy() slot, call that slot. Thus for a + * simple application copy can be implemented as: + * \code + * KStdAction::copy( kapp, TQT_SLOT( copy() ), actionCollection() ); + * \endcode + */ + void copy(); + + /** + * If the widget with focus provides a paste() slot, call that slot. Thus for a + * simple application copy can be implemented as: + * \code + * KStdAction::paste( kapp, TQT_SLOT( paste() ), actionCollection() ); + * \endcode + */ + void paste(); + + /** + * If the widget with focus provides a clear() slot, call that slot. Thus for a + * simple application clear() can be implemented as: + * \code + * new TDEAction( i18n( "Clear" ), "editclear", 0, kapp, TQT_SLOT( clear() ), actionCollection(), "clear" ); + * \endcode + * + * Note that for some widgets, this may not provide the intended bahavior. For + * example if you make use of the code above and a TDEListView has the focus, clear() + * will clear all of the items in the list. If this is not the intened behavior + * and you want to make use of this slot, you can subclass TDEListView and reimplement + * this slot. For example the following code would implement a TDEListView without this + * behavior: + * + * \code + * class MyListView : public TDEListView { + * Q_OBJECT + * public: + * MyListView( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ) : TDEListView( parent, name, f ) {} + * virtual ~MyListView() {} + * public slots: + * virtual void clear() {} + * }; + * \endcode + */ + void clear(); + + /** + * If the widget with focus provides a selectAll() slot, call that slot. Thus for a + * simple application select all can be implemented as: + * \code + * KStdAction::selectAll( kapp, TQT_SLOT( selectAll() ), actionCollection() ); + * \endcode + */ + void selectAll(); + + /** + * Broadcast a received keycode to all listening KDE applications + * The primary use for this feature is to connect hotkeys such as + * XF86Display to their respective TDEGlobalAccel functions while + * the screen is locked by kdesktop_lock. + */ + void broadcastKeyCode(unsigned int keyCode); + +public: + /** + * Returns the DCOP name of the service launcher. This will be something like + * klaucher_$host_$uid. + * @return the name of the service launcher + */ + static TQCString launcher(); + + /** + * Starts a service based on the (translated) name of the service. + * E.g. "Web Browser" + * + * @param _name the name of the service + * @param URL if not empty this URL is passed to the service + * @param error On failure, @p error contains a description of the error + * that occurred. If the pointer is 0, the argument will be + * ignored + * @param dcopService On success, @p dcopService contains the DCOP name + * under which this service is available. If empty, the service does + * not provide DCOP services. If the pointer is 0 the argument + * will be ignored + * @param pid On success, the process id of the new service will be written + * here. If the pointer is 0, the argument will be ignored. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + * @param noWait if set, the function does not wait till the service is running. + * @return an error code indicating success (== 0) or failure (> 0). + */ + static int startServiceByName( const TQString& _name, const TQString &URL, + TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id = "", bool noWait = false ); + + /** + * Starts a service based on the (translated) name of the service. + * E.g. "Web Browser" + * + * @param _name the name of the service + * @param URLs if not empty these URLs will be passed to the service + * @param error On failure, @p error contains a description of the error + * that occurred. If the pointer is 0, the argument will be + * ignored + * @param dcopService On success, @p dcopService contains the DCOP name + * under which this service is available. If empty, the service does + * not provide DCOP services. If the pointer is 0 the argument + * will be ignored + * @param pid On success, the process id of the new service will be written + * here. If the pointer is 0, the argument will be ignored. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + * @param noWait if set, the function does not wait till the service is running. + * @return an error code indicating success (== 0) or failure (> 0). + */ + static int startServiceByName( const TQString& _name, const TQStringList &URLs=TQStringList(), + TQString *error=0, TQCString *dcopService=0, int *pid=0, const TQCString &startup_id = "", bool noWait = false ); + + /** + * Starts a service based on the desktop path of the service. + * E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop" + * + * @param _name the path of the desktop file + * @param URL if not empty this URL is passed to the service + * @param error On failure, @p error contains a description of the error + * that occurred. If the pointer is 0, the argument will be + * ignored + * @param dcopService On success, @p dcopService contains the DCOP name + * under which this service is available. If empty, the service does + * not provide DCOP services. If the pointer is 0 the argument + * will be ignored + * @param pid On success, the process id of the new service will be written + * here. If the pointer is 0, the argument will be ignored. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + * @param noWait if set, the function does not wait till the service is running. + * @return an error code indicating success (== 0) or failure (> 0). + */ + static int startServiceByDesktopPath( const TQString& _name, const TQString &URL, + TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false ); + + /** + * Starts a service based on the desktop path of the service. + * E.g. "Applications/konqueror.desktop" or "/home/user/bla/myfile.desktop" + * + * @param _name the path of the desktop file + * @param URLs if not empty these URLs will be passed to the service + * @param error On failure, @p error contains a description of the error + * that occurred. If the pointer is 0, the argument will be + * ignored + * @param dcopService On success, @p dcopService contains the DCOP name + * under which this service is available. If empty, the service does + * not provide DCOP services. If the pointer is 0 the argument + * will be ignored + * @param pid On success, the process id of the new service will be written + * here. If the pointer is 0, the argument will be ignored. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + * @param noWait if set, the function does not wait till the service is running. + * @return an error code indicating success (== 0) or failure (> 0). + */ + static int startServiceByDesktopPath( const TQString& _name, const TQStringList &URLs=TQStringList(), + TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false ); + + /** + * Starts a service based on the desktop name of the service. + * E.g. "konqueror" + * + * @param _name the desktop name of the service + * @param URL if not empty this URL is passed to the service + * @param error On failure, @p error contains a description of the error + * that occurred. If the pointer is 0, the argument will be + * ignored + * @param dcopService On success, @p dcopService contains the DCOP name + * under which this service is available. If empty, the service does + * not provide DCOP services. If the pointer is 0 the argument + * will be ignored + * @param pid On success, the process id of the new service will be written + * here. If the pointer is 0, the argument will be ignored. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + * @param noWait if set, the function does not wait till the service is running. + * @return an error code indicating success (== 0) or failure (> 0). + */ + static int startServiceByDesktopName( const TQString& _name, const TQString &URL, + TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false ); + + /** + * Starts a service based on the desktop name of the service. + * E.g. "konqueror" + * + * @param _name the desktop name of the service + * @param URLs if not empty these URLs will be passed to the service + * @param error On failure, @p error contains a description of the error + * that occurred. If the pointer is 0, the argument will be + * ignored + * @param dcopService On success, @p dcopService contains the DCOP name + * under which this service is available. If empty, the service does + * not provide DCOP services. If the pointer is 0 the argument + * will be ignored + * @param pid On success, the process id of the new service will be written + * here. If the pointer is 0, the argument will be ignored. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + * @param noWait if set, the function does not wait till the service is running. + * @return an error code indicating success (== 0) or failure (> 0). + */ + static int startServiceByDesktopName( const TQString& _name, const TQStringList &URLs=TQStringList(), + TQString *error=0, TQCString *dcopService=0, int *pid = 0, const TQCString &startup_id = "", bool noWait = false ); + + /** + * Starts a program via tdeinit. + * + * program name and arguments are converted to according to the + * local encoding and passed as is to tdeinit. + * + * @param name Name of the program to start + * @param args Arguments to pass to the program + * @param error On failure, @p error contains a description of the error + * that occurred. If the pointer is 0, the argument will be + * ignored + * @param pid On success, the process id of the new service will be written + * here. If the pointer is 0, the argument will be ignored. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + * @return an error code indicating success (== 0) or failure (> 0). + */ + static int tdeinitExec( const TQString& name, const TQStringList &args, + TQString *error, int *pid, const TQCString& startup_id ); + // KDE4 merge with above with startup_id = "" + static int tdeinitExec( const TQString& name, const TQStringList &args=TQStringList(), + TQString *error=0, int *pid = 0 ); + + /** + * Starts a program via tdeinit and wait for it to finish. + * + * Like tdeinitExec(), but it waits till the program is finished. + * As such it behaves similar to the system(...) function. + * + * @param name Name of the program to start + * @param args Arguments to pass to the program + * @param error On failure, @p error contains a description of the error + * that occurred. If the pointer is 0, the argument will be + * ignored + * @param pid On success, the process id of the new service will be written + * here. If the pointer is 0, the argument will be ignored. + * @param startup_id for app startup notification, "0" for none, + * "" ( empty string ) is the default + * @return an error code indicating success (== 0) or failure (> 0). + */ + static int tdeinitExecWait( const TQString& name, const TQStringList &args, + TQString *error, int *pid, const TQCString& startup_id ); + // KDE4 merge with above with startup_id = "" + static int tdeinitExecWait( const TQString& name, const TQStringList &args=TQStringList(), + TQString *error=0, int *pid = 0 ); + + /** + * Returns a text for the window caption. + * + * This may be set by + * "-caption", otherwise it will be equivalent to the name of the + * executable. + * @return the text for the window caption + */ + TQString caption() const; + + /** + * @deprecated + */ + KDE_DEPRECATED TDEStyle* kstyle() const { return 0; } + + /** + * Builds a caption that contains the application name along with the + * userCaption using a standard layout. + * + * To make a compliant caption + * for your window, simply do: @p setCaption(kapp->makeStdCaption(yourCaption)); + * + * @param userCaption The caption string you want to display in the + * window caption area. Do not include the application name! + * @param withAppName Indicates that the method shall include or ignore + * the application name when making the caption string. You are not + * compliant if you set this to @p false. + * @param modified If true, a 'modified' sign will be included in the + * returned string. This is useful when indicating that a file is + * modified, i.e., it contains data that has not been saved. + * @return the created caption + */ + TQString makeStdCaption( const TQString &userCaption, + bool withAppName=true, bool modified=false ) const; + + /** + * Get a file name in order to make a temporary copy of your document. + * + * @param pFilename The full path to the current file of your + * document. + * @return A new filename for auto-saving. + */ + TQString tempSaveName( const TQString& pFilename ) const; + + /** + * Check whether an auto-save file exists for the document you want to + * open. + * + * @param pFilename The full path to the document you want to open. + * @param bRecover This gets set to true if there was a recover + * file. + * @return The full path of the file to open. + */ + TQString checkRecoverFile( const TQString& pFilename, bool& bRecover ) const; + +#if defined(Q_WS_X11) + /** + * @internal + * Get the X11 display + * @return the X11 Display + */ + Display *getDisplay() { return display; } +#endif + + /** + * @internal + * Gets X11 composition information + */ + void getX11RGBAInformation(Display *dpy); + + /** + * Gets the availability of a composition manager such as kompmgr + * Note that at least one application must have called detectCompositionManagerAvailable + * while the current X display was active in order for this method to return valid results. + * @see detectCompositionManagerAvailable() + * @return whether the composition manager is enabled + */ + static bool isCompositionManagerAvailable(); + + /** + * Detects the availability of a composition manager such as kompmgr + * Note that calling this method will probably cause the screen to flicker. + * @see isCompositionManagerAvailable() + * @param force_available If set, force TDE to assume a composition manager is available + * @param available Whether or not the composition manager is available (only used if force_available is TRUE) + * @return whether the composition manager is enabled + */ + bool detectCompositionManagerAvailable(bool force_available=false, bool available=true); + + /** + * @internal + * Opens the display + * This can be used to initialize a TDEApplication with RGBA support like this: + * TDEApplication app(TDEApplication::openX11RGBADisplay()); + * or + * TDEApplication app(TDEApplication::openX11RGBADisplay(), useStyles); + */ + static Display* openX11RGBADisplay(); + + /** + * Returns the X11 display visual + * + * @return A pointer to the X11 display visual + */ + Qt::HANDLE getX11RGBAVisual(Display *dpy); + + /** + * Returns the X11 display colormap + * + * @return An X11 display colormap object + */ + Qt::HANDLE getX11RGBAColormap(Display *dpy); + + /** + * Returns whether or not X11 composition is available + * + * You must first call getX11RGBAInformation() + * + * Note that getX11RGBAInformation() has already + * been called if you used the default TDEApplication + * constructor. + * + * Additionally, at least one application must have called + * detectCompositionManagerAvailable while the current X + * display was active in order for this method to return + * valid results. + * + * @return true if composition is available + */ + bool isX11CompositionAvailable(); + + /** + * Enables style plugins. + * + * This is useful only to applications that normally + * do not display a GUI and create the TDEApplication with + * allowStyles set to false. + */ + void enableStyles(); + + /** + * Disables style plugins. + * + * Current style plugins do not get unloaded. + * + * This is only useful when used in combination with enableStyles(). + */ + void disableStyles(); + + /** + * Installs widget filter as global X11 event filter. + * + * The widget + * filter receives XEvents in its standard TQWidget::x11Event() function. + * + * Warning: Only do this when absolutely necessary. An installed X11 filter + * can slow things down. + **/ + void installX11EventFilter( TQWidget* filter ); + + /** + * Removes global X11 event filter previously installed by + * installX11EventFilter(). + */ + void removeX11EventFilter( const TQWidget* filter ); + + /** + * Generates a uniform random number. + * @return A truly unpredictable number in the range [0, RAND_MAX) + */ + static int random(); + + /** + * Generates a random string. It operates in the range [A-Za-z0-9] + * @param length Generate a string of this length. + * @return the random string + */ + static TQString randomString(int length); + + /** + * Adds a message type to the KIPC event mask. You can only add "system + * messages" to the event mask. These are the messages with id < 32. + * Messages with id >= 32 are user messages. + * @param id The message id. See KIPC::Message. + * @see KIPC + * @see removeKipcEventMask() + * @see kipcMessage() + */ + void addKipcEventMask(int id); + + /** + * Removes a message type from the KIPC event mask. This message will + * not be handled anymore. + * @param id The message id. + * @see KIPC + * @see addKipcEventMask() + * @see kipcMessage() + */ + void removeKipcEventMask(int id); + + /** + * Returns the app startup notification identifier for this running + * application. + * @return the startup notification identifier + */ + TQCString startupId() const; + + /** + * @internal + * Sets a new value for the application startup notification window property for newly + * created toplevel windows. + * @param startup_id the startup notification identifier + * @see TDEStartupInfo::setNewStartupId + */ + void setStartupId( const TQCString& startup_id ); + + /** + * Updates the last user action timestamp to the given time, or to the current time, + * if 0 is given. Do not use unless you're really sure what you're doing. + * Consult focus stealing prevention section in tdebase/twin/README. + * @since 3.2 + */ + void updateUserTimestamp( unsigned long time = 0 ); + + /** + * Returns the last user action timestamp or 0 if no user activity has taken place yet. + * @since 3.2.3 + * @see updateuserTimestamp + */ + unsigned long userTimestamp() const; + + /** + * Updates the last user action timestamp in the application registered to DCOP with dcopId + * to the given time, or to this application's user time, if 0 is given. + * Use before causing user interaction in the remote application, e.g. invoking a dialog + * in the application using a DCOP call. + * Consult focus stealing prevention section in tdebase/twin/README. + * @since 3.3 + */ + void updateRemoteUserTimestamp( const TQCString& dcopId, unsigned long time = 0 ); + + /** + * Returns the argument to --geometry if any, so the geometry can be set + * wherever necessary + * @return the geometry argument, or TQString::null if there is none + */ + TQString geometryArgument() const; + + /** + * Install a Qt SQL property map with entries for all KDE widgets + * Call this in any application using KDE widgets in TQSqlForm or TQDataView. + */ + void installKDEPropertyMap(); + + /** + * Returns whether a certain action is authorized + * @param genericAction The name of a generic action + * @return true if the action is authorized + */ + bool authorize(const TQString &genericAction); + + /** + * Returns whether a certain TDEAction is authorized. + * + * @param action The name of a TDEAction action. The name is prepended + * with "action/" before being passed to authorize() + * @return true if the TDEAction is authorized + */ + bool authorizeTDEAction(const char *action); + + /** + * Returns whether a certain URL related action is authorized. + * + * @param action The name of the action. Known actions are + * list (may be listed (e.g. in file selection dialog)), + * link (may be linked to), + * open (may open) and + * redirect (may be redirected to) + * @param baseURL The url where the action originates from + * @param destURL The object of the action + * @return true when the action is authorized, false otherwise. + * @since 3.1 + */ + bool authorizeURLAction(const TQString &action, const KURL &baseURL, const KURL &destURL); + + /** + * Allow a certain URL action. This can be useful if your application + * needs to ensure access to an application specific directory that may + * otherwise be subject to KIOSK restrictions. + * @param action The name of the action. + * @param _baseURL The url where the action originates from + * @param _destURL The object of the action + * @since 3.2 + */ + void allowURLAction(const TQString &action, const KURL &_baseURL, const KURL &_destURL); + + /** + * Returns whether access to a certain control module is authorized. + * + * @param menuId identifying the control module, e.g. tde-mouse.desktop + * @return true if access to the module is authorized, false otherwise. + * @since 3.2 + */ + bool authorizeControlModule(const TQString &menuId); + + /** + * Returns whether access to a certain control modules is authorized. + * + * @param menuIds list of menu-ids of control module, + * an example of a menu-id is tde-mouse.desktop. + * @return Those control modules for which access has been authorized. + * @since 3.2 + */ + TQStringList authorizeControlModules(const TQStringList &menuIds); + + /** + * Returns the state of the currently pressed keyboard modifiers (e.g. shift, control, etc.) + * and mouse buttons, similarly to TQKeyEvent::state() and TQMouseEvent::state(). + * You usually should simply use the information provided by TQKeyEvent and TQMouseEvent, + * but it can be useful to query for the status of the modifiers at another moment + * (e.g. some KDE apps do that upon a drop event). + * @return the keyboard modifiers and mouse buttons state + * @since 3.4 + */ + static ButtonState keyboardMouseState(); + + // Same values as ShiftMask etc. in X.h + enum { ShiftModifier = 1<<0, + LockModifier = 1<<1, + ControlModifier = 1<<2, + Modifier1 = 1<<3, + Modifier2 = 1<<4, + Modifier3 = 1<<5, + Modifier4 = 1<<6, + Modifier5 = 1<<7 }; + /** + * @deprecated Use keyboardMouseState() + * @since 3.1 + */ + static uint keyboardModifiers() KDE_DEPRECATED; + + /** @deprecated Same values as Button1Mask etc. in X.h */ + enum { Button1Pressed = 1<<8, + Button2Pressed = 1<<9, + Button3Pressed = 1<<10, + Button4Pressed = 1<<11, + Button5Pressed = 1<<12 }; + /** + * @deprecated Use keyboardMouseState() + * @since 3.1 + */ + static uint mouseState() KDE_DEPRECATED; + + +public slots: + /** + * Tells TDEApplication about one more operation that should be finished + * before the application exits. The standard behavior is to exit on the + * "last window closed" event, but some events should outlive the last window closed + * (e.g. a file copy for a file manager, or 'compacting folders on exit' for a mail client). + */ + void ref(); + + /** + * Tells TDEApplication that one operation such as those described in ref() just finished. + * The application exits if the counter is back to 0. + */ + void deref(); + +protected: + /** + * @internal Used by KUniqueApplication + */ + TDEApplication( bool allowStyles, bool GUIenabled, TDEInstance* _instance ); + +#ifdef Q_WS_X11 + /** + * @internal Used by KUniqueApplication + */ + TDEApplication( Display *display, Qt::HANDLE visual, Qt::HANDLE colormap, + bool allowStyles, TDEInstance* _instance ); + + /** + * Used to catch X11 events + */ + bool x11EventFilter( XEvent * ); + + Display *display; +#endif + Atom kipcCommAtom; + int kipcEventMask; + + /// Current application object. + static TDEApplication *KApp; + int pArgc; + + /** + * This method is used internally to determine which edit slots are implemented + * by the widget that has the focus, and to invoke those slots if available. + * + * @param slot is the slot as returned using the TQT_SLOT() macro, for example TQT_SLOT( cut() ) + * + * This method can be used in TDEApplication subclasses to implement application wide + * edit actions not supported by the TDEApplication class. For example (in your subclass): + * + * \code + * void MyApplication::deselect() + * { + * invokeEditSlot( TQT_SLOT( deselect() ) ); + * } + * \endcode + * + * Now in your application calls to MyApplication::deselect() will call this slot on the + * focused widget if it provides this slot. You can combine this with TDEAction with: + * + * \code + * KStdAction::deselect( static_cast<MyApplication *>( kapp ), TQT_SLOT( cut() ), actionCollection() ); + * \endcode + * + * @see cut() + * @see copy() + * @see paste() + * @see clear() + * @see selectAll() + * + * @since 3.2 + */ + void invokeEditSlot( const char *slot ); + +private slots: + void dcopFailure(const TQString &); + void dcopBlockUserInput( bool ); + void x11FilterDestroyed(); + void checkAppStartedSlot(); + +private: + TQString sessionConfigName() const; + TDEConfig* pSessionConfig; //instance specific application config object + static DCOPClient *s_DCOPClient; // app specific application communication client + static bool s_dcopClientNeedsPostInit; + TQString aCaption; // the name for the window title + bool bSessionManagement; + struct oldPixmapType { TQPixmap a, b; }; + mutable union { + struct { + TQPixmap *icon, *miniIcon; + } pm; + char unused[sizeof(oldPixmapType)]; + } aIconPixmap; // KDE4: remove me + TQString aIconName; + TQString aMiniIconName; + bool useStyles; + TQWidget *smw; + + void init( bool GUIenabled ); + + void parseCommandLine( ); // Handle KDE arguments (Using TDECmdLineArgs) + + void read_app_startup_id(); + + void dcopAutoRegistration(); + void dcopClientPostInit(); + void initUrlActionRestrictions(); + + bool argb_visual; +#if defined(Q_WS_X11) + Qt::HANDLE argb_x11_visual; + Qt::HANDLE argb_x11_colormap; +#endif + +public: + /** + * @internal + */ + bool notify(TQObject *receiver, TQEvent *event); + + /** + @internal + */ + int xErrhandler( Display*, void* ); + + /** + @internal + */ + int xioErrhandler( Display* ); + + /** + * @internal + */ + void iceIOErrorHandler( _IceConn *conn ); + + /** + * @internal + */ + static bool loadedByKdeinit; + + /** + * @internal + */ + static void startKdeinit(); + + /** + * Valid values for the settingsChanged signal + */ + enum SettingsCategory { SETTINGS_MOUSE, SETTINGS_COMPLETION, SETTINGS_PATHS, + SETTINGS_POPUPMENU, SETTINGS_QT, SETTINGS_SHORTCUTS }; + + /** + * Used to obtain the TQPalette that will be used to set the application palette. + * + * This is only useful for configuration modules such as krdb and should not be + * used in normal circumstances. + * @return the QPalette + * @since 3.1 + */ + static TQPalette createApplicationPalette(); + + /** + * @internal + * Raw access for use by TDM. + */ + static TQPalette createApplicationPalette( TDEConfig *config, int contrast ); + + /** + * Installs a handler for the SIGPIPE signal. It is thrown when you write to + * a pipe or socket that has been closed. + * The handler is installed automatically in the constructor, but you may + * need it if your application or component does not have a TDEApplication + * instance. + */ + static void installSigpipeHandler(); + + /** + * @internal + * Whether widgets can be used. + * + * @since 3.2 + */ + static bool guiEnabled(); + +signals: + /** + * Emitted when TDEApplication has changed its palette due to a KControl request. + * + * Normally, widgets will update their palette automatically, but you + * should connect to this to program special behavior. + */ + void tdedisplayPaletteChanged(); + + /** + * Emitted when TDEApplication has changed its GUI style in response to a KControl request. + * + * Normally, widgets will update their styles automatically (as they would + * respond to an explicit setGUIStyle() call), but you should connect to + * this to program special behavior. + */ + void tdedisplayStyleChanged(); + + /** + * Emitted when TDEApplication has changed its font in response to a KControl request. + * + * Normally widgets will update their fonts automatically, but you should + * connect to this to monitor global font changes, especially if you are + * using explicit fonts. + * + * Note: If you derive from a QWidget-based class, a faster method is to + * reimplement TQWidget::fontChange(). This is the preferred way + * to get informed about font updates. + */ + void tdedisplayFontChanged(); + + /** + * Emitted when TDEApplication has changed either its GUI style, its font or its palette + * in response to a tdedisplay request. Normally, widgets will update their styles + * automatically, but you should connect to this to program special + * behavior. */ + void appearanceChanged(); + + /** + * Emitted when the settings for toolbars have been changed. TDEToolBar will know what to do. + */ + void toolbarAppearanceChanged(int); + + /** + * Emitted when the desktop background has been changed by @p kcmdisplay. + * + * @param desk The desktop whose background has changed. + */ + void backgroundChanged(int desk); + + /** + * Emitted when the global settings have been changed - see TDEGlobalSettings + * TDEApplication takes care of calling reparseConfiguration on TDEGlobal::config() + * so that applications/classes using this only have to re-read the configuration + * @param category the category among the enum above + */ + void settingsChanged(int category); + + /** + * Emitted when the global icon settings have been changed. + * @param group the new group + */ + void iconChanged(int group); + + /** + * Emitted when a KIPC user message has been received. + * @param id the message id + * @param data the data + * @see KIPC + * @see KIPC::Message + * @see addKipcEventMask + * @see removeKipcEventMask + */ + void kipcMessage(int id, int data); + + /** + Session management asks you to save the state of your application. + + This signal is provided for compatibility only. For new + applications, simply use TDEMainWindow. By reimplementing + TDEMainWindow::queryClose(), TDEMainWindow::saveProperties() and + TDEMainWindow::readProperties() you can simply handle session + management for applications with multiple toplevel windows. + + For purposes without TDEMainWindow, create an instance of + KSessionManaged and reimplement the functions + KSessionManaged::commitData() and/or + KSessionManaged::saveState() + + If you still want to use this signal, here is what you should do: + + Connect to this signal in order to save your data. Do NOT + manipulate the UI in that slot, it is blocked by the session + manager. + + Use the sessionConfig() TDEConfig object to store all your + instance specific data. + + Do not do any closing at this point! The user may still select + Cancel wanting to continue working with your + application. Cleanups could be done after shutDown() (see + the following). + + */ + void saveYourself(); + + /** Your application is killed. Either by your program itself, + @p xkill or (the usual case) by KDE's logout. + + The signal is particularly useful if your application has to do some + last-second cleanups. Note that no user interaction is possible at + this state. + */ + void shutDown(); + + /** + * @internal + * Used to notify TDEIconLoader objects that they need to reload. + */ + void updateIconLoaders(); + + /** + * @internal + * Used to send TDEGlobalAccel objects a new keypress from physical hotkeys. + */ + void coreFakeKeyPress(unsigned int keyCode); + +private: + void propagateSettings(SettingsCategory category); + void tdedisplaySetPalette(); + void tdedisplaySetStyle(); + void tdedisplaySetFont(); + void applyGUIStyle(); + static void sigpipeHandler(int); + + int captionLayout; + + TDEApplication(const TDEApplication&); + TDEApplication& operator=(const TDEApplication&); +protected: + virtual void virtual_hook( int id, void* data ); +private: + TDEApplicationPrivate* d; +}; + + +/** + * \relates TDEGlobal + * Check, if a file may be accessed in a given mode. + * This is a wrapper around the access() system call. + * checkAccess() calls access() with the given parameters. + * If this is OK, checkAccess() returns true. If not, and W_OK + * is part of mode, it is checked if there is write access to + * the directory. If yes, checkAccess() returns true. + * In all other cases checkAccess() returns false. + * + * Other than access() this function EXPLICITLY ignores non-existant + * files if checking for write access. + * + * @param pathname The full path of the file you want to test + * @param mode The access mode, as in the access() system call. + * @return Whether the access is allowed, true = Access allowed + */ +TDECORE_EXPORT bool checkAccess(const TQString& pathname, int mode); + +class KSessionManagedPrivate; + +/** + Provides highlevel access to session management on a per-object + base. + + KSessionManaged makes it possible to provide implementations for + TQApplication::commitData() and TQApplication::saveState(), without + subclassing TDEApplication. TDEMainWindow internally makes use of this. + + You don't need to do anything with this class when using + TDEMainWindow. Instead, use TDEMainWindow::saveProperties(), + TDEMainWindow::readProperties(), TDEMainWindow::queryClose(), + TDEMainWindow::queryExit() and friends. + + @short Highlevel access to session management. + @author Matthias Ettrich <ettrich@kde.org> + */ +class TDECORE_EXPORT KSessionManaged +{ +public: + KSessionManaged(); + virtual ~KSessionManaged(); + + /** + See TQApplication::saveState() for documentation. + + This function is just a convenience version to avoid subclassing TDEApplication. + + Return true to indicate a successful state save or false to + indicate a problem and to halt the shutdown process (will + implicitly call sm.cancel() ). + */ + virtual bool saveState( TQSessionManager& sm ); + /** + See TQApplication::commitData() for documentation. + + This function is just a convenience version to avoid subclassing TDEApplication. + + Return true to indicate a successful commit of data or false to + indicate a problem and to halt the shutdown process (will + implicitly call sm.cancel() ). + */ + virtual bool commitData( TQSessionManager& sm ); + +protected: + virtual void virtual_hook( int id, void* data ); +private: + KSessionManagedPrivate *d; +}; + + +#endif + diff --git a/tdecore/tdecmdlineargs.cpp b/tdecore/tdecmdlineargs.cpp new file mode 100644 index 000000000..ad24467e2 --- /dev/null +++ b/tdecore/tdecmdlineargs.cpp @@ -0,0 +1,1298 @@ +/* + Copyright (C) 1999 Waldo Bastian <bastian@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 version 2 as published by the Free Software Foundation. + + 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 <config.h> + +#include <sys/param.h> + +#include <assert.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif + +#include <tqdir.h> +#include <tqfile.h> +#include <tqasciidict.h> +#include <tqstrlist.h> + +#include "tdecmdlineargs.h" +#include <tdeaboutdata.h> +#include <klocale.h> +#include <tdeapplication.h> +#include <kglobal.h> +#include <kstringhandler.h> +#include <kstaticdeleter.h> + +#ifdef Q_WS_X11 +#define DISPLAY "DISPLAY" +#elif defined(Q_WS_QWS) +#define DISPLAY "QWS_DISPLAY" +#endif + +#ifdef Q_WS_WIN +#include <win32_utils.h> +#endif + +template class TQAsciiDict<TQCString>; +template class TQPtrList<TDECmdLineArgs>; + +class TDECmdLineParsedOptions : public TQAsciiDict<TQCString> +{ +public: + TDECmdLineParsedOptions() + : TQAsciiDict<TQCString>( 7 ) { } + + // WABA: Huh? + // The compiler doesn't find TDECmdLineParsedOptions::write(s) by itself ??? + // WABA: No, because there is another write function that hides the + // write function in the base class even though this function has a + // different signature. (obscure C++ feature) + TQDataStream& save( TQDataStream &s) const + { return TQGDict::write(s); } + + TQDataStream& load( TQDataStream &s) + { return TQGDict::read(s); } + +protected: + virtual TQDataStream& write( TQDataStream &s, TQPtrCollection::Item data) const + { + TQCString *str = (TQCString *) data; + s << (*str); + return s; + } + + virtual TQDataStream& read( TQDataStream &s, TQPtrCollection::Item &item) + { + TQCString *str = new TQCString; + s >> (*str); + item = (void *)str; + return s; + } + +}; + +class TDECmdLineParsedArgs : public TQStrList +{ +public: + TDECmdLineParsedArgs() + : TQStrList( true ) { } + TQDataStream& save( TQDataStream &s) const + { return TQGList::write(s); } + + TQDataStream& load( TQDataStream &s) + { return TQGList::read(s); } +}; + + +class TDECmdLineArgsList: public TQPtrList<TDECmdLineArgs> +{ +public: + TDECmdLineArgsList() { } +}; + +TDECmdLineArgsList *TDECmdLineArgs::argsList = 0; +int TDECmdLineArgs::argc = 0; +char **TDECmdLineArgs::argv = 0; +char *TDECmdLineArgs::mCwd = 0; +static KStaticDeleter <char> mCwdd; +const TDEAboutData *TDECmdLineArgs::about = 0; +bool TDECmdLineArgs::parsed = false; +bool TDECmdLineArgs::ignoreUnknown = false; + +// +// Static functions +// + +void +TDECmdLineArgs::init(int _argc, char **_argv, const char *_appname, const char* programName, + const char *_description, const char *_version, bool noKApp) +{ + init(_argc, _argv, + new TDEAboutData(_appname, programName, _version, _description), + noKApp); +} + +void +TDECmdLineArgs::init(int _argc, char **_argv, const char *_appname, + const char *_description, const char *_version, bool noKApp) +{ + init(_argc, _argv, + new TDEAboutData(_appname, _appname, _version, _description), + noKApp); +} + +void +TDECmdLineArgs::initIgnore(int _argc, char **_argv, const char *_appname ) +{ + init(_argc, _argv, + new TDEAboutData(_appname, _appname, "unknown", "TDE Application", false)); + ignoreUnknown = true; +} + +void +TDECmdLineArgs::init(const TDEAboutData* ab) +{ + char **_argv = (char **) malloc(sizeof(char *)); + _argv[0] = (char *) ab->appName(); + init(1,_argv,ab, true); +} + + +void +TDECmdLineArgs::init(int _argc, char **_argv, const TDEAboutData *_about, bool noKApp) +{ + argc = _argc; + argv = _argv; + + if (!argv) + { + fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); + fprintf(stderr, "Passing null-pointer to 'argv' is not allowed.\n\n"); + + assert( 0 ); + exit(255); + } + + // Strip path from argv[0] + if (argc) { + char *p = strrchr( argv[0], '/'); + if (p) + argv[0] = p+1; + } + + about = _about; + parsed = false; + mCwd = mCwdd.setObject(mCwd, new char [PATH_MAX+1], true); + (void) getcwd(mCwd, PATH_MAX); +#ifdef Q_WS_WIN + win32_slashify(mCwd, PATH_MAX); +#endif + if (!noKApp) + TDEApplication::addCmdLineOptions(); +} + +TQString TDECmdLineArgs::cwd() +{ + return TQFile::decodeName(TQCString(mCwd)); +} + +const char * TDECmdLineArgs::appName() +{ + if (!argc) return 0; + return argv[0]; +} + +void +TDECmdLineArgs::addCmdLineOptions( const TDECmdLineOptions *options, const char *name, + const char *id, const char *afterId) +{ + if (!argsList) + argsList = new TDECmdLineArgsList(); + + int pos = argsList->count(); + + if (pos && id && argsList->last() && !argsList->last()->name) + pos--; + + TDECmdLineArgs *args; + int i = 0; + for(args = argsList->first(); args; args = argsList->next(), i++) + { + if (!id && !args->id) + return; // Options already present. + + if (id && args->id && (::qstrcmp(id, args->id) == 0)) + return; // Options already present. + + if (afterId && args->id && (::qstrcmp(afterId, args->id) == 0)) + pos = i+1; + } + + assert( parsed == false ); // You must add _ALL_ cmd line options + // before accessing the arguments! + args = new TDECmdLineArgs(options, name, id); + argsList->insert(pos, args); +} + +void +TDECmdLineArgs::saveAppArgs( TQDataStream &ds) +{ + if (!parsed) + parseAllArgs(); + + // Remove Qt and TDE options. + removeArgs("qt"); + removeArgs("tde"); + + TQCString qCwd = mCwd; + ds << qCwd; + + uint count = argsList ? argsList->count() : 0; + ds << count; + + if (!count) return; + + TDECmdLineArgs *args; + for(args = argsList->first(); args; args = argsList->next()) + { + ds << TQCString(args->id); + args->save(ds); + } +} + +void +TDECmdLineArgs::loadAppArgs( TQDataStream &ds) +{ + parsed = true; // don't reparse argc/argv! + + // Remove Qt and TDE options. + removeArgs("qt"); + removeArgs("tde"); + + TDECmdLineArgs *args; + if ( argsList ) { + for(args = argsList->first(); args; args = argsList->next()) + { + args->clear(); + } + } + + if (ds.atEnd()) + return; + + TQCString qCwd; + ds >> qCwd; + delete [] mCwd; + + mCwd = mCwdd.setObject(mCwd, new char[qCwd.length()+1], true); + strncpy(mCwd, qCwd.data(), qCwd.length()+1); + + uint count; + ds >> count; + + while(count--) + { + TQCString id; + ds >> id; + assert( argsList ); + for(args = argsList->first(); args; args = argsList->next()) + { + if (args->id == id) + { + args->load(ds); + break; + } + } + } + parsed = true; +} + +TDECmdLineArgs *TDECmdLineArgs::parsedArgs(const char *id) +{ + TDECmdLineArgs *args = argsList ? argsList->first() : 0; + while(args) + { + if ((id && ::qstrcmp(args->id, id) == 0) || (!id && !args->id)) + { + if (!parsed) + parseAllArgs(); + return args; + } + args = argsList->next(); + } + + return args; +} + +void TDECmdLineArgs::removeArgs(const char *id) +{ + TDECmdLineArgs *args = argsList ? argsList->first() : 0; + while(args) + { + if (args->id && id && ::qstrcmp(args->id, id) == 0) + { + if (!parsed) + parseAllArgs(); + break; + } + args = argsList->next(); + } + + if (args) + delete args; +} + +/* + * @return: + * 0 - option not found. + * 1 - option found // -fork + * 2 - inverse option found ('no') // -nofork + * 3 - option + arg found // -fork now + * + * +4 - no more options follow // !fork + */ +static int +findOption(const TDECmdLineOptions *options, TQCString &opt, + const char *&opt_name, const char *&def, bool &enabled) +{ + int result; + bool inverse; + int len = opt.length(); + while(options && options->name) + { + result = 0; + inverse = false; + opt_name = options->name; + if ((opt_name[0] == ':') || (opt_name[0] == 0)) + { + options++; + continue; + } + + if (opt_name[0] == '!') + { + opt_name++; + result = 4; + } + if ((opt_name[0] == 'n') && (opt_name[1] == 'o')) + { + opt_name += 2; + inverse = true; + } + if (strncmp(opt.data(), opt_name, len) == 0) + { + opt_name += len; + if (!opt_name[0]) + { + if (inverse) + return result+2; + + if (!options->description) + { + options++; + if (!options->name) + return result+0; + TQCString nextOption = options->name; + int p = nextOption.find(' '); + if (p > 0) + nextOption = nextOption.left(p); + if (nextOption[0] == '!') + nextOption = nextOption.mid(1); + if (strncmp(nextOption.data(), "no", 2) == 0) + { + nextOption = nextOption.mid(2); + enabled = !enabled; + } + result = findOption(options, nextOption, opt_name, def, enabled); + assert(result); + opt = nextOption; + return result; + } + + return 1; + } + if (opt_name[0] == ' ') + { + opt_name++; + def = options->def; + return result+3; + } + } + + options++; + } + return 0; +} + + +void +TDECmdLineArgs::findOption(const char *_opt, TQCString opt, int &i, bool _enabled, bool &moreOptions) +{ + TDECmdLineArgs *args = argsList->first(); + const char *opt_name; + const char *def; + TQCString argument; + int j = opt.find('='); + if (j != -1) + { + argument = opt.mid(j+1); + opt = opt.left(j); + } + + bool enabled = true; + int result = 0; + while (args) + { + enabled = _enabled; + result = ::findOption(args->options, opt, opt_name, def, enabled); + if (result) break; + args = argsList->next(); + } + if (!args && (_opt[0] == '-') && _opt[1] && (_opt[1] != '-')) + { + // Option not found check if it is a valid option + // in the style of -Pprinter1 or ps -aux + int p = 1; + while (true) + { + TQCString singleCharOption = " "; + singleCharOption[0] = _opt[p]; + args = argsList->first(); + while (args) + { + enabled = _enabled; + result = ::findOption(args->options, singleCharOption, opt_name, def, enabled); + if (result) break; + args = argsList->next(); + } + if (!args) + break; // Unknown argument + + p++; + if (result == 1) // Single option + { + args->setOption(singleCharOption, enabled); + if (_opt[p]) + continue; // Next option + else + return; // Finished + } + else if (result == 3) // This option takes an argument + { + if (argument.isEmpty()) + { + argument = _opt+p; + } + args->setOption(singleCharOption, (const char*)argument); + return; + } + break; // Unknown argument + } + args = 0; + result = 0; + } + + if (!args || !result) + { + if (ignoreUnknown) + return; + enable_i18n(); + usage( i18n("Unknown option '%1'.").arg(TQString::fromLocal8Bit(_opt))); + } + + if ((result & 4) != 0) + { + result &= ~4; + moreOptions = false; + } + + if (result == 3) // This option takes an argument + { + if (!enabled) + { + if (ignoreUnknown) + return; + enable_i18n(); + usage( i18n("Unknown option '%1'.").arg(TQString::fromLocal8Bit(_opt))); + } + if (argument.isEmpty()) + { + i++; + if (i >= argc) + { + enable_i18n(); + usage( i18n("'%1' missing.").arg( opt_name)); + } + argument = argv[i]; + } + args->setOption(opt, (const char*)argument); + } + else + { + args->setOption(opt, enabled); + } +} + +void +TDECmdLineArgs::printQ(const TQString &msg) +{ + TQCString localMsg = msg.local8Bit(); + fprintf(stdout, "%s", localMsg.data()); +} + +void +TDECmdLineArgs::parseAllArgs() +{ + bool allowArgs = false; + bool inOptions = true; + bool everythingAfterArgIsArgs = false; + TDECmdLineArgs *appOptions = argsList->last(); + if (!appOptions->id) + { + const TDECmdLineOptions *option = appOptions->options; + while(option && option->name) + { + if (option->name[0] == '+') + allowArgs = true; + if ( option->name[0] == '!' && option->name[1] == '+' ) + { + allowArgs = true; + everythingAfterArgIsArgs = true; + } + option++; + } + } + for(int i = 1; i < argc; i++) + { + if (!argv[i]) + continue; + + if ((argv[i][0] == '-') && argv[i][1] && inOptions) + { + bool enabled = true; + const char *option = &argv[i][1]; + const char *orig = argv[i]; + if (option[0] == '-') + { + option++; + argv[i]++; + if (!option[0]) + { + inOptions = false; + continue; + } + } + if (::qstrcmp(option, "help") == 0) + { + usage(0); + } + else if (strncmp(option, "help-",5) == 0) + { + usage(option+5); + } + else if ( (::qstrcmp(option, "version") == 0) || + (::qstrcmp(option, "v") == 0)) + { + printQ( TQString("Qt: %1\n").arg(tqVersion())); + printQ( TQString("TDE: %1\n").arg(TDE_VERSION_STRING)); + printQ( TQString("%1: %2\n"). + arg(about->programName()).arg(about->version())); + exit(0); + } else if ( (::qstrcmp(option, "license") == 0) ) + { + enable_i18n(); + printQ( about->license() ); + printQ( "\n" ); + exit(0); + } else if ( ::qstrcmp( option, "author") == 0 ) { + enable_i18n(); + if ( about ) { + const TQValueList<TDEAboutPerson> authors = about->authors(); + if ( !authors.isEmpty() ) { + TQString authorlist; + for (TQValueList<TDEAboutPerson>::ConstIterator it = authors.begin(); it != authors.end(); ++it ) { + TQString email; + if ( !(*it).emailAddress().isEmpty() ) + email = " <" + (*it).emailAddress() + ">"; + authorlist += TQString(" ") + (*it).name() + email + "\n"; + } + printQ( i18n("the 2nd argument is a list of name+address, one on each line","%1 was written by\n%2").arg ( TQString(about->programName()) ).arg( authorlist ) ); + } + } else { + printQ( i18n("This application was written by somebody who wants to remain anonymous.") ); + } + if (about) + { + if (!about->customAuthorTextEnabled ()) + { + if (about->bugAddress().isEmpty() || about->bugAddress() == "bugs.pearsoncomputing.net" ) + printQ( i18n( "Please use http://bugs.pearsoncomputing.net to report bugs.\n" ) ); + else { + if( about->authors().count() == 1 && about->authors().first().emailAddress() == about->bugAddress() ) + printQ( i18n( "Please report bugs to %1.\n" ).arg( about->authors().first().emailAddress() ) ); + else + printQ( i18n( "Please report bugs to %1.\n" ).arg(about->bugAddress()) ); + } + } + else + { + printQ(about->customAuthorPlainText()); + } + } + exit(0); + } else { + if ((option[0] == 'n') && (option[1] == 'o')) + { + option += 2; + enabled = false; + } + findOption(orig, option, i, enabled, inOptions); + } + } + else + { + // Check whether appOptions allows these arguments + if (!allowArgs) + { + if (ignoreUnknown) + continue; + enable_i18n(); + usage( i18n("Unexpected argument '%1'.").arg(TQString::fromLocal8Bit(argv[i]))); + } + else + { + appOptions->addArgument(argv[i]); + if (everythingAfterArgIsArgs) + inOptions = false; + } + } + } + parsed = true; +} + +/** + * For TDEApplication only: + * + * Return argc + */ +int * +TDECmdLineArgs::tqt_argc() +{ + if (!argsList) + TDEApplication::addCmdLineOptions(); // Lazy bastards! + + static int tqt_argc = -1; + if( tqt_argc != -1 ) + return &tqt_argc; + + TDECmdLineArgs *args = parsedArgs("qt"); + assert(args); // No qt options have been added! + if (!argv) + { + fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); + fprintf(stderr, "Application has not called TDECmdLineArgs::init(...).\n\n"); + + assert( 0 ); + exit(255); + } + + assert(argc >= (args->count()+1)); + tqt_argc = args->count() +1; + return &tqt_argc; +} + +/** + * For TDEApplication only: + * + * Return argv + */ +char *** +TDECmdLineArgs::tqt_argv() +{ + if (!argsList) + TDEApplication::addCmdLineOptions(); // Lazy bastards! + + static char** tqt_argv; + if( tqt_argv != NULL ) + return &tqt_argv; + + TDECmdLineArgs *args = parsedArgs("qt"); + assert(args); // No qt options have been added! + if (!argv) + { + fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); + fprintf(stderr, "Application has not called TDECmdLineArgs::init(...).\n\n"); + + assert( 0 ); + exit(255); + } + + tqt_argv = new char*[ args->count() + 2 ]; + tqt_argv[ 0 ] = tqstrdup( appName()); + int i = 0; + for(; i < args->count(); i++) + { + tqt_argv[i+1] = tqstrdup((char *) args->arg(i)); + } + tqt_argv[i+1] = 0; + + return &tqt_argv; +} + +void +TDECmdLineArgs::enable_i18n() +{ + // called twice or too late + if (TDEGlobal::_locale) + return; + + if (!TDEGlobal::_instance) { + TDEInstance *instance = new TDEInstance(about); + (void) instance->config(); + // Don't delete instance! + } +} + +void +TDECmdLineArgs::usage(const TQString &error) +{ + assert(TDEGlobal::_locale); + TQCString localError = error.local8Bit(); + if (localError[error.length()-1] == '\n') + localError = localError.left(error.length()-1); + fprintf(stderr, "%s: %s\n", argv[0], localError.data()); + + TQString tmp = i18n("Use --help to get a list of available command line options."); + localError = tmp.local8Bit(); + fprintf(stderr, "%s: %s\n", argv[0], localError.data()); + exit(254); +} + +void +TDECmdLineArgs::usage(const char *id) +{ + enable_i18n(); + assert(argsList != 0); // It's an error to call usage(...) without + // having done addCmdLineOptions first! + + TQString optionFormatString = " %1 %2\n"; + TQString optionFormatStringDef = " %1 %2 [%3]\n"; + TQString optionHeaderString = i18n("\n%1:\n"); + TQString tmp; + TQString usage; + + TDECmdLineArgs *args = argsList->last(); + + if (!(args->id) && (args->options) && + (args->options->name) && (args->options->name[0] != '+')) + { + usage = i18n("[options] ")+usage; + } + + while(args) + { + if (args->name) + { + usage = i18n("[%1-options]").arg(args->name)+" "+usage; + } + args = argsList->prev(); + } + + TDECmdLineArgs *appOptions = argsList->last(); + if (!appOptions->id) + { + const TDECmdLineOptions *option = appOptions->options; + while(option && option->name) + { + if (option->name[0] == '+') + usage = usage + (option->name+1) + " "; + else if ( option->name[0] == '!' && option->name[1] == '+' ) + usage = usage + (option->name+2) + " "; + + option++; + } + } + + printQ(i18n("Usage: %1 %2\n").arg(argv[0]).arg(usage)); + printQ("\n"+about->shortDescription()+"\n"); + + printQ(optionHeaderString.arg(i18n("Generic options"))); + printQ(optionFormatString.arg("--help", -25).arg(i18n("Show help about options"))); + + args = argsList->first(); + while(args) + { + if (args->name && args->id) + { + TQString option = TQString("--help-%1").arg(args->id); + TQString desc = i18n("Show %1 specific options").arg(args->name); + + printQ(optionFormatString.arg(option, -25).arg(desc)); + } + args = argsList->next(); + } + + printQ(optionFormatString.arg("--help-all",-25).arg(i18n("Show all options"))); + printQ(optionFormatString.arg("--author",-25).arg(i18n("Show author information"))); + printQ(optionFormatString.arg("-v, --version",-25).arg(i18n("Show version information"))); + printQ(optionFormatString.arg("--license",-25).arg(i18n("Show license information"))); + printQ(optionFormatString.arg("--", -25).arg(i18n("End of options"))); + + args = argsList->first(); // Sets current to 1st. + + bool showAll = id && (::qstrcmp(id, "all") == 0); + + if (!showAll) + { + while(args) + { + if (!id && !args->id) break; + if (id && (::qstrcmp(args->id, id) == 0)) break; + args = argsList->next(); + } + } + + while(args) + { + bool hasArgs = false; + bool hasOptions = false; + TQString optionsHeader; + if (args->name) + optionsHeader = optionHeaderString.arg(i18n("%1 options").arg(TQString::fromLatin1(args->name))); + else + optionsHeader = i18n("\nOptions:\n"); + + while (args) + { + const TDECmdLineOptions *option = args->options; + TQCString opt = ""; +// + while(option && option->name) + { + TQString description; + TQString descriptionRest; + TQStringList dl; + + // Option header + if (option->name[0] == ':') + { + if (option->description) + { + optionsHeader = "\n"+i18n(option->description); + if (!optionsHeader.endsWith("\n")) + optionsHeader.append("\n"); + hasOptions = false; + } + option++; + continue; + } + + // Free-form comment + if (option->name[0] == 0) + { + if (option->description) + { + TQString tmp = "\n"+i18n(option->description); + if (!tmp.endsWith("\n")) + tmp.append("\n"); + printQ(tmp); + } + option++; + continue; + } + + // Options + if (option->description) + { + description = i18n(option->description); + dl = TQStringList::split("\n", description, true); + description = dl.first(); + dl.remove( dl.begin() ); + } + TQCString name = option->name; + if (name[0] == '!') + name = name.mid(1); + + if (name[0] == '+') + { + if (!hasArgs) + { + printQ(i18n("\nArguments:\n")); + hasArgs = true; + } + + name = name.mid(1); + if ((name[0] == '[') && (name[name.length()-1] == ']')) + name = name.mid(1, name.length()-2); + printQ(optionFormatString.arg(QString(name), -25) + .arg(description)); + } + else + { + if (!hasOptions) + { + printQ(optionsHeader); + hasOptions = true; + } + + if ((name.length() == 1) || (name[1] == ' ')) + name = "-"+name; + else + name = "--"+name; + if (!option->description) + { + opt = name + ", "; + } + else + { + opt = opt + name; + if (!option->def) + { + printQ(optionFormatString.arg(QString(opt), -25) + .arg(description)); + } + else + { + printQ(optionFormatStringDef.arg(QString(opt), -25) + .arg(description).arg(option->def)); + } + opt = ""; + } + } + for(TQStringList::Iterator it = dl.begin(); + it != dl.end(); + ++it) + { + printQ(optionFormatString.arg("", -25).arg(*it)); + } + + option++; + } + args = argsList->next(); + if (!args || args->name || !args->id) break; + } + if (!showAll) break; + } + + exit(254); +} + +// +// Member functions +// + +/** + * Constructor. + * + * The given arguments are assumed to be constants. + */ +TDECmdLineArgs::TDECmdLineArgs( const TDECmdLineOptions *_options, + const char *_name, const char *_id) + : options(_options), name(_name), id(_id) +{ + parsedOptionList = 0; + parsedArgList = 0; + isQt = (::qstrcmp(id, "qt") == 0); +} + +/** + * Destructor. + */ +TDECmdLineArgs::~TDECmdLineArgs() +{ + delete parsedOptionList; + delete parsedArgList; + if (argsList) + argsList->removeRef(this); +} + +void +TDECmdLineArgs::clear() +{ + delete parsedArgList; + parsedArgList = 0; + delete parsedOptionList; + parsedOptionList = 0; +} + +void +TDECmdLineArgs::reset() +{ + if ( argsList ) { + argsList->setAutoDelete( true ); + argsList->clear(); + delete argsList; + argsList = 0; + } + parsed = false; +} + +void +TDECmdLineArgs::save( TQDataStream &ds) const +{ + uint count = 0; + if (parsedOptionList) + parsedOptionList->save( ds ); + else + ds << count; + + if (parsedArgList) + parsedArgList->save( ds ); + else + ds << count; +} + +void +TDECmdLineArgs::load( TQDataStream &ds) +{ + if (!parsedOptionList) parsedOptionList = new TDECmdLineParsedOptions; + if (!parsedArgList) parsedArgList = new TDECmdLineParsedArgs; + + parsedOptionList->load( ds ); + parsedArgList->load( ds ); + + if (parsedOptionList->count() == 0) + { + delete parsedOptionList; + parsedOptionList = 0; + } + if (parsedArgList->count() == 0) + { + delete parsedArgList; + parsedArgList = 0; + } +} + +void +TDECmdLineArgs::setOption(const TQCString &opt, bool enabled) +{ + if (isQt) + { + // Qt does it own parsing. + TQCString arg = "-"; + if( !enabled ) + arg += "no"; + arg += opt; + addArgument(arg); + } + if (!parsedOptionList) { + parsedOptionList = new TDECmdLineParsedOptions; + parsedOptionList->setAutoDelete(true); + } + + if (enabled) + parsedOptionList->replace( opt, new TQCString("t") ); + else + parsedOptionList->replace( opt, new TQCString("f") ); +} + +void +TDECmdLineArgs::setOption(const TQCString &opt, const char *value) +{ + if (isQt) + { + // Qt does it's own parsing. + TQCString arg = "-"; + arg += opt; + addArgument(arg); + addArgument(value); + +#ifdef Q_WS_X11 + // Hack coming up! + if (arg == "-display") + { + setenv(DISPLAY, value, true); + } +#endif + } + if (!parsedOptionList) { + parsedOptionList = new TDECmdLineParsedOptions; + parsedOptionList->setAutoDelete(true); + } + + parsedOptionList->insert( opt, new TQCString(value) ); +} + +TQCString +TDECmdLineArgs::getOption(const char *_opt) const +{ + TQCString *value = 0; + if (parsedOptionList) + { + value = parsedOptionList->find(_opt); + } + + if (value) + return (*value); + + // Look up the default. + const char *opt_name; + const char *def; + bool dummy = true; + TQCString opt = _opt; + int result = ::findOption( options, opt, opt_name, def, dummy) & ~4; + + if (result != 3) + { + fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); + fprintf(stderr, "Application requests for getOption(\"%s\") but the \"%s\" option\n", + _opt, _opt); + fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n"); + + assert( 0 ); + exit(255); + } + return TQCString(def); +} + +QCStringList +TDECmdLineArgs::getOptionList(const char *_opt) const +{ + QCStringList result; + if (!parsedOptionList) + return result; + + while(true) + { + TQCString *value = parsedOptionList->take(_opt); + if (!value) + break; + result.prepend(*value); + delete value; + } + + // Reinsert items in dictionary + // WABA: This is rather silly, but I don't want to add restrictions + // to the API like "you can only call this function once". + // I can't access all items without taking them out of the list. + // So taking them out and then putting them back is the only way. + for(QCStringList::ConstIterator it=result.begin(); + it != result.end(); + ++it) + { + parsedOptionList->insert(_opt, new TQCString(*it)); + } + return result; +} + +bool +TDECmdLineArgs::isSet(const char *_opt) const +{ + // Look up the default. + const char *opt_name; + const char *def; + bool dummy = true; + TQCString opt = _opt; + int result = ::findOption( options, opt, opt_name, def, dummy) & ~4; + + if (result == 0) + { + fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs):\n"); + fprintf(stderr, "Application requests for isSet(\"%s\") but the \"%s\" option\n", + _opt, _opt); + fprintf(stderr, "has never been specified via addCmdLineOptions( ... )\n\n"); + + assert( 0 ); + exit(255); + } + + TQCString *value = 0; + if (parsedOptionList) + { + value = parsedOptionList->find(opt); + } + + if (value) + { + if (result == 3) + return true; + else + return ((*value)[0] == 't'); + } + + if (result == 3) + return false; // String option has 'false' as default. + + // We return 'true' as default if the option was listed as '-nofork' + // We return 'false' as default if the option was listed as '-fork' + return (result == 2); +} + +int +TDECmdLineArgs::count() const +{ + if (!parsedArgList) + return 0; + return parsedArgList->count(); +} + +const char * +TDECmdLineArgs::arg(int n) const +{ + if (!parsedArgList || (n >= (int) parsedArgList->count())) + { + fprintf(stderr, "\n\nFAILURE (TDECmdLineArgs): Argument out of bounds\n"); + fprintf(stderr, "Application requests for arg(%d) without checking count() first.\n", + n); + + assert( 0 ); + exit(255); + } + + return parsedArgList->at(n); +} + +KURL +TDECmdLineArgs::url(int n) const +{ + return makeURL( arg(n) ); +} + +KURL TDECmdLineArgs::makeURL(const char *_urlArg) +{ + const TQString urlArg = TQFile::decodeName(_urlArg); + TQFileInfo fileInfo(urlArg); + if (!fileInfo.isRelative()) { // i.e. starts with '/', on unix + KURL result; + result.setPath(urlArg); + return result; // Absolute path. + } + + if ( KURL::isRelativeURL(urlArg) || fileInfo.exists() ) { + KURL result; + result.setPath( cwd()+'/'+urlArg ); + result.cleanPath(); + return result; // Relative path + } + + return KURL(urlArg); // Argument is a URL +} + +void +TDECmdLineArgs::addArgument(const char *argument) +{ + if (!parsedArgList) + parsedArgList = new TDECmdLineParsedArgs; + + parsedArgList->append(argument); +} + +static const TDECmdLineOptions kde_tempfile_option[] = +{ + { "tempfile", I18N_NOOP("The files/URLs opened by the application will be deleted after use"), 0}, + TDECmdLineLastOption +}; + +void +TDECmdLineArgs::addTempFileOption() +{ + TDECmdLineArgs::addCmdLineOptions( kde_tempfile_option, "TDE-tempfile", "tde-tempfile" ); +} + +bool TDECmdLineArgs::isTempFileSet() +{ + TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs( "tde-tempfile" ); + if ( args ) + return args->isSet( "tempfile" ); + return false; +} diff --git a/tdecore/tdecmdlineargs.h b/tdecore/tdecmdlineargs.h new file mode 100644 index 000000000..9b7dc0f4f --- /dev/null +++ b/tdecore/tdecmdlineargs.h @@ -0,0 +1,690 @@ +/* This file is part of the KDE project + Copyright (C) 1999 Waldo Bastian <bastian@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 version 2 as published by the Free Software Foundation. + + 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 _KCMDLINEARGS_H_ +#define _KCMDLINEARGS_H_ + +#include "tdelibs_export.h" +#include <kurl.h> + +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqvaluelist.h> + +typedef TQValueList<TQCString> QCStringList; + +/** + * @short Structure that holds command line options. + * + * This class is intended to be used with the TDECmdLineArgs class, which + * provides convenient and powerful command line argument parsing and + * handling functionality. + * + * @see TDECmdLineArgs for additional usage information + */ +struct TDECORE_EXPORT TDECmdLineOptions +{ + /** + * The name of the argument as it should be called on the command line and + * appear in <i>myapp --help</i>. + * + * Note that if this option starts with "no" that you will need to test for + * the name without the "no" and the result will be the inverse of what is + * specified. i.e. if "nofoo" is the name of the option and + * <i>myapp --nofoo</i> is called: + * + * \code + * TDECmdLineArgs::parsedArgs()->isSet("foo"); // false + * \endcode + */ + const char *name; + /** + * The text description of the option as should appear in + * <i>myapp --help</i>. This value should be wrapped with I18N_NOOP(). + */ + const char *description; + /** + * The default value for the option, if it is not specified on the + * command line. + */ + const char *def; // Default +}; + +#define TDECmdLineLastOption { 0, 0, 0 } + +class TDECmdLineArgsList; +class TDEApplication; +class KUniqueApplication; +class TDECmdLineParsedOptions; +class TDECmdLineParsedArgs; +class TDEAboutData; +class TDECmdLineArgsPrivate; + +/** + * @short A class for command-line argument handling. + * + * TDECmdLineArgs provides simple access to the command-line arguments + * for an application. It takes into account Qt-specific options, + * KDE-specific options and application specific options. + * + * This class is used in %main() via the static method + * init(). + * + * A typical %KDE application using %TDECmdLineArgs should look like this: + * + * \code + * int main(int argc, char *argv[]) + * { + * // Initialize command line args + * TDECmdLineArgs::init(argc, argv, appName, programName, description, version); + * + * // Tell which options are supported + * TDECmdLineArgs::addCmdLineOptions( options ); + * + * // Add options from other components + * KUniqueApplication::addCmdLineOptions(); + * + * .... + * + * // Create application object without passing 'argc' and 'argv' again. + * KUniqueApplication app; + * + * .... + * + * // Handle our own options/arguments + * // A TDEApplication will usually do this in main but this is not + * // necessary. + * // A KUniqueApplication might want to handle it in newInstance(). + * + * TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + * + * // A binary option (on / off) + * if (args->isSet("some-option")) + * .... + * + * // An option which takes an additional argument + * TQCString anotherOptionArg = args->getOption("another-option"); + * + * // Arguments (e.g. files to open) + * for(int i = 0; i < args->count(); i++) // Counting start at 0! + * { + * // don't forget to convert to Unicode! + * openFile( TQFile::decodeName( args->arg(i))); + * // Or more convenient: + * // openURL( args->url(i)); + * + * } + * + * args->clear(); // Free up some memory. + * .... + * } + * \endcode + * + * The options that an application supports are configured using the + * TDECmdLineOptions class. An example is shown below: + * + * \code + * static const TDECmdLineOptions options[] = + * { + * { "a", I18N_NOOP("A short binary option"), 0 }, + * { "b \<file>", I18N_NOOP("A short option which takes an argument"), 0 }, + * { "c \<speed>", I18N_NOOP("As above but with a default value"), "9600" }, + * { "option1", I18N_NOOP("A long binary option, off by default"), 0 }, + * { "nooption2", I18N_NOOP("A long binary option, on by default"), 0 }, + * { ":", I18N_NOOP("Extra options:"), 0 }, + * { "option3 \<file>", I18N_NOOP("A long option which takes an argument"), 0 }, + * { "option4 \<speed>", I18N_NOOP("A long option which takes an argument, defaulting to 9600"), "9600" }, + * { "d", 0, 0 }, + * { "option5", I18N_NOOP("A long option which has a short option as alias"), 0 }, + * { "e", 0, 0 }, + * { "nooption6", I18N_NOOP("Another long option with an alias"), 0 }, + * { "f", 0, 0 }, + * { "option7 \<speed>", I18N_NOOP("'--option7 speed' is the same as '-f speed'"), 0 }, + * { "!option8 \<cmd>", I18N_NOOP("All options following this one will be treated as arguments"), 0 }, + * { "+file", I18N_NOOP("A required argument 'file'"), 0 }, + * { "+[arg1]", I18N_NOOP("An optional argument 'arg1'"), 0 }, + * { "!+command", I18N_NOOP("A required argument 'command', that can contain multiple words, even starting with '-'"), 0 }, + * { "", I18N_NOOP("Additional help text not associated with any particular option") 0 }, + * TDECmdLineLastOption // End of options. + * }; + * \endcode + * + * The I18N_NOOP macro is used to indicate that these strings should be + * marked for translation. The actual translation is done by TDECmdLineArgs. + * You can't use i18n() here because we are setting up a static data + * structure and can't do translations at compile time. + * + * Note that a program should define the options before any arguments. + * + * When a long option has a short option as an alias, a program should + * only test for the long option. + * + * With the above options a command line could look like: + * \code + * myapp -a -c 4800 --display localhost:0.0 --nooption5 -d /tmp/file + * \endcode + * + * Long binary options can be in the form 'option' and 'nooption'. + * A command line may contain the same binary option multiple times, + * the last option determines the outcome: + * \code + * myapp --nooption4 --option4 --nooption4 + * \endcode + * is the same as: + * \code + * myapp --nooption4 + * \endcode + * + * If an option value is provided multiple times, normally only the last + * value is used: + * \code + * myapp -c 1200 -c 2400 -c 4800 + * \endcode + * is usually the same as: + * \code + * myapp -c 4800 + * \endcode + * + * However, an application can choose to use all values specified as well. + * As an example of this, consider that you may wish to specify a + * number of directories to use: + * \code + * myapp -I /usr/include -I /opt/kde/include -I /usr/X11/include + * \endcode + * When an application does this it should mention this in the description + * of the option. To access these options, use getOptionList() + * + * Tips for end-users: + * + * @li Single char options like "-a -b -c" may be combined into "-abc" + * @li The option "--foo bar" may also be written "--foo=bar" + * @li The option "-P lp1" may also be written "-P=lp1" or "-Plp1" + * @li The option "--foo bar" may also be written "-foo bar" + * + * @author Waldo Bastian + * @version 0.0.4 + */ +class TDECORE_EXPORT TDECmdLineArgs +{ + friend class TDEApplication; + friend class KUniqueApplication; + friend class TQPtrList<TDECmdLineArgs>; +public: + // Static functions: + + /** + * Initialize class. + * + * This function should be called as the very first thing in + * your application. + * @param _argc As passed to @p main(...). + * @param _argv As passed to @p main(...). + * @param _appname The untranslated name of your application. This should + * match with @p argv[0]. + * @param programName A program name string to be used for display + * purposes. This string should be marked for + * translation. Example: I18N_NOOP("KEdit") + * @param _description A short description of what your application is about. + * @param _version A version. + * @param noKApp Set this true to not add commandline options for + * TQApplication / TDEApplication + * + * @since 3.2 + */ + static void init(int _argc, char **_argv, const char *_appname, + const char* programName, const char *_description, + const char *_version, bool noKApp = false); + /** + * @deprecated + * You should convert any calls to this method to use the one + * above, by adding in the program name to be used for display + * purposes. Do not forget to mark it for translation using I18N_NOOP. + */ + static void init(int _argc, char **_argv, + const char *_appname, const char *_description, + const char *_version, bool noKApp = false) KDE_DEPRECATED; + + /** + * Initialize class. + * + * This function should be called as the very first thing in + * your application. It uses TDEAboutData to replace some of the + * arguments that would otherwise be required. + * + * @param _argc As passed to @p main(...). + * @param _argv As passed to @p main(...). + * @param about A TDEAboutData object describing your program. + * @param noKApp Set this true to not add commandline options for + * TQApplication / TDEApplication + */ + static void init(int _argc, char **_argv, + const TDEAboutData *about, bool noKApp = false); + + /** + * Initialize Class + * + * This function should be called as the very first thing in your + * application. This method will rarely be used, since it doesn't + * provide any argument parsing. It does provide access to the + * TDEAboutData information. + * This method is exactly the same as calling + * init(0,0, const TDEAboutData *about, true). + * + * @param about the about data. + * \see TDEAboutData + */ + static void init(const TDEAboutData *about); + + /** + * Add options to your application. + * + * You must make sure that all possible options have been added before + * any class uses the command line arguments. + * + * The list of options should look like this: + * + * \code + * static TDECmdLineOptions options[] = + * { + * { "option1 \<argument>", I18N_NOOP("Description 1"), "my_extra_arg" }, + * { "o", 0, 0 }, + * { "option2", I18N_NOOP("Description 2"), 0 }, + * { "nooption3", I18N_NOOP("Description 3"), 0 }, + * TDECmdLineLastOption + * } + * \endcode + * + * @li "option1" is an option that requires an additional argument, + * but if one is not provided, it uses "my_extra_arg". + * @li "option2" is an option that can be turned on. The default is off. + * @li "option3" is an option that can be turned off. The default is on. + * @li "o" does not have a description. It is an alias for the option + * that follows. In this case "option2". + * @li "+file" specifies an argument. The '+' is removed. If your program + * doesn't specify that it can use arguments your program will abort + * when an argument is passed to it. Note that the reverse is not + * true. If required, you must check yourself the number of arguments + * specified by the user: + * \code + * TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + * if (args->count() == 0) TDECmdLineArgs::usage(i18n("No file specified!")); + * \endcode + * + * In BNF: + * \code + * cmd = myapp [options] file + * options = (option)* + * option = --option1 \<argument> | + * (-o | --option2 | --nooption2) | + * ( --option3 | --nooption3 ) + * \endcode + * + * Instead of "--option3" one may also use "-option3" + * + * Usage examples: + * + * @li "myapp --option1 test" + * @li "myapp" (same as "myapp --option1 my_extra_arg") + * @li "myapp --option2" + * @li "myapp --nooption2" (same as "myapp", since it is off by default) + * @li "myapp -o" (same as "myapp --option2") + * @li "myapp --nooption3" + * @li "myapp --option3 (same as "myapp", since it is on by default) + * @li "myapp --option2 --nooption2" (same as "myapp", because it + * option2 is off by default, and the last usage applies) + * @li "myapp /tmp/file" + * + * @param options A list of options that your code supplies. + * @param name the name of the option, can be 0. + * @param id A name with which these options can be identified, can be 0. + * @param afterId The options are inserted after this set of options, can be 0. + */ + static void addCmdLineOptions( const TDECmdLineOptions *options, + const char *name=0, const char *id = 0, + const char *afterId=0); + + /** + * Access parsed arguments. + * + * This function returns all command line arguments that your code + * handles. If unknown command-line arguments are encountered the program + * is aborted and usage information is shown. + * + * @param id The name of the options you are interested in, can be 0. + */ + static TDECmdLineArgs *parsedArgs(const char *id=0); + + /** + * Get the CWD (Current Working Directory) associated with the + * current command line arguments. + * + * Typically this is needed in KUniqueApplication::newInstance() + * since the CWD of the process may be different from the CWD + * where the user started a second instance. + * @return the current working directory + **/ + static TQString cwd(); + + /** + * Get the appname according to argv[0]. + * @return the name of the application + **/ + static const char *appName(); + + /** + * Print the usage help to stdout and exit. + * + * @param id if 0, print all options. If id is set, only print the + * option specified by id. The id is the value set by + * addCmdLineOptions(). + **/ + static void usage(const char *id = 0); + + /** + * Print an error to stderr and the usage help to stdout and exit. + * @param error the error to print + **/ + static void usage(const TQString &error); + + /** + * Enable i18n to be able to print a translated error message. + * + * N.B.: This function leaks memory, therefore you are expected to exit + * afterwards (e.g., by calling usage()). + **/ + static void enable_i18n(); + + // Member functions: + + + /** + * Read out a string option. + * + * The option must have a corresponding TDECmdLineOptions entry + * of the form: + * \code + * { "option \<argument>", I18N_NOOP("Description"), "default" } + * \endcode + * You cannot test for the presence of an alias - you must always + * test for the full option. + * + * @param option The name of the option without '-'. + * + * @return The value of the option. If the option was not + * present on the command line the default is returned. + * If the option was present more than the value of the + * last occurrence is used. + */ + TQCString getOption(const char *option) const; + + /** + * Read out all occurrences of a string option. + * + * The option must have a corresponding TDECmdLineOptions entry + * of the form: + * \code + * { "option \<argument>", I18N_NOOP("Description"), "default" } + * \endcode + * You cannot test for the presence of an alias - you must always + * test for the full option. + * + * @param option The name of the option, without '-' or '-no'. + * + * @return A list of all option values. If no option was present + * on the command line, an empty list is returned. + */ + QCStringList getOptionList(const char *option) const; + + /** + * Read out a boolean option or check for the presence of string option. + * + * @param option The name of the option without '-' or '-no'. + * + * @return The value of the option. It will be true if the option + * was specifically turned on in the command line, or if the option + * is turned on by default (in the TDECmdLineOptions list) and was + * not specifically turned off in the command line. Equivalently, + * it will be false if the option was specifically turned off in + * the command line, or if the option is turned off by default (in + * the TDECmdLineOptions list) and was not specifically turned on in + * the command line. + */ + bool isSet(const char *option) const; + + /** + * Read the number of arguments that aren't options (but, + * for example, filenames). + * + * @return The number of arguments that aren't options + */ + int count() const; + + /** + * Read out an argument. + * + * @param n The argument to read. 0 is the first argument. + * count()-1 is the last argument. + * + * @return A @p const @p char @p * pointer to the n'th argument. + */ + const char *arg(int n) const; + + /** + * Read out an argument representing a URL. + * + * The argument can be + * @li an absolute filename + * @li a relative filename + * @li a URL + * + * @param n The argument to read. 0 is the first argument. + * count()-1 is the last argument. + * + * @return a URL representing the n'th argument. + */ + KURL url(int n) const; + + /** + * Used by url(). + * Made public for apps that don't use TDECmdLineArgs + * @param urlArg the argument + * @return the url. + */ + static KURL makeURL( const char * urlArg ); + + /** + * Made public for apps that don't use TDECmdLineArgs + * To be done before makeURL, to set the current working + * directory in case makeURL needs it. + * @param cwd the new working directory + */ + static void setCwd( char * cwd ) { mCwd = cwd; } + + /** + * Clear all options and arguments. + */ + void clear(); + + /** + * Reset all option definitions, i.e. cancel all addCmdLineOptions calls. + * Note that TDEApplication's options are removed too, you might want to + * call TDEApplication::addCmdLineOptions if you want them back. + * + * You usually don't want to call this method. + */ + static void reset(); + + /** + * Load arguments from a stream. + */ + static void loadAppArgs( TQDataStream &); + + /** + * Add standard option --tempfile + * @since 3.4 + */ + static void addTempFileOption(); + + // this avoids having to know the "id" used by addTempFileOption + // but this approach doesn't scale well, we can't have 50 standard options here... + /** + * @return true if --tempfile was set + * @since 3.4 + */ + static bool isTempFileSet(); + +protected: + /** + * @internal + * Constructor. + */ + TDECmdLineArgs( const TDECmdLineOptions *_options, const char *_name, + const char *_id); + + /** + * @internal use only. + * + * Use clear() if you want to free up some memory. + * + * Destructor. + */ + ~TDECmdLineArgs(); + +private: + /** + * @internal + * + * Checks what to do with a single option + */ + static void findOption(const char *_opt, TQCString opt, int &i, bool enabled, bool &moreOptions); + + /** + * @internal + * + * Parse all arguments, verify correct syntax and put all arguments + * where they belong. + */ + static void parseAllArgs(); + + /** + * @internal for TDEApplication only: + * + * Return argc + */ + static int *tqt_argc(); + + /** + * @internal for TDEApplication only: + * + * Return argv + */ + + static char ***tqt_argv(); + + /** + * @internal + * + * Remove named options. + * + * @param id The name of the options to be removed. + */ + static void removeArgs(const char *id); + + /** + * @internal for KUniqueApplication only: + * + * Save all but the Qt and KDE arguments to a stream. + */ + static void saveAppArgs( TQDataStream &); + + /** + * @internal + * + * Set a boolean option + */ + void setOption(const TQCString &option, bool enabled); + + /** + * @internal + * + * Set a string option + */ + void setOption(const TQCString &option, const char *value); + + /** + * @internal + * + * Add an argument + */ + void addArgument(const char *argument); + + /** + * @internal + * + * Save to a stream. + */ + void save( TQDataStream &) const; + + /** + * @internal + * + * Restore from a stream. + */ + void load( TQDataStream &); + + /** + * @internal for TDEApplication only + * + * Initialize class. + * + * This function should be called as the very first thing in + * your application. + * @param argc As passed to @p main(...). + * @param argv As passed to @p main(...). + * @param appname The untranslated name of your application. This should + * match with @p argv[0]. + * + * This function makes TDECmdLineArgs ignore all unknown options as well as + * all arguments. + */ + static void initIgnore(int _argc, char **_argv, const char *_appname); + + static void printQ(const TQString &msg); + + const TDECmdLineOptions *options; + const char *name; + const char *id; + TDECmdLineParsedOptions *parsedOptionList; + TDECmdLineParsedArgs *parsedArgList; + bool isQt; + + static TDECmdLineArgsList *argsList; // All options. + static const TDEAboutData *about; + + static int argc; // The original argc + static char **argv; // The original argv + static bool parsed; // Whether we have parsed the arguments since calling init + static bool ignoreUnknown; // Ignore unknown options and arguments + static char *mCwd; // Current working directory. Important for KUnqiueApp! + static bool parseArgs; + + TDECmdLineArgsPrivate *d; +}; + +#endif + diff --git a/tdecore/tdeconfig.cpp b/tdecore/tdeconfig.cpp index 1e75be6f1..35c5b73bc 100644 --- a/tdecore/tdeconfig.cpp +++ b/tdecore/tdeconfig.cpp @@ -32,7 +32,7 @@ #include <tqfileinfo.h> -#include <kapplication.h> +#include <tdeapplication.h> #include "tdeconfigbackend.h" #include "tdeconfig.h" diff --git a/tdecore/tdeconfig_compiler/example/autoexample.cpp b/tdecore/tdeconfig_compiler/example/autoexample.cpp index 6ed89d75f..e25219787 100644 --- a/tdecore/tdeconfig_compiler/example/autoexample.cpp +++ b/tdecore/tdeconfig_compiler/example/autoexample.cpp @@ -24,11 +24,11 @@ #include "exampleprefs_base.h" -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <kglobal.h> #include <tdeconfig.h> #include <kstandarddirs.h> diff --git a/tdecore/tdeconfig_compiler/example/example.cpp b/tdecore/tdeconfig_compiler/example/example.cpp index 6788d1ee0..c08339d4a 100644 --- a/tdecore/tdeconfig_compiler/example/example.cpp +++ b/tdecore/tdeconfig_compiler/example/example.cpp @@ -21,11 +21,11 @@ #include "exampleprefs_base.h" -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <kglobal.h> #include <tdeconfig.h> #include <kstandarddirs.h> diff --git a/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp b/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp index 4a8f52712..753bae532 100644 --- a/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp +++ b/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp @@ -27,11 +27,11 @@ #include <tqdom.h> #include <tqregexp.h> -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <kglobal.h> #include <tdeconfig.h> #include <ksimpleconfig.h> diff --git a/tdecore/tdeconfigbackend.cpp b/tdecore/tdeconfigbackend.cpp index 4ad70b4a8..d050a2efe 100644 --- a/tdecore/tdeconfigbackend.cpp +++ b/tdecore/tdeconfigbackend.cpp @@ -41,7 +41,7 @@ #include "tdeconfigbackend.h" #include "tdeconfigbase.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> #include <kprocess.h> #include <klocale.h> diff --git a/tdecore/tdeconfigbase.cpp b/tdecore/tdeconfigbase.cpp index d2ecef888..668a688d8 100644 --- a/tdecore/tdeconfigbase.cpp +++ b/tdecore/tdeconfigbase.cpp @@ -27,7 +27,7 @@ #include <tqdir.h> #include <tqtextstream.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> #include <klocale.h> #include <kcharsets.h> diff --git a/tdecore/tdeconfigdialogmanager.cpp b/tdecore/tdeconfigdialogmanager.cpp index ab5218687..dfabefb59 100644 --- a/tdecore/tdeconfigdialogmanager.cpp +++ b/tdecore/tdeconfigdialogmanager.cpp @@ -30,7 +30,7 @@ #include <tqtimer.h> #include <tqwhatsthis.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfigskeleton.h> #include <kdebug.h> #include <kglobal.h> diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp index 559650e20..263bc5507 100644 --- a/tdecore/tdehardwaredevices.cpp +++ b/tdecore/tdehardwaredevices.cpp @@ -30,7 +30,7 @@ #include <ksimpledirwatch.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <libudev.h> diff --git a/tdecore/tdesycoca.cpp b/tdecore/tdesycoca.cpp index 31da8b741..16914c0bc 100644 --- a/tdecore/tdesycoca.cpp +++ b/tdecore/tdesycoca.cpp @@ -26,7 +26,7 @@ #include <tqfile.h> #include <tqbuffer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <kglobal.h> #include <kdebug.h> diff --git a/tdecore/tests/KIDLTest.cpp b/tdecore/tests/KIDLTest.cpp index f022e307a..a54e32be5 100644 --- a/tdecore/tests/KIDLTest.cpp +++ b/tdecore/tests/KIDLTest.cpp @@ -1,6 +1,6 @@ #include "KIDLTest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> KIDLTest::KIDLTest( const TQCString& id ) diff --git a/tdecore/tests/KIDLTestClient.cpp b/tdecore/tests/KIDLTestClient.cpp index 75d5949c7..4614ed51e 100644 --- a/tdecore/tests/KIDLTestClient.cpp +++ b/tdecore/tests/KIDLTestClient.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include "KIDLTest_stub.h" diff --git a/tdecore/tests/dcopkonqtest.cpp b/tdecore/tests/dcopkonqtest.cpp index 79137cd5f..b8bb055d6 100644 --- a/tdecore/tests/dcopkonqtest.cpp +++ b/tdecore/tests/dcopkonqtest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <dcopclient.h> diff --git a/tdecore/tests/kapptest.cpp b/tdecore/tests/kapptest.cpp index bae6a9c2e..0952f292c 100644 --- a/tdecore/tests/kapptest.cpp +++ b/tdecore/tests/kapptest.cpp @@ -17,11 +17,11 @@ */ #define private public -#include "kapplication.h" +#include "tdeapplication.h" #include <stdio.h> -#include <kcmdlineargs.h> -#include <kaboutdata.h> +#include <tdecmdlineargs.h> +#include <tdeaboutdata.h> #include <kglobalsettings.h> #include <tdesycoca.h> diff --git a/tdecore/tests/kcalendartest.cpp b/tdecore/tests/kcalendartest.cpp index 7856c0430..12c9010e2 100644 --- a/tdecore/tests/kcalendartest.cpp +++ b/tdecore/tests/kcalendartest.cpp @@ -7,12 +7,12 @@ #include <tqstringlist.h> -#include <kapplication.h> -#include <kaboutdata.h> +#include <tdeapplication.h> +#include <tdeaboutdata.h> #include <kdebug.h> #include <kglobal.h> #include <klocale.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> class TDELocale; diff --git a/tdecore/tests/kcmdlineargstest.cpp b/tdecore/tests/kcmdlineargstest.cpp index f05168e1a..8148e4208 100644 --- a/tdecore/tests/kcmdlineargstest.cpp +++ b/tdecore/tests/kcmdlineargstest.cpp @@ -1,6 +1,6 @@ -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdio.h> diff --git a/tdecore/tests/kglobaltest.cpp b/tdecore/tests/kglobaltest.cpp index 9c7b081de..eaab091f9 100644 --- a/tdecore/tests/kglobaltest.cpp +++ b/tdecore/tests/kglobaltest.cpp @@ -2,11 +2,11 @@ #include <kglobal.h> #include <stdio.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdlib.h> #include <kdebug.h> #include <assert.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> static bool check(const TQString& txt, TQString a, TQString b) { diff --git a/tdecore/tests/kiconloadertest.cpp b/tdecore/tests/kiconloadertest.cpp index 29f810488..c6da1994c 100644 --- a/tdecore/tests/kiconloadertest.cpp +++ b/tdecore/tests/kiconloadertest.cpp @@ -1,7 +1,7 @@ #include <kiconloader.h> #include <tqdatetime.h> #include <stdio.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdlib.h> #include <kdebug.h> diff --git a/tdecore/tests/kipctest.cpp b/tdecore/tests/kipctest.cpp index d6cff80e3..af6785f0c 100644 --- a/tdecore/tests/kipctest.cpp +++ b/tdecore/tests/kipctest.cpp @@ -1,7 +1,7 @@ #include <stdio.h> #include <stdlib.h> #include <tqobject.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kipc.h> #include "kipctest.h" diff --git a/tdecore/tests/klocaletest.cpp b/tdecore/tests/klocaletest.cpp index 1d0ca7aba..0647a10d3 100644 --- a/tdecore/tests/klocaletest.cpp +++ b/tdecore/tests/klocaletest.cpp @@ -14,7 +14,7 @@ #include <kglobal.h> #include <kglobalsettings.h> #include "klocale.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kcharsets.h> #include <kdebug.h> diff --git a/tdecore/tests/kmacroexpandertest.cpp b/tdecore/tests/kmacroexpandertest.cpp index fe3f66c65..e357b5801 100644 --- a/tdecore/tests/kmacroexpandertest.cpp +++ b/tdecore/tests/kmacroexpandertest.cpp @@ -1,7 +1,7 @@ #include <kmacroexpander.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kdebug.h> #include <stdlib.h> diff --git a/tdecore/tests/kmdcodectest.cpp b/tdecore/tests/kmdcodectest.cpp index 5cdf4ac3e..bd3162f52 100644 --- a/tdecore/tests/kmdcodectest.cpp +++ b/tdecore/tests/kmdcodectest.cpp @@ -28,8 +28,8 @@ #include <kdebug.h> #include <klocale.h> -#include <kcmdlineargs.h> -#include <kapplication.h> +#include <tdecmdlineargs.h> +#include <tdeapplication.h> #include <kmdcodec.h> diff --git a/tdecore/tests/kmemtest.cpp b/tdecore/tests/kmemtest.cpp index 0a2a1bdb8..f0115b569 100644 --- a/tdecore/tests/kmemtest.cpp +++ b/tdecore/tests/kmemtest.cpp @@ -1,5 +1,5 @@ #include <stdio.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdlib.h> #include <errno.h> #include <string.h> diff --git a/tdecore/tests/knotifytest.cpp b/tdecore/tests/knotifytest.cpp index 27076a1e8..6c5af25a7 100644 --- a/tdecore/tests/knotifytest.cpp +++ b/tdecore/tests/knotifytest.cpp @@ -1,5 +1,5 @@ #include <knotifyclient.h> -#include <kapplication.h> +#include <tdeapplication.h> int main( int argc, char **argv ) { diff --git a/tdecore/tests/kprocesstest.cpp b/tdecore/tests/kprocesstest.cpp index f86cb2f20..c81dada50 100644 --- a/tdecore/tests/kprocesstest.cpp +++ b/tdecore/tests/kprocesstest.cpp @@ -13,7 +13,7 @@ #include <stdio.h> #include <string.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <signal.h> diff --git a/tdecore/tests/kprociotest.cpp b/tdecore/tests/kprociotest.cpp index a4fbb19ad..ee7aaf2b7 100644 --- a/tdecore/tests/kprociotest.cpp +++ b/tdecore/tests/kprociotest.cpp @@ -13,7 +13,7 @@ #include <stdio.h> #include <string.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <signal.h> diff --git a/tdecore/tests/krandomsequencetest.cpp b/tdecore/tests/krandomsequencetest.cpp index 53c42facb..2ba0c72ae 100644 --- a/tdecore/tests/krandomsequencetest.cpp +++ b/tdecore/tests/krandomsequencetest.cpp @@ -19,7 +19,7 @@ #include <tqptrlist.h> #include "krandomsequence.h" -#include "kapplication.h" +#include "tdeapplication.h" #include <stdio.h> diff --git a/tdecore/tests/kresolvertest.cpp b/tdecore/tests/kresolvertest.cpp index 6e1a3080f..0e05cab4e 100644 --- a/tdecore/tests/kresolvertest.cpp +++ b/tdecore/tests/kresolvertest.cpp @@ -40,8 +40,8 @@ #include <ksocks.h> #include <ksockaddr.h> #include <kextsock.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> #include "netsupp.h" diff --git a/tdecore/tests/krfcdatetest.cpp b/tdecore/tests/krfcdatetest.cpp index cb8bffbfd..6ef0fe5e5 100644 --- a/tdecore/tests/krfcdatetest.cpp +++ b/tdecore/tests/krfcdatetest.cpp @@ -1,5 +1,5 @@ #include <stdio.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdlib.h> #include <kdebug.h> #include <kglobal.h> diff --git a/tdecore/tests/ksimpleconfigtest.cpp b/tdecore/tests/ksimpleconfigtest.cpp index 85193f40b..8b0e4ef25 100644 --- a/tdecore/tests/ksimpleconfigtest.cpp +++ b/tdecore/tests/ksimpleconfigtest.cpp @@ -6,7 +6,7 @@ // demonstrates use of KSimpleConfig class #include <ksimpleconfig.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <unistd.h> #include <stdio.h> diff --git a/tdecore/tests/ksocktest.cpp b/tdecore/tests/ksocktest.cpp index e038cbd2c..01a9c4c3a 100644 --- a/tdecore/tests/ksocktest.cpp +++ b/tdecore/tests/ksocktest.cpp @@ -23,8 +23,8 @@ #include "ksockaddr.h" #include "kextsock.h" -#include <kaboutdata.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> diff --git a/tdecore/tests/kstddirstest.cpp b/tdecore/tests/kstddirstest.cpp index 75c326280..ae6ea16bd 100644 --- a/tdecore/tests/kstddirstest.cpp +++ b/tdecore/tests/kstddirstest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kinstance.h> #include <kstandarddirs.h> diff --git a/tdecore/tests/ktempfiletest.cpp b/tdecore/tests/ktempfiletest.cpp index ec3a004cd..20cd6b36d 100644 --- a/tdecore/tests/ktempfiletest.cpp +++ b/tdecore/tests/ktempfiletest.cpp @@ -17,7 +17,7 @@ */ #include "ktempfile.h" -#include "kapplication.h" +#include "tdeapplication.h" #include "kstandarddirs.h" #include <tqstring.h> diff --git a/tdecore/tests/ktimezonestest.cpp b/tdecore/tests/ktimezonestest.cpp index 729c88bb6..5eaf5a4fb 100644 --- a/tdecore/tests/ktimezonestest.cpp +++ b/tdecore/tests/ktimezonestest.cpp @@ -1,5 +1,5 @@ #include "ktimezones.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <stdio.h> #include <stdlib.h> diff --git a/tdecore/tests/kuniqueapptest.cpp b/tdecore/tests/kuniqueapptest.cpp index 053956715..60ac98b5a 100644 --- a/tdecore/tests/kuniqueapptest.cpp +++ b/tdecore/tests/kuniqueapptest.cpp @@ -22,8 +22,8 @@ #include <unistd.h> #include <stdlib.h> #include <stdio.h> -#include <kcmdlineargs.h> -#include <kaboutdata.h> +#include <tdecmdlineargs.h> +#include <tdeaboutdata.h> class TestApp : public KUniqueApplication { diff --git a/tdecore/tests/kurltest.cpp b/tdecore/tests/kurltest.cpp index 178aec6d5..6694d0d80 100644 --- a/tdecore/tests/kurltest.cpp +++ b/tdecore/tests/kurltest.cpp @@ -2,7 +2,7 @@ #include <kurl.h> #include <stdio.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdlib.h> #include <kdebug.h> #include <kglobal.h> @@ -10,7 +10,7 @@ #include <tqtextcodec.h> #include <tqdatastream.h> #include <assert.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> static bool check(TQString txt, TQString a, TQString b) { diff --git a/tdecore/tests/startserviceby.cpp b/tdecore/tests/startserviceby.cpp index 5cccaa3dc..20fc95f34 100644 --- a/tdecore/tests/startserviceby.cpp +++ b/tdecore/tests/startserviceby.cpp @@ -16,11 +16,11 @@ Boston, MA 02110-1301, USA. */ -#include "kapplication.h" +#include "tdeapplication.h" #include <stdio.h> -#include <kcmdlineargs.h> -#include <kaboutdata.h> +#include <tdecmdlineargs.h> +#include <tdeaboutdata.h> #include <kglobalsettings.h> #include <kdebug.h> diff --git a/tdecore/tests/tdeconfigtestgui.cpp b/tdecore/tests/tdeconfigtestgui.cpp index 5ae85d26d..d1e2d5393 100644 --- a/tdecore/tests/tdeconfigtestgui.cpp +++ b/tdecore/tests/tdeconfigtestgui.cpp @@ -29,7 +29,7 @@ #include <unistd.h> #include <stdlib.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tqdialog.h> #include <tqfile.h> #include <tqfileinfo.h> diff --git a/tdecore/tests/tdeconfigtestgui.h b/tdecore/tests/tdeconfigtestgui.h index 347a9c81d..4aa50cb5f 100644 --- a/tdecore/tests/tdeconfigtestgui.h +++ b/tdecore/tests/tdeconfigtestgui.h @@ -19,7 +19,7 @@ #ifndef _KCONFIG_TEST_H #define _KCONFIG_TEST_H -#include <kapplication.h> +#include <tdeapplication.h> #include <tqdialog.h> #include <tqfile.h> #include <tqfileinfo.h> diff --git a/tdecore/tests/tdestdacceltest.cpp b/tdecore/tests/tdestdacceltest.cpp index fbc5077a5..7a1fe8697 100644 --- a/tdecore/tests/tdestdacceltest.cpp +++ b/tdecore/tests/tdestdacceltest.cpp @@ -1,6 +1,6 @@ #include <config.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tdestdaccel.h> #include <stdlib.h> // for exit diff --git a/tdecore/tests/testqtargs.cpp b/tdecore/tests/testqtargs.cpp index a27073468..8383f930e 100644 --- a/tdecore/tests/testqtargs.cpp +++ b/tdecore/tests/testqtargs.cpp @@ -28,7 +28,7 @@ --bg is aliased to --background but If you try it with --background or -background, you get the same thing. - in tdecore/kapplication.cpp, TDECmdLineOption qt_options is defined and used + in tdecore/tdeapplication.cpp, TDECmdLineOption qt_options is defined and used by the static method Kapplication::addCmdLineOptions to add the Qt options but its' entries look like this: @@ -43,9 +43,9 @@ application palette (light and dark shades are\ncalculated)."), 0}, */ -#include <kapplication.h> -#include <kcmdlineargs.h> -#include <kaboutdata.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> +#include <tdeaboutdata.h> #include <klocale.h> static const TDECmdLineOptions options[] = diff --git a/tdecore/twin.cpp b/tdecore/twin.cpp index 841463e52..93352dacc 100644 --- a/tdecore/twin.cpp +++ b/tdecore/twin.cpp @@ -35,7 +35,7 @@ #include "config.h" #include "twin.h" -#include "kapplication.h" +#include "tdeapplication.h" #include <kglobal.h> #include <kiconloader.h> diff --git a/tdecore/twinmodule.cpp b/tdecore/twinmodule.cpp index adc20f218..27b8b0cdd 100644 --- a/tdecore/twinmodule.cpp +++ b/tdecore/twinmodule.cpp @@ -26,7 +26,7 @@ #include "twinmodule.h" #include "twin.h" #include <X11/Xatom.h> -#include "kapplication.h" +#include "tdeapplication.h" #include "kdebug.h" #include <tqtl.h> #include <tqptrlist.h> diff --git a/tdefx/CMakeLists.txt b/tdefx/CMakeLists.txt index 1aa52627f..60d81fe38 100644 --- a/tdefx/CMakeLists.txt +++ b/tdefx/CMakeLists.txt @@ -27,7 +27,7 @@ link_directories( install( FILES kpixmap.h kpixmapsplitter.h kpixmapeffect.h - kimageeffect.h kdrawutil.h kstyle.h kcpuinfo.h + kimageeffect.h kdrawutil.h tdestyle.h kcpuinfo.h DESTINATION ${INCLUDE_INSTALL_DIR} ) @@ -37,7 +37,7 @@ set( target tdefx ) set( ${target}_SRCS kpixmap.cpp kpixmapsplitter.cpp kpixmapeffect.cpp - kimageeffect.cpp kdrawutil.cpp kstyle.cpp kcpuinfo.cpp + kimageeffect.cpp kdrawutil.cpp tdestyle.cpp kcpuinfo.cpp ) tde_add_library( ${target} SHARED AUTOMOC diff --git a/tdefx/Makefile.am b/tdefx/Makefile.am index 2b588ba54..7fb97e400 100644 --- a/tdefx/Makefile.am +++ b/tdefx/Makefile.am @@ -30,10 +30,10 @@ libtdefx_la_NMCHECKWEAK = $(srcdir)/libtdefx_weak.nmcheck $(top_srcdir)/tdecore/ $(top_srcdir)/tdecore/standard_weak.nmcheck include_HEADERS = kpixmap.h kpixmapsplitter.h \ - kpixmapeffect.h kimageeffect.h kdrawutil.h kstyle.h kcpuinfo.h + kpixmapeffect.h kimageeffect.h kdrawutil.h tdestyle.h kcpuinfo.h libtdefx_la_SOURCES = kpixmap.cpp kpixmapsplitter.cpp \ - kpixmapeffect.cpp kimageeffect.cpp kdrawutil.cpp kstyle.cpp \ + kpixmapeffect.cpp kimageeffect.cpp kdrawutil.cpp tdestyle.cpp \ kcpuinfo.cpp METASOURCES = AUTO diff --git a/tdefx/kstyle.cpp b/tdefx/kstyle.cpp deleted file mode 100644 index 29663faf3..000000000 --- a/tdefx/kstyle.cpp +++ /dev/null @@ -1,2418 +0,0 @@ -/* - * - * TDEStyle - * Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org> - * - * TQWindowsStyle CC_ListView and style images were kindly donated by TrollTech, - * Copyright (C) 1998-2000 TrollTech AS. - * - * Many thanks to Bradley T. Hughes for the 3 button scrollbar code. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * 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. - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include "kstyle.h" - -#include <tqapplication.h> -#include <tqbitmap.h> -#include <tqmetaobject.h> -#include <tqcleanuphandler.h> -#include <tqmap.h> -#include <tqimage.h> -#include <tqlistview.h> -#include <tqmenubar.h> -#include <tqpainter.h> -#include <tqpixmap.h> -#include <tqpopupmenu.h> -#include <tqprogressbar.h> -#include <tqscrollbar.h> -#include <tqsettings.h> -#include <tqslider.h> -#include <tqstylefactory.h> -#include <tqtabbar.h> -#include <tqtoolbar.h> -#include <tqframe.h> - -#include <kpixmap.h> -#include <kpixmapeffect.h> -#include <kimageeffect.h> - -#ifdef Q_WS_X11 -# include <X11/Xlib.h> -# ifdef HAVE_XRENDER -# include <X11/extensions/Xrender.h> // schroder - extern bool tqt_use_xrender; -# endif -#else -#undef HAVE_XRENDER -#endif - -#ifdef HAVE_XCOMPOSITE -#include <X11/extensions/Xrender.h> -#include <X11/extensions/Xcomposite.h> -#include <dlfcn.h> -#endif - -#include <limits.h> - -namespace -{ - // INTERNAL - enum TransparencyEngine { - Disabled = 0, - SoftwareTint, - SoftwareBlend, - XRender - }; - - // Drop Shadow - struct ShadowElements { - TQWidget* w1; - TQWidget* w2; - }; - typedef TQMap<const TQWidget*,ShadowElements> ShadowMap; - static ShadowMap *_shadowMap = 0; - TQSingleCleanupHandler<ShadowMap> cleanupShadowMap; - ShadowMap &shadowMap() { - if ( !_shadowMap ) { - _shadowMap = new ShadowMap; - cleanupShadowMap.set( &_shadowMap ); - } - return *_shadowMap; - } - - - // DO NOT ASK ME HOW I MADE THESE TABLES! - // (I probably won't remember anyway ;) - const double top_right_corner[16] = - { 0.949, 0.965, 0.980, 0.992, - 0.851, 0.890, 0.945, 0.980, - 0.706, 0.780, 0.890, 0.960, - 0.608, 0.706, 0.851, 0.949 }; - - const double bottom_right_corner[16] = - { 0.608, 0.706, 0.851, 0.949, - 0.706, 0.780, 0.890, 0.960, - 0.851, 0.890, 0.945, 0.980, - 0.949, 0.965, 0.980, 0.992 }; - - const double bottom_left_corner[16] = - { 0.949, 0.851, 0.706, 0.608, - 0.965, 0.890, 0.780, 0.706, - 0.980, 0.945, 0.890, 0.851, - 0.992, 0.980, 0.960, 0.949 }; - - const double shadow_strip[4] = - { 0.565, 0.675, 0.835, 0.945 }; - - static bool useDropShadow(TQWidget* w) - { - return w && w->metaObject() && - w->metaObject()->findProperty("TDEStyleMenuDropShadow") != -1; - } -} - -namespace -{ -class TransparencyHandler : public TQObject -{ - public: - TransparencyHandler(TDEStyle* style, TransparencyEngine tEngine, - float menuOpacity, bool useDropShadow); - ~TransparencyHandler(); - bool eventFilter(TQObject* object, TQEvent* event); - - protected: - void blendToColor(const TQColor &col); - void blendToPixmap(const TQColorGroup &cg, const TQWidget* p); -#ifdef HAVE_XRENDER - void XRenderBlendToPixmap(const TQWidget* p); -#endif - bool haveX11RGBASupport(); - TQImage handleRealAlpha(TQImage); - void createShadowWindows(const TQWidget* p); - void removeShadowWindows(const TQWidget* p); - void rightShadow(TQImage& dst); - void bottomShadow(TQImage& dst); - private: - bool dropShadow; - float opacity; - TQPixmap pix; - TDEStyle* kstyle; - TransparencyEngine te; -}; -} // namespace - -struct TDEStylePrivate -{ - bool highcolor : 1; - bool useFilledFrameWorkaround : 1; - bool etchDisabledText : 1; - bool scrollablePopupmenus : 1; - bool autoHideAccelerators : 1; - bool menuAltKeyNavigation : 1; - bool menuDropShadow : 1; - bool sloppySubMenus : 1; - bool semiTransparentRubberband : 1; - int popupMenuDelay; - float menuOpacity; - - TransparencyEngine transparencyEngine; - TDEStyle::TDEStyleScrollBarType scrollbarType; - TransparencyHandler* menuHandler; - TDEStyle::TDEStyleFlags flags; - - //For KPE_ListViewBranch - TQBitmap *verticalLine; - TQBitmap *horizontalLine; -}; - -// ----------------------------------------------------------------------------- - - -TDEStyle::TDEStyle( TDEStyleFlags flags, TDEStyleScrollBarType sbtype ) - : TQCommonStyle(), d(new TDEStylePrivate) -{ - d->flags = flags; - bool useMenuTransparency = (flags & AllowMenuTransparency); - d->useFilledFrameWorkaround = (flags & FilledFrameWorkaround); - d->scrollbarType = sbtype; - d->highcolor = TQPixmap::defaultDepth() > 8; - - // Read style settings - TQSettings settings; - d->popupMenuDelay = settings.readNumEntry ("/TDEStyle/Settings/PopupMenuDelay", 256); - d->sloppySubMenus = settings.readBoolEntry("/TDEStyle/Settings/SloppySubMenus", false); - d->etchDisabledText = settings.readBoolEntry("/TDEStyle/Settings/EtchDisabledText", true); - d->menuAltKeyNavigation = settings.readBoolEntry("/TDEStyle/Settings/MenuAltKeyNavigation", true); - d->scrollablePopupmenus = settings.readBoolEntry("/TDEStyle/Settings/ScrollablePopupMenus", false); - d->autoHideAccelerators = settings.readBoolEntry("/TDEStyle/Settings/AutoHideAccelerators", false); - d->menuDropShadow = settings.readBoolEntry("/TDEStyle/Settings/MenuDropShadow", false); - d->semiTransparentRubberband = settings.readBoolEntry("/TDEStyle/Settings/SemiTransparentRubberband", false); - d->menuHandler = NULL; - - if (useMenuTransparency) { - TQString effectEngine = settings.readEntry("/TDEStyle/Settings/MenuTransparencyEngine", "Disabled"); - -#ifdef HAVE_XRENDER - if (effectEngine == "XRender") - d->transparencyEngine = XRender; -#else - if (effectEngine == "XRender") - d->transparencyEngine = SoftwareBlend; -#endif - else if (effectEngine == "SoftwareBlend") - d->transparencyEngine = SoftwareBlend; - else if (effectEngine == "SoftwareTint") - d->transparencyEngine = SoftwareTint; - else - d->transparencyEngine = Disabled; - - if (d->transparencyEngine != Disabled) { - // Create an instance of the menu transparency handler - d->menuOpacity = settings.readDoubleEntry("/TDEStyle/Settings/MenuOpacity", 0.90); - d->menuHandler = new TransparencyHandler(this, d->transparencyEngine, - d->menuOpacity, d->menuDropShadow); - } - } - - d->verticalLine = 0; - d->horizontalLine = 0; - - // Create a transparency handler if only drop shadows are enabled. - if (!d->menuHandler && d->menuDropShadow) - d->menuHandler = new TransparencyHandler(this, Disabled, 1.0, d->menuDropShadow); -} - - -TDEStyle::~TDEStyle() -{ - delete d->verticalLine; - delete d->horizontalLine; - - delete d->menuHandler; - - d->menuHandler = NULL; - delete d; -} - - -TQString TDEStyle::defaultStyle() -{ - if (TQPixmap::defaultDepth() > 8) - return TQString("plastik"); - else - return TQString("light, 3rd revision"); -} - -void TDEStyle::polish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) -{ - if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { - TQWidget* widget = reinterpret_cast<TQWidget*>(ptr); - if ( d->useFilledFrameWorkaround ) - { - if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) { - TQFrame::Shape shape = frame->frameShape(); - if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel) - widget->installEventFilter(this); - } - } - if (widget->isTopLevel()) - { - if (!d->menuHandler && useDropShadow(widget)) - d->menuHandler = new TransparencyHandler(this, Disabled, 1.0, false); - - if (d->menuHandler && useDropShadow(widget)) - widget->installEventFilter(d->menuHandler); - } - } -} - - -void TDEStyle::unPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) -{ - if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { - TQWidget* widget = reinterpret_cast<TQWidget*>(ptr); - if ( d->useFilledFrameWorkaround ) - { - if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) { - TQFrame::Shape shape = frame->frameShape(); - if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel) - widget->removeEventFilter(this); - } - } - if (widget->isTopLevel() && d->menuHandler && useDropShadow(widget)) - widget->removeEventFilter(d->menuHandler); - } -} - - -// Style changes (should) always re-polish popups. -void TDEStyle::polishPopupMenu( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) -{ - if ( !(ceData.windowState & WState_Polished ) ) { - widgetActionRequest(ceData, elementFlags, ptr, WAR_SetCheckable); - } - - if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { - TQWidget* widget = reinterpret_cast<TQWidget*>(ptr); - TQPopupMenu *p = dynamic_cast<TQPopupMenu*>(widget); - if (p) { - // Install transparency handler if the effect is enabled. - if ( d->menuHandler && (strcmp(p->name(), "tear off menu") != 0)) { - p->installEventFilter(d->menuHandler); - } - } - } -} - - -// ----------------------------------------------------------------------------- -// TDEStyle extensions -// ----------------------------------------------------------------------------- - -void TDEStyle::setScrollBarType(TDEStyleScrollBarType sbtype) -{ - d->scrollbarType = sbtype; -} - -TDEStyle::TDEStyleFlags TDEStyle::styleFlags() const -{ - return d->flags; -} - -void TDEStyle::renderMenuBlendPixmap( KPixmap &pix, const TQColorGroup &cg, - const TQPopupMenu* /* popup */ ) const -{ - pix.fill(cg.button()); // Just tint as the default behavior -} - -void TDEStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, - TQPainter* p, - const TQWidget* widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags, - const TQStyleOption &opt ) const -{ - TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption()); - drawTDEStylePrimitive(kpe, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), r, cg, flags, opt); -} - -void TDEStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, - TQPainter* p, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags, - const TQStyleOption&, /* opt */ - const TQWidget* widget ) const -{ - switch( kpe ) - { - // Dock / Toolbar / General handles. - // --------------------------------- - - case KPE_DockWindowHandle: { - - // Draws a nice DockWindow handle including the dock title. - TQWidget* wid = const_cast<TQWidget*>(widget); - bool horizontal = flags & Style_Horizontal; - int x,y,w,h,x2,y2; - - r.rect( &x, &y, &w, &h ); - if ((w <= 2) || (h <= 2)) { - p->fillRect(r, cg.highlight()); - return; - } - - - x2 = x + w - 1; - y2 = y + h - 1; - - TQFont fnt; - fnt = TQApplication::font(wid); - fnt.setPointSize( fnt.pointSize()-2 ); - - // Draw the item on an off-screen pixmap - // to preserve Xft antialiasing for - // vertically oriented handles. - TQPixmap pix; - if (horizontal) - pix.resize( h-2, w-2 ); - else - pix.resize( w-2, h-2 ); - - TQString title = wid->parentWidget()->caption(); - TQPainter p2; - p2.begin(&pix); - p2.fillRect(pix.rect(), cg.brush(TQColorGroup::Highlight)); - p2.setPen(cg.highlightedText()); - p2.setFont(fnt); - p2.drawText(pix.rect(), AlignCenter, title); - p2.end(); - - // Draw a sunken bevel - p->setPen(cg.dark()); - p->drawLine(x, y, x2, y); - p->drawLine(x, y, x, y2); - p->setPen(cg.light()); - p->drawLine(x+1, y2, x2, y2); - p->drawLine(x2, y+1, x2, y2); - - if (horizontal) { - TQWMatrix m; - m.rotate(-90.0); - TQPixmap vpix = pix.xForm(m); - bitBlt(wid, r.x()+1, r.y()+1, &vpix); - } else - bitBlt(wid, r.x()+1, r.y()+1, &pix); - - break; - } - - - /* - * KPE_ListViewExpander and KPE_ListViewBranch are based on code from - * QWindowStyle's CC_ListView, kindly donated by TrollTech. - * CC_ListView code is Copyright (C) 1998-2000 TrollTech AS. - */ - - case KPE_ListViewExpander: { - // Typical Windows style expand/collapse element. - int radius = (r.width() - 4) / 2; - int centerx = r.x() + r.width()/2; - int centery = r.y() + r.height()/2; - - // Outer box - p->setPen( cg.mid() ); - p->drawRect( r ); - - // plus or minus - p->setPen( cg.text() ); - p->drawLine( centerx - radius, centery, centerx + radius, centery ); - if ( flags & Style_On ) // Collapsed = On - p->drawLine( centerx, centery - radius, centerx, centery + radius ); - break; - } - - case KPE_ListViewBranch: { - // Typical Windows style listview branch element (dotted line). - - // Create the dotline pixmaps if not already created - if ( !d->verticalLine ) - { - // make 128*1 and 1*128 bitmaps that can be used for - // drawing the right sort of lines. - d->verticalLine = new TQBitmap( 1, 129, true ); - d->horizontalLine = new TQBitmap( 128, 1, true ); - TQPointArray a( 64 ); - TQPainter p2; - p2.begin( d->verticalLine ); - - int i; - for( i=0; i < 64; i++ ) - a.setPoint( i, 0, i*2+1 ); - p2.setPen( color1 ); - p2.drawPoints( a ); - p2.end(); - TQApplication::flushX(); - d->verticalLine->setMask( *d->verticalLine ); - - p2.begin( d->horizontalLine ); - for( i=0; i < 64; i++ ) - a.setPoint( i, i*2+1, 0 ); - p2.setPen( color1 ); - p2.drawPoints( a ); - p2.end(); - TQApplication::flushX(); - d->horizontalLine->setMask( *d->horizontalLine ); - } - - p->setPen( cg.text() ); // cg.dark() is bad for dark color schemes. - - if (flags & Style_Horizontal) - { - int point = r.x(); - int other = r.y(); - int end = r.x()+r.width(); - int thickness = r.height(); - - while( point < end ) - { - int i = 128; - if ( i+point > end ) - i = end-point; - p->drawPixmap( point, other, *d->horizontalLine, 0, 0, i, thickness ); - point += i; - } - - } else { - int point = r.y(); - int other = r.x(); - int end = r.y()+r.height(); - int thickness = r.width(); - int pixmapoffset = (flags & Style_NoChange) ? 0 : 1; // ### Hackish - - while( point < end ) - { - int i = 128; - if ( i+point > end ) - i = end-point; - p->drawPixmap( other, point, *d->verticalLine, 0, pixmapoffset, thickness, i ); - point += i; - } - } - - break; - } - - // Reimplement the other primitives in your styles. - // The current implementation just paints something visibly different. - case KPE_ToolBarHandle: - case KPE_GeneralHandle: - case KPE_SliderHandle: - p->fillRect(r, cg.light()); - break; - - case KPE_SliderGroove: - p->fillRect(r, cg.dark()); - break; - - default: - p->fillRect(r, Qt::yellow); // Something really bad happened - highlight. - break; - } -} - - -int TDEStyle::kPixelMetric( TDEStylePixelMetric kpm, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget* /* widget */) const -{ - int value; - switch(kpm) - { - case KPM_ListViewBranchThickness: - value = 1; - break; - - case KPM_MenuItemSeparatorHeight: - case KPM_MenuItemHMargin: - case KPM_MenuItemVMargin: - case KPM_MenuItemHFrame: - case KPM_MenuItemVFrame: - case KPM_MenuItemCheckMarkHMargin: - case KPM_MenuItemArrowHMargin: - case KPM_MenuItemTabSpacing: - default: - value = 0; - } - - return value; -} - -// ----------------------------------------------------------------------------- - -// #ifdef USE_QT4 // tdebindings / smoke needs this function declaration available at all times. Furthermore I don't think it would hurt to have the declaration available at all times...so leave these commented out for now - -//void TDEStyle::drawPrimitive( TQ_ControlElement pe, -// TQPainter* p, -// const TQStyleControlElementData &ceData, -// ControlElementFlags elementFlags, -// const TQRect &r, -// const TQColorGroup &cg, -// SFlags flags, -// const TQStyleOption& opt ) const -//{ -// // FIXME: -// // What should "widget" be in actuality? How should I get it? From where? -// // Almost certainly it should not be null! -// TQWidget *widget = 0; -// drawControl(pe, p, ceData, elementFlags, r, cg, flags, opt, widget); -//} - -// #endif // USE_QT4 - -// ----------------------------------------------------------------------------- - -void TDEStyle::drawPrimitive( TQ_PrimitiveElement pe, - TQPainter* p, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags, - const TQStyleOption& opt ) const -{ - // TOOLBAR/DOCK WINDOW HANDLE - // ------------------------------------------------------------------------ - if (pe == PE_DockWindowHandle) - { - // Wild workarounds are here. Beware. - TQWidget *widget, *parent; - - if (p && p->device()->devType() == TQInternal::Widget) { - widget = static_cast<TQWidget*>(p->device()); - parent = widget->parentWidget(); - } else - return; // Don't paint on non-widgets - - // Check if we are a normal toolbar or a hidden dockwidget. - if ( parent && - (parent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || // Normal toolbar - (parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock - - // Draw a toolbar handle - drawTDEStylePrimitive( KPE_ToolBarHandle, p, ceData, elementFlags, r, cg, flags, opt, widget ); - - else if (ceData.widgetObjectTypes.contains(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING)) - - // Draw a dock window handle - drawTDEStylePrimitive( KPE_DockWindowHandle, p, ceData, elementFlags, r, cg, flags, opt, widget ); - - else - // General handle, probably a kicker applet handle. - drawTDEStylePrimitive( KPE_GeneralHandle, p, ceData, elementFlags, r, cg, flags, opt, widget ); -#if TQT_VERSION >= 0x030300 -#ifdef HAVE_XRENDER - } else if ( d->semiTransparentRubberband && pe == TQStyle::PE_RubberBand ) { - TQRect rect = r.normalize(); - TQPoint point; - point = p->xForm( point ); - - static XRenderColor clr = { 0, 0, 0, 0 }; - static unsigned long fillColor = 0; - if ( fillColor != cg.highlight().rgb() ) { - fillColor = cg.highlight().rgb(); - - unsigned long color = fillColor << 8 | 0x40; - - int red = (color >> 24) & 0xff; - int green = (color >> 16) & 0xff; - int blue = (color >> 8) & 0xff; - int alpha = (color >> 0) & 0xff; - - red = red * alpha / 255; - green = green * alpha / 255; - blue = blue * alpha / 255; - - clr.red = (red << 8) + red; - clr.green = (green << 8) + green; - clr.blue = (blue << 8) + blue; - clr.alpha = (alpha << 8) + alpha; - } - - XRenderFillRectangle( - p->device()->x11Display(), - PictOpOver, - p->device()->x11RenderHandle(), - &clr, - rect.x() + point.x(), - rect.y() + point.y(), - rect.width(), - rect.height() ); - - p->save(); - p->setRasterOp( TQt::CopyROP ); - p->setPen( TQPen( cg.highlight().dark( 160 ), 1 ) ); - p->setBrush( NoBrush ); - p->drawRect( - rect.x() + point.x(), - rect.y() + point.y(), - rect.width(), - rect.height() ); - p->restore(); -#endif -#endif - } else - TQCommonStyle::drawPrimitive( pe, p, ceData, elementFlags, r, cg, flags, opt ); -} - - - -void TDEStyle::drawControl( TQ_ControlElement element, - TQPainter* p, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags, - const TQStyleOption &opt, - const TQWidget* widget ) const -{ - switch (element) - { - // TABS - // ------------------------------------------------------------------------ - case CE_TabBarTab: { - TQTabBar::Shape tbs = ceData.tabBarData.shape; - bool selected = flags & Style_Selected; - int x = r.x(), y=r.y(), bottom=r.bottom(), right=r.right(); - - switch (tbs) { - - case TQTabBar::RoundedAbove: { - if (!selected) - p->translate(0,1); - p->setPen(selected ? cg.light() : cg.shadow()); - p->drawLine(x, y+4, x, bottom); - p->drawLine(x, y+4, x+4, y); - p->drawLine(x+4, y, right-1, y); - if (selected) - p->setPen(cg.shadow()); - p->drawLine(right, y+1, right, bottom); - - p->setPen(cg.midlight()); - p->drawLine(x+1, y+4, x+1, bottom); - p->drawLine(x+1, y+4, x+4, y+1); - p->drawLine(x+5, y+1, right-2, y+1); - - if (selected) { - p->setPen(cg.mid()); - p->drawLine(right-1, y+1, right-1, bottom); - } else { - p->setPen(cg.mid()); - p->drawPoint(right-1, y+1); - p->drawLine(x+4, y+2, right-1, y+2); - p->drawLine(x+3, y+3, right-1, y+3); - p->fillRect(x+2, y+4, r.width()-3, r.height()-6, cg.mid()); - - p->setPen(cg.light()); - p->drawLine(x, bottom-1, right, bottom-1); - p->translate(0,-1); - } - break; - } - - case TQTabBar::RoundedBelow: { - if (!selected) - p->translate(0,-1); - p->setPen(selected ? cg.light() : cg.shadow()); - p->drawLine(x, bottom-4, x, y); - if (selected) - p->setPen(cg.mid()); - p->drawLine(x, bottom-4, x+4, bottom); - if (selected) - p->setPen(cg.shadow()); - p->drawLine(x+4, bottom, right-1, bottom); - p->drawLine(right, bottom-1, right, y); - - p->setPen(cg.midlight()); - p->drawLine(x+1, bottom-4, x+1, y); - p->drawLine(x+1, bottom-4, x+4, bottom-1); - p->drawLine(x+5, bottom-1, right-2, bottom-1); - - if (selected) { - p->setPen(cg.mid()); - p->drawLine(right-1, y, right-1, bottom-1); - } else { - p->setPen(cg.mid()); - p->drawPoint(right-1, bottom-1); - p->drawLine(x+4, bottom-2, right-1, bottom-2); - p->drawLine(x+3, bottom-3, right-1, bottom-3); - p->fillRect(x+2, y+2, r.width()-3, r.height()-6, cg.mid()); - p->translate(0,1); - p->setPen(cg.dark()); - p->drawLine(x, y, right, y); - } - break; - } - - case TQTabBar::TriangularAbove: { - if (!selected) - p->translate(0,1); - p->setPen(selected ? cg.light() : cg.shadow()); - p->drawLine(x, bottom, x, y+6); - p->drawLine(x, y+6, x+6, y); - p->drawLine(x+6, y, right-6, y); - if (selected) - p->setPen(cg.mid()); - p->drawLine(right-5, y+1, right-1, y+5); - p->setPen(cg.shadow()); - p->drawLine(right, y+6, right, bottom); - - p->setPen(cg.midlight()); - p->drawLine(x+1, bottom, x+1, y+6); - p->drawLine(x+1, y+6, x+6, y+1); - p->drawLine(x+6, y+1, right-6, y+1); - p->drawLine(right-5, y+2, right-2, y+5); - p->setPen(cg.mid()); - p->drawLine(right-1, y+6, right-1, bottom); - - TQPointArray a(6); - a.setPoint(0, x+2, bottom); - a.setPoint(1, x+2, y+7); - a.setPoint(2, x+7, y+2); - a.setPoint(3, right-7, y+2); - a.setPoint(4, right-2, y+7); - a.setPoint(5, right-2, bottom); - p->setPen (selected ? cg.background() : cg.mid()); - p->setBrush(selected ? cg.background() : cg.mid()); - p->drawPolygon(a); - p->setBrush(NoBrush); - if (!selected) { - p->translate(0,-1); - p->setPen(cg.light()); - p->drawLine(x, bottom, right, bottom); - } - break; - } - - default: { // TQTabBar::TriangularBelow - if (!selected) - p->translate(0,-1); - p->setPen(selected ? cg.light() : cg.shadow()); - p->drawLine(x, y, x, bottom-6); - if (selected) - p->setPen(cg.mid()); - p->drawLine(x, bottom-6, x+6, bottom); - if (selected) - p->setPen(cg.shadow()); - p->drawLine(x+6, bottom, right-6, bottom); - p->drawLine(right-5, bottom-1, right-1, bottom-5); - if (!selected) - p->setPen(cg.shadow()); - p->drawLine(right, bottom-6, right, y); - - p->setPen(cg.midlight()); - p->drawLine(x+1, y, x+1, bottom-6); - p->drawLine(x+1, bottom-6, x+6, bottom-1); - p->drawLine(x+6, bottom-1, right-6, bottom-1); - p->drawLine(right-5, bottom-2, right-2, bottom-5); - p->setPen(cg.mid()); - p->drawLine(right-1, bottom-6, right-1, y); - - TQPointArray a(6); - a.setPoint(0, x+2, y); - a.setPoint(1, x+2, bottom-7); - a.setPoint(2, x+7, bottom-2); - a.setPoint(3, right-7, bottom-2); - a.setPoint(4, right-2, bottom-7); - a.setPoint(5, right-2, y); - p->setPen (selected ? cg.background() : cg.mid()); - p->setBrush(selected ? cg.background() : cg.mid()); - p->drawPolygon(a); - p->setBrush(NoBrush); - if (!selected) { - p->translate(0,1); - p->setPen(cg.dark()); - p->drawLine(x, y, right, y); - } - break; - } - }; - - break; - } - - // Popup menu scroller - // ------------------------------------------------------------------------ - case CE_PopupMenuScroller: { - p->fillRect(r, cg.background()); - drawPrimitive(PE_ButtonTool, p, ceData, elementFlags, r, cg, Style_Enabled); - drawPrimitive((flags & Style_Up) ? PE_ArrowUp : PE_ArrowDown, p, ceData, elementFlags, r, cg, Style_Enabled); - break; - } - - - // PROGRESSBAR - // ------------------------------------------------------------------------ - case CE_ProgressBarGroove: { - TQRect fr = subRect(SR_ProgressBarGroove, ceData, elementFlags, widget); - drawPrimitive(PE_Panel, p, ceData, elementFlags, fr, cg, Style_Sunken, TQStyleOption::SO_Default); - break; - } - - case CE_ProgressBarContents: { - // ### Take into account totalSteps() for busy indicator - TQRect cr = subRect(SR_ProgressBarContents, ceData, elementFlags, widget); - double progress = ceData.currentStep; - bool reverse = TQApplication::reverseLayout(); - int steps = ceData.totalSteps; - - if (!cr.isValid()) - return; - - // Draw progress bar - if (progress > 0 || steps == 0) { - double pg = (steps == 0) ? 0.1 : progress / steps; - int width = QMIN(cr.width(), (int)(pg * cr.width())); - if (steps == 0) { //Busy indicator - - if (width < 1) width = 1; //A busy indicator with width 0 is kind of useless - - int remWidth = cr.width() - width; //Never disappear completely - if (remWidth <= 0) remWidth = 1; //Do something non-crashy when too small... - - int pstep = int(progress) % ( 2 * remWidth ); - - if ( pstep > remWidth ) { - //Bounce about.. We're remWidth + some delta, we want to be remWidth - delta... - // - ( (remWidth + some delta) - 2* remWidth ) = - (some deleta - remWidth) = remWidth - some delta.. - pstep = - (pstep - 2 * remWidth ); - } - - if (reverse) - p->fillRect(cr.x() + cr.width() - width - pstep, cr.y(), width, cr.height(), - cg.brush(TQColorGroup::Highlight)); - else - p->fillRect(cr.x() + pstep, cr.y(), width, cr.height(), - cg.brush(TQColorGroup::Highlight)); - - return; - } - - - // Do fancy gradient for highcolor displays - if (d->highcolor) { - TQColor c(cg.highlight()); - KPixmap pix; - pix.resize(cr.width(), cr.height()); - KPixmapEffect::gradient(pix, reverse ? c.light(150) : c.dark(150), - reverse ? c.dark(150) : c.light(150), - KPixmapEffect::HorizontalGradient); - if (reverse) - p->drawPixmap(cr.x()+(cr.width()-width), cr.y(), pix, - cr.width()-width, 0, width, cr.height()); - else - p->drawPixmap(cr.x(), cr.y(), pix, 0, 0, width, cr.height()); - } else - if (reverse) - p->fillRect(cr.x()+(cr.width()-width), cr.y(), width, cr.height(), - cg.brush(TQColorGroup::Highlight)); - else - p->fillRect(cr.x(), cr.y(), width, cr.height(), - cg.brush(TQColorGroup::Highlight)); - } - break; - } - - case CE_ProgressBarLabel: { - TQRect cr = subRect(SR_ProgressBarContents, ceData, elementFlags, widget); - double progress = ceData.currentStep; - bool reverse = TQApplication::reverseLayout(); - int steps = ceData.totalSteps; - - if (!cr.isValid()) - return; - - TQFont font = p->font(); - font.setBold(true); - p->setFont(font); - - // Draw label - if (progress > 0 || steps == 0) { - double pg = (steps == 0) ? 1.0 : progress / steps; - int width = QMIN(cr.width(), (int)(pg * cr.width())); - TQRect crect; - if (reverse) - crect.setRect(cr.x()+(cr.width()-width), cr.y(), cr.width(), cr.height()); - else - crect.setRect(cr.x()+width, cr.y(), cr.width(), cr.height()); - - p->save(); - p->setPen((elementFlags & CEF_IsEnabled) ? (reverse ? cg.text() : cg.highlightedText()) : cg.text()); - p->drawText(r, AlignCenter, ceData.progressText); - p->setClipRect(crect); - p->setPen(reverse ? cg.highlightedText() : cg.text()); - p->drawText(r, AlignCenter, ceData.progressText); - p->restore(); - - } else { - p->setPen(cg.text()); - p->drawText(r, AlignCenter, ceData.progressText); - } - - break; - } - - default: - TQCommonStyle::drawControl(element, p, ceData, elementFlags, r, cg, flags, opt, widget); - } -} - - -TQRect TDEStyle::subRect(SubRect r, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, const TQWidget* widget) const -{ - switch(r) - { - // KDE2 look smooth progress bar - // ------------------------------------------------------------------------ - case SR_ProgressBarGroove: - return ceData.rect; - - case SR_ProgressBarContents: - case SR_ProgressBarLabel: { - // ### take into account indicatorFollowsStyle() - TQRect rt = ceData.rect; - return TQRect(rt.x()+2, rt.y()+2, rt.width()-4, rt.height()-4); - } - - default: - return TQCommonStyle::subRect(r, ceData, elementFlags, widget); - } -} - - -int TDEStyle::pixelMetric(PixelMetric m, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget* widget) const -{ - switch(m) - { - // BUTTONS - // ------------------------------------------------------------------------ - case PM_ButtonShiftHorizontal: // Offset by 1 - case PM_ButtonShiftVertical: // ### Make configurable - return 1; - - case PM_DockWindowHandleExtent: - { - TQWidget* parent = 0; - // Check that we are not a normal toolbar or a hidden dockwidget, - // in which case we need to adjust the height for font size - if (widget - && !(ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING)) - && !(ceData.parentWidgetData.widgetObjectTypes.contains(TQMAINWINDOW_OBJECT_NAME_STRING)) - && (ceData.widgetObjectTypes.contains(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING)) ) - return widget->fontMetrics().lineSpacing(); - else - return TQCommonStyle::pixelMetric(m, ceData, elementFlags, widget); - } - - // TABS - // ------------------------------------------------------------------------ - case PM_TabBarTabHSpace: - return 24; - - case PM_TabBarTabVSpace: { - if ( ceData.tabBarData.shape == TQTabBar::RoundedAbove || - ceData.tabBarData.shape == TQTabBar::RoundedBelow ) - return 10; - else - return 4; - } - - case PM_TabBarTabOverlap: { - TQTabBar::Shape tbs = ceData.tabBarData.shape; - - if ( (tbs == TQTabBar::RoundedAbove) || - (tbs == TQTabBar::RoundedBelow) ) - return 0; - else - return 2; - } - - // SLIDER - // ------------------------------------------------------------------------ - case PM_SliderLength: - return 18; - - case PM_SliderThickness: - return 24; - - // Determines how much space to leave for the actual non-tickmark - // portion of the slider. - case PM_SliderControlThickness: { - TQSlider::TickSetting ts = (TQSlider::TickSetting)ceData.tickMarkSetting; - int thickness = (ceData.orientation == TQt::Horizontal) ? - ceData.rect.height() : ceData.rect.width(); - switch (ts) { - case TQSlider::NoMarks: // Use total area. - break; - case TQSlider::Both: - thickness = (thickness/2) + 3; // Use approx. 1/2 of area. - break; - default: // Use approx. 2/3 of area - thickness = ((thickness*2)/3) + 3; - break; - }; - return thickness; - } - - // SPLITTER - // ------------------------------------------------------------------------ - case PM_SplitterWidth: - if (ceData.widgetObjectTypes.contains(TQDOCKWINDOWRESIZEHANDLE_OBJECT_NAME_STRING)) - return 8; // ### why do we need 2pix extra? - else - return 6; - - // FRAMES - // ------------------------------------------------------------------------ - case PM_MenuBarFrameWidth: - return 1; - - case PM_DockWindowFrameWidth: - return 1; - - // GENERAL - // ------------------------------------------------------------------------ - case PM_MaximumDragDistance: - return -1; - - case PM_MenuBarItemSpacing: - return 5; - - case PM_ToolBarItemSpacing: - return 0; - - case PM_PopupMenuScrollerHeight: - return pixelMetric( PM_ScrollBarExtent, ceData, elementFlags, 0); - - default: - return TQCommonStyle::pixelMetric( m, ceData, elementFlags, widget ); - } -} - -//Helper to find the next sibling that's not hidden -static TQListViewItem* nextVisibleSibling(TQListViewItem* item) -{ - TQListViewItem* sibling = item; - do - { - sibling = sibling->nextSibling(); - } - while (sibling && !sibling->isVisible()); - - return sibling; -} - -void TDEStyle::drawComplexControl( TQ_ComplexControl control, - TQPainter* p, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags, - SCFlags controls, - SCFlags active, - const TQStyleOption &opt, - const TQWidget* widget ) const -{ - switch(control) - { - // 3 BUTTON SCROLLBAR - // ------------------------------------------------------------------------ - case CC_ScrollBar: { - // Many thanks to Brad Hughes for contributing this code. - bool useThreeButtonScrollBar = (d->scrollbarType & ThreeButtonScrollBar); - - bool maxedOut = (ceData.minSteps == ceData.maxSteps); - bool horizontal = (ceData.orientation == TQt::Horizontal); - SFlags sflags = ((horizontal ? Style_Horizontal : Style_Default) | - (maxedOut ? Style_Default : Style_Enabled)); - - TQRect addline, subline, subline2, addpage, subpage, slider, first, last; - subline = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarSubLine, opt, widget); - addline = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarAddLine, opt, widget); - subpage = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarSubPage, opt, widget); - addpage = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarAddPage, opt, widget); - slider = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarSlider, opt, widget); - first = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarFirst, opt, widget); - last = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarLast, opt, widget); - subline2 = addline; - - if ( useThreeButtonScrollBar ) { - if (horizontal) { - subline2.moveBy(-addline.width(), 0); - } - else { - subline2.moveBy(0, -addline.height()); - } - } - - // Draw the up/left button set - if ((controls & SC_ScrollBarSubLine) && subline.isValid()) { - drawPrimitive(PE_ScrollBarSubLine, p, ceData, elementFlags, subline, cg, - sflags | (active == SC_ScrollBarSubLine ? - Style_Down : Style_Default)); - - if (useThreeButtonScrollBar && subline2.isValid()) - drawPrimitive(PE_ScrollBarSubLine, p, ceData, elementFlags, subline2, cg, - sflags | (active == SC_ScrollBarSubLine ? - Style_Down : Style_Default)); - } - - if ((controls & SC_ScrollBarAddLine) && addline.isValid()) - drawPrimitive(PE_ScrollBarAddLine, p, ceData, elementFlags, addline, cg, - sflags | ((active == SC_ScrollBarAddLine) ? - Style_Down : Style_Default)); - - if ((controls & SC_ScrollBarSubPage) && subpage.isValid()) - drawPrimitive(PE_ScrollBarSubPage, p, ceData, elementFlags, subpage, cg, - sflags | ((active == SC_ScrollBarSubPage) ? - Style_Down : Style_Default)); - - if ((controls & SC_ScrollBarAddPage) && addpage.isValid()) - drawPrimitive(PE_ScrollBarAddPage, p, ceData, elementFlags, addpage, cg, - sflags | ((active == SC_ScrollBarAddPage) ? - Style_Down : Style_Default)); - - if ((controls & SC_ScrollBarFirst) && first.isValid()) - drawPrimitive(PE_ScrollBarFirst, p, ceData, elementFlags, first, cg, - sflags | ((active == SC_ScrollBarFirst) ? - Style_Down : Style_Default)); - - if ((controls & SC_ScrollBarLast) && last.isValid()) - drawPrimitive(PE_ScrollBarLast, p, ceData, elementFlags, last, cg, - sflags | ((active == SC_ScrollBarLast) ? - Style_Down : Style_Default)); - - if ((controls & SC_ScrollBarSlider) && slider.isValid()) { - drawPrimitive(PE_ScrollBarSlider, p, ceData, elementFlags, slider, cg, - sflags | ((active == SC_ScrollBarSlider) ? - Style_Down : Style_Default)); - // Draw focus rect - if (elementFlags & CEF_HasFocus) { - TQRect fr(slider.x() + 2, slider.y() + 2, - slider.width() - 5, slider.height() - 5); - drawPrimitive(PE_FocusRect, p, ceData, elementFlags, fr, cg, Style_Default); - } - } - break; - } - - - // SLIDER - // ------------------------------------------------------------------- - case CC_Slider: { - TQRect groove = querySubControlMetrics(CC_Slider, ceData, elementFlags, SC_SliderGroove, opt, widget); - TQRect handle = querySubControlMetrics(CC_Slider, ceData, elementFlags, SC_SliderHandle, opt, widget); - - // Double-buffer slider for no flicker - TQPixmap pix(ceData.rect.size()); - TQPainter p2; - p2.begin(&pix); - - if ( (elementFlags & CEF_HasParentWidget) && - !ceData.parentWidgetData.bgPixmap.isNull() ) { - TQPixmap pixmap = ceData.parentWidgetData.bgPixmap; - p2.drawTiledPixmap(r, pixmap, ceData.pos); - } else - pix.fill(cg.background()); - - // Draw slider groove - if ((controls & SC_SliderGroove) && groove.isValid()) { - drawTDEStylePrimitive( KPE_SliderGroove, &p2, ceData, elementFlags, groove, cg, flags, opt, widget ); - - // Draw the focus rect around the groove - if (elementFlags & CEF_HasFocus) { - drawPrimitive(PE_FocusRect, &p2, ceData, elementFlags, groove, cg); - } - } - - // Draw the tickmarks - if (controls & SC_SliderTickmarks) - TQCommonStyle::drawComplexControl(control, &p2, ceData, elementFlags, - r, cg, flags, SC_SliderTickmarks, active, opt, widget); - - // Draw the slider handle - if ((controls & SC_SliderHandle) && handle.isValid()) { - if (active == SC_SliderHandle) - flags |= Style_Active; - drawTDEStylePrimitive( KPE_SliderHandle, &p2, ceData, elementFlags, handle, cg, flags, opt, widget ); - } - - p2.end(); - - TQPaintDevice* ppd = p->device(); - if (ppd->isExtDev()) { - p->drawPixmap(0, 0, pix); - } - else { - bitBlt((TQWidget*)widget, r.x(), r.y(), &pix); - } - break; - } - - // LISTVIEW - // ------------------------------------------------------------------- - case CC_ListView: { - - /* - * Many thanks to TrollTech AS for donating CC_ListView from TQWindowsStyle. - * CC_ListView code is Copyright (C) 1998-2000 TrollTech AS. - */ - - // Paint the icon and text. - if ( controls & SC_ListView ) - TQCommonStyle::drawComplexControl( control, p, ceData, elementFlags, r, cg, flags, controls, active, opt, widget ); - - // If we're have a branch or are expanded... - if ( controls & (SC_ListViewBranch | SC_ListViewExpand) ) - { - // If no list view item was supplied, break - if (opt.isDefault()) - break; - - TQListViewItem *item = opt.listViewItem(); - TQListViewItem *child = item->firstChild(); - - int y = r.y(); - int c; // dotline vertice count - int dotoffset = 0; - TQPointArray dotlines; - - if ( active == SC_All && controls == SC_ListViewExpand ) { - // We only need to draw a vertical line - c = 2; - dotlines.resize(2); - dotlines[0] = TQPoint( r.right(), r.top() ); - dotlines[1] = TQPoint( r.right(), r.bottom() ); - - } else { - - int linetop = 0, linebot = 0; - // each branch needs at most two lines, ie. four end points - dotoffset = (item->itemPos() + item->height() - y) % 2; - dotlines.resize( item->childCount() * 4 ); - c = 0; - - // skip the stuff above the exposed rectangle - while ( child && y + child->height() <= 0 ) - { - y += child->totalHeight(); - child = nextVisibleSibling(child); - } - - int bx = r.width() / 2; - - // paint stuff in the magical area - TQListView* v = item->listView(); - int lh = QMAX( p->fontMetrics().height() + 2 * v->itemMargin(), - TQApplication::globalStrut().height() ); - if ( lh % 2 > 0 ) - lh++; - - // Draw all the expand/close boxes... - TQRect boxrect; - TQStyle::StyleFlags boxflags; - while ( child && y < r.height() ) - { - linebot = y + lh/2; - if ( (child->isExpandable() || child->childCount()) && - (child->height() > 0) ) - { - // The primitive requires a rect. - boxrect = TQRect( bx-4, linebot-4, 9, 9 ); - boxflags = child->isOpen() ? TQStyle::Style_Off : TQStyle::Style_On; - - // TDEStyle extension: Draw the box and expand/collapse indicator - drawTDEStylePrimitive( KPE_ListViewExpander, p, ceData, elementFlags, boxrect, cg, boxflags, opt, NULL ); - - // dotlinery - p->setPen( cg.mid() ); - dotlines[c++] = TQPoint( bx, linetop ); - dotlines[c++] = TQPoint( bx, linebot - 5 ); - dotlines[c++] = TQPoint( bx + 5, linebot ); - dotlines[c++] = TQPoint( r.width(), linebot ); - linetop = linebot + 5; - } else { - // just dotlinery - dotlines[c++] = TQPoint( bx+1, linebot ); - dotlines[c++] = TQPoint( r.width(), linebot ); - } - - y += child->totalHeight(); - child = nextVisibleSibling(child); - } - - if ( child ) // there's a child to draw, so move linebot to edge of rectangle - linebot = r.height(); - - if ( linetop < linebot ) - { - dotlines[c++] = TQPoint( bx, linetop ); - dotlines[c++] = TQPoint( bx, linebot ); - } - } - - // Draw all the branches... - static int thickness = kPixelMetric( KPM_ListViewBranchThickness, ceData, elementFlags ); - int line; // index into dotlines - TQRect branchrect; - TQStyle::StyleFlags branchflags; - for( line = 0; line < c; line += 2 ) - { - // assumptions here: lines are horizontal or vertical. - // lines always start with the numerically lowest - // coordinate. - - // point ... relevant coordinate of current point - // end ..... same coordinate of the end of the current line - // other ... the other coordinate of the current point/line - if ( dotlines[line].y() == dotlines[line+1].y() ) - { - // Horizontal branch - int end = dotlines[line+1].x(); - int point = dotlines[line].x(); - int other = dotlines[line].y(); - - branchrect = TQRect( point, other-(thickness/2), end-point, thickness ); - branchflags = TQStyle::Style_Horizontal; - - // TDEStyle extension: Draw the horizontal branch - drawTDEStylePrimitive( KPE_ListViewBranch, p, ceData, elementFlags, branchrect, cg, branchflags, opt, NULL ); - - } else { - // Vertical branch - int end = dotlines[line+1].y(); - int point = dotlines[line].y(); - int other = dotlines[line].x(); - int pixmapoffset = ((point & 1) != dotoffset ) ? 1 : 0; - - branchrect = TQRect( other-(thickness/2), point, thickness, end-point ); - if (!pixmapoffset) // ### Hackish - used to hint the offset - branchflags = TQStyle::Style_NoChange; - else - branchflags = TQStyle::Style_Default; - - // TDEStyle extension: Draw the vertical branch - drawTDEStylePrimitive( KPE_ListViewBranch, p, ceData, elementFlags, branchrect, cg, branchflags, opt, NULL ); - } - } - } - break; - } - - default: - TQCommonStyle::drawComplexControl( control, p, ceData, elementFlags, r, cg, - flags, controls, active, opt, widget ); - break; - } -} - - -TQStyle::SubControl TDEStyle::querySubControl( TQ_ComplexControl control, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQPoint &pos, - const TQStyleOption &opt, - const TQWidget* widget ) const -{ - TQStyle::SubControl ret = TQCommonStyle::querySubControl(control, ceData, elementFlags, pos, opt, widget); - - if (d->scrollbarType == ThreeButtonScrollBar) { - // Enable third button - if (control == CC_ScrollBar && ret == SC_None) - ret = SC_ScrollBarSubLine; - } - return ret; -} - - -TQRect TDEStyle::querySubControlMetrics( TQ_ComplexControl control, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - SubControl sc, - const TQStyleOption &opt, - const TQWidget* widget ) const -{ - TQRect ret; - - if (control == CC_ScrollBar) - { - bool threeButtonScrollBar = d->scrollbarType & ThreeButtonScrollBar; - bool platinumScrollBar = d->scrollbarType & PlatinumStyleScrollBar; - bool nextScrollBar = d->scrollbarType & NextStyleScrollBar; - - bool horizontal = ceData.orientation == TQt::Horizontal; - int sliderstart = ceData.startStep; - int sbextent = pixelMetric(PM_ScrollBarExtent, ceData, elementFlags, widget); - int maxlen = (horizontal ? ceData.rect.width() : ceData.rect.height()) - - (sbextent * (threeButtonScrollBar ? 3 : 2)); - int sliderlen; - - // calculate slider length - if (ceData.maxSteps != ceData.minSteps) - { - uint range = ceData.maxSteps - ceData.minSteps; - sliderlen = (ceData.pageStep * maxlen) / (range + ceData.pageStep); - - int slidermin = pixelMetric( PM_ScrollBarSliderMin, ceData, elementFlags, widget ); - if ( sliderlen < slidermin || range > INT_MAX / 2 ) - sliderlen = slidermin; - if ( sliderlen > maxlen ) - sliderlen = maxlen; - } else - sliderlen = maxlen; - - // Subcontrols - switch (sc) - { - case SC_ScrollBarSubLine: { - // top/left button - if (platinumScrollBar) { - if (horizontal) - ret.setRect(ceData.rect.width() - 2 * sbextent, 0, sbextent, sbextent); - else - ret.setRect(0, ceData.rect.height() - 2 * sbextent, sbextent, sbextent); - } else - ret.setRect(0, 0, sbextent, sbextent); - break; - } - - case SC_ScrollBarAddLine: { - // bottom/right button - if (nextScrollBar) { - if (horizontal) - ret.setRect(sbextent, 0, sbextent, sbextent); - else - ret.setRect(0, sbextent, sbextent, sbextent); - } else { - if (horizontal) - ret.setRect(ceData.rect.width() - sbextent, 0, sbextent, sbextent); - else - ret.setRect(0, ceData.rect.height() - sbextent, sbextent, sbextent); - } - break; - } - - case SC_ScrollBarSubPage: { - // between top/left button and slider - if (platinumScrollBar) { - if (horizontal) - ret.setRect(0, 0, sliderstart, sbextent); - else - ret.setRect(0, 0, sbextent, sliderstart); - } else if (nextScrollBar) { - if (horizontal) - ret.setRect(sbextent*2, 0, sliderstart-2*sbextent, sbextent); - else - ret.setRect(0, sbextent*2, sbextent, sliderstart-2*sbextent); - } else { - if (horizontal) - ret.setRect(sbextent, 0, sliderstart - sbextent, sbextent); - else - ret.setRect(0, sbextent, sbextent, sliderstart - sbextent); - } - break; - } - - case SC_ScrollBarAddPage: { - // between bottom/right button and slider - int fudge; - - if (platinumScrollBar) - fudge = 0; - else if (nextScrollBar) - fudge = 2*sbextent; - else - fudge = sbextent; - - if (horizontal) - ret.setRect(sliderstart + sliderlen, 0, - maxlen - sliderstart - sliderlen + fudge, sbextent); - else - ret.setRect(0, sliderstart + sliderlen, sbextent, - maxlen - sliderstart - sliderlen + fudge); - break; - } - - case SC_ScrollBarGroove: { - int multi = threeButtonScrollBar ? 3 : 2; - int fudge; - - if (platinumScrollBar) - fudge = 0; - else if (nextScrollBar) - fudge = 2*sbextent; - else - fudge = sbextent; - - if (horizontal) - ret.setRect(fudge, 0, ceData.rect.width() - sbextent * multi, ceData.rect.height()); - else - ret.setRect(0, fudge, ceData.rect.width(), ceData.rect.height() - sbextent * multi); - break; - } - - case SC_ScrollBarSlider: { - if (horizontal) - ret.setRect(sliderstart, 0, sliderlen, sbextent); - else - ret.setRect(0, sliderstart, sbextent, sliderlen); - break; - } - - default: - ret = TQCommonStyle::querySubControlMetrics(control, ceData, elementFlags, sc, opt, widget); - break; - } - } else - ret = TQCommonStyle::querySubControlMetrics(control, ceData, elementFlags, sc, opt, widget); - - return ret; -} - -static const char * const kstyle_close_xpm[] = { -"12 12 2 1", -"# c #000000", -". c None", -"............", -"............", -"..##....##..", -"...##..##...", -"....####....", -".....##.....", -"....####....", -"...##..##...", -"..##....##..", -"............", -"............", -"............"}; - -static const char * const kstyle_maximize_xpm[]={ -"12 12 2 1", -"# c #000000", -". c None", -"............", -"............", -".##########.", -".##########.", -".#........#.", -".#........#.", -".#........#.", -".#........#.", -".#........#.", -".#........#.", -".##########.", -"............"}; - - -static const char * const kstyle_minimize_xpm[] = { -"12 12 2 1", -"# c #000000", -". c None", -"............", -"............", -"............", -"............", -"............", -"............", -"............", -"...######...", -"...######...", -"............", -"............", -"............"}; - -static const char * const kstyle_normalizeup_xpm[] = { -"12 12 2 1", -"# c #000000", -". c None", -"............", -"...#######..", -"...#######..", -"...#.....#..", -".#######.#..", -".#######.#..", -".#.....#.#..", -".#.....###..", -".#.....#....", -".#.....#....", -".#######....", -"............"}; - - -static const char * const kstyle_shade_xpm[] = { -"12 12 2 1", -"# c #000000", -". c None", -"............", -"............", -"............", -"............", -"............", -".....#......", -"....###.....", -"...#####....", -"..#######...", -"............", -"............", -"............"}; - -static const char * const kstyle_unshade_xpm[] = { -"12 12 2 1", -"# c #000000", -". c None", -"............", -"............", -"............", -"............", -"..#######...", -"...#####....", -"....###.....", -".....#......", -"............", -"............", -"............", -"............"}; - -static const char * const dock_window_close_xpm[] = { -"8 8 2 1", -"# c #000000", -". c None", -"##....##", -".##..##.", -"..####..", -"...##...", -"..####..", -".##..##.", -"##....##", -"........"}; - -// Message box icons, from page 210 of the Windows style guide. - -// Hand-drawn to resemble Microsoft's icons, but in the Mac/Netscape -// palette. The "question mark" icon, which Microsoft recommends not -// using but a lot of people still use, is left out. - -/* XPM */ -static const char * const information_xpm[]={ -"32 32 5 1", -". c None", -"c c #000000", -"* c #999999", -"a c #ffffff", -"b c #0000ff", -"...........********.............", -"........***aaaaaaaa***..........", -"......**aaaaaaaaaaaaaa**........", -".....*aaaaaaaaaaaaaaaaaa*.......", -"....*aaaaaaaabbbbaaaaaaaac......", -"...*aaaaaaaabbbbbbaaaaaaaac.....", -"..*aaaaaaaaabbbbbbaaaaaaaaac....", -".*aaaaaaaaaaabbbbaaaaaaaaaaac...", -".*aaaaaaaaaaaaaaaaaaaaaaaaaac*..", -"*aaaaaaaaaaaaaaaaaaaaaaaaaaaac*.", -"*aaaaaaaaaabbbbbbbaaaaaaaaaaac*.", -"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", -"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", -"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", -"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", -"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", -".*aaaaaaaaaaabbbbbaaaaaaaaaac***", -".*aaaaaaaaaaabbbbbaaaaaaaaaac***", -"..*aaaaaaaaaabbbbbaaaaaaaaac***.", -"...caaaaaaabbbbbbbbbaaaaaac****.", -"....caaaaaaaaaaaaaaaaaaaac****..", -".....caaaaaaaaaaaaaaaaaac****...", -"......ccaaaaaaaaaaaaaacc****....", -".......*cccaaaaaaaaccc*****.....", -"........***cccaaaac*******......", -"..........****caaac*****........", -".............*caaac**...........", -"...............caac**...........", -"................cac**...........", -".................cc**...........", -"..................***...........", -"...................**..........."}; -/* XPM */ -static const char* const warning_xpm[]={ -"32 32 4 1", -". c None", -"a c #ffff00", -"* c #000000", -"b c #999999", -".............***................", -"............*aaa*...............", -"...........*aaaaa*b.............", -"...........*aaaaa*bb............", -"..........*aaaaaaa*bb...........", -"..........*aaaaaaa*bb...........", -".........*aaaaaaaaa*bb..........", -".........*aaaaaaaaa*bb..........", -"........*aaaaaaaaaaa*bb.........", -"........*aaaa***aaaa*bb.........", -".......*aaaa*****aaaa*bb........", -".......*aaaa*****aaaa*bb........", -"......*aaaaa*****aaaaa*bb.......", -"......*aaaaa*****aaaaa*bb.......", -".....*aaaaaa*****aaaaaa*bb......", -".....*aaaaaa*****aaaaaa*bb......", -"....*aaaaaaaa***aaaaaaaa*bb.....", -"....*aaaaaaaa***aaaaaaaa*bb.....", -"...*aaaaaaaaa***aaaaaaaaa*bb....", -"...*aaaaaaaaaa*aaaaaaaaaa*bb....", -"..*aaaaaaaaaaa*aaaaaaaaaaa*bb...", -"..*aaaaaaaaaaaaaaaaaaaaaaa*bb...", -".*aaaaaaaaaaaa**aaaaaaaaaaa*bb..", -".*aaaaaaaaaaa****aaaaaaaaaa*bb..", -"*aaaaaaaaaaaa****aaaaaaaaaaa*bb.", -"*aaaaaaaaaaaaa**aaaaaaaaaaaa*bb.", -"*aaaaaaaaaaaaaaaaaaaaaaaaaaa*bbb", -"*aaaaaaaaaaaaaaaaaaaaaaaaaaa*bbb", -".*aaaaaaaaaaaaaaaaaaaaaaaaa*bbbb", -"..*************************bbbbb", -"....bbbbbbbbbbbbbbbbbbbbbbbbbbb.", -".....bbbbbbbbbbbbbbbbbbbbbbbbb.."}; -/* XPM */ -static const char* const critical_xpm[]={ -"32 32 4 1", -". c None", -"a c #999999", -"* c #ff0000", -"b c #ffffff", -"...........********.............", -".........************...........", -".......****************.........", -"......******************........", -".....********************a......", -"....**********************a.....", -"...************************a....", -"..*******b**********b*******a...", -"..******bbb********bbb******a...", -".******bbbbb******bbbbb******a..", -".*******bbbbb****bbbbb*******a..", -"*********bbbbb**bbbbb*********a.", -"**********bbbbbbbbbb**********a.", -"***********bbbbbbbb***********aa", -"************bbbbbb************aa", -"************bbbbbb************aa", -"***********bbbbbbbb***********aa", -"**********bbbbbbbbbb**********aa", -"*********bbbbb**bbbbb*********aa", -".*******bbbbb****bbbbb*******aa.", -".******bbbbb******bbbbb******aa.", -"..******bbb********bbb******aaa.", -"..*******b**********b*******aa..", -"...************************aaa..", -"....**********************aaa...", -"....a********************aaa....", -".....a******************aaa.....", -"......a****************aaa......", -".......aa************aaaa.......", -".........aa********aaaaa........", -"...........aaaaaaaaaaa..........", -".............aaaaaaa............"}; - -TQPixmap TDEStyle::stylePixmap( StylePixmap stylepixmap, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQStyleOption& opt, - const TQWidget* widget) const -{ - switch (stylepixmap) { - case SP_TitleBarShadeButton: - return TQPixmap(const_cast<const char**>(kstyle_shade_xpm)); - case SP_TitleBarUnshadeButton: - return TQPixmap(const_cast<const char**>(kstyle_unshade_xpm)); - case SP_TitleBarNormalButton: - return TQPixmap(const_cast<const char**>(kstyle_normalizeup_xpm)); - case SP_TitleBarMinButton: - return TQPixmap(const_cast<const char**>(kstyle_minimize_xpm)); - case SP_TitleBarMaxButton: - return TQPixmap(const_cast<const char**>(kstyle_maximize_xpm)); - case SP_TitleBarCloseButton: - return TQPixmap(const_cast<const char**>(kstyle_close_xpm)); - case SP_DockWindowCloseButton: - return TQPixmap(const_cast<const char**>(dock_window_close_xpm )); - case SP_MessageBoxInformation: - return TQPixmap(const_cast<const char**>(information_xpm)); - case SP_MessageBoxWarning: - return TQPixmap(const_cast<const char**>(warning_xpm)); - case SP_MessageBoxCritical: - return TQPixmap(const_cast<const char**>(critical_xpm)); - default: - break; - } - return TQCommonStyle::stylePixmap(stylepixmap, ceData, elementFlags, opt, widget); -} - - -int TDEStyle::styleHint( TQ_StyleHint sh, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, - const TQStyleOption &opt, TQStyleHintReturn* shr, const TQWidget* w) const -{ - switch (sh) - { - case SH_EtchDisabledText: - return d->etchDisabledText ? 1 : 0; - - case SH_PopupMenu_Scrollable: - return d->scrollablePopupmenus ? 1 : 0; - - case SH_HideUnderlineAcceleratorWhenAltUp: - return d->autoHideAccelerators ? 1 : 0; - - case SH_MenuBar_AltKeyNavigation: - return d->menuAltKeyNavigation ? 1 : 0; - - case SH_PopupMenu_SubMenuPopupDelay: - if ( styleHint( SH_PopupMenu_SloppySubMenus, ceData, elementFlags, TQStyleOption::Default, 0, w ) ) - return QMIN( 100, d->popupMenuDelay ); - else - return d->popupMenuDelay; - - case SH_PopupMenu_SloppySubMenus: - return d->sloppySubMenus; - - case SH_ItemView_ChangeHighlightOnFocus: - case SH_Slider_SloppyKeyEvents: - case SH_MainWindow_SpaceBelowMenuBar: - case SH_PopupMenu_AllowActiveAndDisabled: - return 0; - - case SH_Slider_SnapToValue: - case SH_PrintDialog_RightAlignButtons: - case SH_FontDialog_SelectAssociatedText: - case SH_MenuBar_MouseTracking: - case SH_PopupMenu_MouseTracking: - case SH_ComboBox_ListMouseTracking: - case SH_ScrollBar_MiddleClickAbsolutePosition: - return 1; - case SH_LineEdit_PasswordCharacter: - { - if (w) { - const TQFontMetrics &fm = w->fontMetrics(); - if (fm.inFont(TQChar(0x25CF))) { - return 0x25CF; - } else if (fm.inFont(TQChar(0x2022))) { - return 0x2022; - } - } - return '*'; - } - - default: - return TQCommonStyle::styleHint(sh, ceData, elementFlags, opt, shr, w); - } -} - - -bool TDEStyle::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *event ) -{ - if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) { - TQObject* object = reinterpret_cast<TQObject*>(source); - if ( d->useFilledFrameWorkaround ) - { - // Make the QMenuBar/TQToolBar paintEvent() cover a larger area to - // ensure that the filled frame contents are properly painted. - // We essentially modify the paintEvent's rect to include the - // panel border, which also paints the widget's interior. - // This is nasty, but I see no other way to properly repaint - // filled frames in all QMenuBars and QToolBars. - // -- Karol. - TQFrame *frame = 0; - if ( event->type() == TQEvent::Paint - && (frame = ::tqqt_cast<TQFrame*>(object)) ) - { - if (frame->frameShape() != TQFrame::ToolBarPanel && frame->frameShape() != TQFrame::MenuBarPanel) - return false; - - bool horizontal = true; - TQPaintEvent* pe = (TQPaintEvent*)event; - TQToolBar *toolbar = ::tqqt_cast< TQToolBar *>( frame ); - TQRect r = pe->rect(); - - if (toolbar && toolbar->orientation() == Qt::Vertical) - horizontal = false; - - if (horizontal) { - if ( r.height() == frame->height() ) - return false; // Let TQFrame handle the painting now. - - // Else, send a new paint event with an updated paint rect. - TQPaintEvent dummyPE( TQRect( r.x(), 0, r.width(), frame->height()) ); - TQApplication::sendEvent( frame, &dummyPE ); - } - else { // Vertical - if ( r.width() == frame->width() ) - return false; - - TQPaintEvent dummyPE( TQRect( 0, r.y(), frame->width(), r.height()) ); - TQApplication::sendEvent( frame, &dummyPE ); - } - - // Discard this event as we sent a new paintEvent. - return true; - } - } - } - - return false; -} - - -// ----------------------------------------------------------------------------- -// I N T E R N A L - TDEStyle menu transparency handler -// ----------------------------------------------------------------------------- - -TransparencyHandler::TransparencyHandler( TDEStyle* style, - TransparencyEngine tEngine, float menuOpacity, bool useDropShadow ) - : TQObject() -{ - te = tEngine; - kstyle = style; - opacity = menuOpacity; - dropShadow = useDropShadow; - pix.setOptimization(TQPixmap::BestOptim); -} - -TransparencyHandler::~TransparencyHandler() -{ -} - -bool TransparencyHandler::haveX11RGBASupport() -{ - // Simple way to determine if we have ARGB support - if (TQPaintDevice::x11AppDepth() == 32) { - return true; - } - else { - return false; - } -} - -#define REAL_ALPHA_STRENGTH 255.0 - -// This is meant to be ugly but fast. -void TransparencyHandler::rightShadow(TQImage& dst) -{ - bool have_composite = haveX11RGBASupport(); - - if (dst.depth() != 32) - dst = dst.convertDepth(32); - - // blend top-right corner. - int pixels = dst.width() * dst.height(); -#ifdef WORDS_BIGENDIAN - register unsigned char* data = dst.bits() + 1; // Skip alpha -#else - register unsigned char* data = dst.bits(); // Skip alpha -#endif - for(register int i = 0; i < 16; i++) { - if (have_composite) { - data++; - data++; - data++; - *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-top_right_corner[i])); data++; - } - else { - *data = (unsigned char)((*data)*top_right_corner[i]); data++; - *data = (unsigned char)((*data)*top_right_corner[i]); data++; - *data = (unsigned char)((*data)*top_right_corner[i]); data++; - data++; // skip alpha - } - } - - pixels -= 32; // tint right strip without rounded edges. - register int c = 0; - for(register int i = 0; i < pixels; i++) { - if (have_composite) { - data++; - data++; - data++;; - *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-shadow_strip[c])); data++; - } - else { - *data = (unsigned char)((*data)*shadow_strip[c]); data++; - *data = (unsigned char)((*data)*shadow_strip[c]); data++; - *data = (unsigned char)((*data)*shadow_strip[c]); data++; - data++; // skip alpha - } - ++c; - c %= 4; - } - - // tint bottom edge - for(register int i = 0; i < 16; i++) { - if (have_composite) { - data++; - data++; - data++; - *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-bottom_right_corner[i])); data++; - } - else { - *data = (unsigned char)((*data)*bottom_right_corner[i]); data++; - *data = (unsigned char)((*data)*bottom_right_corner[i]); data++; - *data = (unsigned char)((*data)*bottom_right_corner[i]); data++; - data++; // skip alpha - } - } -} - -void TransparencyHandler::bottomShadow(TQImage& dst) -{ - bool have_composite = haveX11RGBASupport(); - - if (dst.depth() != 32) - dst = dst.convertDepth(32); - - int line = 0; - int width = dst.width() - 4; - double strip_data = shadow_strip[0]; - double* corner = const_cast<double*>(bottom_left_corner); - -#ifdef WORDS_BIGENDIAN - register unsigned char* data = dst.bits() + 1; // Skip alpha -#else - register unsigned char* data = dst.bits(); // Skip alpha -#endif - - for(int y = 0; y < 4; y++) - { - // Bottom-left Corner - for(register int x = 0; x < 4; x++) { - if (have_composite) { - data++; - data++; - data++; - *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-(*corner))); data++; - } - else { - *data = (unsigned char)((*data)*(*corner)); data++; - *data = (unsigned char)((*data)*(*corner)); data++; - *data = (unsigned char)((*data)*(*corner)); data++; - data++; // skip alpha - } - corner++; - } - - // Scanline - for(register int x = 0; x < width; x++) { - if (have_composite) { - data++; - data++; - data++; - *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-strip_data)); data++; - } - else { - *data = (unsigned char)((*data)*strip_data); data++; - *data = (unsigned char)((*data)*strip_data); data++; - *data = (unsigned char)((*data)*strip_data); data++; - data++; // skip alpha - } - } - - strip_data = shadow_strip[++line]; - } -} - -TQImage TransparencyHandler::handleRealAlpha(TQImage img) { - TQImage clearImage = img.convertDepth(32); - clearImage.setAlphaBuffer(true); - - int w = clearImage.width(); - int h = clearImage.height(); - - for (int y = 0; y < h; ++y) { - TQRgb *ls = (TQRgb *)clearImage.scanLine( y ); - for (int x = 0; x < w; ++x) { - ls[x] = tqRgba( 0, 0, 0, 0 ); - } - } - - return clearImage; -} - -// Create a shadow of thickness 4. -void TransparencyHandler::createShadowWindows(const TQWidget* p) -{ -#ifdef Q_WS_X11 - int x2 = p->x()+p->width(); - int y2 = p->y()+p->height(); - TQRect shadow1(x2, p->y() + 4, 4, p->height()); - TQRect shadow2(p->x() + 4, y2, p->width() - 4, 4); - - bool have_composite = haveX11RGBASupport(); - - // Create a fake drop-down shadow effect via blended Xwindows - ShadowElements se; - se.w1 = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WType_Popup | WX11BypassWM) ); - se.w2 = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WType_Popup | WX11BypassWM) ); - se.w1->setGeometry(shadow1); - se.w2->setGeometry(shadow2); - XSelectInput(tqt_xdisplay(), se.w1->winId(), StructureNotifyMask ); - XSelectInput(tqt_xdisplay(), se.w2->winId(), StructureNotifyMask ); - - // Insert a new ShadowMap entry - shadowMap()[p] = se; - - // Some hocus-pocus here to create the drop-shadow. - TQPixmap pix_shadow1; - TQPixmap pix_shadow2; - if (have_composite) { - pix_shadow1 = TQPixmap(shadow1.width(), shadow1.height()); - pix_shadow2 = TQPixmap(shadow2.width(), shadow2.height()); - } - else { - pix_shadow1 = TQPixmap::grabWindow(tqt_xrootwin(), - shadow1.x(), shadow1.y(), shadow1.width(), shadow1.height()); - pix_shadow2 = TQPixmap::grabWindow(tqt_xrootwin(), - shadow2.x(), shadow2.y(), shadow2.width(), shadow2.height()); - } - - TQImage img; - img = pix_shadow1.convertToImage(); - if (have_composite) img = handleRealAlpha(img); - rightShadow(img); - pix_shadow1.convertFromImage(img); - img = pix_shadow2.convertToImage(); - if (have_composite) img = handleRealAlpha(img); - bottomShadow(img); - pix_shadow2.convertFromImage(img); - - // Set the background pixmaps - se.w1->setErasePixmap(pix_shadow1); - se.w2->setErasePixmap(pix_shadow2); - - // Show the 'shadow' just before showing the popup menu window - // Don't use TQWidget::show() so we don't confuse QEffects, thus causing broken focus. - XMapWindow(tqt_xdisplay(), se.w1->winId()); - XMapWindow(tqt_xdisplay(), se.w2->winId()); -#else - Q_UNUSED( p ) -#endif -} - -void TransparencyHandler::removeShadowWindows(const TQWidget* p) -{ -#ifdef Q_WS_X11 - ShadowMap::iterator it = shadowMap().find(p); - if (it != shadowMap().end()) - { - ShadowElements se = it.data(); - XUnmapWindow(tqt_xdisplay(), se.w1->winId()); // hide - XUnmapWindow(tqt_xdisplay(), se.w2->winId()); - XFlush(tqt_xdisplay()); // try to hide faster - delete se.w1; - delete se.w2; - shadowMap().erase(it); - } -#else - Q_UNUSED( p ) -#endif -} - -bool TransparencyHandler::eventFilter( TQObject* object, TQEvent* event ) -{ -#if !defined Q_WS_MAC && !defined Q_WS_WIN - // Transparency idea was borrowed from KDE2's "MegaGradient" Style, - // Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> - - // Added 'fake' menu shadows <04-Jul-2002> -- Karol - TQWidget* p = (TQWidget*)object; - TQEvent::Type et = event->type(); - - if (et == TQEvent::Show) - { - // Handle translucency - if (te != Disabled) - { - pix = TQPixmap::grabWindow(tqt_xrootwin(), - p->x(), p->y(), p->width(), p->height()); - - switch (te) { -#ifdef HAVE_XRENDER - case XRender: - if (tqt_use_xrender) { - XRenderBlendToPixmap(p); - break; - } - // Fall through intended -#else - case XRender: -#endif - case SoftwareBlend: - blendToPixmap(p->colorGroup(), p); - break; - - case SoftwareTint: - default: - blendToColor(p->colorGroup().button()); - }; - - p->setErasePixmap(pix); - } - - // Handle drop shadow - // * FIXME : !shadowMap().contains(p) is a workaround for leftover - // * shadows after duplicate show events. - // * TODO : determine real cause for duplicate events - // * till 20021005 - if ((dropShadow || useDropShadow(p)) - && p->width() > 16 && p->height() > 16 && !shadowMap().contains( p )) - createShadowWindows(p); - } - else if (et == TQEvent::Resize && p->isShown() && p->isTopLevel()) - { - // Handle drop shadow - if (dropShadow || useDropShadow(p)) - { - removeShadowWindows(p); - createShadowWindows(p); - } - } - else if (et == TQEvent::Hide) - { - // Handle drop shadow - if (dropShadow || useDropShadow(p)) - removeShadowWindows(p); - - // Handle translucency - if (te != Disabled) - p->setErasePixmap(TQPixmap()); - } - -#endif - return false; -} - - -// Blends a TQImage to a predefined color, with a given opacity. -void TransparencyHandler::blendToColor(const TQColor &col) -{ - if (opacity < 0.0 || opacity > 1.0) - return; - - TQImage img = pix.convertToImage(); - KImageEffect::blend(col, img, opacity); - pix.convertFromImage(img); -} - - -void TransparencyHandler::blendToPixmap(const TQColorGroup &cg, const TQWidget* p) -{ - if (opacity < 0.0 || opacity > 1.0) - return; - - KPixmap blendPix; - blendPix.resize( pix.width(), pix.height() ); - - if (blendPix.width() != pix.width() || - blendPix.height() != pix.height()) - return; - - // Allow styles to define the blend pixmap - allows for some interesting effects. - if (::tqqt_cast<TQPopupMenu*>(p)) - kstyle->renderMenuBlendPixmap( blendPix, cg, ::tqqt_cast<TQPopupMenu*>(p) ); - else - blendPix.fill(cg.button()); // Just tint as the default behavior - - TQImage blendImg = blendPix.convertToImage(); - TQImage backImg = pix.convertToImage(); - KImageEffect::blend(blendImg, backImg, opacity); - pix.convertFromImage(backImg); -} - - -#ifdef HAVE_XRENDER -// Here we go, use XRender in all its glory. -// NOTE: This is actually a bit slower than the above routines -// on non-accelerated displays. -- Karol. -void TransparencyHandler::XRenderBlendToPixmap(const TQWidget* p) -{ - KPixmap renderPix; - renderPix.resize( pix.width(), pix.height() ); - - // Allow styles to define the blend pixmap - allows for some interesting effects. - if (::tqqt_cast<TQPopupMenu*>(p)) - kstyle->renderMenuBlendPixmap( renderPix, p->colorGroup(), - ::tqqt_cast<TQPopupMenu*>(p) ); - else - renderPix.fill(p->colorGroup().button()); // Just tint as the default behavior - - Display* dpy = tqt_xdisplay(); - Pixmap alphaPixmap; - Picture alphaPicture; - XRenderPictFormat Rpf; - XRenderPictureAttributes Rpa; - XRenderColor clr; - clr.alpha = ((unsigned short)(255*opacity) << 8); - - Rpf.type = PictTypeDirect; - Rpf.depth = 8; - Rpf.direct.alphaMask = 0xff; - Rpa.repeat = True; // Tile - - XRenderPictFormat* xformat = XRenderFindFormat(dpy, - PictFormatType | PictFormatDepth | PictFormatAlphaMask, &Rpf, 0); - - alphaPixmap = XCreatePixmap(dpy, p->handle(), 1, 1, 8); - alphaPicture = XRenderCreatePicture(dpy, alphaPixmap, xformat, CPRepeat, &Rpa); - - XRenderFillRectangle(dpy, PictOpSrc, alphaPicture, &clr, 0, 0, 1, 1); - - XRenderComposite(dpy, PictOpOver, - renderPix.x11RenderHandle(), alphaPicture, pix.x11RenderHandle(), // src, mask, dst - 0, 0, // srcx, srcy - 0, 0, // maskx, masky - 0, 0, // dstx, dsty - pix.width(), pix.height()); - - XRenderFreePicture(dpy, alphaPicture); - XFreePixmap(dpy, alphaPixmap); -} -#endif - -void TDEStyle::virtual_hook( int, void* ) -{ /*BASE::virtual_hook( id, data );*/ } - -// HACK for gtk-qt-engine - -extern "C" KDE_EXPORT -void kde_kstyle_set_scrollbar_type_windows( void* style ) -{ - ((TDEStyle*)style)->setScrollBarType( TDEStyle::WindowsStyleScrollBar ); -} - -// vim: set noet ts=4 sw=4: -// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off; - -#include "kstyle.moc" diff --git a/tdefx/kstyle.h b/tdefx/kstyle.h deleted file mode 100644 index 9c3867bb3..000000000 --- a/tdefx/kstyle.h +++ /dev/null @@ -1,383 +0,0 @@ -/* - * $Id$ - * - * TDEStyle - * Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org> - * - * TQWindowsStyle CC_ListView and style images were kindly donated by TrollTech, - * Copyright (C) 1998-2000 TrollTech AS. - * - * Many thanks to Bradley T. Hughes for the 3 button scrollbar code. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License version 2 as published by the Free Software Foundation. - * - * 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 __KSTYLE_H -#define __KSTYLE_H - -// W A R N I N G -// ------------- -// This API is still subject to change. -// I will remove this warning when I feel the API is sufficiently flexible. - -#include <tqcommonstyle.h> - -#include <tdelibs_export.h> - -class KPixmap; - -struct TDEStylePrivate; -/** - * Simplifies and extends the TQStyle API to make style coding easier. - * - * The TDEStyle class provides a simple internal menu transparency engine - * which attempts to use XRender for accelerated blending where requested, - * or falls back to fast internal software tinting/blending routines. - * It also simplifies more complex portions of the TQStyle API, such as - * the PopupMenuItems, ScrollBars and Sliders by providing extra "primitive - * elements" which are simple to implement by the style writer. - * - * @see TQStyle::QStyle - * @see TQCommonStyle::QCommonStyle - * @author Karol Szwed (gallium@kde.org) - * @version $Id$ - */ -class TDEFX_EXPORT TDEStyle: public TQCommonStyle -{ - Q_OBJECT - - - public: - - /** - * TDEStyle Flags: - * - * @li Default - Default style setting, where menu transparency - * and the FilledFrameWorkaround are disabled. - * - * @li AllowMenuTransparency - Enable this flag to use TDEStyle's - * internal menu transparency engine. - * - * @li FilledFrameWorkaround - Enable this flag to facilitate - * proper repaints of QMenuBars and QToolBars when the style chooses - * to paint the interior of a TQFrame. The style primitives in question - * are PE_PanelMenuBar and PE_PanelDockWindow. The HighColor style uses - * this workaround to enable painting of gradients in menubars and - * toolbars. - */ - typedef uint TDEStyleFlags; - enum TDEStyleOption { - Default = 0x00000000, //!< All options disabled - AllowMenuTransparency = 0x00000001, //!< Internal transparency enabled - FilledFrameWorkaround = 0x00000002 //!< Filled frames enabled - }; - - /** - * TDEStyle ScrollBarType: - * - * Allows the style writer to easily select what type of scrollbar - * should be used without having to duplicate large amounts of source - * code by implementing the complex control CC_ScrollBar. - * - * @li WindowsStyleScrollBar - Two button scrollbar with the previous - * button at the top/left, and the next button at the bottom/right. - * - * @li PlatinumStyleScrollBar - Two button scrollbar with both the - * previous and next buttons at the bottom/right. - * - * @li ThreeButtonScrollBar - %KDE style three button scrollbar with - * two previous buttons, and one next button. The next button is always - * at the bottom/right, whilst the two previous buttons are on either - * end of the scrollbar. - * - * @li NextStyleScrollBar - Similar to the PlatinumStyle scroll bar, but - * with the buttons grouped on the opposite end of the scrollbar. - * - * @see TDEStyle::TDEStyle() - */ - enum TDEStyleScrollBarType { - WindowsStyleScrollBar = 0x00000000, //!< two button, windows style - PlatinumStyleScrollBar = 0x00000001, //!< two button, platinum style - ThreeButtonScrollBar = 0x00000002, //!< three buttons, %KDE style - NextStyleScrollBar = 0x00000004 //!< two button, NeXT style - }; - - /** - * Constructs a TDEStyle object. - * - * Select the appropriate TDEStyle flags and scrollbar type - * for your style. The user's style preferences selected in KControl - * are read by using TQSettings and are automatically applied to the style. - * As a fallback, TDEStyle paints progressbars and tabbars. It inherits from - * TQCommonStyle for speed, so don't expect much to be implemented. - * - * It is advisable to use a currently implemented style such as the HighColor - * style as a foundation for any new TDEStyle, so the limited number of - * drawing fallbacks should not prove problematic. - * - * @param flags the style to be applied - * @param sbtype the scroll bar type - * @see TDEStyle::TDEStyleFlags - * @see TDEStyle::TDEStyleScrollBarType - * @author Karol Szwed (gallium@kde.org) - */ - TDEStyle( TDEStyleFlags flags = TDEStyle::Default, - TDEStyleScrollBarType sbtype = TDEStyle::WindowsStyleScrollBar ); - - /** - * Destructs the TDEStyle object. - */ - ~TDEStyle(); - - /** - * Returns the default widget style depending on color depth. - */ - static TQString defaultStyle(); - - /** - * Modifies the scrollbar type used by the style. - * - * This function is only provided for convenience. It allows - * you to make a late decision about what scrollbar type to use for the - * style after performing some processing in your style's constructor. - * In most situations however, setting the scrollbar type via the TDEStyle - * constructor should suffice. - * @param sbtype the scroll bar type - * @see TDEStyle::TDEStyleScrollBarType - */ - void setScrollBarType(TDEStyleScrollBarType sbtype); - - /** - * Returns the TDEStyle flags used to initialize the style. - * - * This is used solely for the kcmstyle module, and hence is internal. - */ - TDEStyleFlags styleFlags() const; - - // --------------------------------------------------------------------------- - - /** - * This virtual function defines the pixmap used to blend between the popup - * menu and the background to create different menu transparency effects. - * For example, you can fill the pixmap "pix" with a gradient based on the - * popup's colorGroup, a texture, or some other fancy painting routine. - * TDEStyle will then internally blend this pixmap with a snapshot of the - * background behind the popupMenu to create the illusion of transparency. - * - * This virtual is never called if XRender/Software blending is disabled by - * the user in KDE's style control module. - */ - virtual void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup& cg, - const TQPopupMenu* popup ) const; - - /** - * TDEStyle Primitive Elements: - * - * The TDEStyle class extends the Qt's Style API by providing certain - * simplifications for parts of TQStyle. To do this, the TDEStylePrimitive - * elements were defined, which are very similar to Qt's PrimitiveElement. - * - * The first three Handle primitives simplify and extend PE_DockWindowHandle, - * so do not reimplement PE_DockWindowHandle if you want the TDEStyle handle - * simplifications to be operable. Similarly do not reimplement CC_Slider, - * SC_SliderGroove and SC_SliderHandle when using the TDEStyle slider - * primitives. TDEStyle automatically double-buffers slider painting - * when they are drawn via these TDEStyle primitives to avoid flicker. - * - * @li KPE_DockWindowHandle - This primitive is already implemented in TDEStyle, - * and paints a bevelled rect with the DockWindow caption text. Re-implement - * this primitive to perform other more fancy effects when drawing the dock window - * handle. - * - * @li KPE_ToolBarHandle - This primitive must be reimplemented. It currently - * only paints a filled rectangle as default behavior. This primitive is used - * to render TQToolBar handles. - * - * @li KPE_GeneralHandle - This primitive must be reimplemented. It is used - * to render general handles that are not part of a TQToolBar or TQDockWindow, such - * as the applet handles used in Kicker. The default implementation paints a filled - * rect of arbitrary color. - * - * @li KPE_SliderGroove - This primitive must be reimplemented. It is used to - * paint the slider groove. The default implementation paints a filled rect of - * arbitrary color. - * - * @li KPE_SliderHandle - This primitive must be reimplemented. It is used to - * paint the slider handle. The default implementation paints a filled rect of - * arbitrary color. - * - * @li KPE_ListViewExpander - This primitive is already implemented in TDEStyle. It - * is used to draw the Expand/Collapse element in QListViews. To indicate the - * expanded state, the style flags are set to Style_Off, while Style_On implies collapsed. - * - * @li KPE_ListViewBranch - This primitive is already implemented in TDEStyle. It is - * used to draw the ListView branches where necessary. - */ - enum TDEStylePrimitive { - KPE_DockWindowHandle, - KPE_ToolBarHandle, - KPE_GeneralHandle, - - KPE_SliderGroove, - KPE_SliderHandle, - - KPE_ListViewExpander, - KPE_ListViewBranch - }; - - // Old API - // DEPRECATED - virtual void drawTDEStylePrimitive( TDEStylePrimitive kpe, - TQPainter* p, - const TQWidget* widget, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::SO_Default ) const; - - /** - * This function is identical to Qt's TQStyle::tqdrawPrimitive(), except that - * it adds one further parameter, 'widget', that can be used to determine - * the widget state of the TDEStylePrimitive in question. - * - * @see TDEStyle::TDEStylePrimitive - * @see TQStyle::tqdrawPrimitive - * @see TQStyle::drawComplexControl - */ - virtual void drawTDEStylePrimitive( TDEStylePrimitive kpe, - TQPainter* p, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::SO_Default, - const TQWidget* widget = 0 ) const; - - - enum TDEStylePixelMetric { - KPM_MenuItemSeparatorHeight = 0x00000001, - KPM_MenuItemHMargin = 0x00000002, - KPM_MenuItemVMargin = 0x00000004, - KPM_MenuItemHFrame = 0x00000008, - KPM_MenuItemVFrame = 0x00000010, - KPM_MenuItemCheckMarkHMargin = 0x00000020, - KPM_MenuItemArrowHMargin = 0x00000040, - KPM_MenuItemTabSpacing = 0x00000080, - KPM_ListViewBranchThickness = 0x00000100 - }; - - int kPixelMetric( TDEStylePixelMetric kpm, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget* widget = 0 ) const; - - // --------------------------------------------------------------------------- - - void polish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); - void unPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); - void polishPopupMenu( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ); - - void drawPrimitive( TQ_PrimitiveElement pe, - TQPainter* p, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::SO_Default ) const; - -// #ifdef USE_QT4 // tdebindings / smoke needs this function declaration available at all times. Furthermore I don't think it would hurt to have the declaration available at all times...so leave these commented out for now - -// void drawPrimitive( TQ_ControlElement pe, -// TQPainter* p, -// const TQStyleControlElementData &ceData, -// ControlElementFlags elementFlags, -// const TQRect &r, -// const TQColorGroup &cg, -// SFlags flags = Style_Default, -// const TQStyleOption& = TQStyleOption::SO_Default ) const; - -// #endif // USE_QT4 - - void drawControl( TQ_ControlElement element, - TQPainter* p, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - const TQStyleOption& = TQStyleOption::SO_Default, - const TQWidget* widget = 0 ) const; - - void drawComplexControl( TQ_ComplexControl control, - TQPainter *p, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQRect &r, - const TQColorGroup &cg, - SFlags flags = Style_Default, - SCFlags controls = SC_All, - SCFlags active = SC_None, - const TQStyleOption& = TQStyleOption::SO_Default, - const TQWidget* widget = 0 ) const; - - SubControl querySubControl( TQ_ComplexControl control, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQPoint &pos, - const TQStyleOption& = TQStyleOption::SO_Default, - const TQWidget* widget = 0 ) const; - - TQRect querySubControlMetrics( TQ_ComplexControl control, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - SubControl sc, - const TQStyleOption& = TQStyleOption::SO_Default, - const TQWidget* widget = 0 ) const; - - int pixelMetric( PixelMetric m, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, - const TQWidget* widget = 0 ) const; - - TQRect subRect( SubRect r, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, - const TQWidget* widget = 0 ) const; - - TQPixmap stylePixmap( StylePixmap stylepixmap, - const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQStyleOption& = TQStyleOption::SO_Default, - const TQWidget* widget = 0 ) const; - - int styleHint( TQ_StyleHint sh, const TQStyleControlElementData &ceData, - ControlElementFlags elementFlags, - const TQStyleOption &opt = TQStyleOption::SO_Default, - TQStyleHintReturn* shr = 0, - const TQWidget* w = 0 ) const; - - protected: - virtual bool objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ); - - private: - // Disable copy constructor and = operator - TDEStyle( const TDEStyle & ); - TDEStyle& operator=( const TDEStyle & ); - - protected: - virtual void virtual_hook( int id, void* data ); - private: - TDEStylePrivate *d; -}; - - -// vim: set noet ts=4 sw=4: -#endif - diff --git a/tdefx/tdestylen.cpp b/tdefx/tdestylen.cpp new file mode 100644 index 000000000..0c6a7f1fe --- /dev/null +++ b/tdefx/tdestylen.cpp @@ -0,0 +1,2418 @@ +/* + * + * TDEStyle + * Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org> + * + * TQWindowsStyle CC_ListView and style images were kindly donated by TrollTech, + * Copyright (C) 1998-2000 TrollTech AS. + * + * Many thanks to Bradley T. Hughes for the 3 button scrollbar code. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * 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. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "tdestyle.h" + +#include <tqapplication.h> +#include <tqbitmap.h> +#include <tqmetaobject.h> +#include <tqcleanuphandler.h> +#include <tqmap.h> +#include <tqimage.h> +#include <tqlistview.h> +#include <tqmenubar.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqpopupmenu.h> +#include <tqprogressbar.h> +#include <tqscrollbar.h> +#include <tqsettings.h> +#include <tqslider.h> +#include <tqstylefactory.h> +#include <tqtabbar.h> +#include <tqtoolbar.h> +#include <tqframe.h> + +#include <kpixmap.h> +#include <kpixmapeffect.h> +#include <kimageeffect.h> + +#ifdef Q_WS_X11 +# include <X11/Xlib.h> +# ifdef HAVE_XRENDER +# include <X11/extensions/Xrender.h> // schroder + extern bool tqt_use_xrender; +# endif +#else +#undef HAVE_XRENDER +#endif + +#ifdef HAVE_XCOMPOSITE +#include <X11/extensions/Xrender.h> +#include <X11/extensions/Xcomposite.h> +#include <dlfcn.h> +#endif + +#include <limits.h> + +namespace +{ + // INTERNAL + enum TransparencyEngine { + Disabled = 0, + SoftwareTint, + SoftwareBlend, + XRender + }; + + // Drop Shadow + struct ShadowElements { + TQWidget* w1; + TQWidget* w2; + }; + typedef TQMap<const TQWidget*,ShadowElements> ShadowMap; + static ShadowMap *_shadowMap = 0; + TQSingleCleanupHandler<ShadowMap> cleanupShadowMap; + ShadowMap &shadowMap() { + if ( !_shadowMap ) { + _shadowMap = new ShadowMap; + cleanupShadowMap.set( &_shadowMap ); + } + return *_shadowMap; + } + + + // DO NOT ASK ME HOW I MADE THESE TABLES! + // (I probably won't remember anyway ;) + const double top_right_corner[16] = + { 0.949, 0.965, 0.980, 0.992, + 0.851, 0.890, 0.945, 0.980, + 0.706, 0.780, 0.890, 0.960, + 0.608, 0.706, 0.851, 0.949 }; + + const double bottom_right_corner[16] = + { 0.608, 0.706, 0.851, 0.949, + 0.706, 0.780, 0.890, 0.960, + 0.851, 0.890, 0.945, 0.980, + 0.949, 0.965, 0.980, 0.992 }; + + const double bottom_left_corner[16] = + { 0.949, 0.851, 0.706, 0.608, + 0.965, 0.890, 0.780, 0.706, + 0.980, 0.945, 0.890, 0.851, + 0.992, 0.980, 0.960, 0.949 }; + + const double shadow_strip[4] = + { 0.565, 0.675, 0.835, 0.945 }; + + static bool useDropShadow(TQWidget* w) + { + return w && w->metaObject() && + w->metaObject()->findProperty("TDEStyleMenuDropShadow") != -1; + } +} + +namespace +{ +class TransparencyHandler : public TQObject +{ + public: + TransparencyHandler(TDEStyle* style, TransparencyEngine tEngine, + float menuOpacity, bool useDropShadow); + ~TransparencyHandler(); + bool eventFilter(TQObject* object, TQEvent* event); + + protected: + void blendToColor(const TQColor &col); + void blendToPixmap(const TQColorGroup &cg, const TQWidget* p); +#ifdef HAVE_XRENDER + void XRenderBlendToPixmap(const TQWidget* p); +#endif + bool haveX11RGBASupport(); + TQImage handleRealAlpha(TQImage); + void createShadowWindows(const TQWidget* p); + void removeShadowWindows(const TQWidget* p); + void rightShadow(TQImage& dst); + void bottomShadow(TQImage& dst); + private: + bool dropShadow; + float opacity; + TQPixmap pix; + TDEStyle* kstyle; + TransparencyEngine te; +}; +} // namespace + +struct TDEStylePrivate +{ + bool highcolor : 1; + bool useFilledFrameWorkaround : 1; + bool etchDisabledText : 1; + bool scrollablePopupmenus : 1; + bool autoHideAccelerators : 1; + bool menuAltKeyNavigation : 1; + bool menuDropShadow : 1; + bool sloppySubMenus : 1; + bool semiTransparentRubberband : 1; + int popupMenuDelay; + float menuOpacity; + + TransparencyEngine transparencyEngine; + TDEStyle::TDEStyleScrollBarType scrollbarType; + TransparencyHandler* menuHandler; + TDEStyle::TDEStyleFlags flags; + + //For KPE_ListViewBranch + TQBitmap *verticalLine; + TQBitmap *horizontalLine; +}; + +// ----------------------------------------------------------------------------- + + +TDEStyle::TDEStyle( TDEStyleFlags flags, TDEStyleScrollBarType sbtype ) + : TQCommonStyle(), d(new TDEStylePrivate) +{ + d->flags = flags; + bool useMenuTransparency = (flags & AllowMenuTransparency); + d->useFilledFrameWorkaround = (flags & FilledFrameWorkaround); + d->scrollbarType = sbtype; + d->highcolor = TQPixmap::defaultDepth() > 8; + + // Read style settings + TQSettings settings; + d->popupMenuDelay = settings.readNumEntry ("/TDEStyle/Settings/PopupMenuDelay", 256); + d->sloppySubMenus = settings.readBoolEntry("/TDEStyle/Settings/SloppySubMenus", false); + d->etchDisabledText = settings.readBoolEntry("/TDEStyle/Settings/EtchDisabledText", true); + d->menuAltKeyNavigation = settings.readBoolEntry("/TDEStyle/Settings/MenuAltKeyNavigation", true); + d->scrollablePopupmenus = settings.readBoolEntry("/TDEStyle/Settings/ScrollablePopupMenus", false); + d->autoHideAccelerators = settings.readBoolEntry("/TDEStyle/Settings/AutoHideAccelerators", false); + d->menuDropShadow = settings.readBoolEntry("/TDEStyle/Settings/MenuDropShadow", false); + d->semiTransparentRubberband = settings.readBoolEntry("/TDEStyle/Settings/SemiTransparentRubberband", false); + d->menuHandler = NULL; + + if (useMenuTransparency) { + TQString effectEngine = settings.readEntry("/TDEStyle/Settings/MenuTransparencyEngine", "Disabled"); + +#ifdef HAVE_XRENDER + if (effectEngine == "XRender") + d->transparencyEngine = XRender; +#else + if (effectEngine == "XRender") + d->transparencyEngine = SoftwareBlend; +#endif + else if (effectEngine == "SoftwareBlend") + d->transparencyEngine = SoftwareBlend; + else if (effectEngine == "SoftwareTint") + d->transparencyEngine = SoftwareTint; + else + d->transparencyEngine = Disabled; + + if (d->transparencyEngine != Disabled) { + // Create an instance of the menu transparency handler + d->menuOpacity = settings.readDoubleEntry("/TDEStyle/Settings/MenuOpacity", 0.90); + d->menuHandler = new TransparencyHandler(this, d->transparencyEngine, + d->menuOpacity, d->menuDropShadow); + } + } + + d->verticalLine = 0; + d->horizontalLine = 0; + + // Create a transparency handler if only drop shadows are enabled. + if (!d->menuHandler && d->menuDropShadow) + d->menuHandler = new TransparencyHandler(this, Disabled, 1.0, d->menuDropShadow); +} + + +TDEStyle::~TDEStyle() +{ + delete d->verticalLine; + delete d->horizontalLine; + + delete d->menuHandler; + + d->menuHandler = NULL; + delete d; +} + + +TQString TDEStyle::defaultStyle() +{ + if (TQPixmap::defaultDepth() > 8) + return TQString("plastik"); + else + return TQString("light, 3rd revision"); +} + +void TDEStyle::polish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) +{ + if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { + TQWidget* widget = reinterpret_cast<TQWidget*>(ptr); + if ( d->useFilledFrameWorkaround ) + { + if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) { + TQFrame::Shape shape = frame->frameShape(); + if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel) + widget->installEventFilter(this); + } + } + if (widget->isTopLevel()) + { + if (!d->menuHandler && useDropShadow(widget)) + d->menuHandler = new TransparencyHandler(this, Disabled, 1.0, false); + + if (d->menuHandler && useDropShadow(widget)) + widget->installEventFilter(d->menuHandler); + } + } +} + + +void TDEStyle::unPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) +{ + if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { + TQWidget* widget = reinterpret_cast<TQWidget*>(ptr); + if ( d->useFilledFrameWorkaround ) + { + if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) { + TQFrame::Shape shape = frame->frameShape(); + if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel) + widget->removeEventFilter(this); + } + } + if (widget->isTopLevel() && d->menuHandler && useDropShadow(widget)) + widget->removeEventFilter(d->menuHandler); + } +} + + +// Style changes (should) always re-polish popups. +void TDEStyle::polishPopupMenu( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ) +{ + if ( !(ceData.windowState & WState_Polished ) ) { + widgetActionRequest(ceData, elementFlags, ptr, WAR_SetCheckable); + } + + if (ceData.widgetObjectTypes.contains(TQWIDGET_OBJECT_NAME_STRING)) { + TQWidget* widget = reinterpret_cast<TQWidget*>(ptr); + TQPopupMenu *p = dynamic_cast<TQPopupMenu*>(widget); + if (p) { + // Install transparency handler if the effect is enabled. + if ( d->menuHandler && (strcmp(p->name(), "tear off menu") != 0)) { + p->installEventFilter(d->menuHandler); + } + } + } +} + + +// ----------------------------------------------------------------------------- +// TDEStyle extensions +// ----------------------------------------------------------------------------- + +void TDEStyle::setScrollBarType(TDEStyleScrollBarType sbtype) +{ + d->scrollbarType = sbtype; +} + +TDEStyle::TDEStyleFlags TDEStyle::styleFlags() const +{ + return d->flags; +} + +void TDEStyle::renderMenuBlendPixmap( KPixmap &pix, const TQColorGroup &cg, + const TQPopupMenu* /* popup */ ) const +{ + pix.fill(cg.button()); // Just tint as the default behavior +} + +void TDEStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags, + const TQStyleOption &opt ) const +{ + TQStyleControlElementData ceData = populateControlElementDataFromWidget(widget, TQStyleOption()); + drawTDEStylePrimitive(kpe, p, ceData, getControlElementFlagsForObject(widget, ceData.widgetObjectTypes, TQStyleOption()), r, cg, flags, opt); +} + +void TDEStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, + TQPainter* p, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags, + const TQStyleOption&, /* opt */ + const TQWidget* widget ) const +{ + switch( kpe ) + { + // Dock / Toolbar / General handles. + // --------------------------------- + + case KPE_DockWindowHandle: { + + // Draws a nice DockWindow handle including the dock title. + TQWidget* wid = const_cast<TQWidget*>(widget); + bool horizontal = flags & Style_Horizontal; + int x,y,w,h,x2,y2; + + r.rect( &x, &y, &w, &h ); + if ((w <= 2) || (h <= 2)) { + p->fillRect(r, cg.highlight()); + return; + } + + + x2 = x + w - 1; + y2 = y + h - 1; + + TQFont fnt; + fnt = TQApplication::font(wid); + fnt.setPointSize( fnt.pointSize()-2 ); + + // Draw the item on an off-screen pixmap + // to preserve Xft antialiasing for + // vertically oriented handles. + TQPixmap pix; + if (horizontal) + pix.resize( h-2, w-2 ); + else + pix.resize( w-2, h-2 ); + + TQString title = wid->parentWidget()->caption(); + TQPainter p2; + p2.begin(&pix); + p2.fillRect(pix.rect(), cg.brush(TQColorGroup::Highlight)); + p2.setPen(cg.highlightedText()); + p2.setFont(fnt); + p2.drawText(pix.rect(), AlignCenter, title); + p2.end(); + + // Draw a sunken bevel + p->setPen(cg.dark()); + p->drawLine(x, y, x2, y); + p->drawLine(x, y, x, y2); + p->setPen(cg.light()); + p->drawLine(x+1, y2, x2, y2); + p->drawLine(x2, y+1, x2, y2); + + if (horizontal) { + TQWMatrix m; + m.rotate(-90.0); + TQPixmap vpix = pix.xForm(m); + bitBlt(wid, r.x()+1, r.y()+1, &vpix); + } else + bitBlt(wid, r.x()+1, r.y()+1, &pix); + + break; + } + + + /* + * KPE_ListViewExpander and KPE_ListViewBranch are based on code from + * QWindowStyle's CC_ListView, kindly donated by TrollTech. + * CC_ListView code is Copyright (C) 1998-2000 TrollTech AS. + */ + + case KPE_ListViewExpander: { + // Typical Windows style expand/collapse element. + int radius = (r.width() - 4) / 2; + int centerx = r.x() + r.width()/2; + int centery = r.y() + r.height()/2; + + // Outer box + p->setPen( cg.mid() ); + p->drawRect( r ); + + // plus or minus + p->setPen( cg.text() ); + p->drawLine( centerx - radius, centery, centerx + radius, centery ); + if ( flags & Style_On ) // Collapsed = On + p->drawLine( centerx, centery - radius, centerx, centery + radius ); + break; + } + + case KPE_ListViewBranch: { + // Typical Windows style listview branch element (dotted line). + + // Create the dotline pixmaps if not already created + if ( !d->verticalLine ) + { + // make 128*1 and 1*128 bitmaps that can be used for + // drawing the right sort of lines. + d->verticalLine = new TQBitmap( 1, 129, true ); + d->horizontalLine = new TQBitmap( 128, 1, true ); + TQPointArray a( 64 ); + TQPainter p2; + p2.begin( d->verticalLine ); + + int i; + for( i=0; i < 64; i++ ) + a.setPoint( i, 0, i*2+1 ); + p2.setPen( color1 ); + p2.drawPoints( a ); + p2.end(); + TQApplication::flushX(); + d->verticalLine->setMask( *d->verticalLine ); + + p2.begin( d->horizontalLine ); + for( i=0; i < 64; i++ ) + a.setPoint( i, i*2+1, 0 ); + p2.setPen( color1 ); + p2.drawPoints( a ); + p2.end(); + TQApplication::flushX(); + d->horizontalLine->setMask( *d->horizontalLine ); + } + + p->setPen( cg.text() ); // cg.dark() is bad for dark color schemes. + + if (flags & Style_Horizontal) + { + int point = r.x(); + int other = r.y(); + int end = r.x()+r.width(); + int thickness = r.height(); + + while( point < end ) + { + int i = 128; + if ( i+point > end ) + i = end-point; + p->drawPixmap( point, other, *d->horizontalLine, 0, 0, i, thickness ); + point += i; + } + + } else { + int point = r.y(); + int other = r.x(); + int end = r.y()+r.height(); + int thickness = r.width(); + int pixmapoffset = (flags & Style_NoChange) ? 0 : 1; // ### Hackish + + while( point < end ) + { + int i = 128; + if ( i+point > end ) + i = end-point; + p->drawPixmap( other, point, *d->verticalLine, 0, pixmapoffset, thickness, i ); + point += i; + } + } + + break; + } + + // Reimplement the other primitives in your styles. + // The current implementation just paints something visibly different. + case KPE_ToolBarHandle: + case KPE_GeneralHandle: + case KPE_SliderHandle: + p->fillRect(r, cg.light()); + break; + + case KPE_SliderGroove: + p->fillRect(r, cg.dark()); + break; + + default: + p->fillRect(r, Qt::yellow); // Something really bad happened - highlight. + break; + } +} + + +int TDEStyle::kPixelMetric( TDEStylePixelMetric kpm, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget* /* widget */) const +{ + int value; + switch(kpm) + { + case KPM_ListViewBranchThickness: + value = 1; + break; + + case KPM_MenuItemSeparatorHeight: + case KPM_MenuItemHMargin: + case KPM_MenuItemVMargin: + case KPM_MenuItemHFrame: + case KPM_MenuItemVFrame: + case KPM_MenuItemCheckMarkHMargin: + case KPM_MenuItemArrowHMargin: + case KPM_MenuItemTabSpacing: + default: + value = 0; + } + + return value; +} + +// ----------------------------------------------------------------------------- + +// #ifdef USE_QT4 // tdebindings / smoke needs this function declaration available at all times. Furthermore I don't think it would hurt to have the declaration available at all times...so leave these commented out for now + +//void TDEStyle::drawPrimitive( TQ_ControlElement pe, +// TQPainter* p, +// const TQStyleControlElementData &ceData, +// ControlElementFlags elementFlags, +// const TQRect &r, +// const TQColorGroup &cg, +// SFlags flags, +// const TQStyleOption& opt ) const +//{ +// // FIXME: +// // What should "widget" be in actuality? How should I get it? From where? +// // Almost certainly it should not be null! +// TQWidget *widget = 0; +// drawControl(pe, p, ceData, elementFlags, r, cg, flags, opt, widget); +//} + +// #endif // USE_QT4 + +// ----------------------------------------------------------------------------- + +void TDEStyle::drawPrimitive( TQ_PrimitiveElement pe, + TQPainter* p, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags, + const TQStyleOption& opt ) const +{ + // TOOLBAR/DOCK WINDOW HANDLE + // ------------------------------------------------------------------------ + if (pe == PE_DockWindowHandle) + { + // Wild workarounds are here. Beware. + TQWidget *widget, *parent; + + if (p && p->device()->devType() == TQInternal::Widget) { + widget = static_cast<TQWidget*>(p->device()); + parent = widget->parentWidget(); + } else + return; // Don't paint on non-widgets + + // Check if we are a normal toolbar or a hidden dockwidget. + if ( parent && + (parent->inherits(TQTOOLBAR_OBJECT_NAME_STRING) || // Normal toolbar + (parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock + + // Draw a toolbar handle + drawTDEStylePrimitive( KPE_ToolBarHandle, p, ceData, elementFlags, r, cg, flags, opt, widget ); + + else if (ceData.widgetObjectTypes.contains(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING)) + + // Draw a dock window handle + drawTDEStylePrimitive( KPE_DockWindowHandle, p, ceData, elementFlags, r, cg, flags, opt, widget ); + + else + // General handle, probably a kicker applet handle. + drawTDEStylePrimitive( KPE_GeneralHandle, p, ceData, elementFlags, r, cg, flags, opt, widget ); +#if TQT_VERSION >= 0x030300 +#ifdef HAVE_XRENDER + } else if ( d->semiTransparentRubberband && pe == TQStyle::PE_RubberBand ) { + TQRect rect = r.normalize(); + TQPoint point; + point = p->xForm( point ); + + static XRenderColor clr = { 0, 0, 0, 0 }; + static unsigned long fillColor = 0; + if ( fillColor != cg.highlight().rgb() ) { + fillColor = cg.highlight().rgb(); + + unsigned long color = fillColor << 8 | 0x40; + + int red = (color >> 24) & 0xff; + int green = (color >> 16) & 0xff; + int blue = (color >> 8) & 0xff; + int alpha = (color >> 0) & 0xff; + + red = red * alpha / 255; + green = green * alpha / 255; + blue = blue * alpha / 255; + + clr.red = (red << 8) + red; + clr.green = (green << 8) + green; + clr.blue = (blue << 8) + blue; + clr.alpha = (alpha << 8) + alpha; + } + + XRenderFillRectangle( + p->device()->x11Display(), + PictOpOver, + p->device()->x11RenderHandle(), + &clr, + rect.x() + point.x(), + rect.y() + point.y(), + rect.width(), + rect.height() ); + + p->save(); + p->setRasterOp( TQt::CopyROP ); + p->setPen( TQPen( cg.highlight().dark( 160 ), 1 ) ); + p->setBrush( NoBrush ); + p->drawRect( + rect.x() + point.x(), + rect.y() + point.y(), + rect.width(), + rect.height() ); + p->restore(); +#endif +#endif + } else + TQCommonStyle::drawPrimitive( pe, p, ceData, elementFlags, r, cg, flags, opt ); +} + + + +void TDEStyle::drawControl( TQ_ControlElement element, + TQPainter* p, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags, + const TQStyleOption &opt, + const TQWidget* widget ) const +{ + switch (element) + { + // TABS + // ------------------------------------------------------------------------ + case CE_TabBarTab: { + TQTabBar::Shape tbs = ceData.tabBarData.shape; + bool selected = flags & Style_Selected; + int x = r.x(), y=r.y(), bottom=r.bottom(), right=r.right(); + + switch (tbs) { + + case TQTabBar::RoundedAbove: { + if (!selected) + p->translate(0,1); + p->setPen(selected ? cg.light() : cg.shadow()); + p->drawLine(x, y+4, x, bottom); + p->drawLine(x, y+4, x+4, y); + p->drawLine(x+4, y, right-1, y); + if (selected) + p->setPen(cg.shadow()); + p->drawLine(right, y+1, right, bottom); + + p->setPen(cg.midlight()); + p->drawLine(x+1, y+4, x+1, bottom); + p->drawLine(x+1, y+4, x+4, y+1); + p->drawLine(x+5, y+1, right-2, y+1); + + if (selected) { + p->setPen(cg.mid()); + p->drawLine(right-1, y+1, right-1, bottom); + } else { + p->setPen(cg.mid()); + p->drawPoint(right-1, y+1); + p->drawLine(x+4, y+2, right-1, y+2); + p->drawLine(x+3, y+3, right-1, y+3); + p->fillRect(x+2, y+4, r.width()-3, r.height()-6, cg.mid()); + + p->setPen(cg.light()); + p->drawLine(x, bottom-1, right, bottom-1); + p->translate(0,-1); + } + break; + } + + case TQTabBar::RoundedBelow: { + if (!selected) + p->translate(0,-1); + p->setPen(selected ? cg.light() : cg.shadow()); + p->drawLine(x, bottom-4, x, y); + if (selected) + p->setPen(cg.mid()); + p->drawLine(x, bottom-4, x+4, bottom); + if (selected) + p->setPen(cg.shadow()); + p->drawLine(x+4, bottom, right-1, bottom); + p->drawLine(right, bottom-1, right, y); + + p->setPen(cg.midlight()); + p->drawLine(x+1, bottom-4, x+1, y); + p->drawLine(x+1, bottom-4, x+4, bottom-1); + p->drawLine(x+5, bottom-1, right-2, bottom-1); + + if (selected) { + p->setPen(cg.mid()); + p->drawLine(right-1, y, right-1, bottom-1); + } else { + p->setPen(cg.mid()); + p->drawPoint(right-1, bottom-1); + p->drawLine(x+4, bottom-2, right-1, bottom-2); + p->drawLine(x+3, bottom-3, right-1, bottom-3); + p->fillRect(x+2, y+2, r.width()-3, r.height()-6, cg.mid()); + p->translate(0,1); + p->setPen(cg.dark()); + p->drawLine(x, y, right, y); + } + break; + } + + case TQTabBar::TriangularAbove: { + if (!selected) + p->translate(0,1); + p->setPen(selected ? cg.light() : cg.shadow()); + p->drawLine(x, bottom, x, y+6); + p->drawLine(x, y+6, x+6, y); + p->drawLine(x+6, y, right-6, y); + if (selected) + p->setPen(cg.mid()); + p->drawLine(right-5, y+1, right-1, y+5); + p->setPen(cg.shadow()); + p->drawLine(right, y+6, right, bottom); + + p->setPen(cg.midlight()); + p->drawLine(x+1, bottom, x+1, y+6); + p->drawLine(x+1, y+6, x+6, y+1); + p->drawLine(x+6, y+1, right-6, y+1); + p->drawLine(right-5, y+2, right-2, y+5); + p->setPen(cg.mid()); + p->drawLine(right-1, y+6, right-1, bottom); + + TQPointArray a(6); + a.setPoint(0, x+2, bottom); + a.setPoint(1, x+2, y+7); + a.setPoint(2, x+7, y+2); + a.setPoint(3, right-7, y+2); + a.setPoint(4, right-2, y+7); + a.setPoint(5, right-2, bottom); + p->setPen (selected ? cg.background() : cg.mid()); + p->setBrush(selected ? cg.background() : cg.mid()); + p->drawPolygon(a); + p->setBrush(NoBrush); + if (!selected) { + p->translate(0,-1); + p->setPen(cg.light()); + p->drawLine(x, bottom, right, bottom); + } + break; + } + + default: { // TQTabBar::TriangularBelow + if (!selected) + p->translate(0,-1); + p->setPen(selected ? cg.light() : cg.shadow()); + p->drawLine(x, y, x, bottom-6); + if (selected) + p->setPen(cg.mid()); + p->drawLine(x, bottom-6, x+6, bottom); + if (selected) + p->setPen(cg.shadow()); + p->drawLine(x+6, bottom, right-6, bottom); + p->drawLine(right-5, bottom-1, right-1, bottom-5); + if (!selected) + p->setPen(cg.shadow()); + p->drawLine(right, bottom-6, right, y); + + p->setPen(cg.midlight()); + p->drawLine(x+1, y, x+1, bottom-6); + p->drawLine(x+1, bottom-6, x+6, bottom-1); + p->drawLine(x+6, bottom-1, right-6, bottom-1); + p->drawLine(right-5, bottom-2, right-2, bottom-5); + p->setPen(cg.mid()); + p->drawLine(right-1, bottom-6, right-1, y); + + TQPointArray a(6); + a.setPoint(0, x+2, y); + a.setPoint(1, x+2, bottom-7); + a.setPoint(2, x+7, bottom-2); + a.setPoint(3, right-7, bottom-2); + a.setPoint(4, right-2, bottom-7); + a.setPoint(5, right-2, y); + p->setPen (selected ? cg.background() : cg.mid()); + p->setBrush(selected ? cg.background() : cg.mid()); + p->drawPolygon(a); + p->setBrush(NoBrush); + if (!selected) { + p->translate(0,1); + p->setPen(cg.dark()); + p->drawLine(x, y, right, y); + } + break; + } + }; + + break; + } + + // Popup menu scroller + // ------------------------------------------------------------------------ + case CE_PopupMenuScroller: { + p->fillRect(r, cg.background()); + drawPrimitive(PE_ButtonTool, p, ceData, elementFlags, r, cg, Style_Enabled); + drawPrimitive((flags & Style_Up) ? PE_ArrowUp : PE_ArrowDown, p, ceData, elementFlags, r, cg, Style_Enabled); + break; + } + + + // PROGRESSBAR + // ------------------------------------------------------------------------ + case CE_ProgressBarGroove: { + TQRect fr = subRect(SR_ProgressBarGroove, ceData, elementFlags, widget); + drawPrimitive(PE_Panel, p, ceData, elementFlags, fr, cg, Style_Sunken, TQStyleOption::SO_Default); + break; + } + + case CE_ProgressBarContents: { + // ### Take into account totalSteps() for busy indicator + TQRect cr = subRect(SR_ProgressBarContents, ceData, elementFlags, widget); + double progress = ceData.currentStep; + bool reverse = TQApplication::reverseLayout(); + int steps = ceData.totalSteps; + + if (!cr.isValid()) + return; + + // Draw progress bar + if (progress > 0 || steps == 0) { + double pg = (steps == 0) ? 0.1 : progress / steps; + int width = QMIN(cr.width(), (int)(pg * cr.width())); + if (steps == 0) { //Busy indicator + + if (width < 1) width = 1; //A busy indicator with width 0 is kind of useless + + int remWidth = cr.width() - width; //Never disappear completely + if (remWidth <= 0) remWidth = 1; //Do something non-crashy when too small... + + int pstep = int(progress) % ( 2 * remWidth ); + + if ( pstep > remWidth ) { + //Bounce about.. We're remWidth + some delta, we want to be remWidth - delta... + // - ( (remWidth + some delta) - 2* remWidth ) = - (some deleta - remWidth) = remWidth - some delta.. + pstep = - (pstep - 2 * remWidth ); + } + + if (reverse) + p->fillRect(cr.x() + cr.width() - width - pstep, cr.y(), width, cr.height(), + cg.brush(TQColorGroup::Highlight)); + else + p->fillRect(cr.x() + pstep, cr.y(), width, cr.height(), + cg.brush(TQColorGroup::Highlight)); + + return; + } + + + // Do fancy gradient for highcolor displays + if (d->highcolor) { + TQColor c(cg.highlight()); + KPixmap pix; + pix.resize(cr.width(), cr.height()); + KPixmapEffect::gradient(pix, reverse ? c.light(150) : c.dark(150), + reverse ? c.dark(150) : c.light(150), + KPixmapEffect::HorizontalGradient); + if (reverse) + p->drawPixmap(cr.x()+(cr.width()-width), cr.y(), pix, + cr.width()-width, 0, width, cr.height()); + else + p->drawPixmap(cr.x(), cr.y(), pix, 0, 0, width, cr.height()); + } else + if (reverse) + p->fillRect(cr.x()+(cr.width()-width), cr.y(), width, cr.height(), + cg.brush(TQColorGroup::Highlight)); + else + p->fillRect(cr.x(), cr.y(), width, cr.height(), + cg.brush(TQColorGroup::Highlight)); + } + break; + } + + case CE_ProgressBarLabel: { + TQRect cr = subRect(SR_ProgressBarContents, ceData, elementFlags, widget); + double progress = ceData.currentStep; + bool reverse = TQApplication::reverseLayout(); + int steps = ceData.totalSteps; + + if (!cr.isValid()) + return; + + TQFont font = p->font(); + font.setBold(true); + p->setFont(font); + + // Draw label + if (progress > 0 || steps == 0) { + double pg = (steps == 0) ? 1.0 : progress / steps; + int width = QMIN(cr.width(), (int)(pg * cr.width())); + TQRect crect; + if (reverse) + crect.setRect(cr.x()+(cr.width()-width), cr.y(), cr.width(), cr.height()); + else + crect.setRect(cr.x()+width, cr.y(), cr.width(), cr.height()); + + p->save(); + p->setPen((elementFlags & CEF_IsEnabled) ? (reverse ? cg.text() : cg.highlightedText()) : cg.text()); + p->drawText(r, AlignCenter, ceData.progressText); + p->setClipRect(crect); + p->setPen(reverse ? cg.highlightedText() : cg.text()); + p->drawText(r, AlignCenter, ceData.progressText); + p->restore(); + + } else { + p->setPen(cg.text()); + p->drawText(r, AlignCenter, ceData.progressText); + } + + break; + } + + default: + TQCommonStyle::drawControl(element, p, ceData, elementFlags, r, cg, flags, opt, widget); + } +} + + +TQRect TDEStyle::subRect(SubRect r, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, const TQWidget* widget) const +{ + switch(r) + { + // KDE2 look smooth progress bar + // ------------------------------------------------------------------------ + case SR_ProgressBarGroove: + return ceData.rect; + + case SR_ProgressBarContents: + case SR_ProgressBarLabel: { + // ### take into account indicatorFollowsStyle() + TQRect rt = ceData.rect; + return TQRect(rt.x()+2, rt.y()+2, rt.width()-4, rt.height()-4); + } + + default: + return TQCommonStyle::subRect(r, ceData, elementFlags, widget); + } +} + + +int TDEStyle::pixelMetric(PixelMetric m, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget* widget) const +{ + switch(m) + { + // BUTTONS + // ------------------------------------------------------------------------ + case PM_ButtonShiftHorizontal: // Offset by 1 + case PM_ButtonShiftVertical: // ### Make configurable + return 1; + + case PM_DockWindowHandleExtent: + { + TQWidget* parent = 0; + // Check that we are not a normal toolbar or a hidden dockwidget, + // in which case we need to adjust the height for font size + if (widget + && !(ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING)) + && !(ceData.parentWidgetData.widgetObjectTypes.contains(TQMAINWINDOW_OBJECT_NAME_STRING)) + && (ceData.widgetObjectTypes.contains(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING)) ) + return widget->fontMetrics().lineSpacing(); + else + return TQCommonStyle::pixelMetric(m, ceData, elementFlags, widget); + } + + // TABS + // ------------------------------------------------------------------------ + case PM_TabBarTabHSpace: + return 24; + + case PM_TabBarTabVSpace: { + if ( ceData.tabBarData.shape == TQTabBar::RoundedAbove || + ceData.tabBarData.shape == TQTabBar::RoundedBelow ) + return 10; + else + return 4; + } + + case PM_TabBarTabOverlap: { + TQTabBar::Shape tbs = ceData.tabBarData.shape; + + if ( (tbs == TQTabBar::RoundedAbove) || + (tbs == TQTabBar::RoundedBelow) ) + return 0; + else + return 2; + } + + // SLIDER + // ------------------------------------------------------------------------ + case PM_SliderLength: + return 18; + + case PM_SliderThickness: + return 24; + + // Determines how much space to leave for the actual non-tickmark + // portion of the slider. + case PM_SliderControlThickness: { + TQSlider::TickSetting ts = (TQSlider::TickSetting)ceData.tickMarkSetting; + int thickness = (ceData.orientation == TQt::Horizontal) ? + ceData.rect.height() : ceData.rect.width(); + switch (ts) { + case TQSlider::NoMarks: // Use total area. + break; + case TQSlider::Both: + thickness = (thickness/2) + 3; // Use approx. 1/2 of area. + break; + default: // Use approx. 2/3 of area + thickness = ((thickness*2)/3) + 3; + break; + }; + return thickness; + } + + // SPLITTER + // ------------------------------------------------------------------------ + case PM_SplitterWidth: + if (ceData.widgetObjectTypes.contains(TQDOCKWINDOWRESIZEHANDLE_OBJECT_NAME_STRING)) + return 8; // ### why do we need 2pix extra? + else + return 6; + + // FRAMES + // ------------------------------------------------------------------------ + case PM_MenuBarFrameWidth: + return 1; + + case PM_DockWindowFrameWidth: + return 1; + + // GENERAL + // ------------------------------------------------------------------------ + case PM_MaximumDragDistance: + return -1; + + case PM_MenuBarItemSpacing: + return 5; + + case PM_ToolBarItemSpacing: + return 0; + + case PM_PopupMenuScrollerHeight: + return pixelMetric( PM_ScrollBarExtent, ceData, elementFlags, 0); + + default: + return TQCommonStyle::pixelMetric( m, ceData, elementFlags, widget ); + } +} + +//Helper to find the next sibling that's not hidden +static TQListViewItem* nextVisibleSibling(TQListViewItem* item) +{ + TQListViewItem* sibling = item; + do + { + sibling = sibling->nextSibling(); + } + while (sibling && !sibling->isVisible()); + + return sibling; +} + +void TDEStyle::drawComplexControl( TQ_ComplexControl control, + TQPainter* p, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags, + SCFlags controls, + SCFlags active, + const TQStyleOption &opt, + const TQWidget* widget ) const +{ + switch(control) + { + // 3 BUTTON SCROLLBAR + // ------------------------------------------------------------------------ + case CC_ScrollBar: { + // Many thanks to Brad Hughes for contributing this code. + bool useThreeButtonScrollBar = (d->scrollbarType & ThreeButtonScrollBar); + + bool maxedOut = (ceData.minSteps == ceData.maxSteps); + bool horizontal = (ceData.orientation == TQt::Horizontal); + SFlags sflags = ((horizontal ? Style_Horizontal : Style_Default) | + (maxedOut ? Style_Default : Style_Enabled)); + + TQRect addline, subline, subline2, addpage, subpage, slider, first, last; + subline = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarSubLine, opt, widget); + addline = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarAddLine, opt, widget); + subpage = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarSubPage, opt, widget); + addpage = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarAddPage, opt, widget); + slider = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarSlider, opt, widget); + first = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarFirst, opt, widget); + last = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarLast, opt, widget); + subline2 = addline; + + if ( useThreeButtonScrollBar ) { + if (horizontal) { + subline2.moveBy(-addline.width(), 0); + } + else { + subline2.moveBy(0, -addline.height()); + } + } + + // Draw the up/left button set + if ((controls & SC_ScrollBarSubLine) && subline.isValid()) { + drawPrimitive(PE_ScrollBarSubLine, p, ceData, elementFlags, subline, cg, + sflags | (active == SC_ScrollBarSubLine ? + Style_Down : Style_Default)); + + if (useThreeButtonScrollBar && subline2.isValid()) + drawPrimitive(PE_ScrollBarSubLine, p, ceData, elementFlags, subline2, cg, + sflags | (active == SC_ScrollBarSubLine ? + Style_Down : Style_Default)); + } + + if ((controls & SC_ScrollBarAddLine) && addline.isValid()) + drawPrimitive(PE_ScrollBarAddLine, p, ceData, elementFlags, addline, cg, + sflags | ((active == SC_ScrollBarAddLine) ? + Style_Down : Style_Default)); + + if ((controls & SC_ScrollBarSubPage) && subpage.isValid()) + drawPrimitive(PE_ScrollBarSubPage, p, ceData, elementFlags, subpage, cg, + sflags | ((active == SC_ScrollBarSubPage) ? + Style_Down : Style_Default)); + + if ((controls & SC_ScrollBarAddPage) && addpage.isValid()) + drawPrimitive(PE_ScrollBarAddPage, p, ceData, elementFlags, addpage, cg, + sflags | ((active == SC_ScrollBarAddPage) ? + Style_Down : Style_Default)); + + if ((controls & SC_ScrollBarFirst) && first.isValid()) + drawPrimitive(PE_ScrollBarFirst, p, ceData, elementFlags, first, cg, + sflags | ((active == SC_ScrollBarFirst) ? + Style_Down : Style_Default)); + + if ((controls & SC_ScrollBarLast) && last.isValid()) + drawPrimitive(PE_ScrollBarLast, p, ceData, elementFlags, last, cg, + sflags | ((active == SC_ScrollBarLast) ? + Style_Down : Style_Default)); + + if ((controls & SC_ScrollBarSlider) && slider.isValid()) { + drawPrimitive(PE_ScrollBarSlider, p, ceData, elementFlags, slider, cg, + sflags | ((active == SC_ScrollBarSlider) ? + Style_Down : Style_Default)); + // Draw focus rect + if (elementFlags & CEF_HasFocus) { + TQRect fr(slider.x() + 2, slider.y() + 2, + slider.width() - 5, slider.height() - 5); + drawPrimitive(PE_FocusRect, p, ceData, elementFlags, fr, cg, Style_Default); + } + } + break; + } + + + // SLIDER + // ------------------------------------------------------------------- + case CC_Slider: { + TQRect groove = querySubControlMetrics(CC_Slider, ceData, elementFlags, SC_SliderGroove, opt, widget); + TQRect handle = querySubControlMetrics(CC_Slider, ceData, elementFlags, SC_SliderHandle, opt, widget); + + // Double-buffer slider for no flicker + TQPixmap pix(ceData.rect.size()); + TQPainter p2; + p2.begin(&pix); + + if ( (elementFlags & CEF_HasParentWidget) && + !ceData.parentWidgetData.bgPixmap.isNull() ) { + TQPixmap pixmap = ceData.parentWidgetData.bgPixmap; + p2.drawTiledPixmap(r, pixmap, ceData.pos); + } else + pix.fill(cg.background()); + + // Draw slider groove + if ((controls & SC_SliderGroove) && groove.isValid()) { + drawTDEStylePrimitive( KPE_SliderGroove, &p2, ceData, elementFlags, groove, cg, flags, opt, widget ); + + // Draw the focus rect around the groove + if (elementFlags & CEF_HasFocus) { + drawPrimitive(PE_FocusRect, &p2, ceData, elementFlags, groove, cg); + } + } + + // Draw the tickmarks + if (controls & SC_SliderTickmarks) + TQCommonStyle::drawComplexControl(control, &p2, ceData, elementFlags, + r, cg, flags, SC_SliderTickmarks, active, opt, widget); + + // Draw the slider handle + if ((controls & SC_SliderHandle) && handle.isValid()) { + if (active == SC_SliderHandle) + flags |= Style_Active; + drawTDEStylePrimitive( KPE_SliderHandle, &p2, ceData, elementFlags, handle, cg, flags, opt, widget ); + } + + p2.end(); + + TQPaintDevice* ppd = p->device(); + if (ppd->isExtDev()) { + p->drawPixmap(0, 0, pix); + } + else { + bitBlt((TQWidget*)widget, r.x(), r.y(), &pix); + } + break; + } + + // LISTVIEW + // ------------------------------------------------------------------- + case CC_ListView: { + + /* + * Many thanks to TrollTech AS for donating CC_ListView from TQWindowsStyle. + * CC_ListView code is Copyright (C) 1998-2000 TrollTech AS. + */ + + // Paint the icon and text. + if ( controls & SC_ListView ) + TQCommonStyle::drawComplexControl( control, p, ceData, elementFlags, r, cg, flags, controls, active, opt, widget ); + + // If we're have a branch or are expanded... + if ( controls & (SC_ListViewBranch | SC_ListViewExpand) ) + { + // If no list view item was supplied, break + if (opt.isDefault()) + break; + + TQListViewItem *item = opt.listViewItem(); + TQListViewItem *child = item->firstChild(); + + int y = r.y(); + int c; // dotline vertice count + int dotoffset = 0; + TQPointArray dotlines; + + if ( active == SC_All && controls == SC_ListViewExpand ) { + // We only need to draw a vertical line + c = 2; + dotlines.resize(2); + dotlines[0] = TQPoint( r.right(), r.top() ); + dotlines[1] = TQPoint( r.right(), r.bottom() ); + + } else { + + int linetop = 0, linebot = 0; + // each branch needs at most two lines, ie. four end points + dotoffset = (item->itemPos() + item->height() - y) % 2; + dotlines.resize( item->childCount() * 4 ); + c = 0; + + // skip the stuff above the exposed rectangle + while ( child && y + child->height() <= 0 ) + { + y += child->totalHeight(); + child = nextVisibleSibling(child); + } + + int bx = r.width() / 2; + + // paint stuff in the magical area + TQListView* v = item->listView(); + int lh = QMAX( p->fontMetrics().height() + 2 * v->itemMargin(), + TQApplication::globalStrut().height() ); + if ( lh % 2 > 0 ) + lh++; + + // Draw all the expand/close boxes... + TQRect boxrect; + TQStyle::StyleFlags boxflags; + while ( child && y < r.height() ) + { + linebot = y + lh/2; + if ( (child->isExpandable() || child->childCount()) && + (child->height() > 0) ) + { + // The primitive requires a rect. + boxrect = TQRect( bx-4, linebot-4, 9, 9 ); + boxflags = child->isOpen() ? TQStyle::Style_Off : TQStyle::Style_On; + + // TDEStyle extension: Draw the box and expand/collapse indicator + drawTDEStylePrimitive( KPE_ListViewExpander, p, ceData, elementFlags, boxrect, cg, boxflags, opt, NULL ); + + // dotlinery + p->setPen( cg.mid() ); + dotlines[c++] = TQPoint( bx, linetop ); + dotlines[c++] = TQPoint( bx, linebot - 5 ); + dotlines[c++] = TQPoint( bx + 5, linebot ); + dotlines[c++] = TQPoint( r.width(), linebot ); + linetop = linebot + 5; + } else { + // just dotlinery + dotlines[c++] = TQPoint( bx+1, linebot ); + dotlines[c++] = TQPoint( r.width(), linebot ); + } + + y += child->totalHeight(); + child = nextVisibleSibling(child); + } + + if ( child ) // there's a child to draw, so move linebot to edge of rectangle + linebot = r.height(); + + if ( linetop < linebot ) + { + dotlines[c++] = TQPoint( bx, linetop ); + dotlines[c++] = TQPoint( bx, linebot ); + } + } + + // Draw all the branches... + static int thickness = kPixelMetric( KPM_ListViewBranchThickness, ceData, elementFlags ); + int line; // index into dotlines + TQRect branchrect; + TQStyle::StyleFlags branchflags; + for( line = 0; line < c; line += 2 ) + { + // assumptions here: lines are horizontal or vertical. + // lines always start with the numerically lowest + // coordinate. + + // point ... relevant coordinate of current point + // end ..... same coordinate of the end of the current line + // other ... the other coordinate of the current point/line + if ( dotlines[line].y() == dotlines[line+1].y() ) + { + // Horizontal branch + int end = dotlines[line+1].x(); + int point = dotlines[line].x(); + int other = dotlines[line].y(); + + branchrect = TQRect( point, other-(thickness/2), end-point, thickness ); + branchflags = TQStyle::Style_Horizontal; + + // TDEStyle extension: Draw the horizontal branch + drawTDEStylePrimitive( KPE_ListViewBranch, p, ceData, elementFlags, branchrect, cg, branchflags, opt, NULL ); + + } else { + // Vertical branch + int end = dotlines[line+1].y(); + int point = dotlines[line].y(); + int other = dotlines[line].x(); + int pixmapoffset = ((point & 1) != dotoffset ) ? 1 : 0; + + branchrect = TQRect( other-(thickness/2), point, thickness, end-point ); + if (!pixmapoffset) // ### Hackish - used to hint the offset + branchflags = TQStyle::Style_NoChange; + else + branchflags = TQStyle::Style_Default; + + // TDEStyle extension: Draw the vertical branch + drawTDEStylePrimitive( KPE_ListViewBranch, p, ceData, elementFlags, branchrect, cg, branchflags, opt, NULL ); + } + } + } + break; + } + + default: + TQCommonStyle::drawComplexControl( control, p, ceData, elementFlags, r, cg, + flags, controls, active, opt, widget ); + break; + } +} + + +TQStyle::SubControl TDEStyle::querySubControl( TQ_ComplexControl control, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQPoint &pos, + const TQStyleOption &opt, + const TQWidget* widget ) const +{ + TQStyle::SubControl ret = TQCommonStyle::querySubControl(control, ceData, elementFlags, pos, opt, widget); + + if (d->scrollbarType == ThreeButtonScrollBar) { + // Enable third button + if (control == CC_ScrollBar && ret == SC_None) + ret = SC_ScrollBarSubLine; + } + return ret; +} + + +TQRect TDEStyle::querySubControlMetrics( TQ_ComplexControl control, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + SubControl sc, + const TQStyleOption &opt, + const TQWidget* widget ) const +{ + TQRect ret; + + if (control == CC_ScrollBar) + { + bool threeButtonScrollBar = d->scrollbarType & ThreeButtonScrollBar; + bool platinumScrollBar = d->scrollbarType & PlatinumStyleScrollBar; + bool nextScrollBar = d->scrollbarType & NextStyleScrollBar; + + bool horizontal = ceData.orientation == TQt::Horizontal; + int sliderstart = ceData.startStep; + int sbextent = pixelMetric(PM_ScrollBarExtent, ceData, elementFlags, widget); + int maxlen = (horizontal ? ceData.rect.width() : ceData.rect.height()) + - (sbextent * (threeButtonScrollBar ? 3 : 2)); + int sliderlen; + + // calculate slider length + if (ceData.maxSteps != ceData.minSteps) + { + uint range = ceData.maxSteps - ceData.minSteps; + sliderlen = (ceData.pageStep * maxlen) / (range + ceData.pageStep); + + int slidermin = pixelMetric( PM_ScrollBarSliderMin, ceData, elementFlags, widget ); + if ( sliderlen < slidermin || range > INT_MAX / 2 ) + sliderlen = slidermin; + if ( sliderlen > maxlen ) + sliderlen = maxlen; + } else + sliderlen = maxlen; + + // Subcontrols + switch (sc) + { + case SC_ScrollBarSubLine: { + // top/left button + if (platinumScrollBar) { + if (horizontal) + ret.setRect(ceData.rect.width() - 2 * sbextent, 0, sbextent, sbextent); + else + ret.setRect(0, ceData.rect.height() - 2 * sbextent, sbextent, sbextent); + } else + ret.setRect(0, 0, sbextent, sbextent); + break; + } + + case SC_ScrollBarAddLine: { + // bottom/right button + if (nextScrollBar) { + if (horizontal) + ret.setRect(sbextent, 0, sbextent, sbextent); + else + ret.setRect(0, sbextent, sbextent, sbextent); + } else { + if (horizontal) + ret.setRect(ceData.rect.width() - sbextent, 0, sbextent, sbextent); + else + ret.setRect(0, ceData.rect.height() - sbextent, sbextent, sbextent); + } + break; + } + + case SC_ScrollBarSubPage: { + // between top/left button and slider + if (platinumScrollBar) { + if (horizontal) + ret.setRect(0, 0, sliderstart, sbextent); + else + ret.setRect(0, 0, sbextent, sliderstart); + } else if (nextScrollBar) { + if (horizontal) + ret.setRect(sbextent*2, 0, sliderstart-2*sbextent, sbextent); + else + ret.setRect(0, sbextent*2, sbextent, sliderstart-2*sbextent); + } else { + if (horizontal) + ret.setRect(sbextent, 0, sliderstart - sbextent, sbextent); + else + ret.setRect(0, sbextent, sbextent, sliderstart - sbextent); + } + break; + } + + case SC_ScrollBarAddPage: { + // between bottom/right button and slider + int fudge; + + if (platinumScrollBar) + fudge = 0; + else if (nextScrollBar) + fudge = 2*sbextent; + else + fudge = sbextent; + + if (horizontal) + ret.setRect(sliderstart + sliderlen, 0, + maxlen - sliderstart - sliderlen + fudge, sbextent); + else + ret.setRect(0, sliderstart + sliderlen, sbextent, + maxlen - sliderstart - sliderlen + fudge); + break; + } + + case SC_ScrollBarGroove: { + int multi = threeButtonScrollBar ? 3 : 2; + int fudge; + + if (platinumScrollBar) + fudge = 0; + else if (nextScrollBar) + fudge = 2*sbextent; + else + fudge = sbextent; + + if (horizontal) + ret.setRect(fudge, 0, ceData.rect.width() - sbextent * multi, ceData.rect.height()); + else + ret.setRect(0, fudge, ceData.rect.width(), ceData.rect.height() - sbextent * multi); + break; + } + + case SC_ScrollBarSlider: { + if (horizontal) + ret.setRect(sliderstart, 0, sliderlen, sbextent); + else + ret.setRect(0, sliderstart, sbextent, sliderlen); + break; + } + + default: + ret = TQCommonStyle::querySubControlMetrics(control, ceData, elementFlags, sc, opt, widget); + break; + } + } else + ret = TQCommonStyle::querySubControlMetrics(control, ceData, elementFlags, sc, opt, widget); + + return ret; +} + +static const char * const kstyle_close_xpm[] = { +"12 12 2 1", +"# c #000000", +". c None", +"............", +"............", +"..##....##..", +"...##..##...", +"....####....", +".....##.....", +"....####....", +"...##..##...", +"..##....##..", +"............", +"............", +"............"}; + +static const char * const kstyle_maximize_xpm[]={ +"12 12 2 1", +"# c #000000", +". c None", +"............", +"............", +".##########.", +".##########.", +".#........#.", +".#........#.", +".#........#.", +".#........#.", +".#........#.", +".#........#.", +".##########.", +"............"}; + + +static const char * const kstyle_minimize_xpm[] = { +"12 12 2 1", +"# c #000000", +". c None", +"............", +"............", +"............", +"............", +"............", +"............", +"............", +"...######...", +"...######...", +"............", +"............", +"............"}; + +static const char * const kstyle_normalizeup_xpm[] = { +"12 12 2 1", +"# c #000000", +". c None", +"............", +"...#######..", +"...#######..", +"...#.....#..", +".#######.#..", +".#######.#..", +".#.....#.#..", +".#.....###..", +".#.....#....", +".#.....#....", +".#######....", +"............"}; + + +static const char * const kstyle_shade_xpm[] = { +"12 12 2 1", +"# c #000000", +". c None", +"............", +"............", +"............", +"............", +"............", +".....#......", +"....###.....", +"...#####....", +"..#######...", +"............", +"............", +"............"}; + +static const char * const kstyle_unshade_xpm[] = { +"12 12 2 1", +"# c #000000", +". c None", +"............", +"............", +"............", +"............", +"..#######...", +"...#####....", +"....###.....", +".....#......", +"............", +"............", +"............", +"............"}; + +static const char * const dock_window_close_xpm[] = { +"8 8 2 1", +"# c #000000", +". c None", +"##....##", +".##..##.", +"..####..", +"...##...", +"..####..", +".##..##.", +"##....##", +"........"}; + +// Message box icons, from page 210 of the Windows style guide. + +// Hand-drawn to resemble Microsoft's icons, but in the Mac/Netscape +// palette. The "question mark" icon, which Microsoft recommends not +// using but a lot of people still use, is left out. + +/* XPM */ +static const char * const information_xpm[]={ +"32 32 5 1", +". c None", +"c c #000000", +"* c #999999", +"a c #ffffff", +"b c #0000ff", +"...........********.............", +"........***aaaaaaaa***..........", +"......**aaaaaaaaaaaaaa**........", +".....*aaaaaaaaaaaaaaaaaa*.......", +"....*aaaaaaaabbbbaaaaaaaac......", +"...*aaaaaaaabbbbbbaaaaaaaac.....", +"..*aaaaaaaaabbbbbbaaaaaaaaac....", +".*aaaaaaaaaaabbbbaaaaaaaaaaac...", +".*aaaaaaaaaaaaaaaaaaaaaaaaaac*..", +"*aaaaaaaaaaaaaaaaaaaaaaaaaaaac*.", +"*aaaaaaaaaabbbbbbbaaaaaaaaaaac*.", +"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", +"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", +"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", +"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", +"*aaaaaaaaaaaabbbbbaaaaaaaaaaac**", +".*aaaaaaaaaaabbbbbaaaaaaaaaac***", +".*aaaaaaaaaaabbbbbaaaaaaaaaac***", +"..*aaaaaaaaaabbbbbaaaaaaaaac***.", +"...caaaaaaabbbbbbbbbaaaaaac****.", +"....caaaaaaaaaaaaaaaaaaaac****..", +".....caaaaaaaaaaaaaaaaaac****...", +"......ccaaaaaaaaaaaaaacc****....", +".......*cccaaaaaaaaccc*****.....", +"........***cccaaaac*******......", +"..........****caaac*****........", +".............*caaac**...........", +"...............caac**...........", +"................cac**...........", +".................cc**...........", +"..................***...........", +"...................**..........."}; +/* XPM */ +static const char* const warning_xpm[]={ +"32 32 4 1", +". c None", +"a c #ffff00", +"* c #000000", +"b c #999999", +".............***................", +"............*aaa*...............", +"...........*aaaaa*b.............", +"...........*aaaaa*bb............", +"..........*aaaaaaa*bb...........", +"..........*aaaaaaa*bb...........", +".........*aaaaaaaaa*bb..........", +".........*aaaaaaaaa*bb..........", +"........*aaaaaaaaaaa*bb.........", +"........*aaaa***aaaa*bb.........", +".......*aaaa*****aaaa*bb........", +".......*aaaa*****aaaa*bb........", +"......*aaaaa*****aaaaa*bb.......", +"......*aaaaa*****aaaaa*bb.......", +".....*aaaaaa*****aaaaaa*bb......", +".....*aaaaaa*****aaaaaa*bb......", +"....*aaaaaaaa***aaaaaaaa*bb.....", +"....*aaaaaaaa***aaaaaaaa*bb.....", +"...*aaaaaaaaa***aaaaaaaaa*bb....", +"...*aaaaaaaaaa*aaaaaaaaaa*bb....", +"..*aaaaaaaaaaa*aaaaaaaaaaa*bb...", +"..*aaaaaaaaaaaaaaaaaaaaaaa*bb...", +".*aaaaaaaaaaaa**aaaaaaaaaaa*bb..", +".*aaaaaaaaaaa****aaaaaaaaaa*bb..", +"*aaaaaaaaaaaa****aaaaaaaaaaa*bb.", +"*aaaaaaaaaaaaa**aaaaaaaaaaaa*bb.", +"*aaaaaaaaaaaaaaaaaaaaaaaaaaa*bbb", +"*aaaaaaaaaaaaaaaaaaaaaaaaaaa*bbb", +".*aaaaaaaaaaaaaaaaaaaaaaaaa*bbbb", +"..*************************bbbbb", +"....bbbbbbbbbbbbbbbbbbbbbbbbbbb.", +".....bbbbbbbbbbbbbbbbbbbbbbbbb.."}; +/* XPM */ +static const char* const critical_xpm[]={ +"32 32 4 1", +". c None", +"a c #999999", +"* c #ff0000", +"b c #ffffff", +"...........********.............", +".........************...........", +".......****************.........", +"......******************........", +".....********************a......", +"....**********************a.....", +"...************************a....", +"..*******b**********b*******a...", +"..******bbb********bbb******a...", +".******bbbbb******bbbbb******a..", +".*******bbbbb****bbbbb*******a..", +"*********bbbbb**bbbbb*********a.", +"**********bbbbbbbbbb**********a.", +"***********bbbbbbbb***********aa", +"************bbbbbb************aa", +"************bbbbbb************aa", +"***********bbbbbbbb***********aa", +"**********bbbbbbbbbb**********aa", +"*********bbbbb**bbbbb*********aa", +".*******bbbbb****bbbbb*******aa.", +".******bbbbb******bbbbb******aa.", +"..******bbb********bbb******aaa.", +"..*******b**********b*******aa..", +"...************************aaa..", +"....**********************aaa...", +"....a********************aaa....", +".....a******************aaa.....", +"......a****************aaa......", +".......aa************aaaa.......", +".........aa********aaaaa........", +"...........aaaaaaaaaaa..........", +".............aaaaaaa............"}; + +TQPixmap TDEStyle::stylePixmap( StylePixmap stylepixmap, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQStyleOption& opt, + const TQWidget* widget) const +{ + switch (stylepixmap) { + case SP_TitleBarShadeButton: + return TQPixmap(const_cast<const char**>(kstyle_shade_xpm)); + case SP_TitleBarUnshadeButton: + return TQPixmap(const_cast<const char**>(kstyle_unshade_xpm)); + case SP_TitleBarNormalButton: + return TQPixmap(const_cast<const char**>(kstyle_normalizeup_xpm)); + case SP_TitleBarMinButton: + return TQPixmap(const_cast<const char**>(kstyle_minimize_xpm)); + case SP_TitleBarMaxButton: + return TQPixmap(const_cast<const char**>(kstyle_maximize_xpm)); + case SP_TitleBarCloseButton: + return TQPixmap(const_cast<const char**>(kstyle_close_xpm)); + case SP_DockWindowCloseButton: + return TQPixmap(const_cast<const char**>(dock_window_close_xpm )); + case SP_MessageBoxInformation: + return TQPixmap(const_cast<const char**>(information_xpm)); + case SP_MessageBoxWarning: + return TQPixmap(const_cast<const char**>(warning_xpm)); + case SP_MessageBoxCritical: + return TQPixmap(const_cast<const char**>(critical_xpm)); + default: + break; + } + return TQCommonStyle::stylePixmap(stylepixmap, ceData, elementFlags, opt, widget); +} + + +int TDEStyle::styleHint( TQ_StyleHint sh, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, + const TQStyleOption &opt, TQStyleHintReturn* shr, const TQWidget* w) const +{ + switch (sh) + { + case SH_EtchDisabledText: + return d->etchDisabledText ? 1 : 0; + + case SH_PopupMenu_Scrollable: + return d->scrollablePopupmenus ? 1 : 0; + + case SH_HideUnderlineAcceleratorWhenAltUp: + return d->autoHideAccelerators ? 1 : 0; + + case SH_MenuBar_AltKeyNavigation: + return d->menuAltKeyNavigation ? 1 : 0; + + case SH_PopupMenu_SubMenuPopupDelay: + if ( styleHint( SH_PopupMenu_SloppySubMenus, ceData, elementFlags, TQStyleOption::Default, 0, w ) ) + return QMIN( 100, d->popupMenuDelay ); + else + return d->popupMenuDelay; + + case SH_PopupMenu_SloppySubMenus: + return d->sloppySubMenus; + + case SH_ItemView_ChangeHighlightOnFocus: + case SH_Slider_SloppyKeyEvents: + case SH_MainWindow_SpaceBelowMenuBar: + case SH_PopupMenu_AllowActiveAndDisabled: + return 0; + + case SH_Slider_SnapToValue: + case SH_PrintDialog_RightAlignButtons: + case SH_FontDialog_SelectAssociatedText: + case SH_MenuBar_MouseTracking: + case SH_PopupMenu_MouseTracking: + case SH_ComboBox_ListMouseTracking: + case SH_ScrollBar_MiddleClickAbsolutePosition: + return 1; + case SH_LineEdit_PasswordCharacter: + { + if (w) { + const TQFontMetrics &fm = w->fontMetrics(); + if (fm.inFont(TQChar(0x25CF))) { + return 0x25CF; + } else if (fm.inFont(TQChar(0x2022))) { + return 0x2022; + } + } + return '*'; + } + + default: + return TQCommonStyle::styleHint(sh, ceData, elementFlags, opt, shr, w); + } +} + + +bool TDEStyle::objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *event ) +{ + if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) { + TQObject* object = reinterpret_cast<TQObject*>(source); + if ( d->useFilledFrameWorkaround ) + { + // Make the QMenuBar/TQToolBar paintEvent() cover a larger area to + // ensure that the filled frame contents are properly painted. + // We essentially modify the paintEvent's rect to include the + // panel border, which also paints the widget's interior. + // This is nasty, but I see no other way to properly repaint + // filled frames in all QMenuBars and QToolBars. + // -- Karol. + TQFrame *frame = 0; + if ( event->type() == TQEvent::Paint + && (frame = ::tqqt_cast<TQFrame*>(object)) ) + { + if (frame->frameShape() != TQFrame::ToolBarPanel && frame->frameShape() != TQFrame::MenuBarPanel) + return false; + + bool horizontal = true; + TQPaintEvent* pe = (TQPaintEvent*)event; + TQToolBar *toolbar = ::tqqt_cast< TQToolBar *>( frame ); + TQRect r = pe->rect(); + + if (toolbar && toolbar->orientation() == Qt::Vertical) + horizontal = false; + + if (horizontal) { + if ( r.height() == frame->height() ) + return false; // Let TQFrame handle the painting now. + + // Else, send a new paint event with an updated paint rect. + TQPaintEvent dummyPE( TQRect( r.x(), 0, r.width(), frame->height()) ); + TQApplication::sendEvent( frame, &dummyPE ); + } + else { // Vertical + if ( r.width() == frame->width() ) + return false; + + TQPaintEvent dummyPE( TQRect( 0, r.y(), frame->width(), r.height()) ); + TQApplication::sendEvent( frame, &dummyPE ); + } + + // Discard this event as we sent a new paintEvent. + return true; + } + } + } + + return false; +} + + +// ----------------------------------------------------------------------------- +// I N T E R N A L - TDEStyle menu transparency handler +// ----------------------------------------------------------------------------- + +TransparencyHandler::TransparencyHandler( TDEStyle* style, + TransparencyEngine tEngine, float menuOpacity, bool useDropShadow ) + : TQObject() +{ + te = tEngine; + kstyle = style; + opacity = menuOpacity; + dropShadow = useDropShadow; + pix.setOptimization(TQPixmap::BestOptim); +} + +TransparencyHandler::~TransparencyHandler() +{ +} + +bool TransparencyHandler::haveX11RGBASupport() +{ + // Simple way to determine if we have ARGB support + if (TQPaintDevice::x11AppDepth() == 32) { + return true; + } + else { + return false; + } +} + +#define REAL_ALPHA_STRENGTH 255.0 + +// This is meant to be ugly but fast. +void TransparencyHandler::rightShadow(TQImage& dst) +{ + bool have_composite = haveX11RGBASupport(); + + if (dst.depth() != 32) + dst = dst.convertDepth(32); + + // blend top-right corner. + int pixels = dst.width() * dst.height(); +#ifdef WORDS_BIGENDIAN + register unsigned char* data = dst.bits() + 1; // Skip alpha +#else + register unsigned char* data = dst.bits(); // Skip alpha +#endif + for(register int i = 0; i < 16; i++) { + if (have_composite) { + data++; + data++; + data++; + *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-top_right_corner[i])); data++; + } + else { + *data = (unsigned char)((*data)*top_right_corner[i]); data++; + *data = (unsigned char)((*data)*top_right_corner[i]); data++; + *data = (unsigned char)((*data)*top_right_corner[i]); data++; + data++; // skip alpha + } + } + + pixels -= 32; // tint right strip without rounded edges. + register int c = 0; + for(register int i = 0; i < pixels; i++) { + if (have_composite) { + data++; + data++; + data++;; + *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-shadow_strip[c])); data++; + } + else { + *data = (unsigned char)((*data)*shadow_strip[c]); data++; + *data = (unsigned char)((*data)*shadow_strip[c]); data++; + *data = (unsigned char)((*data)*shadow_strip[c]); data++; + data++; // skip alpha + } + ++c; + c %= 4; + } + + // tint bottom edge + for(register int i = 0; i < 16; i++) { + if (have_composite) { + data++; + data++; + data++; + *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-bottom_right_corner[i])); data++; + } + else { + *data = (unsigned char)((*data)*bottom_right_corner[i]); data++; + *data = (unsigned char)((*data)*bottom_right_corner[i]); data++; + *data = (unsigned char)((*data)*bottom_right_corner[i]); data++; + data++; // skip alpha + } + } +} + +void TransparencyHandler::bottomShadow(TQImage& dst) +{ + bool have_composite = haveX11RGBASupport(); + + if (dst.depth() != 32) + dst = dst.convertDepth(32); + + int line = 0; + int width = dst.width() - 4; + double strip_data = shadow_strip[0]; + double* corner = const_cast<double*>(bottom_left_corner); + +#ifdef WORDS_BIGENDIAN + register unsigned char* data = dst.bits() + 1; // Skip alpha +#else + register unsigned char* data = dst.bits(); // Skip alpha +#endif + + for(int y = 0; y < 4; y++) + { + // Bottom-left Corner + for(register int x = 0; x < 4; x++) { + if (have_composite) { + data++; + data++; + data++; + *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-(*corner))); data++; + } + else { + *data = (unsigned char)((*data)*(*corner)); data++; + *data = (unsigned char)((*data)*(*corner)); data++; + *data = (unsigned char)((*data)*(*corner)); data++; + data++; // skip alpha + } + corner++; + } + + // Scanline + for(register int x = 0; x < width; x++) { + if (have_composite) { + data++; + data++; + data++; + *data = (unsigned char)(REAL_ALPHA_STRENGTH*(1.0-strip_data)); data++; + } + else { + *data = (unsigned char)((*data)*strip_data); data++; + *data = (unsigned char)((*data)*strip_data); data++; + *data = (unsigned char)((*data)*strip_data); data++; + data++; // skip alpha + } + } + + strip_data = shadow_strip[++line]; + } +} + +TQImage TransparencyHandler::handleRealAlpha(TQImage img) { + TQImage clearImage = img.convertDepth(32); + clearImage.setAlphaBuffer(true); + + int w = clearImage.width(); + int h = clearImage.height(); + + for (int y = 0; y < h; ++y) { + TQRgb *ls = (TQRgb *)clearImage.scanLine( y ); + for (int x = 0; x < w; ++x) { + ls[x] = tqRgba( 0, 0, 0, 0 ); + } + } + + return clearImage; +} + +// Create a shadow of thickness 4. +void TransparencyHandler::createShadowWindows(const TQWidget* p) +{ +#ifdef Q_WS_X11 + int x2 = p->x()+p->width(); + int y2 = p->y()+p->height(); + TQRect shadow1(x2, p->y() + 4, 4, p->height()); + TQRect shadow2(p->x() + 4, y2, p->width() - 4, 4); + + bool have_composite = haveX11RGBASupport(); + + // Create a fake drop-down shadow effect via blended Xwindows + ShadowElements se; + se.w1 = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WType_Popup | WX11BypassWM) ); + se.w2 = new TQWidget(0, 0, (WFlags)(WStyle_Customize | WType_Popup | WX11BypassWM) ); + se.w1->setGeometry(shadow1); + se.w2->setGeometry(shadow2); + XSelectInput(tqt_xdisplay(), se.w1->winId(), StructureNotifyMask ); + XSelectInput(tqt_xdisplay(), se.w2->winId(), StructureNotifyMask ); + + // Insert a new ShadowMap entry + shadowMap()[p] = se; + + // Some hocus-pocus here to create the drop-shadow. + TQPixmap pix_shadow1; + TQPixmap pix_shadow2; + if (have_composite) { + pix_shadow1 = TQPixmap(shadow1.width(), shadow1.height()); + pix_shadow2 = TQPixmap(shadow2.width(), shadow2.height()); + } + else { + pix_shadow1 = TQPixmap::grabWindow(tqt_xrootwin(), + shadow1.x(), shadow1.y(), shadow1.width(), shadow1.height()); + pix_shadow2 = TQPixmap::grabWindow(tqt_xrootwin(), + shadow2.x(), shadow2.y(), shadow2.width(), shadow2.height()); + } + + TQImage img; + img = pix_shadow1.convertToImage(); + if (have_composite) img = handleRealAlpha(img); + rightShadow(img); + pix_shadow1.convertFromImage(img); + img = pix_shadow2.convertToImage(); + if (have_composite) img = handleRealAlpha(img); + bottomShadow(img); + pix_shadow2.convertFromImage(img); + + // Set the background pixmaps + se.w1->setErasePixmap(pix_shadow1); + se.w2->setErasePixmap(pix_shadow2); + + // Show the 'shadow' just before showing the popup menu window + // Don't use TQWidget::show() so we don't confuse QEffects, thus causing broken focus. + XMapWindow(tqt_xdisplay(), se.w1->winId()); + XMapWindow(tqt_xdisplay(), se.w2->winId()); +#else + Q_UNUSED( p ) +#endif +} + +void TransparencyHandler::removeShadowWindows(const TQWidget* p) +{ +#ifdef Q_WS_X11 + ShadowMap::iterator it = shadowMap().find(p); + if (it != shadowMap().end()) + { + ShadowElements se = it.data(); + XUnmapWindow(tqt_xdisplay(), se.w1->winId()); // hide + XUnmapWindow(tqt_xdisplay(), se.w2->winId()); + XFlush(tqt_xdisplay()); // try to hide faster + delete se.w1; + delete se.w2; + shadowMap().erase(it); + } +#else + Q_UNUSED( p ) +#endif +} + +bool TransparencyHandler::eventFilter( TQObject* object, TQEvent* event ) +{ +#if !defined Q_WS_MAC && !defined Q_WS_WIN + // Transparency idea was borrowed from KDE2's "MegaGradient" Style, + // Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> + + // Added 'fake' menu shadows <04-Jul-2002> -- Karol + TQWidget* p = (TQWidget*)object; + TQEvent::Type et = event->type(); + + if (et == TQEvent::Show) + { + // Handle translucency + if (te != Disabled) + { + pix = TQPixmap::grabWindow(tqt_xrootwin(), + p->x(), p->y(), p->width(), p->height()); + + switch (te) { +#ifdef HAVE_XRENDER + case XRender: + if (tqt_use_xrender) { + XRenderBlendToPixmap(p); + break; + } + // Fall through intended +#else + case XRender: +#endif + case SoftwareBlend: + blendToPixmap(p->colorGroup(), p); + break; + + case SoftwareTint: + default: + blendToColor(p->colorGroup().button()); + }; + + p->setErasePixmap(pix); + } + + // Handle drop shadow + // * FIXME : !shadowMap().contains(p) is a workaround for leftover + // * shadows after duplicate show events. + // * TODO : determine real cause for duplicate events + // * till 20021005 + if ((dropShadow || useDropShadow(p)) + && p->width() > 16 && p->height() > 16 && !shadowMap().contains( p )) + createShadowWindows(p); + } + else if (et == TQEvent::Resize && p->isShown() && p->isTopLevel()) + { + // Handle drop shadow + if (dropShadow || useDropShadow(p)) + { + removeShadowWindows(p); + createShadowWindows(p); + } + } + else if (et == TQEvent::Hide) + { + // Handle drop shadow + if (dropShadow || useDropShadow(p)) + removeShadowWindows(p); + + // Handle translucency + if (te != Disabled) + p->setErasePixmap(TQPixmap()); + } + +#endif + return false; +} + + +// Blends a TQImage to a predefined color, with a given opacity. +void TransparencyHandler::blendToColor(const TQColor &col) +{ + if (opacity < 0.0 || opacity > 1.0) + return; + + TQImage img = pix.convertToImage(); + KImageEffect::blend(col, img, opacity); + pix.convertFromImage(img); +} + + +void TransparencyHandler::blendToPixmap(const TQColorGroup &cg, const TQWidget* p) +{ + if (opacity < 0.0 || opacity > 1.0) + return; + + KPixmap blendPix; + blendPix.resize( pix.width(), pix.height() ); + + if (blendPix.width() != pix.width() || + blendPix.height() != pix.height()) + return; + + // Allow styles to define the blend pixmap - allows for some interesting effects. + if (::tqqt_cast<TQPopupMenu*>(p)) + kstyle->renderMenuBlendPixmap( blendPix, cg, ::tqqt_cast<TQPopupMenu*>(p) ); + else + blendPix.fill(cg.button()); // Just tint as the default behavior + + TQImage blendImg = blendPix.convertToImage(); + TQImage backImg = pix.convertToImage(); + KImageEffect::blend(blendImg, backImg, opacity); + pix.convertFromImage(backImg); +} + + +#ifdef HAVE_XRENDER +// Here we go, use XRender in all its glory. +// NOTE: This is actually a bit slower than the above routines +// on non-accelerated displays. -- Karol. +void TransparencyHandler::XRenderBlendToPixmap(const TQWidget* p) +{ + KPixmap renderPix; + renderPix.resize( pix.width(), pix.height() ); + + // Allow styles to define the blend pixmap - allows for some interesting effects. + if (::tqqt_cast<TQPopupMenu*>(p)) + kstyle->renderMenuBlendPixmap( renderPix, p->colorGroup(), + ::tqqt_cast<TQPopupMenu*>(p) ); + else + renderPix.fill(p->colorGroup().button()); // Just tint as the default behavior + + Display* dpy = tqt_xdisplay(); + Pixmap alphaPixmap; + Picture alphaPicture; + XRenderPictFormat Rpf; + XRenderPictureAttributes Rpa; + XRenderColor clr; + clr.alpha = ((unsigned short)(255*opacity) << 8); + + Rpf.type = PictTypeDirect; + Rpf.depth = 8; + Rpf.direct.alphaMask = 0xff; + Rpa.repeat = True; // Tile + + XRenderPictFormat* xformat = XRenderFindFormat(dpy, + PictFormatType | PictFormatDepth | PictFormatAlphaMask, &Rpf, 0); + + alphaPixmap = XCreatePixmap(dpy, p->handle(), 1, 1, 8); + alphaPicture = XRenderCreatePicture(dpy, alphaPixmap, xformat, CPRepeat, &Rpa); + + XRenderFillRectangle(dpy, PictOpSrc, alphaPicture, &clr, 0, 0, 1, 1); + + XRenderComposite(dpy, PictOpOver, + renderPix.x11RenderHandle(), alphaPicture, pix.x11RenderHandle(), // src, mask, dst + 0, 0, // srcx, srcy + 0, 0, // maskx, masky + 0, 0, // dstx, dsty + pix.width(), pix.height()); + + XRenderFreePicture(dpy, alphaPicture); + XFreePixmap(dpy, alphaPixmap); +} +#endif + +void TDEStyle::virtual_hook( int, void* ) +{ /*BASE::virtual_hook( id, data );*/ } + +// HACK for gtk-qt-engine + +extern "C" KDE_EXPORT +void kde_kstyle_set_scrollbar_type_windows( void* style ) +{ + ((TDEStyle*)style)->setScrollBarType( TDEStyle::WindowsStyleScrollBar ); +} + +// vim: set noet ts=4 sw=4: +// kate: indent-width 4; replace-tabs off; tab-width 4; space-indent off; + +#include "tdestyle.moc" diff --git a/tdefx/tdestylen.h b/tdefx/tdestylen.h new file mode 100644 index 000000000..9c3867bb3 --- /dev/null +++ b/tdefx/tdestylen.h @@ -0,0 +1,383 @@ +/* + * $Id$ + * + * TDEStyle + * Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org> + * + * TQWindowsStyle CC_ListView and style images were kindly donated by TrollTech, + * Copyright (C) 1998-2000 TrollTech AS. + * + * Many thanks to Bradley T. Hughes for the 3 button scrollbar code. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * 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 __KSTYLE_H +#define __KSTYLE_H + +// W A R N I N G +// ------------- +// This API is still subject to change. +// I will remove this warning when I feel the API is sufficiently flexible. + +#include <tqcommonstyle.h> + +#include <tdelibs_export.h> + +class KPixmap; + +struct TDEStylePrivate; +/** + * Simplifies and extends the TQStyle API to make style coding easier. + * + * The TDEStyle class provides a simple internal menu transparency engine + * which attempts to use XRender for accelerated blending where requested, + * or falls back to fast internal software tinting/blending routines. + * It also simplifies more complex portions of the TQStyle API, such as + * the PopupMenuItems, ScrollBars and Sliders by providing extra "primitive + * elements" which are simple to implement by the style writer. + * + * @see TQStyle::QStyle + * @see TQCommonStyle::QCommonStyle + * @author Karol Szwed (gallium@kde.org) + * @version $Id$ + */ +class TDEFX_EXPORT TDEStyle: public TQCommonStyle +{ + Q_OBJECT + + + public: + + /** + * TDEStyle Flags: + * + * @li Default - Default style setting, where menu transparency + * and the FilledFrameWorkaround are disabled. + * + * @li AllowMenuTransparency - Enable this flag to use TDEStyle's + * internal menu transparency engine. + * + * @li FilledFrameWorkaround - Enable this flag to facilitate + * proper repaints of QMenuBars and QToolBars when the style chooses + * to paint the interior of a TQFrame. The style primitives in question + * are PE_PanelMenuBar and PE_PanelDockWindow. The HighColor style uses + * this workaround to enable painting of gradients in menubars and + * toolbars. + */ + typedef uint TDEStyleFlags; + enum TDEStyleOption { + Default = 0x00000000, //!< All options disabled + AllowMenuTransparency = 0x00000001, //!< Internal transparency enabled + FilledFrameWorkaround = 0x00000002 //!< Filled frames enabled + }; + + /** + * TDEStyle ScrollBarType: + * + * Allows the style writer to easily select what type of scrollbar + * should be used without having to duplicate large amounts of source + * code by implementing the complex control CC_ScrollBar. + * + * @li WindowsStyleScrollBar - Two button scrollbar with the previous + * button at the top/left, and the next button at the bottom/right. + * + * @li PlatinumStyleScrollBar - Two button scrollbar with both the + * previous and next buttons at the bottom/right. + * + * @li ThreeButtonScrollBar - %KDE style three button scrollbar with + * two previous buttons, and one next button. The next button is always + * at the bottom/right, whilst the two previous buttons are on either + * end of the scrollbar. + * + * @li NextStyleScrollBar - Similar to the PlatinumStyle scroll bar, but + * with the buttons grouped on the opposite end of the scrollbar. + * + * @see TDEStyle::TDEStyle() + */ + enum TDEStyleScrollBarType { + WindowsStyleScrollBar = 0x00000000, //!< two button, windows style + PlatinumStyleScrollBar = 0x00000001, //!< two button, platinum style + ThreeButtonScrollBar = 0x00000002, //!< three buttons, %KDE style + NextStyleScrollBar = 0x00000004 //!< two button, NeXT style + }; + + /** + * Constructs a TDEStyle object. + * + * Select the appropriate TDEStyle flags and scrollbar type + * for your style. The user's style preferences selected in KControl + * are read by using TQSettings and are automatically applied to the style. + * As a fallback, TDEStyle paints progressbars and tabbars. It inherits from + * TQCommonStyle for speed, so don't expect much to be implemented. + * + * It is advisable to use a currently implemented style such as the HighColor + * style as a foundation for any new TDEStyle, so the limited number of + * drawing fallbacks should not prove problematic. + * + * @param flags the style to be applied + * @param sbtype the scroll bar type + * @see TDEStyle::TDEStyleFlags + * @see TDEStyle::TDEStyleScrollBarType + * @author Karol Szwed (gallium@kde.org) + */ + TDEStyle( TDEStyleFlags flags = TDEStyle::Default, + TDEStyleScrollBarType sbtype = TDEStyle::WindowsStyleScrollBar ); + + /** + * Destructs the TDEStyle object. + */ + ~TDEStyle(); + + /** + * Returns the default widget style depending on color depth. + */ + static TQString defaultStyle(); + + /** + * Modifies the scrollbar type used by the style. + * + * This function is only provided for convenience. It allows + * you to make a late decision about what scrollbar type to use for the + * style after performing some processing in your style's constructor. + * In most situations however, setting the scrollbar type via the TDEStyle + * constructor should suffice. + * @param sbtype the scroll bar type + * @see TDEStyle::TDEStyleScrollBarType + */ + void setScrollBarType(TDEStyleScrollBarType sbtype); + + /** + * Returns the TDEStyle flags used to initialize the style. + * + * This is used solely for the kcmstyle module, and hence is internal. + */ + TDEStyleFlags styleFlags() const; + + // --------------------------------------------------------------------------- + + /** + * This virtual function defines the pixmap used to blend between the popup + * menu and the background to create different menu transparency effects. + * For example, you can fill the pixmap "pix" with a gradient based on the + * popup's colorGroup, a texture, or some other fancy painting routine. + * TDEStyle will then internally blend this pixmap with a snapshot of the + * background behind the popupMenu to create the illusion of transparency. + * + * This virtual is never called if XRender/Software blending is disabled by + * the user in KDE's style control module. + */ + virtual void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup& cg, + const TQPopupMenu* popup ) const; + + /** + * TDEStyle Primitive Elements: + * + * The TDEStyle class extends the Qt's Style API by providing certain + * simplifications for parts of TQStyle. To do this, the TDEStylePrimitive + * elements were defined, which are very similar to Qt's PrimitiveElement. + * + * The first three Handle primitives simplify and extend PE_DockWindowHandle, + * so do not reimplement PE_DockWindowHandle if you want the TDEStyle handle + * simplifications to be operable. Similarly do not reimplement CC_Slider, + * SC_SliderGroove and SC_SliderHandle when using the TDEStyle slider + * primitives. TDEStyle automatically double-buffers slider painting + * when they are drawn via these TDEStyle primitives to avoid flicker. + * + * @li KPE_DockWindowHandle - This primitive is already implemented in TDEStyle, + * and paints a bevelled rect with the DockWindow caption text. Re-implement + * this primitive to perform other more fancy effects when drawing the dock window + * handle. + * + * @li KPE_ToolBarHandle - This primitive must be reimplemented. It currently + * only paints a filled rectangle as default behavior. This primitive is used + * to render TQToolBar handles. + * + * @li KPE_GeneralHandle - This primitive must be reimplemented. It is used + * to render general handles that are not part of a TQToolBar or TQDockWindow, such + * as the applet handles used in Kicker. The default implementation paints a filled + * rect of arbitrary color. + * + * @li KPE_SliderGroove - This primitive must be reimplemented. It is used to + * paint the slider groove. The default implementation paints a filled rect of + * arbitrary color. + * + * @li KPE_SliderHandle - This primitive must be reimplemented. It is used to + * paint the slider handle. The default implementation paints a filled rect of + * arbitrary color. + * + * @li KPE_ListViewExpander - This primitive is already implemented in TDEStyle. It + * is used to draw the Expand/Collapse element in QListViews. To indicate the + * expanded state, the style flags are set to Style_Off, while Style_On implies collapsed. + * + * @li KPE_ListViewBranch - This primitive is already implemented in TDEStyle. It is + * used to draw the ListView branches where necessary. + */ + enum TDEStylePrimitive { + KPE_DockWindowHandle, + KPE_ToolBarHandle, + KPE_GeneralHandle, + + KPE_SliderGroove, + KPE_SliderHandle, + + KPE_ListViewExpander, + KPE_ListViewBranch + }; + + // Old API + // DEPRECATED + virtual void drawTDEStylePrimitive( TDEStylePrimitive kpe, + TQPainter* p, + const TQWidget* widget, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::SO_Default ) const; + + /** + * This function is identical to Qt's TQStyle::tqdrawPrimitive(), except that + * it adds one further parameter, 'widget', that can be used to determine + * the widget state of the TDEStylePrimitive in question. + * + * @see TDEStyle::TDEStylePrimitive + * @see TQStyle::tqdrawPrimitive + * @see TQStyle::drawComplexControl + */ + virtual void drawTDEStylePrimitive( TDEStylePrimitive kpe, + TQPainter* p, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::SO_Default, + const TQWidget* widget = 0 ) const; + + + enum TDEStylePixelMetric { + KPM_MenuItemSeparatorHeight = 0x00000001, + KPM_MenuItemHMargin = 0x00000002, + KPM_MenuItemVMargin = 0x00000004, + KPM_MenuItemHFrame = 0x00000008, + KPM_MenuItemVFrame = 0x00000010, + KPM_MenuItemCheckMarkHMargin = 0x00000020, + KPM_MenuItemArrowHMargin = 0x00000040, + KPM_MenuItemTabSpacing = 0x00000080, + KPM_ListViewBranchThickness = 0x00000100 + }; + + int kPixelMetric( TDEStylePixelMetric kpm, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget* widget = 0 ) const; + + // --------------------------------------------------------------------------- + + void polish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); + void unPolish( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void * ); + void polishPopupMenu( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr ); + + void drawPrimitive( TQ_PrimitiveElement pe, + TQPainter* p, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::SO_Default ) const; + +// #ifdef USE_QT4 // tdebindings / smoke needs this function declaration available at all times. Furthermore I don't think it would hurt to have the declaration available at all times...so leave these commented out for now + +// void drawPrimitive( TQ_ControlElement pe, +// TQPainter* p, +// const TQStyleControlElementData &ceData, +// ControlElementFlags elementFlags, +// const TQRect &r, +// const TQColorGroup &cg, +// SFlags flags = Style_Default, +// const TQStyleOption& = TQStyleOption::SO_Default ) const; + +// #endif // USE_QT4 + + void drawControl( TQ_ControlElement element, + TQPainter* p, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + const TQStyleOption& = TQStyleOption::SO_Default, + const TQWidget* widget = 0 ) const; + + void drawComplexControl( TQ_ComplexControl control, + TQPainter *p, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQRect &r, + const TQColorGroup &cg, + SFlags flags = Style_Default, + SCFlags controls = SC_All, + SCFlags active = SC_None, + const TQStyleOption& = TQStyleOption::SO_Default, + const TQWidget* widget = 0 ) const; + + SubControl querySubControl( TQ_ComplexControl control, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQPoint &pos, + const TQStyleOption& = TQStyleOption::SO_Default, + const TQWidget* widget = 0 ) const; + + TQRect querySubControlMetrics( TQ_ComplexControl control, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + SubControl sc, + const TQStyleOption& = TQStyleOption::SO_Default, + const TQWidget* widget = 0 ) const; + + int pixelMetric( PixelMetric m, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, + const TQWidget* widget = 0 ) const; + + TQRect subRect( SubRect r, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, + const TQWidget* widget = 0 ) const; + + TQPixmap stylePixmap( StylePixmap stylepixmap, + const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQStyleOption& = TQStyleOption::SO_Default, + const TQWidget* widget = 0 ) const; + + int styleHint( TQ_StyleHint sh, const TQStyleControlElementData &ceData, + ControlElementFlags elementFlags, + const TQStyleOption &opt = TQStyleOption::SO_Default, + TQStyleHintReturn* shr = 0, + const TQWidget* w = 0 ) const; + + protected: + virtual bool objectEventHandler( const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ); + + private: + // Disable copy constructor and = operator + TDEStyle( const TDEStyle & ); + TDEStyle& operator=( const TDEStyle & ); + + protected: + virtual void virtual_hook( int id, void* data ); + private: + TDEStylePrivate *d; +}; + + +// vim: set noet ts=4 sw=4: +#endif + diff --git a/tdehtml/ecma/kjs_debugwin.cpp b/tdehtml/ecma/kjs_debugwin.cpp index 069720c0b..f1b2b430d 100644 --- a/tdehtml/ecma/kjs_debugwin.cpp +++ b/tdehtml/ecma/kjs_debugwin.cpp @@ -55,7 +55,7 @@ #include <tdeshortcut.h> #include <tdeconfig.h> #include <tdeconfigbase.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcop/dcopclient.h> #include <kstringhandler.h> diff --git a/tdehtml/html/html_documentimpl.cpp b/tdehtml/html/html_documentimpl.cpp index 21c3e12c5..e4f090973 100644 --- a/tdehtml/html/html_documentimpl.cpp +++ b/tdehtml/html/html_documentimpl.cpp @@ -44,7 +44,7 @@ #include "dom/dom_exception.h" #include <dcopclient.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kurl.h> #include <kglobal.h> diff --git a/tdehtml/html/html_formimpl.cpp b/tdehtml/html/html_formimpl.cpp index 3f8384a97..372904e0e 100644 --- a/tdehtml/html/html_formimpl.cpp +++ b/tdehtml/html/html_formimpl.cpp @@ -51,7 +51,7 @@ #include <kdebug.h> #include <kmimetype.h> #include <kmessagebox.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #ifndef TDEHTML_NO_WALLET #include <tdewallet.h> diff --git a/tdehtml/java/kjavaappletserver.cpp b/tdehtml/java/kjavaappletserver.cpp index 7ad046b9a..5d108ffcf 100644 --- a/tdehtml/java/kjavaappletserver.cpp +++ b/tdehtml/java/kjavaappletserver.cpp @@ -29,7 +29,7 @@ #include <tdeconfig.h> #include <klocale.h> #include <tdeparts/browserextension.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <tdeio/job.h> diff --git a/tdehtml/java/kjavaappletviewer.cpp b/tdehtml/java/kjavaappletviewer.cpp index 913678092..5d5b47fbf 100644 --- a/tdehtml/java/kjavaappletviewer.cpp +++ b/tdehtml/java/kjavaappletviewer.cpp @@ -30,12 +30,12 @@ #include <tqlabel.h> #include <klibloader.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <kstaticdeleter.h> #include <klocale.h> #include <kstatusbar.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tdeconfig.h> #include <tdeio/authinfo.h> diff --git a/tdehtml/java/tests/testkjavaappletserver.cpp b/tdehtml/java/tests/testkjavaappletserver.cpp index d0af25127..641b06327 100644 --- a/tdehtml/java/tests/testkjavaappletserver.cpp +++ b/tdehtml/java/tests/testkjavaappletserver.cpp @@ -1,5 +1,5 @@ -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kdebug.h> #include <tqstring.h> #include <stdio.h> diff --git a/tdehtml/misc/helper.cpp b/tdehtml/misc/helper.cpp index 047a278fa..b5191c7ca 100644 --- a/tdehtml/misc/helper.cpp +++ b/tdehtml/misc/helper.cpp @@ -29,7 +29,7 @@ #include <rendering/render_object.h> #include <tqptrlist.h> #include <kstaticdeleter.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <tqtooltip.h> diff --git a/tdehtml/misc/loader.cpp b/tdehtml/misc/loader.cpp index 6fccfced8..b7f42aa29 100644 --- a/tdehtml/misc/loader.cpp +++ b/tdehtml/misc/loader.cpp @@ -56,7 +56,7 @@ #include <tqmovie.h> #include <tqwidget.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeio/job.h> #include <tdeio/jobclasses.h> #include <kglobal.h> diff --git a/tdehtml/rendering/render_frames.cpp b/tdehtml/rendering/render_frames.cpp index 64bef11dc..12d0d75ec 100644 --- a/tdehtml/rendering/render_frames.cpp +++ b/tdehtml/rendering/render_frames.cpp @@ -38,7 +38,7 @@ #include "tdehtml_part.h" #include "misc/knsplugininstaller.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kmessagebox.h> #include <kmimetype.h> #include <klocale.h> diff --git a/tdehtml/rendering/render_image.cpp b/tdehtml/rendering/render_image.cpp index 97c2641ba..b41911e3a 100644 --- a/tdehtml/rendering/render_image.cpp +++ b/tdehtml/rendering/render_image.cpp @@ -30,7 +30,7 @@ #include <tqdrawutil.h> #include <tqpainter.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kglobalsettings.h> diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index fe9763b0e..3cc65676d 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -53,7 +53,7 @@ #include <ksavefile.h> #include <kurldrag.h> #include <kstringhandler.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kmessagebox.h> #include <kstandarddirs.h> #include <krun.h> diff --git a/tdehtml/tdehtml_factory.cpp b/tdehtml/tdehtml_factory.cpp index 103945736..b52476ea1 100644 --- a/tdehtml/tdehtml_factory.cpp +++ b/tdehtml/tdehtml_factory.cpp @@ -30,7 +30,7 @@ #include "misc/arena.h" #include <kinstance.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <klocale.h> #include <assert.h> diff --git a/tdehtml/tdehtml_part.cpp b/tdehtml/tdehtml_part.cpp index b6fdde210..c4bba759c 100644 --- a/tdehtml/tdehtml_part.cpp +++ b/tdehtml/tdehtml_part.cpp @@ -91,7 +91,7 @@ using namespace DOM; #include <ktempfile.h> #include <kglobalsettings.h> #include <kurldrag.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeparts/browserinterface.h> #if !defined(QT_NO_DRAGANDDROP) #include <tdemultipledrag.h> diff --git a/tdehtml/tdehtmlview.cpp b/tdehtml/tdehtmlview.cpp index 48ead5cf2..010075f2a 100644 --- a/tdehtml/tdehtmlview.cpp +++ b/tdehtml/tdehtmlview.cpp @@ -61,7 +61,7 @@ #include "xml/dom2_rangeimpl.h" #endif -#include <kapplication.h> +#include <tdeapplication.h> #include <kcursor.h> #include <kdebug.h> #include <kdialogbase.h> diff --git a/tdehtml/tdemultipart/tdemultipart.h b/tdehtml/tdemultipart/tdemultipart.h index 776584c91..de309eef1 100644 --- a/tdehtml/tdemultipart/tdemultipart.h +++ b/tdehtml/tdemultipart/tdemultipart.h @@ -25,7 +25,7 @@ #include <tdeparts/part.h> #include <tdeparts/factory.h> #include <tdeparts/browserextension.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <tqdatetime.h> class TDEHTMLPart; diff --git a/tdehtml/test_regression.cpp b/tdehtml/test_regression.cpp index a127bb709..028fadc36 100644 --- a/tdehtml/test_regression.cpp +++ b/tdehtml/test_regression.cpp @@ -30,7 +30,7 @@ #include <pwd.h> #include <signal.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <tqimage.h> #include <tqfile.h> @@ -60,7 +60,7 @@ #include <tdeaction.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include "tdehtml_factory.h" #include <tdeio/job.h> #include <tdemainwindow.h> diff --git a/tdehtml/test_regression_fontoverload.cpp b/tdehtml/test_regression_fontoverload.cpp index 744150ffe..d09a3dbd1 100644 --- a/tdehtml/test_regression_fontoverload.cpp +++ b/tdehtml/test_regression_fontoverload.cpp @@ -353,7 +353,7 @@ KDE_EXPORT void TQApplication::setPalette( const TQPalette &, bool , done = true; } -#include <kapplication.h> +#include <tdeapplication.h> void TDEApplication::dcopFailure( const TQString & ) { tqDebug( "TDEApplication::dcopFailure" ); diff --git a/tdehtml/testtdehtml.cpp b/tdehtml/testtdehtml.cpp index 91eb19eee..bce2c4db0 100644 --- a/tdehtml/testtdehtml.cpp +++ b/tdehtml/testtdehtml.cpp @@ -2,7 +2,7 @@ #include <stdlib.h> #include "decoder.h" -#include "kapplication.h" +#include "tdeapplication.h" #include "html_document.h" #include "htmltokenizer.h" // to be able to delete a static protected member pointer in kbrowser... @@ -27,7 +27,7 @@ #include "html/html_imageimpl.h" #include "rendering/render_style.h" #include <tdemainwindow.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <tdeaction.h> #include "domtreeview.h" #include <tdefiledialog.h> diff --git a/tdehtml/xml/dom_docimpl.cpp b/tdehtml/xml/dom_docimpl.cpp index 854d7b3e3..47836b41e 100644 --- a/tdehtml/xml/dom_docimpl.cpp +++ b/tdehtml/xml/dom_docimpl.cpp @@ -77,7 +77,7 @@ #include "html/html_tableimpl.h" #include "html/html_objectimpl.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeio/job.h> #include <stdlib.h> diff --git a/tdeio/bookmarks/kbookmark.cc b/tdeio/bookmarks/kbookmark.cc index ab1cc398a..e6bef2e02 100644 --- a/tdeio/bookmarks/kbookmark.cc +++ b/tdeio/bookmarks/kbookmark.cc @@ -28,7 +28,7 @@ #include <kglobal.h> #include <klocale.h> #include <assert.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <kbookmarkmanager.h> diff --git a/tdeio/bookmarks/kbookmarkimporter_crash.cc b/tdeio/bookmarks/kbookmarkimporter_crash.cc index f49879124..0443b3b1c 100644 --- a/tdeio/bookmarks/kbookmarkimporter_crash.cc +++ b/tdeio/bookmarks/kbookmarkimporter_crash.cc @@ -24,7 +24,7 @@ #include <kstringhandler.h> #include <klocale.h> #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <tqfile.h> #include <tqdir.h> diff --git a/tdeio/bookmarks/kbookmarkmanager.cc b/tdeio/bookmarks/kbookmarkmanager.cc index a87e0f20e..205d879ab 100644 --- a/tdeio/bookmarks/kbookmarkmanager.cc +++ b/tdeio/bookmarks/kbookmarkmanager.cc @@ -32,7 +32,7 @@ #include <kmessagebox.h> #include <kprocess.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <tqfile.h> #include <tqfileinfo.h> diff --git a/tdeio/bookmarks/kbookmarkmenu.cc b/tdeio/bookmarks/kbookmarkmenu.cc index c99d02284..0468bcd5a 100644 --- a/tdeio/bookmarks/kbookmarkmenu.cc +++ b/tdeio/bookmarks/kbookmarkmenu.cc @@ -26,7 +26,7 @@ #include "kbookmarkimporter_ie.h" #include "kbookmarkdrag.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <kdialogbase.h> diff --git a/tdeio/kpasswdserver/kpasswdserver.cpp b/tdeio/kpasswdserver/kpasswdserver.cpp index ff7295181..4986eb45a 100644 --- a/tdeio/kpasswdserver/kpasswdserver.cpp +++ b/tdeio/kpasswdserver/kpasswdserver.cpp @@ -29,7 +29,7 @@ #include <tqtimer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <kmessagebox.h> #include <kdebug.h> diff --git a/tdeio/kssl/ksslcertdlg.cc b/tdeio/kssl/ksslcertdlg.cc index 3d51c1e85..ea3c29556 100644 --- a/tdeio/kssl/ksslcertdlg.cc +++ b/tdeio/kssl/ksslcertdlg.cc @@ -29,7 +29,7 @@ #include <tqframe.h> #include <tqlabel.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> #include <klocale.h> #include <kglobalsettings.h> diff --git a/tdeio/kssl/ksslinfodlg.cc b/tdeio/kssl/ksslinfodlg.cc index 289c3a8d2..03a1300e8 100644 --- a/tdeio/kssl/ksslinfodlg.cc +++ b/tdeio/kssl/ksslinfodlg.cc @@ -30,7 +30,7 @@ #include <tqscrollview.h> #include <tqfile.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> #include <klocale.h> #include <kprocess.h> diff --git a/tdeio/kssl/ksslkeygen.cc b/tdeio/kssl/ksslkeygen.cc index 669a76cee..93d6d2da4 100644 --- a/tdeio/kssl/ksslkeygen.cc +++ b/tdeio/kssl/ksslkeygen.cc @@ -23,7 +23,7 @@ #include "keygenwizard.h" #include "keygenwizard2.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> diff --git a/tdeio/misc/kpac/proxyscout.cpp b/tdeio/misc/kpac/proxyscout.cpp index b651e2313..a010d328e 100644 --- a/tdeio/misc/kpac/proxyscout.cpp +++ b/tdeio/misc/kpac/proxyscout.cpp @@ -22,7 +22,7 @@ #include <ctime> #include <dcopclient.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <knotifyclient.h> #include <kprotocolmanager.h> diff --git a/tdeio/misc/tdefile/fileprops.cpp b/tdeio/misc/tdefile/fileprops.cpp index 854aeffc5..df210fa4d 100644 --- a/tdeio/misc/tdefile/fileprops.cpp +++ b/tdeio/misc/tdefile/fileprops.cpp @@ -21,9 +21,9 @@ #include <tqfile.h> #include <tqptrlist.h> -#include <kaboutdata.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <tdefilemetainfo.h> #include <klocale.h> #include <kpropertiesdialog.h> diff --git a/tdeio/misc/tdemailservice.cpp b/tdeio/misc/tdemailservice.cpp index c59067610..2d256c5c9 100644 --- a/tdeio/misc/tdemailservice.cpp +++ b/tdeio/misc/tdemailservice.cpp @@ -16,9 +16,9 @@ Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> static const TDECmdLineOptions options[] = { diff --git a/tdeio/misc/tdentlm/tdentlm.cpp b/tdeio/misc/tdentlm/tdentlm.cpp index 2ef5d1cb6..812c41a64 100644 --- a/tdeio/misc/tdentlm/tdentlm.cpp +++ b/tdeio/misc/tdentlm/tdentlm.cpp @@ -24,7 +24,7 @@ #include <string.h> #include <tqdatetime.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kswap.h> #include <kmdcodec.h> #include <kdebug.h> diff --git a/tdeio/misc/tdesendbugmail/main.cpp b/tdeio/misc/tdesendbugmail/main.cpp index 9b44a18b2..aaffd3b65 100644 --- a/tdeio/misc/tdesendbugmail/main.cpp +++ b/tdeio/misc/tdesendbugmail/main.cpp @@ -8,11 +8,11 @@ #include <tqtextstream.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kemailsettings.h> #include <klocale.h> -#include <kcmdlineargs.h> -#include <kaboutdata.h> +#include <tdecmdlineargs.h> +#include <tdeaboutdata.h> #include <kdebug.h> #include <tdeconfig.h> diff --git a/tdeio/misc/tdetelnetservice.cpp b/tdeio/misc/tdetelnetservice.cpp index d3788e5d2..99260d8d0 100644 --- a/tdeio/misc/tdetelnetservice.cpp +++ b/tdeio/misc/tdetelnetservice.cpp @@ -21,9 +21,9 @@ // $Id$ -#include <kapplication.h> +#include <tdeapplication.h> #include <kmessagebox.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <kdebug.h> #include <klocale.h> #include <kprocess.h> diff --git a/tdeio/misc/tdewalletd/tdewalletd.cpp b/tdeio/misc/tdewalletd/tdewalletd.cpp index a8b3ade1a..364197b72 100644 --- a/tdeio/misc/tdewalletd/tdewalletd.cpp +++ b/tdeio/misc/tdewalletd/tdewalletd.cpp @@ -28,7 +28,7 @@ #include <dcopclient.h> #include <dcopref.h> #include <kactivelabel.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <kdirwatch.h> diff --git a/tdeio/misc/uiserver.cpp b/tdeio/misc/uiserver.cpp index abe918854..107b57c64 100644 --- a/tdeio/misc/uiserver.cpp +++ b/tdeio/misc/uiserver.cpp @@ -29,8 +29,8 @@ #include <tdeconfig.h> #include <kstandarddirs.h> #include <kuniqueapplication.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> #include <kglobal.h> #include <klocale.h> #include <dcopclient.h> diff --git a/tdeio/tdefile/kcombiview.cpp b/tdeio/tdefile/kcombiview.cpp index ae408c8e2..13830ab01 100644 --- a/tdeio/tdefile/kcombiview.cpp +++ b/tdeio/tdefile/kcombiview.cpp @@ -32,7 +32,7 @@ #include <tqdir.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <kglobal.h> diff --git a/tdeio/tdefile/kdiroperator.cpp b/tdeio/tdefile/kdiroperator.cpp index 706b63164..1ae03daec 100644 --- a/tdeio/tdefile/kdiroperator.cpp +++ b/tdeio/tdefile/kdiroperator.cpp @@ -32,7 +32,7 @@ #include <tqvbox.h> #include <tdeaction.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kdialog.h> #include <kdialogbase.h> diff --git a/tdeio/tdefile/kdirselectdialog.cpp b/tdeio/tdefile/kdirselectdialog.cpp index e26c2cdf5..39959229d 100644 --- a/tdeio/tdefile/kdirselectdialog.cpp +++ b/tdeio/tdefile/kdirselectdialog.cpp @@ -24,7 +24,7 @@ #include <tqvaluestack.h> #include <tdeactionclasses.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kcombobox.h> #include <tdeconfig.h> #include <tdefiledialog.h> diff --git a/tdeio/tdefile/kicondialog.cpp b/tdeio/tdefile/kicondialog.cpp index aa8968b05..9d7975e2b 100644 --- a/tdeio/tdefile/kicondialog.cpp +++ b/tdeio/tdefile/kicondialog.cpp @@ -19,7 +19,7 @@ #include <kiconviewsearchline.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <kglobal.h> #include <kstandarddirs.h> diff --git a/tdeio/tdefile/kimagefilepreview.cpp b/tdeio/tdefile/kimagefilepreview.cpp index 6c6722951..a1ce7d6b3 100644 --- a/tdeio/tdefile/kimagefilepreview.cpp +++ b/tdeio/tdefile/kimagefilepreview.cpp @@ -14,7 +14,7 @@ #include <tqwhatsthis.h> #include <tqtimer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kglobal.h> #include <kiconloader.h> diff --git a/tdeio/tdefile/knotifydialog.cpp b/tdeio/tdefile/knotifydialog.cpp index bd1abb277..f23ac78e4 100644 --- a/tdeio/tdefile/knotifydialog.cpp +++ b/tdeio/tdefile/knotifydialog.cpp @@ -18,8 +18,8 @@ #include <dcopclient.h> -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <kaudioplayer.h> #include <kcombobox.h> #include <tdeconfig.h> diff --git a/tdeio/tdefile/kopenwith.cpp b/tdeio/tdefile/kopenwith.cpp index ca0043e70..5a855de21 100644 --- a/tdeio/tdefile/kopenwith.cpp +++ b/tdeio/tdefile/kopenwith.cpp @@ -34,7 +34,7 @@ #include <tqstyle.h> #include <tqwhatsthis.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kbuttonbox.h> #include <kcombobox.h> #include <kdesktopfile.h> diff --git a/tdeio/tdefile/kpropertiesdialog.cpp b/tdeio/tdefile/kpropertiesdialog.cpp index 9d4ee6534..389115a3c 100644 --- a/tdeio/tdefile/kpropertiesdialog.cpp +++ b/tdeio/tdefile/kpropertiesdialog.cpp @@ -85,7 +85,7 @@ extern "C" { } #endif -#include <kapplication.h> +#include <tdeapplication.h> #include <kdialog.h> #include <kdirsize.h> #include <kdirwatch.h> diff --git a/tdeio/tdefile/kurlbar.cpp b/tdeio/tdefile/kurlbar.cpp index 0f575e4e5..46b096c2b 100644 --- a/tdeio/tdefile/kurlbar.cpp +++ b/tdeio/tdefile/kurlbar.cpp @@ -30,7 +30,7 @@ #include <tqvbox.h> #include <tqwhatsthis.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <tdeconfig.h> #include <kdebug.h> #include <kglobal.h> diff --git a/tdeio/tdefile/tdefiledetailview.cpp b/tdeio/tdefile/tdefiledetailview.cpp index 897c99aec..b3c44250e 100644 --- a/tdeio/tdefile/tdefiledetailview.cpp +++ b/tdeio/tdefile/tdefiledetailview.cpp @@ -25,7 +25,7 @@ #include <tqpainter.h> #include <tqpixmap.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdefileitem.h> #include <kglobal.h> #include <kglobalsettings.h> diff --git a/tdeio/tdefile/tdefiledialog.cpp b/tdeio/tdefile/tdefiledialog.cpp index ed50ae49b..8db764724 100644 --- a/tdeio/tdefile/tdefiledialog.cpp +++ b/tdeio/tdefile/tdefiledialog.cpp @@ -44,9 +44,9 @@ #include <tdeaccel.h> #include <tdeaction.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kcharsets.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <tdecompletionbox.h> #include <tdeconfig.h> #include <kdebug.h> diff --git a/tdeio/tdefile/tdefileiconview.cpp b/tdeio/tdefile/tdefileiconview.cpp index 406e3d3fe..131485273 100644 --- a/tdeio/tdefile/tdefileiconview.cpp +++ b/tdeio/tdefile/tdefileiconview.cpp @@ -30,7 +30,7 @@ #include <tqtooltip.h> #include <tdeaction.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <tdefileitem.h> #include <kiconeffect.h> diff --git a/tdeio/tdefile/tdefilesharedlg.cpp b/tdeio/tdefile/tdefilesharedlg.cpp index d64918b4f..6204fa6bb 100644 --- a/tdeio/tdefile/tdefilesharedlg.cpp +++ b/tdeio/tdefile/tdefilesharedlg.cpp @@ -37,7 +37,7 @@ #include <tdeio/tdefileshare.h> #include <kseparator.h> #include <tqpushbutton.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <ksimpleconfig.h> #include <kmessagebox.h> diff --git a/tdeio/tdefile/tdefileview.cpp b/tdeio/tdefile/tdefileview.cpp index fb3cb0e9f..63c973723 100644 --- a/tdeio/tdefile/tdefileview.cpp +++ b/tdeio/tdefile/tdefileview.cpp @@ -23,7 +23,7 @@ #include <stdlib.h> #include <tdeaction.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kglobal.h> #include <klocale.h> diff --git a/tdeio/tdefile/tderecentdocument.cpp b/tdeio/tdefile/tderecentdocument.cpp index 3d5ec44e7..968db93a4 100644 --- a/tdeio/tdefile/tderecentdocument.cpp +++ b/tdeio/tdefile/tderecentdocument.cpp @@ -28,7 +28,7 @@ #include <tderecentdocument.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kurl.h> #include <kdebug.h> #include <kmimetype.h> diff --git a/tdeio/tdefile/tests/kcustommenueditortest.cpp b/tdeio/tdefile/tests/kcustommenueditortest.cpp index 40a34b203..3d95b6c9f 100644 --- a/tdeio/tdefile/tests/kcustommenueditortest.cpp +++ b/tdeio/tdefile/tests/kcustommenueditortest.cpp @@ -1,5 +1,5 @@ #include "kcustommenueditor.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <tdeconfig.h> diff --git a/tdeio/tdefile/tests/kdirselectdialogtest.cpp b/tdeio/tdefile/tests/kdirselectdialogtest.cpp index 3d15c47d0..0c2209d31 100644 --- a/tdeio/tdefile/tests/kdirselectdialogtest.cpp +++ b/tdeio/tdefile/tests/kdirselectdialogtest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <kdirselectdialog.h> #include <kmessagebox.h> #include <kurl.h> diff --git a/tdeio/tdefile/tests/kfdtest.cpp b/tdeio/tdefile/tests/kfdtest.cpp index 60c8b6d70..baf82725f 100644 --- a/tdeio/tdefile/tests/kfdtest.cpp +++ b/tdeio/tdefile/tests/kfdtest.cpp @@ -2,7 +2,7 @@ #include <tqstringlist.h> #include <tdefiledialog.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kmessagebox.h> #include <tqtimer.h> diff --git a/tdeio/tdefile/tests/kfstest.cpp b/tdeio/tdefile/tests/kfstest.cpp index 0a2a698f5..c57e3678e 100644 --- a/tdeio/tdefile/tests/kfstest.cpp +++ b/tdeio/tdefile/tests/kfstest.cpp @@ -32,7 +32,7 @@ #include <tdefileiconview.h> #include <kmessagebox.h> #include <tdeconfig.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kurl.h> #include <kurlbar.h> #include <kdiroperator.h> diff --git a/tdeio/tdefile/tests/kicondialogtest.cpp b/tdeio/tdefile/tests/kicondialogtest.cpp index c3f7a827d..3000e89a0 100644 --- a/tdeio/tdefile/tests/kicondialogtest.cpp +++ b/tdeio/tdefile/tests/kicondialogtest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <kicondialog.h> int main( int argc, char **argv ) diff --git a/tdeio/tdefile/tests/knotifytest.cpp b/tdeio/tdefile/tests/knotifytest.cpp index 0493b59b4..1716a86a3 100644 --- a/tdeio/tdefile/tests/knotifytest.cpp +++ b/tdeio/tdefile/tests/knotifytest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <knotifydialog.h> int main( int argc, char **argv ) diff --git a/tdeio/tdefile/tests/kopenwithtest.cpp b/tdeio/tdefile/tests/kopenwithtest.cpp index f78b1830b..925aa7625 100644 --- a/tdeio/tdefile/tests/kopenwithtest.cpp +++ b/tdeio/tdefile/tests/kopenwithtest.cpp @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include <tqwidget.h> #include <tqstringlist.h> #include <tqdir.h> diff --git a/tdeio/tdefile/tests/kurlrequestertest.cpp b/tdeio/tdefile/tests/kurlrequestertest.cpp index 0e4851cfb..829055304 100644 --- a/tdeio/tdefile/tests/kurlrequestertest.cpp +++ b/tdeio/tdefile/tests/kurlrequestertest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <keditlistbox.h> #include <kurlrequester.h> #include <kurlrequesterdlg.h> diff --git a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp index 689472597..529d12dda 100644 --- a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp +++ b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp @@ -22,7 +22,7 @@ #include <kglobal.h> #include <kiconloader.h> #include <tdemainwindow.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kurl.h> #include <kdebug.h> #include <kstatusbar.h> diff --git a/tdeio/tdeio/defaultprogress.cpp b/tdeio/tdeio/defaultprogress.cpp index 10db4fde7..4293e752e 100644 --- a/tdeio/tdeio/defaultprogress.cpp +++ b/tdeio/tdeio/defaultprogress.cpp @@ -22,7 +22,7 @@ #include <tqdatetime.h> #include <tqcheckbox.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kdialog.h> #include <kstringhandler.h> diff --git a/tdeio/tdeio/job.cpp b/tdeio/tdeio/job.cpp index eba15be03..a4e731451 100644 --- a/tdeio/tdeio/job.cpp +++ b/tdeio/tdeio/job.cpp @@ -41,7 +41,7 @@ extern "C" { #include <tqtimer.h> #include <tqfile.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> #include <klocale.h> #include <ksimpleconfig.h> diff --git a/tdeio/tdeio/kdcopservicestarter.cpp b/tdeio/tdeio/kdcopservicestarter.cpp index a6e39815f..c859cce2b 100644 --- a/tdeio/tdeio/kdcopservicestarter.cpp +++ b/tdeio/tdeio/kdcopservicestarter.cpp @@ -18,7 +18,7 @@ #include "kdcopservicestarter.h" #include "ktrader.h" -#include <kapplication.h> +#include <tdeapplication.h> #include "kservice.h" #include <kstaticdeleter.h> #include <kdebug.h> diff --git a/tdeio/tdeio/kdirlister.cpp b/tdeio/tdeio/kdirlister.cpp index 0d3498aa7..669766ab5 100644 --- a/tdeio/tdeio/kdirlister.cpp +++ b/tdeio/tdeio/kdirlister.cpp @@ -26,7 +26,7 @@ #include <tqtimer.h> #include <tqeventloop.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> #include <tdeio/job.h> diff --git a/tdeio/tdeio/kdirwatch.cpp b/tdeio/tdeio/kdirwatch.cpp index 4fcb921bb..63c89b9d7 100644 --- a/tdeio/tdeio/kdirwatch.cpp +++ b/tdeio/tdeio/kdirwatch.cpp @@ -54,7 +54,7 @@ #include <tqstringlist.h> #include <tqtimer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tdeconfig.h> #include <kglobal.h> diff --git a/tdeio/tdeio/kimageio.cpp b/tdeio/tdeio/kimageio.cpp index e983cb945..f9de08376 100644 --- a/tdeio/tdeio/kimageio.cpp +++ b/tdeio/tdeio/kimageio.cpp @@ -11,7 +11,7 @@ #include"config.h" #include <tqdir.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <tqstring.h> #include <tqregexp.h> diff --git a/tdeio/tdeio/kmessageboxwrapper.h b/tdeio/tdeio/kmessageboxwrapper.h index 3590b5e89..c55060549 100644 --- a/tdeio/tdeio/kmessageboxwrapper.h +++ b/tdeio/tdeio/kmessageboxwrapper.h @@ -19,7 +19,7 @@ #ifndef KMESSAGEBOXWRAPPER_H #define KMESSAGEBOXWRAPPER_H #include <kmessagebox.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> /** diff --git a/tdeio/tdeio/kmimemagic.cpp b/tdeio/tdeio/kmimemagic.cpp index 4285e3ec7..4d75d8d58 100644 --- a/tdeio/tdeio/kmimemagic.cpp +++ b/tdeio/tdeio/kmimemagic.cpp @@ -18,7 +18,7 @@ */ #include "kmimemagic.h" #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tqfile.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> diff --git a/tdeio/tdeio/kmimetype.cpp b/tdeio/tdeio/kmimetype.cpp index c610e7e3f..8129b31f9 100644 --- a/tdeio/tdeio/kmimetype.cpp +++ b/tdeio/tdeio/kmimetype.cpp @@ -46,7 +46,7 @@ #include <dcopclient.h> #include <dcopref.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kprocess.h> #include <kdebug.h> #include <kdesktopfile.h> diff --git a/tdeio/tdeio/kprotocolmanager.h b/tdeio/tdeio/kprotocolmanager.h index ce504a83f..95106f90d 100644 --- a/tdeio/tdeio/kprotocolmanager.h +++ b/tdeio/tdeio/kprotocolmanager.h @@ -22,7 +22,7 @@ #include <tqstringlist.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeio/global.h> /** @deprecated Use KProtocolManager::defaultUserAgent() instead. */ diff --git a/tdeio/tdeio/krun.cpp b/tdeio/tdeio/krun.cpp index 69274ce24..8547802d6 100644 --- a/tdeio/tdeio/krun.cpp +++ b/tdeio/tdeio/krun.cpp @@ -42,7 +42,7 @@ #include <kdatastream.h> #include <kmessageboxwrapper.h> #include <kurl.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> #include <kprotocolinfo.h> diff --git a/tdeio/tdeio/kservice.cpp b/tdeio/tdeio/kservice.cpp index 5147af0ad..13be78bea 100644 --- a/tdeio/tdeio/kservice.cpp +++ b/tdeio/tdeio/kservice.cpp @@ -37,7 +37,7 @@ #include <tqtl.h> #include <ksimpleconfig.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kdesktopfile.h> #include <kglobal.h> diff --git a/tdeio/tdeio/kservicetypefactory.cpp b/tdeio/tdeio/kservicetypefactory.cpp index ecf527384..e198f1333 100644 --- a/tdeio/tdeio/kservicetypefactory.cpp +++ b/tdeio/tdeio/kservicetypefactory.cpp @@ -24,7 +24,7 @@ #include "kmimetype.h" #include "kuserprofile.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <assert.h> #include <kstringhandler.h> diff --git a/tdeio/tdeio/kshred.cpp b/tdeio/tdeio/kshred.cpp index f3997bf58..470f9a03e 100644 --- a/tdeio/tdeio/kshred.cpp +++ b/tdeio/tdeio/kshred.cpp @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <klocale.h> #include <kdebug.h> #include <stdlib.h> -#include <kapplication.h> +#include <tdeapplication.h> // antlarr: KDE 4: Make it const TQString & KShred::KShred(TQString fileName) diff --git a/tdeio/tdeio/kurlcompletion.cpp b/tdeio/tdeio/kurlcompletion.cpp index dc6581ce6..e9ce26908 100644 --- a/tdeio/tdeio/kurlcompletion.cpp +++ b/tdeio/tdeio/kurlcompletion.cpp @@ -39,7 +39,7 @@ #include <tqdeepcopy.h> #include <tqthread.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kcompletion.h> #include <kurl.h> diff --git a/tdeio/tdeio/kuserprofile.cpp b/tdeio/tdeio/kuserprofile.cpp index ebd8b8deb..124f7f8f8 100644 --- a/tdeio/tdeio/kuserprofile.cpp +++ b/tdeio/tdeio/kuserprofile.cpp @@ -22,7 +22,7 @@ #include "kservicetypefactory.h" #include <tdeconfig.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> #include <kdebug.h> #include <kstaticdeleter.h> diff --git a/tdeio/tdeio/netaccess.cpp b/tdeio/tdeio/netaccess.cpp index 89830d88b..dd3a1bdc8 100644 --- a/tdeio/tdeio/netaccess.cpp +++ b/tdeio/tdeio/netaccess.cpp @@ -33,7 +33,7 @@ #include <tqfile.h> #include <tqmetaobject.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <ktempfile.h> #include <kdebug.h> diff --git a/tdeio/tdeio/observer.cpp b/tdeio/tdeio/observer.cpp index 5e4e7aa87..dfd847b04 100644 --- a/tdeio/tdeio/observer.cpp +++ b/tdeio/tdeio/observer.cpp @@ -22,7 +22,7 @@ #include <assert.h> #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <kurl.h> diff --git a/tdeio/tdeio/previewjob.cpp b/tdeio/tdeio/previewjob.cpp index 2279aef40..c51ba154d 100644 --- a/tdeio/tdeio/previewjob.cpp +++ b/tdeio/tdeio/previewjob.cpp @@ -42,7 +42,7 @@ #include <kdatastream.h> // Do not remove, needed for correct bool serialization #include <tdefileitem.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <ktempfile.h> #include <ktrader.h> #include <kmdcodec.h> diff --git a/tdeio/tdeio/renamedlg.cpp b/tdeio/tdeio/renamedlg.cpp index f5c2d32dd..06b12d129 100644 --- a/tdeio/tdeio/renamedlg.cpp +++ b/tdeio/tdeio/renamedlg.cpp @@ -32,7 +32,7 @@ #include <kmessagebox.h> #include <kpushbutton.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeio/global.h> #include <ktrader.h> #include <klibloader.h> diff --git a/tdeio/tdeio/skipdlg.cpp b/tdeio/tdeio/skipdlg.cpp index eab245dfc..6cd924136 100644 --- a/tdeio/tdeio/skipdlg.cpp +++ b/tdeio/tdeio/skipdlg.cpp @@ -26,7 +26,7 @@ #include <tqlayout.h> #include <tqlabel.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <kurl.h> #include <kpushbutton.h> diff --git a/tdeio/tdeio/slave.cpp b/tdeio/tdeio/slave.cpp index 380be2058..e66a719df 100644 --- a/tdeio/tdeio/slave.cpp +++ b/tdeio/tdeio/slave.cpp @@ -38,7 +38,7 @@ #include <klocale.h> #include <kglobal.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <ktempfile.h> #include <ksock.h> #include <kprocess.h> diff --git a/tdeio/tdeio/slavebase.cpp b/tdeio/tdeio/slavebase.cpp index 8b6ee3903..29a8e0c48 100644 --- a/tdeio/tdeio/slavebase.cpp +++ b/tdeio/tdeio/slavebase.cpp @@ -44,7 +44,7 @@ #include <dcopclient.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <ksock.h> #include <kcrash.h> #include <tdesu/client.h> diff --git a/tdeio/tdeio/slaveinterface.cpp b/tdeio/tdeio/slaveinterface.cpp index 40b66c47a..6de70b57f 100644 --- a/tdeio/tdeio/slaveinterface.cpp +++ b/tdeio/tdeio/slaveinterface.cpp @@ -27,7 +27,7 @@ #include <unistd.h> #include <signal.h> #include <tdeio/observer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <time.h> #include <tqtimer.h> diff --git a/tdeio/tdeio/statusbarprogress.cpp b/tdeio/tdeio/statusbarprogress.cpp index 66517ca03..e0497e391 100644 --- a/tdeio/tdeio/statusbarprogress.cpp +++ b/tdeio/tdeio/statusbarprogress.cpp @@ -22,7 +22,7 @@ #include <tqpushbutton.h> #include <tqlabel.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <kdebug.h> #include <kprogress.h> diff --git a/tdeio/tdeio/tcpslavebase.cpp b/tdeio/tdeio/tcpslavebase.cpp index 2b7df9d7b..2a4aff68e 100644 --- a/tdeio/tdeio/tcpslavebase.cpp +++ b/tdeio/tdeio/tcpslavebase.cpp @@ -53,7 +53,7 @@ #include <tqcstring.h> #include <tqdatastream.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kprotocolmanager.h> #include <kde_file.h> diff --git a/tdeio/tdeioexec/main.cpp b/tdeio/tdeioexec/main.cpp index 0276008a4..eb615344b 100644 --- a/tdeio/tdeioexec/main.cpp +++ b/tdeio/tdeioexec/main.cpp @@ -26,7 +26,7 @@ #include <tqfile.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <kdebug.h> #include <kmessagebox.h> @@ -36,8 +36,8 @@ #include <kprocess.h> #include <kservice.h> #include <klocale.h> -#include <kcmdlineargs.h> -#include <kaboutdata.h> +#include <tdecmdlineargs.h> +#include <tdeaboutdata.h> #include <kstartupinfo.h> #include <kshell.h> #include <kde_file.h> diff --git a/tdeio/tests/getalltest.cpp b/tdeio/tests/getalltest.cpp index 07d8723ed..37f9b1ab2 100644 --- a/tdeio/tests/getalltest.cpp +++ b/tdeio/tests/getalltest.cpp @@ -2,7 +2,7 @@ #include <kmimetype.h> #include <kservicetype.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> int main(int argc, char *argv[]) diff --git a/tdeio/tests/jobtest.cpp b/tdeio/tests/jobtest.cpp index c6a79743a..a2d5b40d1 100644 --- a/tdeio/tests/jobtest.cpp +++ b/tdeio/tests/jobtest.cpp @@ -22,11 +22,11 @@ #include <config.h> #include <kurl.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klargefile.h> #include <tdeio/netaccess.h> #include <kdebug.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <kprotocolinfo.h> #include <tqfileinfo.h> diff --git a/tdeio/tests/kacltest.cpp b/tdeio/tests/kacltest.cpp index b55aedce8..50d3bc25a 100644 --- a/tdeio/tests/kacltest.cpp +++ b/tdeio/tests/kacltest.cpp @@ -22,9 +22,9 @@ #include <config.h> #include <kacl.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <tqfileinfo.h> #include <tqeventloop.h> diff --git a/tdeio/tests/kdcopcheck.cpp b/tdeio/tests/kdcopcheck.cpp index 79f050f51..5f1ad611a 100644 --- a/tdeio/tests/kdcopcheck.cpp +++ b/tdeio/tests/kdcopcheck.cpp @@ -13,7 +13,7 @@ #include "kdcopcheck.h" #include <dcopclient.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdio.h> #include <stdlib.h> diff --git a/tdeio/tests/kdefaultprogresstest.cpp b/tdeio/tests/kdefaultprogresstest.cpp index 7e77611ed..7f1bad6a4 100644 --- a/tdeio/tests/kdefaultprogresstest.cpp +++ b/tdeio/tests/kdefaultprogresstest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeio/defaultprogress.h> #include <kurl.h> #include <kdebug.h> diff --git a/tdeio/tests/kdirlistertest.cpp b/tdeio/tests/kdirlistertest.cpp index 000fb200c..aaba5400a 100644 --- a/tdeio/tests/kdirlistertest.cpp +++ b/tdeio/tests/kdirlistertest.cpp @@ -21,7 +21,7 @@ #include <tqlayout.h> #include <tqpushbutton.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdirlister.h> #include <kdebug.h> diff --git a/tdeio/tests/kdirwatchtest.cpp b/tdeio/tests/kdirwatchtest.cpp index 0ca853f1a..9f50c2170 100644 --- a/tdeio/tests/kdirwatchtest.cpp +++ b/tdeio/tests/kdirwatchtest.cpp @@ -12,7 +12,7 @@ #include <tqfile.h> #include <kdebug.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include "kdirwatchtest.h" diff --git a/tdeio/tests/kdirwatchtest.h b/tdeio/tests/kdirwatchtest.h index 24dc94a91..493043c01 100644 --- a/tdeio/tests/kdirwatchtest.h +++ b/tdeio/tests/kdirwatchtest.h @@ -17,7 +17,7 @@ #include <tqobject.h> #include "kdirwatch.h" -#include "kapplication.h" +#include "tdeapplication.h" class myTest : public TQObject { diff --git a/tdeio/tests/kdirwatchunittest.h b/tdeio/tests/kdirwatchunittest.h index 42222a787..416aeecfe 100644 --- a/tdeio/tests/kdirwatchunittest.h +++ b/tdeio/tests/kdirwatchunittest.h @@ -17,7 +17,7 @@ #include <tqobject.h> #include "kdirwatch.h" -#include "kapplication.h" +#include "tdeapplication.h" #include <tdeunittest/tester.h> #include <tdeunittest/module.h> diff --git a/tdeio/tests/kionetrctest.cpp b/tdeio/tests/kionetrctest.cpp index 4c05f77e1..b0fbf7087 100644 --- a/tdeio/tests/kionetrctest.cpp +++ b/tdeio/tests/kionetrctest.cpp @@ -1,7 +1,7 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> #include "authinfo.h" diff --git a/tdeio/tests/kiopassdlgtest.cpp b/tdeio/tests/kiopassdlgtest.cpp index adb14a306..3dd4d7294 100644 --- a/tdeio/tests/kiopassdlgtest.cpp +++ b/tdeio/tests/kiopassdlgtest.cpp @@ -1,8 +1,8 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <kmessagebox.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include "passdlg.h" diff --git a/tdeio/tests/kmimefromext.cpp b/tdeio/tests/kmimefromext.cpp index 9b3f9dd54..d2cc0bca8 100644 --- a/tdeio/tests/kmimefromext.cpp +++ b/tdeio/tests/kmimefromext.cpp @@ -18,8 +18,8 @@ #include <ktrader.h> #include <kmimetype.h> -#include <kcmdlineargs.h> -#include <kapplication.h> +#include <tdecmdlineargs.h> +#include <tdeapplication.h> #include <stdio.h> diff --git a/tdeio/tests/kpropsdlgtest.cpp b/tdeio/tests/kpropsdlgtest.cpp index c09ff622c..638a60ec2 100644 --- a/tdeio/tests/kpropsdlgtest.cpp +++ b/tdeio/tests/kpropsdlgtest.cpp @@ -1,8 +1,8 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <kpropertiesdialog.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> static TDECmdLineOptions options[] = diff --git a/tdeio/tests/kprotocolinfotest.cpp b/tdeio/tests/kprotocolinfotest.cpp index 30c9decd8..646249678 100644 --- a/tdeio/tests/kprotocolinfotest.cpp +++ b/tdeio/tests/kprotocolinfotest.cpp @@ -18,10 +18,10 @@ #include <kprotocolinfo.h> #include <kprotocolmanager.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobalsettings.h> -#include <kcmdlineargs.h> -#include <kaboutdata.h> +#include <tdecmdlineargs.h> +#include <tdeaboutdata.h> #include <kdebug.h> #include <assert.h> diff --git a/tdeio/tests/kruntest.cpp b/tdeio/tests/kruntest.cpp index d8f47859b..f2065f8b8 100644 --- a/tdeio/tests/kruntest.cpp +++ b/tdeio/tests/kruntest.cpp @@ -21,7 +21,7 @@ #include "kruntest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kshell.h> #include <kservice.h> diff --git a/tdeio/tests/kscantest.cpp b/tdeio/tests/kscantest.cpp index 14abd1b33..d37f2eb97 100644 --- a/tdeio/tests/kscantest.cpp +++ b/tdeio/tests/kscantest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <kscan.h> int main( int argc, char **argv ) diff --git a/tdeio/tests/kurifiltertest.cpp b/tdeio/tests/kurifiltertest.cpp index 67f27645d..5cc79bd82 100644 --- a/tdeio/tests/kurifiltertest.cpp +++ b/tdeio/tests/kurifiltertest.cpp @@ -22,10 +22,10 @@ #include <iostream> #include <stdlib.h> -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <kdebug.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <kstandarddirs.h> #include <ksimpleconfig.h> diff --git a/tdeio/tests/kurlcompletiontest.cpp b/tdeio/tests/kurlcompletiontest.cpp index c8dc99595..7d479d156 100644 --- a/tdeio/tests/kurlcompletiontest.cpp +++ b/tdeio/tests/kurlcompletiontest.cpp @@ -16,14 +16,14 @@ * Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include <kurlcompletion.h> #include <kdebug.h> #include <tqdir.h> #include <assert.h> #include <tqfile.h> #include <ktempdir.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <unistd.h> class KURLCompletionTest diff --git a/tdeio/tests/metatest.cpp b/tdeio/tests/metatest.cpp index 9890bb711..cd391e0d5 100644 --- a/tdeio/tests/metatest.cpp +++ b/tdeio/tests/metatest.cpp @@ -1,6 +1,6 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <tdefilemetainfo.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <tqstringlist.h> #include <tqimage.h> #include <kdebug.h> diff --git a/tdeio/tests/netaccesstest.cpp b/tdeio/tests/netaccesstest.cpp index 1a5de205d..b9b0ffab7 100644 --- a/tdeio/tests/netaccesstest.cpp +++ b/tdeio/tests/netaccesstest.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kurl.h> #include <tdeio/netaccess.h> diff --git a/tdeio/tests/previewtest.cpp b/tdeio/tests/previewtest.cpp index 87bdd326d..6d0cd78b2 100644 --- a/tdeio/tests/previewtest.cpp +++ b/tdeio/tests/previewtest.cpp @@ -3,7 +3,7 @@ #include <tqlayout.h> #include <tqpushbutton.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klineedit.h> diff --git a/tdeio/tests/speed.cpp b/tdeio/tests/speed.cpp index 8256fa04f..4b14a6bb6 100644 --- a/tdeio/tests/speed.cpp +++ b/tdeio/tests/speed.cpp @@ -17,11 +17,11 @@ * Boston, MA 02110-1301, USA. */ #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <time.h> #include "speed.h" #include <tdeio/job.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <tqdir.h> #include <tdeio/global.h> diff --git a/tdeio/tests/tdeioslavetest.cpp b/tdeio/tests/tdeioslavetest.cpp index aee514f54..ecc5e4af5 100644 --- a/tdeio/tests/tdeioslavetest.cpp +++ b/tdeio/tests/tdeioslavetest.cpp @@ -14,8 +14,8 @@ #include <tqdir.h> #include <kacl.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kdebug.h> #include <klocale.h> #include <kurl.h> diff --git a/tdeio/tests/tdesycocatest.cpp b/tdeio/tests/tdesycocatest.cpp index e1b40339f..719d90da8 100644 --- a/tdeio/tests/tdesycocatest.cpp +++ b/tdeio/tests/tdesycocatest.cpp @@ -28,7 +28,7 @@ #include <kprotocolinfo.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdio.h> #include <stdlib.h> diff --git a/tdeio/tests/tdesycocaupdatetest.cpp b/tdeio/tests/tdesycocaupdatetest.cpp index e7778e056..48a195a00 100644 --- a/tdeio/tests/tdesycocaupdatetest.cpp +++ b/tdeio/tests/tdesycocaupdatetest.cpp @@ -1,6 +1,6 @@ #include <kservice.h> -#include <kapplication.h> +#include <tdeapplication.h> int main(int argc, char *argv[]) { diff --git a/tdeio/tests/tdetradertest.cpp b/tdeio/tests/tdetradertest.cpp index 7a4b258dc..b33dcf398 100644 --- a/tdeio/tests/tdetradertest.cpp +++ b/tdeio/tests/tdetradertest.cpp @@ -16,10 +16,10 @@ * Boston, MA 02110-1301, USA. */ -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <ktrader.h> #include <kmimetype.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdio.h> static TDECmdLineOptions options[] = diff --git a/tdeioslave/http/http.cc b/tdeioslave/http/http.cc index 2dd5cc143..539cc4dc5 100644 --- a/tdeioslave/http/http.cc +++ b/tdeioslave/http/http.cc @@ -62,7 +62,7 @@ #include <kmimemagic.h> #include <dcopclient.h> #include <kdatastream.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <kstringhandler.h> #include <kremoteencoding.h> diff --git a/tdeioslave/http/http_cache_cleaner.cpp b/tdeioslave/http/http_cache_cleaner.cpp index c9f4e4678..af9ede123 100644 --- a/tdeioslave/http/http_cache_cleaner.cpp +++ b/tdeioslave/http/http_cache_cleaner.cpp @@ -34,7 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <kinstance.h> #include <klocale.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <kglobal.h> #include <kstandarddirs.h> #include <dcopclient.h> diff --git a/tdeioslave/http/kcookiejar/kcookieserver.cpp b/tdeioslave/http/kcookiejar/kcookieserver.cpp index ceb1df57f..798b06318 100644 --- a/tdeioslave/http/kcookiejar/kcookieserver.cpp +++ b/tdeioslave/http/kcookiejar/kcookieserver.cpp @@ -37,8 +37,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <tdeconfig.h> #include <kdebug.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kstandarddirs.h> #include "kcookiejar.h" diff --git a/tdeioslave/http/kcookiejar/kcookiewin.cpp b/tdeioslave/http/kcookiejar/kcookiewin.cpp index 57a22f62c..3b845a104 100644 --- a/tdeioslave/http/kcookiejar/kcookiewin.cpp +++ b/tdeioslave/http/kcookiejar/kcookiewin.cpp @@ -63,7 +63,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <kurllabel.h> #include <klineedit.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #ifdef Q_WS_X11 #include <X11/Xlib.h> diff --git a/tdeioslave/http/kcookiejar/main.cpp b/tdeioslave/http/kcookiejar/main.cpp index 976b6b87c..59d912524 100644 --- a/tdeioslave/http/kcookiejar/main.cpp +++ b/tdeioslave/http/kcookiejar/main.cpp @@ -22,9 +22,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include <dcopclient.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> static const char description[] = I18N_NOOP("HTTP Cookie Daemon"); diff --git a/tdeioslave/http/kcookiejar/tests/kcookiejartest.cpp b/tdeioslave/http/kcookiejar/tests/kcookiejartest.cpp index 51e61a332..9d720d6c4 100644 --- a/tdeioslave/http/kcookiejar/tests/kcookiejartest.cpp +++ b/tdeioslave/http/kcookiejar/tests/kcookiejartest.cpp @@ -24,9 +24,9 @@ #include <tqdatetime.h> #include <tqstring.h> -#include <kapplication.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> #include <kstandarddirs.h> #include "../kcookiejar.cpp" diff --git a/tdeioslave/metainfo/metainfo.cpp b/tdeioslave/metainfo/metainfo.cpp index 68f07c800..54f7acc3a 100644 --- a/tdeioslave/metainfo/metainfo.cpp +++ b/tdeioslave/metainfo/metainfo.cpp @@ -20,7 +20,7 @@ #include <kdatastream.h> // Do not remove, needed for correct bool serialization #include <kurl.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kmimetype.h> #include <kdebug.h> #include <tdefilemetainfo.h> diff --git a/tdelfeditor/tdelfeditor.cpp b/tdelfeditor/tdelfeditor.cpp index 7d58c9f08..99af949ed 100644 --- a/tdelfeditor/tdelfeditor.cpp +++ b/tdelfeditor/tdelfeditor.cpp @@ -43,10 +43,10 @@ extern "C" { #include <tqfileinfo.h> #include <kglobal.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> /* return application name */ diff --git a/tdemdi/tdemdi/dockcontainer.cpp b/tdemdi/tdemdi/dockcontainer.cpp index db29c293f..88bfa020d 100644 --- a/tdemdi/tdemdi/dockcontainer.cpp +++ b/tdemdi/tdemdi/dockcontainer.cpp @@ -33,7 +33,7 @@ #include <kdebug.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <klocale.h> diff --git a/tdemdi/tdemdi/guiclient.cpp b/tdemdi/tdemdi/guiclient.cpp index d3e162e14..255150289 100644 --- a/tdemdi/tdemdi/guiclient.cpp +++ b/tdemdi/tdemdi/guiclient.cpp @@ -22,7 +22,7 @@ #include "guiclient.moc" #include <tqpopupmenu.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <tdetoolbar.h> #include <klocale.h> diff --git a/tdemdi/tdemdi/mainwindow.cpp b/tdemdi/tdemdi/mainwindow.cpp index 358791ab0..4d477fc9c 100644 --- a/tdemdi/tdemdi/mainwindow.cpp +++ b/tdemdi/tdemdi/mainwindow.cpp @@ -52,7 +52,7 @@ #include <tqmenubar.h> #include <kmenubar.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tdeversion.h> #include <tqtabwidget.h> diff --git a/tdemdi/tdemdidockcontainer.cpp b/tdemdi/tdemdidockcontainer.cpp index 17f4dcf8a..ba0ba0de0 100644 --- a/tdemdi/tdemdidockcontainer.cpp +++ b/tdemdi/tdemdidockcontainer.cpp @@ -32,7 +32,7 @@ #include <kdebug.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <klocale.h> diff --git a/tdemdi/tdemdiguiclient.cpp b/tdemdi/tdemdiguiclient.cpp index c9b2f70f3..1c43b8039 100644 --- a/tdemdi/tdemdiguiclient.cpp +++ b/tdemdi/tdemdiguiclient.cpp @@ -21,7 +21,7 @@ #include "tdemdiguiclient.moc" #include <tqpopupmenu.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <tdetoolbar.h> #include <tdemainwindow.h> diff --git a/tdemdi/tdemdimainfrm.cpp b/tdemdi/tdemdimainfrm.cpp index 771afb8de..3c9f7c442 100644 --- a/tdemdi/tdemdimainfrm.cpp +++ b/tdemdi/tdemdimainfrm.cpp @@ -44,7 +44,7 @@ #include <tqmenubar.h> #include <kmenubar.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tdeversion.h> #include <tqtabwidget.h> diff --git a/tdemdi/test/main.cpp b/tdemdi/test/main.cpp index 4f14a410c..29a91e39f 100644 --- a/tdemdi/test/main.cpp +++ b/tdemdi/test/main.cpp @@ -26,7 +26,7 @@ //---------------------------------------------------------------------------- #ifndef NO_KDE -# include <kapplication.h> +# include <tdeapplication.h> TDEApplication* theApp; #else # include <tqapplication.h> diff --git a/tdeparts/genericfactory.h b/tdeparts/genericfactory.h index 75a5292ed..eb54959a4 100644 --- a/tdeparts/genericfactory.h +++ b/tdeparts/genericfactory.h @@ -4,7 +4,7 @@ #include <tdeparts/factory.h> #include <tdeparts/part.h> #include <kgenericfactory.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <kdebug.h> namespace KParts diff --git a/tdeparts/historyprovider.cpp b/tdeparts/historyprovider.cpp index 17cf609a1..9c893ae53 100644 --- a/tdeparts/historyprovider.cpp +++ b/tdeparts/historyprovider.cpp @@ -19,7 +19,7 @@ #include <tqdict.h> -#include <kapplication.h> +#include <tdeapplication.h> #include "historyprovider.h" diff --git a/tdeparts/tests/example.cpp b/tdeparts/tests/example.cpp index 0571bf4ad..403fda062 100644 --- a/tdeparts/tests/example.cpp +++ b/tdeparts/tests/example.cpp @@ -9,7 +9,7 @@ #include <kiconloader.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kmessagebox.h> #include <tdeaction.h> #include <klocale.h> diff --git a/tdeparts/tests/ghostview.cpp b/tdeparts/tests/ghostview.cpp index 24d70a14d..72b165e65 100644 --- a/tdeparts/tests/ghostview.cpp +++ b/tdeparts/tests/ghostview.cpp @@ -1,11 +1,11 @@ #include <kiconloader.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeaction.h> #include <klocale.h> #include <tdefiledialog.h> #include <kmessagebox.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <klibloader.h> #include <tqwidget.h> diff --git a/tdeparts/tests/normalktm.cpp b/tdeparts/tests/normalktm.cpp index 14efbef94..664d6c7ec 100644 --- a/tdeparts/tests/normalktm.cpp +++ b/tdeparts/tests/normalktm.cpp @@ -9,7 +9,7 @@ #include <kiconloader.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kmessagebox.h> #include <tdeaction.h> #include <klocale.h> diff --git a/tdeparts/tests/notepad.cpp b/tdeparts/tests/notepad.cpp index 547cab520..81ff2c1f2 100644 --- a/tdeparts/tests/notepad.cpp +++ b/tdeparts/tests/notepad.cpp @@ -8,8 +8,8 @@ #include <tqtextstream.h> #include <tqmultilineedit.h> -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tdeaction.h> #include <klocale.h> diff --git a/tdeparts/tests/parts.cpp b/tdeparts/tests/parts.cpp index e765f55e7..408e73280 100644 --- a/tdeparts/tests/parts.cpp +++ b/tdeparts/tests/parts.cpp @@ -12,7 +12,7 @@ #include <tqvbox.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kmessagebox.h> #include <tdeaction.h> diff --git a/tdeprint/cups/cupsdconf2/main.cpp b/tdeprint/cups/cupsdconf2/main.cpp index 5febb18a1..abc81477c 100644 --- a/tdeprint/cups/cupsdconf2/main.cpp +++ b/tdeprint/cups/cupsdconf2/main.cpp @@ -21,8 +21,8 @@ #include <tqfile.h> #include <klocale.h> -#include <kcmdlineargs.h> -#include <kapplication.h> +#include <tdecmdlineargs.h> +#include <tdeapplication.h> static TDECmdLineOptions options[] = { diff --git a/tdeprint/cups/cupsinfos.cpp b/tdeprint/cups/cupsinfos.cpp index 5013b57cc..330429583 100644 --- a/tdeprint/cups/cupsinfos.cpp +++ b/tdeprint/cups/cupsinfos.cpp @@ -26,7 +26,7 @@ #include <tdeio/authinfo.h> #include <klocale.h> #include <tdeconfig.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <kdebug.h> #include <kstringhandler.h> diff --git a/tdeprint/cups/kmcupsmanager.cpp b/tdeprint/cups/kmcupsmanager.cpp index 99fff556a..cd472eefa 100644 --- a/tdeprint/cups/kmcupsmanager.cpp +++ b/tdeprint/cups/kmcupsmanager.cpp @@ -41,7 +41,7 @@ #include <tqdatetime.h> #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <tdeconfig.h> #include <kstandarddirs.h> diff --git a/tdeprint/kmfactory.cpp b/tdeprint/kmfactory.cpp index 7d972cbf8..09a2cf45a 100644 --- a/tdeprint/kmfactory.cpp +++ b/tdeprint/kmfactory.cpp @@ -40,7 +40,7 @@ #include <klocale.h> #include <ksimpleconfig.h> #include <kstaticdeleter.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <dcopclient.h> #include <dcopref.h> #include <tdeio/authinfo.h> diff --git a/tdeprint/kmmanager.cpp b/tdeprint/kmmanager.cpp index 1c772ec3c..ca9b1036f 100644 --- a/tdeprint/kmmanager.cpp +++ b/tdeprint/kmmanager.cpp @@ -32,7 +32,7 @@ #include <tdeconfig.h> #include <klocale.h> #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klibloader.h> #include <unistd.h> diff --git a/tdeprint/kpcopiespage.cpp b/tdeprint/kpcopiespage.cpp index 3557fe4d4..d804cc9f2 100644 --- a/tdeprint/kpcopiespage.cpp +++ b/tdeprint/kpcopiespage.cpp @@ -34,7 +34,7 @@ #include <tqwhatsthis.h> #include <tqlayout.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <kiconloader.h> #include <kseparator.h> diff --git a/tdeprint/kpfilterpage.cpp b/tdeprint/kpfilterpage.cpp index 7f3d18807..4704abb15 100644 --- a/tdeprint/kpfilterpage.cpp +++ b/tdeprint/kpfilterpage.cpp @@ -32,7 +32,7 @@ #include <kmessagebox.h> #include <kactivelabel.h> #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdialog.h> KPFilterPage::KPFilterPage(TQWidget *parent, const char *name) diff --git a/tdeprint/kprintdialog.cpp b/tdeprint/kprintdialog.cpp index 73e700886..312146855 100644 --- a/tdeprint/kprintdialog.cpp +++ b/tdeprint/kprintdialog.cpp @@ -61,7 +61,7 @@ #include <tdeconfig.h> #include <kguiitem.h> #include <kstdguiitem.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeio/renamedlg.h> #include <time.h> diff --git a/tdeprint/kprinter.cpp b/tdeprint/kprinter.cpp index 4d34280a0..95cfc1733 100644 --- a/tdeprint/kprinter.cpp +++ b/tdeprint/kprinter.cpp @@ -33,7 +33,7 @@ #include <tqtl.h> #include <tqdir.h> #include <tqguardedptr.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <kglobal.h> #include <tdeconfig.h> diff --git a/tdeprint/kprinterimpl.cpp b/tdeprint/kprinterimpl.cpp index fd05024a3..ac79220f5 100644 --- a/tdeprint/kprinterimpl.cpp +++ b/tdeprint/kprinterimpl.cpp @@ -34,7 +34,7 @@ #include <kinputdialog.h> #include <klocale.h> #include <dcopclient.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <kdatastream.h> #include <kdebug.h> diff --git a/tdeprint/kprintpreview.cpp b/tdeprint/kprintpreview.cpp index b1a2f50ac..0311f543d 100644 --- a/tdeprint/kprintpreview.cpp +++ b/tdeprint/kprintpreview.cpp @@ -32,7 +32,7 @@ #include <ktrader.h> #include <kuserprofile.h> #include <krun.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <klocale.h> #include <kmessagebox.h> diff --git a/tdeprint/kprintprocess.cpp b/tdeprint/kprintprocess.cpp index fbee05a0c..ec93fcce6 100644 --- a/tdeprint/kprintprocess.cpp +++ b/tdeprint/kprintprocess.cpp @@ -18,7 +18,7 @@ **/ #include "kprintprocess.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <tqfile.h> diff --git a/tdeprint/lpr/matichandler.cpp b/tdeprint/lpr/matichandler.cpp index 738f7e178..e1242c5fc 100644 --- a/tdeprint/lpr/matichandler.cpp +++ b/tdeprint/lpr/matichandler.cpp @@ -31,7 +31,7 @@ #include <klocale.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kprocess.h> #include <tqfile.h> diff --git a/tdeprint/management/kaddprinterwizard.cpp b/tdeprint/management/kaddprinterwizard.cpp index 99da2a9b7..256b85011 100644 --- a/tdeprint/management/kaddprinterwizard.cpp +++ b/tdeprint/management/kaddprinterwizard.cpp @@ -1,6 +1,6 @@ #include "kmmanager.h" -#include <kcmdlineargs.h> -#include <kapplication.h> +#include <tdecmdlineargs.h> +#include <tdeapplication.h> #include <kmessagebox.h> #include <klocale.h> #include <kglobal.h> diff --git a/tdeprint/management/kmdbcreator.cpp b/tdeprint/management/kmdbcreator.cpp index c101bb270..2297d4034 100644 --- a/tdeprint/management/kmdbcreator.cpp +++ b/tdeprint/management/kmdbcreator.cpp @@ -25,7 +25,7 @@ #include <tqfileinfo.h> #include <tqdir.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <kdebug.h> diff --git a/tdeprint/management/kmdriverdb.cpp b/tdeprint/management/kmdriverdb.cpp index a7d14fe92..9eb28cf87 100644 --- a/tdeprint/management/kmdriverdb.cpp +++ b/tdeprint/management/kmdriverdb.cpp @@ -28,7 +28,7 @@ #include <tqtextstream.h> #include <tqfileinfo.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kmessagebox.h> KMDriverDB* KMDriverDB::m_self = 0; diff --git a/tdeprint/management/kmjobviewer.cpp b/tdeprint/management/kmjobviewer.cpp index 9d5c498c0..741e69378 100644 --- a/tdeprint/management/kmjobviewer.cpp +++ b/tdeprint/management/kmjobviewer.cpp @@ -39,7 +39,7 @@ #include <tdeaction.h> #include <kstdaction.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kcursor.h> #include <kmenubar.h> #include <kdebug.h> diff --git a/tdeprint/management/kmmainview.cpp b/tdeprint/management/kmmainview.cpp index da5b2dd0a..5e68f3726 100644 --- a/tdeprint/management/kmmainview.cpp +++ b/tdeprint/management/kmmainview.cpp @@ -54,7 +54,7 @@ #include <kdialogbase.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kprocess.h> #undef m_manager diff --git a/tdeprint/management/kmwdrivertest.cpp b/tdeprint/management/kmwdrivertest.cpp index 4f57762aa..cb46a45a0 100644 --- a/tdeprint/management/kmwdrivertest.cpp +++ b/tdeprint/management/kmwdrivertest.cpp @@ -29,7 +29,7 @@ #include <kpushbutton.h> #include <tqlayout.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kmessagebox.h> #include <kguiitem.h> #include <tdeio/netaccess.h> diff --git a/tdeprint/management/kmwizard.cpp b/tdeprint/management/kmwizard.cpp index 5dc915572..5bb86967a 100644 --- a/tdeprint/management/kmwizard.cpp +++ b/tdeprint/management/kmwizard.cpp @@ -31,7 +31,7 @@ #include <klocale.h> #include <kdebug.h> #include <kseparator.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstdguiitem.h> #include "kmwinfopage.h" diff --git a/tdeprint/management/kmwsocketutil.cpp b/tdeprint/management/kmwsocketutil.cpp index 04556c07b..a4f23959a 100644 --- a/tdeprint/management/kmwsocketutil.cpp +++ b/tdeprint/management/kmwsocketutil.cpp @@ -32,7 +32,7 @@ #include <tqregexp.h> #include <knumvalidator.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <kextsock.h> #include <kdebug.h> diff --git a/tdeprint/management/kxmlcommanddlg.cpp b/tdeprint/management/kxmlcommanddlg.cpp index 5019b92b3..2080149d9 100644 --- a/tdeprint/management/kxmlcommanddlg.cpp +++ b/tdeprint/management/kxmlcommanddlg.cpp @@ -45,7 +45,7 @@ #include <tdelistbox.h> #include <kmimetype.h> #include <kmessagebox.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kguiitem.h> diff --git a/tdeprint/messagewindow.cpp b/tdeprint/messagewindow.cpp index a1b6ddf29..7f642896e 100644 --- a/tdeprint/messagewindow.cpp +++ b/tdeprint/messagewindow.cpp @@ -25,7 +25,7 @@ #include <tqpixmap.h> #include <tqhbox.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> TQPtrDict<MessageWindow> MessageWindow::m_windows; diff --git a/tdeprint/tdeprintd.cpp b/tdeprint/tdeprintd.cpp index 02d32ab77..5080cc40c 100644 --- a/tdeprint/tdeprintd.cpp +++ b/tdeprint/tdeprintd.cpp @@ -33,7 +33,7 @@ #include <kiconloader.h> #include <kstandarddirs.h> #include <twin.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tqlayout.h> #include <tqtimer.h> #include <tqregexp.h> diff --git a/tdeprint/tests/drawdemo.cpp b/tdeprint/tests/drawdemo.cpp index 3f04c9196..71d4a0680 100644 --- a/tdeprint/tests/drawdemo.cpp +++ b/tdeprint/tests/drawdemo.cpp @@ -14,7 +14,7 @@ #include <tqpushbutton.h> #include <tqradiobutton.h> #include <tqbuttongroup.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tqapplication.h> #include <math.h> diff --git a/tdeprint/tests/main.cpp b/tdeprint/tests/main.cpp index 332ba1fc4..d714bcdf6 100644 --- a/tdeprint/tests/main.cpp +++ b/tdeprint/tests/main.cpp @@ -9,7 +9,7 @@ *****************************************************************************/ #include "helpwindow.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <tqwindowsstyle.h> #include <tqstylesheet.h> #include <stdlib.h> diff --git a/tderandr/libtderandr.cc b/tderandr/libtderandr.cc index 65005f91e..976b156ac 100644 --- a/tderandr/libtderandr.cc +++ b/tderandr/libtderandr.cc @@ -28,7 +28,7 @@ #include <klocale.h> #include <kmessagebox.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <stdlib.h> #include <unistd.h> diff --git a/tderandr/randr.cpp b/tderandr/randr.cpp index 334da5a79..68bfc2e68 100644 --- a/tderandr/randr.cpp +++ b/tderandr/randr.cpp @@ -24,7 +24,7 @@ #include <kdebug.h> #include <klocale.h> #include <kglobal.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kiconloader.h> #include <dcopclient.h> #include <kipc.h> diff --git a/tderesources/configpage.cpp b/tderesources/configpage.cpp index d0ba22df7..e70332c71 100644 --- a/tderesources/configpage.cpp +++ b/tderesources/configpage.cpp @@ -25,7 +25,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kcombobox.h> #include <kdebug.h> #include <klocale.h> diff --git a/tderesources/kcmtderesources.cpp b/tderesources/kcmtderesources.cpp index 6afc1c1f6..1b779fabd 100644 --- a/tderesources/kcmtderesources.cpp +++ b/tderesources/kcmtderesources.cpp @@ -21,7 +21,7 @@ #include <tqlayout.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <kgenericfactory.h> #include <klocale.h> diff --git a/tderesources/managerimpl.cpp b/tderesources/managerimpl.cpp index 467f049e9..288a40223 100644 --- a/tderesources/managerimpl.cpp +++ b/tderesources/managerimpl.cpp @@ -23,8 +23,8 @@ #include <dcopclient.h> -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tdeconfig.h> #include <kstandarddirs.h> diff --git a/tderesources/resource.cpp b/tderesources/resource.cpp index 2a16ee159..41c08767e 100644 --- a/tderesources/resource.cpp +++ b/tderesources/resource.cpp @@ -22,7 +22,7 @@ */ #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <klocale.h> #include "resource.h" diff --git a/tderesources/testresources.cpp b/tderesources/testresources.cpp index 515563172..7644315d4 100644 --- a/tderesources/testresources.cpp +++ b/tderesources/testresources.cpp @@ -1,7 +1,7 @@ #include <kdebug.h> -#include <kapplication.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> #include "resource.h" #include "manager.h" diff --git a/tdersync/rsyncconfigdialog.cpp b/tdersync/rsyncconfigdialog.cpp index 8b22b84a2..78df9e335 100644 --- a/tdersync/rsyncconfigdialog.cpp +++ b/tdersync/rsyncconfigdialog.cpp @@ -82,7 +82,7 @@ #include <kprogressbox.h> #include <kpassdlg.h> #include <tdelistview.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfigdialog.h> #include <kdirlister.h> diff --git a/tdersync/tdersync.h b/tdersync/tdersync.h index ffb5cfd6f..a4908fe63 100644 --- a/tdersync/tdersync.h +++ b/tdersync/tdersync.h @@ -61,7 +61,7 @@ #include <kprogressbox.h> #include <kpassdlg.h> #include <tdelistview.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfigdialog.h> #include <kdirlister.h> diff --git a/tdespell2/tests/backgroundtest.cpp b/tdespell2/tests/backgroundtest.cpp index 14f9e029d..92c7e7792 100644 --- a/tdespell2/tests/backgroundtest.cpp +++ b/tdespell2/tests/backgroundtest.cpp @@ -24,7 +24,7 @@ #include "broker.h" using namespace KSpell2; -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> const char *text = "Rationale \ diff --git a/tdespell2/tests/test.cpp b/tdespell2/tests/test.cpp index e8ceabaf7..b68dbee42 100644 --- a/tdespell2/tests/test.cpp +++ b/tdespell2/tests/test.cpp @@ -21,7 +21,7 @@ #include "broker.h" #include "dictionary.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tqdatetime.h> diff --git a/tdespell2/tests/test_config.cpp b/tdespell2/tests/test_config.cpp index 2d243bd46..c3c5ec740 100644 --- a/tdespell2/tests/test_config.cpp +++ b/tdespell2/tests/test_config.cpp @@ -20,7 +20,7 @@ */ #include "configdialog.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> using namespace KSpell2; diff --git a/tdespell2/tests/test_configdialog.cpp b/tdespell2/tests/test_configdialog.cpp index a9ff16cdd..4e3b560e9 100644 --- a/tdespell2/tests/test_configdialog.cpp +++ b/tdespell2/tests/test_configdialog.cpp @@ -21,7 +21,7 @@ #include "configdialog.h" #include "broker.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> using namespace KSpell2; diff --git a/tdespell2/tests/test_dialog.cpp b/tdespell2/tests/test_dialog.cpp index 19503e307..d6441bde6 100644 --- a/tdespell2/tests/test_dialog.cpp +++ b/tdespell2/tests/test_dialog.cpp @@ -25,7 +25,7 @@ #include "dictionary.h" #include "filter.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> using namespace KSpell2; diff --git a/tdespell2/tests/test_filter.cpp b/tdespell2/tests/test_filter.cpp index 430f157dd..a1fcb670c 100644 --- a/tdespell2/tests/test_filter.cpp +++ b/tdespell2/tests/test_filter.cpp @@ -21,7 +21,7 @@ #include "filter.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> using namespace KSpell2; diff --git a/tdespell2/tests/test_highlighter.cpp b/tdespell2/tests/test_highlighter.cpp index c11972254..3f7c253e4 100644 --- a/tdespell2/tests/test_highlighter.cpp +++ b/tdespell2/tests/test_highlighter.cpp @@ -22,7 +22,7 @@ #include "dictionary.h" #include "filter.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tqtextedit.h> diff --git a/tdesu/client.cpp b/tdesu/client.cpp index 8eaf86af8..91e922250 100644 --- a/tdesu/client.cpp +++ b/tdesu/client.cpp @@ -32,7 +32,7 @@ #include <kdebug.h> #include <kstandarddirs.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kde_file.h> #include "client.h" diff --git a/tdesu/stub.cpp b/tdesu/stub.cpp index f5b435b40..4cd5864de 100644 --- a/tdesu/stub.cpp +++ b/tdesu/stub.cpp @@ -20,7 +20,7 @@ #include <tqcstring.h> #include <kdatastream.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <dcopclient.h> diff --git a/tdeui/CMakeLists.txt b/tdeui/CMakeLists.txt index b8e11ed32..85d2fc9b4 100644 --- a/tdeui/CMakeLists.txt +++ b/tdeui/CMakeLists.txt @@ -53,7 +53,7 @@ install( FILES klineeditdlg.h kinputdialog.h kactivelabel.h kcharselect.h kcolordrag.h qxembed.h knumvalidator.h kdialog.h kdialogbase.h - kjanuswidget.h kaboutdialog.h + kjanuswidget.h tdeaboutdialog.h kauthicon.h kmessagebox.h ksharedpixmap.h kdualcolorbtn.h kdualcolorbutton.h tdetoolbarbutton.h tdetoolbarradiogroup.h ktextbrowser.h @@ -64,7 +64,7 @@ install( FILES kxmlguiclient.h kxmlgui.h kxmlguibuilder.h kxmlguifactory.h kpixmapio.h kwordwrap.h kedittoolbar.h kdockwidget.h kanimwidget.h - krootpixmap.h kaboutkde.h kaboutapplication.h + krootpixmap.h tdeabouttde.h tdeaboutapplication.h kpanelapplet.h kpushbutton.h kdcopactionproxy.h kcolorcombo.h kpanelextension.h tdecompletionbox.h ksqueezedtextlabel.h kcommand.h twindowlistmenu.h tdefontcombo.h tdeaccelgen.h ktip.h @@ -117,7 +117,7 @@ set( ${target}_SRCS kruler.cpp kcursor.cpp klineeditdlg.cpp kcharselect.cpp kcolordrag.cpp knumvalidator.cpp kdialog.cpp kdialogbase.cpp - kjanuswidget.cpp kaboutdialog.cpp + kjanuswidget.cpp tdeaboutdialog.cpp kauthicon.cpp kmessagebox.cpp kdualcolorbutton.cpp tdetoolbarradiogroup.cpp tdetoolbarbutton.cpp ktextbrowser.cpp khelpmenu.cpp kswitchlanguagedialog.cpp @@ -126,8 +126,8 @@ set( ${target}_SRCS kcombobox.cpp kpassdlg.cpp kxmlguiclient.cpp kxmlguifactory.cpp kxmlguifactory_p.cpp kxmlguibuilder.cpp kedittoolbar.cpp kpanelappmenu.cpp kdockwidget.cpp kdockwidget_private.cpp - kanimwidget.cpp krootpixmap.cpp kaboutkde.cpp - kaboutapplication.cpp kpanelapplet.cpp kdcopactionproxy.cpp + kanimwidget.cpp krootpixmap.cpp tdeabouttde.cpp + tdeaboutapplication.cpp kpanelapplet.cpp kdcopactionproxy.cpp kcolorcombo.cpp kpushbutton.cpp kpanelextension.cpp tdecompletionbox.cpp ksqueezedtextlabel.cpp tdecmodule.cpp kcommand.cpp twindowlistmenu.cpp tdefontcombo.cpp ktip.cpp diff --git a/tdeui/MAINTAINERS b/tdeui/MAINTAINERS index 4e22d00a0..f4e2165fb 100644 --- a/tdeui/MAINTAINERS +++ b/tdeui/MAINTAINERS @@ -5,9 +5,9 @@ that class. When adding yourself as a maintainer, don't be afraid to reorder the files to a more logical grouping. -kaboutapplication.cpp -kaboutdialog.cpp -kaboutkde.cpp +tdeaboutapplication.cpp +tdeaboutdialog.cpp +tdeabouttde.cpp tdeaction.cpp Holger Freyther <freyther@kde.org>, Martijn Klingens <klingens@kde.org> kanimwidget.cpp Waldo Bastian <bastian@kde.org> karrowbutton.cpp Frerich Raabe <raabe@kde.org> diff --git a/tdeui/Makefile.am b/tdeui/Makefile.am index 4a1b472ff..26a9423cd 100644 --- a/tdeui/Makefile.am +++ b/tdeui/Makefile.am @@ -50,7 +50,7 @@ include_HEADERS = kprogressbox.h kprogress.h kcolordlg.h \ klineeditdlg.h kinputdialog.h kactivelabel.h \ kcharselect.h kcolordrag.h qxembed.h \ knumvalidator.h kdialog.h kdialogbase.h \ - kjanuswidget.h kaboutdialog.h \ + kjanuswidget.h tdeaboutdialog.h \ kauthicon.h kmessagebox.h ksharedpixmap.h \ kdualcolorbtn.h kdualcolorbutton.h tdetoolbarbutton.h \ tdetoolbarradiogroup.h ktextbrowser.h \ @@ -61,7 +61,7 @@ include_HEADERS = kprogressbox.h kprogress.h kcolordlg.h \ kxmlguiclient.h kxmlgui.h kxmlguibuilder.h kxmlguifactory.h \ kpixmapio.h kwordwrap.h \ kedittoolbar.h kdockwidget.h kanimwidget.h \ - krootpixmap.h kaboutkde.h kaboutapplication.h \ + krootpixmap.h tdeabouttde.h tdeaboutapplication.h \ kpanelapplet.h kpushbutton.h kdcopactionproxy.h kcolorcombo.h \ kpanelextension.h tdecompletionbox.h ksqueezedtextlabel.h \ kcommand.h twindowlistmenu.h tdefontcombo.h tdeaccelgen.h ktip.h \ @@ -98,7 +98,7 @@ libtdeui_la_SOURCES = \ kruler.cpp kcursor.cpp klineeditdlg.cpp \ kcharselect.cpp kcolordrag.cpp \ knumvalidator.cpp kdialog.cpp kdialogbase.cpp \ - kjanuswidget.cpp kaboutdialog.cpp \ + kjanuswidget.cpp tdeaboutdialog.cpp \ kauthicon.cpp kmessagebox.cpp kdualcolorbutton.cpp \ tdetoolbarradiogroup.cpp tdetoolbarbutton.cpp \ ktextbrowser.cpp khelpmenu.cpp kswitchlanguagedialog.cpp \ @@ -107,8 +107,8 @@ libtdeui_la_SOURCES = \ kcombobox.cpp kpassdlg.cpp kxmlguiclient.cpp kxmlguifactory.cpp \ kxmlguifactory_p.cpp kxmlguibuilder.cpp kedittoolbar.cpp \ kpanelappmenu.cpp kdockwidget.cpp kdockwidget_private.cpp \ - kanimwidget.cpp krootpixmap.cpp kaboutkde.cpp \ - kaboutapplication.cpp kpanelapplet.cpp kdcopactionproxy.cpp \ + kanimwidget.cpp krootpixmap.cpp tdeabouttde.cpp \ + tdeaboutapplication.cpp kpanelapplet.cpp kdcopactionproxy.cpp \ kcolorcombo.cpp kpushbutton.cpp kpanelextension.cpp \ tdecompletionbox.cpp ksqueezedtextlabel.cpp tdecmodule.cpp \ kcommand.cpp twindowlistmenu.cpp tdefontcombo.cpp ktip.cpp \ diff --git a/tdeui/kaboutapplication.cpp b/tdeui/kaboutapplication.cpp deleted file mode 100644 index 681b22642..000000000 --- a/tdeui/kaboutapplication.cpp +++ /dev/null @@ -1,188 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Waldo Bastian (bastian@kde.org) and - * Espen Sand (espen@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. - * - */ - -// I (espen) prefer that header files are included alphabetically - -#include <tqlabel.h> -#include <kaboutapplication.h> -#include <kaboutdialog_private.h> -#include <kaboutdata.h> -#include <kapplication.h> -#include <kglobal.h> -#include <klocale.h> -#include <kurllabel.h> -#include <kactivelabel.h> -#include "ktextedit.h" - -TDEAboutApplication::TDEAboutApplication( TQWidget *parent, const char *name, - bool modal ) - :TDEAboutDialog( AbtTabbed|AbtProduct, - kapp ? kapp->caption() : TQString::null, - Close, Close, - parent, name, modal ) -{ - buildDialog(TDEGlobal::instance()->aboutData()); -} - -TDEAboutApplication::TDEAboutApplication( const TDEAboutData *aboutData, TQWidget *parent, - const char *name, bool modal ) - :TDEAboutDialog( AbtTabbed|AbtProduct, aboutData->programName(), Close, Close, - parent, name, modal ) -{ - buildDialog(aboutData); -} - -void TDEAboutApplication::buildDialog( const TDEAboutData *aboutData ) -{ - if( !aboutData ) - { - // - // Recovery - // - - //i18n "??" is displayed as (pseudo-)version when no data is known about the application - setProduct( kapp ? kapp->caption() : TQString::null, i18n("??"), TQString::null, TQString::null ); - TDEAboutContainer *appPage = addContainerPage( i18n("&About")); - - TQString appPageText = - i18n("No information available.\n" - "The supplied TDEAboutData object does not exist."); - TQLabel *appPageLabel = new TQLabel( "\n\n\n\n"+appPageText+"\n\n\n\n", 0 ); - appPage->addWidget( appPageLabel ); - return; - } - - setProduct( aboutData->programName(), aboutData->version(), - TQString::null, TQString::null ); - - if (!aboutData->programLogo().isNull()) - setProgramLogo( aboutData->programLogo() ); - - TQString appPageText = aboutData->shortDescription() + "\n"; - - if (!aboutData->otherText().isEmpty()) - appPageText += "\n" + aboutData->otherText()+"\n"; - - if (!aboutData->copyrightStatement().isEmpty()) - appPageText += "\n" + aboutData->copyrightStatement()+"\n"; - - TDEAboutContainer *appPage = addContainerPage( i18n("&About")); - - TQLabel *appPageLabel = new TQLabel( appPageText, 0 ); - appPage->addWidget( appPageLabel ); - - if (!aboutData->homepage().isEmpty()) - { - KURLLabel *url = new KURLLabel(); - url->setText(aboutData->homepage()); - url->setURL(aboutData->homepage()); - appPage->addWidget( url ); - connect( url, TQT_SIGNAL(leftClickedURL(const TQString &)), - this, TQT_SLOT(openURLSlot(const TQString &))); - } - - int authorCount = aboutData->authors().count(); - if (authorCount) - { - TQString authorPageTitle = authorCount == 1 ? - i18n("A&uthor") : i18n("A&uthors"); - TDEAboutContainer *authorPage = addScrolledContainerPage( authorPageTitle ); - - if (!aboutData->customAuthorTextEnabled() || !aboutData->customAuthorRichText().isEmpty ()) - { - TQString text; - KActiveLabel* activeLabel = new KActiveLabel( authorPage ); - if (!aboutData->customAuthorTextEnabled()) - { - if ( aboutData->bugAddress().isEmpty() || aboutData->bugAddress() == "submit@bugs.pearsoncomputing.net") - text = i18n( "Please use <a href=\"http://bugs.pearsoncomputing.net\">http://bugs.pearsoncomputing.net</a> to report bugs.\n" ); - else { - if( aboutData->authors().count() == 1 && ( aboutData->authors().first().emailAddress() == aboutData->bugAddress() ) ) - { - text = i18n( "Please report bugs to <a href=\"mailto:%1\">%2</a>.\n" ).arg( aboutData->authors().first().emailAddress() ).arg( aboutData->authors().first().emailAddress() ); - } - else { - text = i18n( "Please report bugs to <a href=\"mailto:%1\">%2</a>.\n" ).arg(aboutData->bugAddress()).arg(aboutData->bugAddress() ); - } - } - } - else - { - text = aboutData->customAuthorRichText(); - } - activeLabel->setText( text ); - authorPage->addWidget( activeLabel ); - } - - TQValueList<TDEAboutPerson>::ConstIterator it; - for (it = aboutData->authors().begin(); - it != aboutData->authors().end(); ++it) - { - authorPage->addPerson( (*it).name(), (*it).emailAddress(), - (*it).webAddress(), (*it).task() ); - } - } - - int creditsCount = aboutData->credits().count(); - if (creditsCount) - { - TDEAboutContainer *creditsPage = - addScrolledContainerPage( i18n("&Thanks To") ); - TQValueList<TDEAboutPerson>::ConstIterator it; - for (it = aboutData->credits().begin(); - it != aboutData->credits().end(); ++it) - { - creditsPage->addPerson( (*it).name(), (*it).emailAddress(), - (*it).webAddress(), (*it).task() ); - } - } - - const TQValueList<TDEAboutTranslator> translatorList = aboutData->translators(); - - if(translatorList.count() > 0) - { - TQString text = "<qt>"; - - TQValueList<TDEAboutTranslator>::ConstIterator it; - for(it = translatorList.begin(); it != translatorList.end(); ++it) - { - text += TQString("<p>%1<br>   " - "<a href=\"mailto:%2\">%2</a></p>") - .arg((*it).name()) - .arg((*it).emailAddress()) - .arg((*it).emailAddress()); - } - - text += TDEAboutData::aboutTranslationTeam() + "</qt>"; - addTextPage( i18n("T&ranslation"), text, true); - } - - if (!aboutData->license().isEmpty() ) - { - addLicensePage( i18n("&License Agreement"), aboutData->license() ); - } - - // - // Make sure the dialog has a reasonable width - // - setInitialSize( TQSize(400,1) ); -} diff --git a/tdeui/kaboutapplication.h b/tdeui/kaboutapplication.h deleted file mode 100644 index c313460ff..000000000 --- a/tdeui/kaboutapplication.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Waldo Bastian (bastian@kde.org) and - * Espen Sand (espen@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 _KABOUT_APPLICATION_H_ -#define _KABOUT_APPLICATION_H_ - -#include <kaboutdata.h> -#include <kaboutdialog.h> - -/** - * @short Standard "About Application" dialog box. - * - * This class provides the standard "About Application" dialog box - * that is used by KHelpMenu. It uses the information of the global - * TDEAboutData that is specified at the start of your program in - * main(). Normally you should not use this class directly but rather - * the KHelpMenu class or even better just subclass your toplevel - * window from TDEMainWindow. If you do the latter, the help menu and - * thereby this dialog box is available through the - * TDEMainWindow::helpMenu() function. - * - * @author Waldo Bastian (bastian@kde.org) and Espen Sand (espen@kde.org) - */ - -class TDEUI_EXPORT TDEAboutApplication : public TDEAboutDialog -{ - public: - /** - * Constructor. Creates a fully featured "About Application" dialog box. - * Note that this dialog is made modeless in the KHelpMenu class so - * the users may expect a modeless dialog. - * - * @param parent The parent of the dialog box. You should use the - * toplevel window so that the dialog becomes centered. - * @param name Internal name of the widget. This name is not used in the - * caption. - * @param modal If false, this widget will be modeless and must be - * made visible using TQWidget::show(). Otherwise it will be - * modal and must be made visible using TQWidget::exec(). - */ - TDEAboutApplication( TQWidget *parent=0, const char *name=0, bool modal=true ); - - /** - * Constructor. Mostly does the same stuff as the previous constructor, except - * that it can take a custom TDEAboutData object instead of the one specified - * in your main() function. This is especially useful for applications - * which are implemented as (dynamically loaded) libraries, e.g. panel - * applets. - * - * @param aboutData A pointer to a TDEAboutData object which data - * will be used for filling the dialog. - * @param parent The parent of the dialog box. You should use the - * toplevel window so that the dialog becomes centered. - * @param name Internal name of the widget. This name is not used in the - * caption. - * @param modal If false, this widget will be modeless and must be - * made visible using TQWidget::show(). Otherwise it will be - * modal and must be made visible using TQWidget::exec(). - */ - TDEAboutApplication( const TDEAboutData *aboutData, TQWidget *parent=0, const char *name=0, bool modal=true ); - -/* - FIXME: The two constructors should be replaced with the following after the lib freeze: - - TDEAboutApplication( const TDEAboutData *aboutData=0, TQWidget *parent=0, const char *name=0, bool modal=true ); - - This will make buildDialog() obsolete as well (Frerich). -*/ - protected: - void buildDialog( const TDEAboutData *aboutData ); -}; - - -#endif - diff --git a/tdeui/kaboutdialog.cpp b/tdeui/kaboutdialog.cpp deleted file mode 100644 index 7cc1c6327..000000000 --- a/tdeui/kaboutdialog.cpp +++ /dev/null @@ -1,1797 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 1999-2001 Mirko Boehm <mirko@kde.org> and - * Espen Sand <espensa@online.no> - * - * 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 <tqclipboard.h> -#include <tqimage.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <ktextedit.h> -#include <tqobjectlist.h> -#include <tqpainter.h> -#include <tqrect.h> -#include <tqtabwidget.h> -#include <tqtabbar.h> - -#include <kapplication.h> -#include <kglobal.h> -#include <kglobalsettings.h> -#include <klocale.h> -#include <ktextbrowser.h> -#include <kurllabel.h> -#include <kaboutdialog.h> -#include <kaboutdialog_private.h> -#include <kdebug.h> - -//MOC_SKIP_BEGIN -template class TQPtrList<TDEAboutContributor>; -//MOC_SKIP_END - -#define WORKTEXT_IDENTATION 16 -#define Grid 3 - -// ############################################################## -// MOC OUTPUT FILES: -#include "kaboutdialog.moc" -#include "kaboutdialog_private.moc" -// ############################################################## - -class TDEAboutTabWidget : public TQTabWidget -{ -public: - TDEAboutTabWidget( TQWidget* parent ) : TQTabWidget( parent ) {} - TQSize sizeHint() const { - return TQTabWidget::sizeHint().expandedTo( tabBar()->sizeHint() + TQSize(4,4) ); - } -}; - - - - -TDEAboutContributor::TDEAboutContributor( TQWidget *_parent, const char *wname, - const TQString &_name,const TQString &_email, - const TQString &_url, const TQString &_work, - bool showHeader, bool showFrame, - bool showBold ) - : TQFrame( _parent, wname ), mShowHeader(showHeader), mShowBold(showBold), d(0) -{ - if( showFrame ) - { - setFrameStyle(TQFrame::Panel | TQFrame::Raised); - } - - mLabel[0] = new TQLabel( this ); - mLabel[1] = new TQLabel( this ); - mLabel[2] = new TQLabel( this ); - mLabel[3] = new TQLabel( this ); - mText[0] = new TQLabel( this ); - mText[1] = new KURLLabel( this ); - mText[2] = new KURLLabel( this ); - mText[3] = new TQLabel( this ); - - setName( _name, i18n("Author"), false ); - setEmail( _email, i18n("Email"), false ); - setURL( _url, i18n("Homepage"), false ); - setWork( _work, i18n("Task"), false ); - - KURLLabel *kurl = static_cast<KURLLabel *>(mText[1]); - kurl->setFloat(true); - kurl->setUnderline(true); - kurl->setMargin(0); - connect(kurl, TQT_SIGNAL(leftClickedURL(const TQString &)), - TQT_SLOT(emailClickedSlot(const TQString &))); - - kurl = static_cast<KURLLabel *>(mText[2]); - kurl->setFloat(true); - kurl->setUnderline(true); - kurl->setMargin(0); - connect(kurl, TQT_SIGNAL(leftClickedURL(const TQString &)), - TQT_SLOT(urlClickedSlot(const TQString &))); - - mLabel[3]->setAlignment( AlignTop ); - - fontChange( font() ); - updateLayout(); -} - - -void TDEAboutContributor::setName( const TQString &_text, const TQString &_header, - bool _update ) -{ - mLabel[0]->setText(_header); - mText[0]->setText(_text); - if( _update ) { updateLayout(); } -} - - -void TDEAboutContributor::setEmail( const TQString &_text, const TQString &_header, - bool _update ) -{ - mLabel[1]->setText(_header); - KURLLabel* const kurl = static_cast<KURLLabel *>(mText[1]); - kurl->setText(_text); - kurl->setURL(_text); - if( _update ) { updateLayout(); } -} - - -void TDEAboutContributor::setURL( const TQString &_text, const TQString &_header, - bool _update ) -{ - mLabel[2]->setText(_header); - KURLLabel* const kurl = static_cast<KURLLabel *>(mText[2]); - kurl->setText(_text); - kurl->setURL(_text); - if( _update ) { updateLayout(); } -} - - -void TDEAboutContributor::setWork( const TQString &_text, const TQString &_header, - bool _update ) -{ - mLabel[3]->setText(_header); - mText[3]->setText(_text); - if( _update ) { updateLayout(); } -} - - -TQString TDEAboutContributor::getName( void ) const -{ - return mText[0]->text(); -} - - -TQString TDEAboutContributor::getEmail( void ) const -{ - return mText[1]->text(); -} - - -TQString TDEAboutContributor::getURL( void ) const -{ - return mText[2]->text(); -} - - -TQString TDEAboutContributor::getWork( void ) const -{ - return mText[3]->text(); -} - - - -void TDEAboutContributor::updateLayout( void ) -{ - delete layout(); - - int row = 0; - if( !mText[0]->text().isEmpty() ) { ++row; } - if( !mText[1]->text().isEmpty() ) { ++row; } - if( !mText[2]->text().isEmpty() ) { ++row; } - if( !mText[3]->text().isEmpty() ) { ++row; } - - - TQGridLayout *gbox; - if( row == 0 ) - { - gbox = new TQGridLayout( this, 1, 1, 0 ); - for( int i=0; i<4; ++i ) - { - mLabel[i]->hide(); - mText[i]->hide(); - } - } - else - { - if( mText[0]->text().isEmpty() && !mShowHeader ) - { - gbox = new TQGridLayout( this, row, 1, frameWidth()+1, 2 ); - } - else - { - gbox = new TQGridLayout( this, row, 2, frameWidth()+1, 2 ); - if( !mShowHeader ) - { - gbox->addColSpacing( 0, KDialog::spacingHint()*2 ); - } - gbox->setColStretch( 1, 10 ); - } - - for( int i=0, r=0; i<4; ++i ) - { - mLabel[i]->setFixedHeight( fontMetrics().lineSpacing() ); - if( i != 3 ) - { - mText[i]->setFixedHeight( fontMetrics().lineSpacing() ); - } - - if( !mText[i]->text().isEmpty() ) - { - if( mShowHeader ) - { - gbox->addWidget( TQT_TQWIDGET(mLabel[i]), r, 0, (TQ_Alignment)AlignLeft ); - gbox->addWidget( TQT_TQWIDGET(mText[i]), r, 1, (TQ_Alignment)AlignLeft ); - mLabel[i]->show(); - mText[i]->show(); - } - else - { - mLabel[i]->hide(); - if( !i ) - { - gbox->addMultiCellWidget( TQT_TQWIDGET(mText[i]), r, r, 0, 1, (TQ_Alignment)AlignLeft ); - } - else - { - gbox->addWidget( TQT_TQWIDGET(mText[i]), r, 1, (TQ_Alignment)AlignLeft ); - } - mText[i]->show(); - } - ++r; - } - else - { - mLabel[i]->hide(); - mText[i]->hide(); - } - } - } - - gbox->activate(); - setMinimumSize( sizeHint() ); -} - - -void TDEAboutContributor::fontChange( const TQFont &/*oldFont*/ ) -{ - if( mShowBold ) - { - TQFont f( font() ); - f.setBold( true ); - mText[0]->setFont( f ); - } - update(); -} - - -TQSize TDEAboutContributor::sizeHint( void ) const -{ - return minimumSizeHint(); -} - - -void TDEAboutContributor::urlClickedSlot( const TQString &u ) -{ - emit openURL(u); -} - - -void TDEAboutContributor::emailClickedSlot( const TQString &e ) -{ - emit sendEmail( mText[0]->text(), e ) ; -} - - -// -// Internal widget for the TDEAboutDialog class. -// -TDEAboutContainerBase::TDEAboutContainerBase( int layoutType, TQWidget *_parent, - char *_name ) - : TQWidget( _parent, _name ), - mImageLabel(0), mTitleLabel(0), mIconLabel(0),mVersionLabel(0), - mAuthorLabel(0), mImageFrame(0),mPageTab(0),mPlainSpace(0),d(0) -{ - mTopLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); - if( !mTopLayout ) { return; } - - if( layoutType & AbtImageOnly ) - { - layoutType &= ~(AbtImageLeft|AbtImageRight|AbtTabbed|AbtPlain); - } - if( layoutType & AbtImageLeft ) - { - layoutType &= ~AbtImageRight; - } - - if( layoutType & AbtTitle ) - { - mTitleLabel = new TQLabel( this, "title" ); - mTitleLabel->setAlignment(AlignCenter); - mTopLayout->addWidget( mTitleLabel ); - mTopLayout->addSpacing( KDialog::spacingHint() ); - } - - if( layoutType & AbtProduct ) - { - TQWidget* const productArea = new TQWidget( this, "area" ); - mTopLayout->addWidget( productArea, 0, TQApplication::reverseLayout() ? AlignRight : AlignLeft ); - - TQHBoxLayout* const hbox = new TQHBoxLayout(productArea,0,KDialog::spacingHint()); - if( !hbox ) { return; } - - mIconLabel = new TQLabel( productArea ); - hbox->addWidget( mIconLabel, 0, AlignLeft|AlignHCenter ); - - TQVBoxLayout* const vbox = new TQVBoxLayout(); - if( !vbox ) { return; } - hbox->addLayout( vbox ); - - mVersionLabel = new TQLabel( productArea, "version" ); - mAuthorLabel = new TQLabel( productArea, "author" ); - vbox->addWidget( mVersionLabel ); - vbox->addWidget( mAuthorLabel ); - hbox->activate(); - - mTopLayout->addSpacing( KDialog::spacingHint() ); - } - - TQHBoxLayout* const hbox = new TQHBoxLayout(); - if( !hbox ) { return; } - mTopLayout->addLayout( hbox, 10 ); - - if( layoutType & AbtImageLeft ) - { - TQVBoxLayout* vbox = new TQVBoxLayout(); - hbox->addLayout(vbox); - vbox->addSpacing(1); - mImageFrame = new TQFrame( this ); - setImageFrame( true ); - vbox->addWidget( mImageFrame ); - vbox->addSpacing(1); - - vbox = new TQVBoxLayout( mImageFrame, 1 ); - mImageLabel = new KImageTrackLabel( mImageFrame ); - connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), - TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); - vbox->addStretch(10); - vbox->addWidget( mImageLabel ); - vbox->addStretch(10); - vbox->activate(); - } - - if( layoutType & AbtTabbed ) - { - mPageTab = new TDEAboutTabWidget( this ); - if( !mPageTab ) { return; } - hbox->addWidget( mPageTab, 10 ); - } - else if( layoutType & AbtImageOnly ) - { - mImageFrame = new TQFrame( this ); - setImageFrame( true ); - hbox->addWidget( mImageFrame, 10 ); - - TQGridLayout* const gbox = new TQGridLayout(mImageFrame, 3, 3, 1, 0 ); - gbox->setRowStretch( 0, 10 ); - gbox->setRowStretch( 2, 10 ); - gbox->setColStretch( 0, 10 ); - gbox->setColStretch( 2, 10 ); - - mImageLabel = new KImageTrackLabel( mImageFrame ); - connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), - TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); - gbox->addWidget( mImageLabel, 1, 1 ); - gbox->activate(); - } - else - { - mPlainSpace = new TQFrame( this ); - if( !mPlainSpace ) { return; } - hbox->addWidget( mPlainSpace, 10 ); - } - - if( layoutType & AbtImageRight ) - { - TQVBoxLayout *vbox = new TQVBoxLayout(); - hbox->addLayout(vbox); - vbox->addSpacing(1); - mImageFrame = new TQFrame( this ); - setImageFrame( true ); - vbox->addWidget( mImageFrame ); - vbox->addSpacing(1); - - vbox = new TQVBoxLayout( mImageFrame, 1 ); - mImageLabel = new KImageTrackLabel( mImageFrame ); - connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), - TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); - vbox->addStretch(10); - vbox->addWidget( mImageLabel ); - vbox->addStretch(10); - vbox->activate(); - } - - fontChange( font() ); -} - - -void TDEAboutContainerBase::show( void ) -{ - TQWidget::show(); -} - -TQSize TDEAboutContainerBase::sizeHint( void ) const -{ - return minimumSize().expandedTo( TQSize( TQWidget::sizeHint().width(), 0 ) ); -} - -void TDEAboutContainerBase::fontChange( const TQFont &/*oldFont*/ ) -{ - if( mTitleLabel ) - { - TQFont f( TDEGlobalSettings::generalFont() ); - f.setBold( true ); - int fs = f.pointSize(); - if (fs == -1) - fs = TQFontInfo(f).pointSize(); - f.setPointSize( fs+2 ); // Lets not make it too big - mTitleLabel->setFont(f); - } - - if( mVersionLabel ) - { - TQFont f( TDEGlobalSettings::generalFont() ); - f.setBold( true ); - mVersionLabel->setFont(f); - mAuthorLabel->setFont(f); - mVersionLabel->parentWidget()->layout()->activate(); - } - - update(); -} - -TQFrame *TDEAboutContainerBase::addTextPage( const TQString &title, - const TQString &text, - bool richText, int numLines ) -{ - TQFrame* const page = addEmptyPage( title ); - if( !page ) { return 0; } - if( numLines <= 0 ) { numLines = 10; } - - TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); - - if( richText ) - { - KTextBrowser* const browser = new KTextBrowser( page, "browser" ); - browser->setHScrollBarMode( TQScrollView::AlwaysOff ); - browser->setText( text ); - browser->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); - - vbox->addWidget(browser); - connect(browser, TQT_SIGNAL(urlClick(const TQString &)), - TQT_SLOT(slotUrlClick(const TQString &))); - connect(browser, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - TQT_SLOT(slotMailClick(const TQString &,const TQString &))); - } - else - { - KTextEdit* const textEdit = new KTextEdit( page, "text" ); - textEdit->setReadOnly( true ); - textEdit->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); - textEdit->setWordWrap( TQTextEdit::NoWrap ); - vbox->addWidget( textEdit ); - } - - return page; -} - -TQFrame *TDEAboutContainerBase::addLicensePage( const TQString &title, - const TQString &text, int numLines) -{ - TQFrame* const page = addEmptyPage( title ); - if( !page ) { return 0; } - if( numLines <= 0 ) { numLines = 10; } - - TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); - - KTextEdit* const textEdit = new KTextEdit( page, "license" ); - textEdit->setFont( TDEGlobalSettings::fixedFont() ); - textEdit->setReadOnly( true ); - textEdit->setWordWrap( TQTextEdit::NoWrap ); - textEdit->setText( text ); - textEdit->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); - vbox->addWidget( textEdit ); - return page; -} - - -TDEAboutContainer *TDEAboutContainerBase::addContainerPage( const TQString &title, - int childAlignment, - int innerAlignment ) -{ - if( !mPageTab ) - { - kdDebug(291) << "addPage: " << "Invalid layout" << endl; - return 0; - } - - TDEAboutContainer* const container = new TDEAboutContainer( mPageTab, "container", - KDialog::spacingHint(), KDialog::spacingHint(), childAlignment, - innerAlignment ); - mPageTab->addTab( container, title ); - - connect(container, TQT_SIGNAL(urlClick(const TQString &)), - TQT_SLOT(slotUrlClick(const TQString &))); - connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - TQT_SLOT(slotMailClick(const TQString &,const TQString &))); - - return container; -} - - -TDEAboutContainer *TDEAboutContainerBase::addScrolledContainerPage( - const TQString &title, - int childAlignment, - int innerAlignment ) -{ - if( !mPageTab ) - { - kdDebug(291) << "addPage: " << "Invalid layout" << endl; - return 0; - } - - TQFrame* const page = addEmptyPage( title ); - TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); - TQScrollView* const scrollView = new TQScrollView( page ); - scrollView->viewport()->setBackgroundMode( PaletteBackground ); - vbox->addWidget( scrollView ); - - TDEAboutContainer* const container = new TDEAboutContainer( scrollView, "container", - KDialog::spacingHint(), KDialog::spacingHint(), childAlignment, - innerAlignment ); - scrollView->addChild( container ); - - - connect(container, TQT_SIGNAL(urlClick(const TQString &)), - TQT_SLOT(slotUrlClick(const TQString &))); - connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - TQT_SLOT(slotMailClick(const TQString &,const TQString &))); - - return container; -} - - -TQFrame *TDEAboutContainerBase::addEmptyPage( const TQString &title ) -{ - if( !mPageTab ) - { - kdDebug(291) << "addPage: " << "Invalid layout" << endl; - return 0; - } - - TQFrame* const page = new TQFrame( mPageTab, title.latin1() ); - page->setFrameStyle( TQFrame::NoFrame ); - - mPageTab->addTab( page, title ); - return page; -} - - -TDEAboutContainer *TDEAboutContainerBase::addContainer( int childAlignment, - int innerAlignment ) -{ - TDEAboutContainer* const container = new TDEAboutContainer( this, "container", - 0, KDialog::spacingHint(), childAlignment, innerAlignment ); - mTopLayout->addWidget( container, 0, childAlignment ); - - connect(container, TQT_SIGNAL(urlClick(const TQString &)), - TQT_SLOT(slotUrlClick(const TQString &))); - connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - TQT_SLOT(slotMailClick(const TQString &,const TQString &))); - - return container; -} - - - -void TDEAboutContainerBase::setTitle( const TQString &title ) -{ - if( !mTitleLabel ) - { - kdDebug(291) << "setTitle: " << "Invalid layout" << endl; - return; - } - mTitleLabel->setText(title); -} - - -void TDEAboutContainerBase::setImage( const TQString &fileName ) -{ - if( !mImageLabel ) - { - kdDebug(291) << "setImage: " << "Invalid layout" << endl; - return; - } - if( fileName.isNull() ) - { - return; - } - - const TQPixmap logo( fileName ); - if( !logo.isNull() ) - mImageLabel->setPixmap( logo ); - - mImageFrame->layout()->activate(); -} - -void TDEAboutContainerBase::setProgramLogo( const TQString &fileName ) -{ - if( fileName.isNull() ) - { - return; - } - - const TQPixmap logo( fileName ); - setProgramLogo( logo ); -} - -void TDEAboutContainerBase::setProgramLogo( const TQPixmap &pixmap ) -{ - if( !mIconLabel ) - { - kdDebug(291) << "setProgramLogo: " << "Invalid layout" << endl; - return; - } - if( !pixmap.isNull() ) - { - mIconLabel->setPixmap( pixmap ); - } -} - -void TDEAboutContainerBase::setImageBackgroundColor( const TQColor &color ) -{ - if( mImageFrame ) - { - mImageFrame->setBackgroundColor( color ); - } -} - - -void TDEAboutContainerBase::setImageFrame( bool state ) -{ - if( mImageFrame ) - { - if( state ) - { - mImageFrame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); - mImageFrame->setLineWidth(1); - } - else - { - mImageFrame->setFrameStyle( TQFrame::NoFrame ); - mImageFrame->setLineWidth(0); - } - } -} - - -void TDEAboutContainerBase::setProduct( const TQString &appName, - const TQString &version, - const TQString &author, - const TQString &year ) -{ - if( !mIconLabel ) - { - kdDebug(291) << "setProduct: " << "Invalid layout" << endl; - return; - } - - if ( kapp ) - { - mIconLabel->setPixmap( kapp->icon() ); - kdDebug(291) << "setPixmap (iconName): " << kapp->iconName() << endl; - } - else - kdDebug(291) << "no kapp" << endl; - - const TQString msg1 = i18n("%1 %2 (Using Trinity %3)").arg(appName).arg(version). - arg(TQString::fromLatin1(TDE_VERSION_STRING)); - const TQString msg2 = !year.isEmpty() ? i18n("%1 %2, %3").arg('©').arg(year). - arg(author) : TQString::fromLatin1(""); - - //if (!year.isEmpty()) - // msg2 = i18n("%1 %2, %3").arg('©').arg(year).arg(author); - - mVersionLabel->setText( msg1 ); - mAuthorLabel->setText( msg2 ); - if( msg2.isEmpty() ) - { - mAuthorLabel->hide(); - } - - mIconLabel->parentWidget()->layout()->activate(); -} - - -void TDEAboutContainerBase::slotMouseTrack( int mode, const TQMouseEvent *e ) -{ - emit mouseTrack( mode, e ); -} - - -void TDEAboutContainerBase::slotUrlClick( const TQString &url ) -{ - emit urlClick( url ); -} - -void TDEAboutContainerBase::slotMailClick( const TQString &_name, - const TQString &_address ) -{ - emit mailClick( _name, _address ); -} - - - -TDEAboutContainer::TDEAboutContainer( TQWidget *_parent, const char *_name, - int _margin, int _spacing, - int childAlignment, int innerAlignment ) - : TQFrame( _parent, _name ), d(0) -{ - mAlignment = innerAlignment; - - TQGridLayout* const gbox = new TQGridLayout( this, 3, 3, _margin, _spacing ); - if( childAlignment & AlignHCenter ) - { - gbox->setColStretch( 0, 10 ); - gbox->setColStretch( 2, 10 ); - } - else if( childAlignment & AlignRight ) - { - gbox->setColStretch( 0, 10 ); - } - else - { - gbox->setColStretch( 2, 10 ); - } - - if( childAlignment & AlignVCenter ) - { - gbox->setRowStretch( 0, 10 ); - gbox->setRowStretch( 2, 10 ); - } - else if( childAlignment & AlignRight ) - { - gbox->setRowStretch( 0, 10 ); - } - else - { - gbox->setRowStretch( 2, 10 ); - } - - mVbox = new TQVBoxLayout( _spacing ); - gbox->addLayout( mVbox, 1, 1 ); - gbox->activate(); -} - - -void TDEAboutContainer::childEvent( TQChildEvent *e ) -{ - if( !e->inserted() || !e->child()->isWidgetType() ) - { - return; - } - - TQWidget* const w = static_cast<TQWidget *>(e->child()); - mVbox->addWidget( w, 0, mAlignment ); - const TQSize s( sizeHint() ); - setMinimumSize( s ); - - TQObjectList const l = childrenListObject(); // silence please - TQObjectListIterator itr( l ); - TQObject * o; - while ( (o = itr.current()) ) { - ++itr; - if( o->isWidgetType() ) - { - TQT_TQWIDGET(o)->setMinimumWidth( s.width() ); - } - } -} - - -TQSize TDEAboutContainer::sizeHint( void ) const -{ - // - // The size is computed by adding the sizeHint().height() of all - // widget children and taking the width of the widest child and adding - // layout()->margin() and layout()->spacing() - // - - TQSize total_size; - - int numChild = 0; - TQObjectList const l = childrenListObject(); // silence please - - TQObjectListIterator itr( l ); - TQObject * o; - while ( (o = itr.current()) ) { - ++itr; - if( o->isWidgetType() ) - { - ++numChild; - TQWidget* const w= TQT_TQWIDGET(o); - - TQSize s = w->minimumSize(); - if( s.isEmpty() ) - { - s = w->minimumSizeHint(); - if( s.isEmpty() ) - { - s = w->sizeHint(); - if( s.isEmpty() ) - { - s = TQSize( 100, 100 ); // Default size - } - } - } - total_size.setHeight( total_size.height() + s.height() ); - if( s.width() > total_size.width() ) { total_size.setWidth( s.width() ); } - } - } - - if( numChild > 0 ) - { - // - // Seems I have to add 1 to the height to properly show the border - // of the last entry if layout()->margin() is 0 - // - - total_size.setHeight( total_size.height() + layout()->spacing()*(numChild-1) ); - total_size += TQSize( layout()->margin()*2, layout()->margin()*2 + 1 ); - } - else - { - total_size = TQSize( 1, 1 ); - } - return total_size; -} - - -TQSize TDEAboutContainer::minimumSizeHint( void ) const -{ - return sizeHint(); -} - - -void TDEAboutContainer::addWidget( TQWidget *widget ) -{ - widget->reparent( this, 0, TQPoint(0,0) ); -} - - -void TDEAboutContainer::addPerson( const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_task, - bool showHeader, bool showFrame,bool showBold) -{ - - TDEAboutContributor* const cont = new TDEAboutContributor( this, "pers", - _name, _email, _url, _task, showHeader, showFrame, showBold ); - connect( cont, TQT_SIGNAL( openURL(const TQString&)), - this, TQT_SIGNAL( urlClick(const TQString &))); - connect( cont, TQT_SIGNAL( sendEmail(const TQString &, const TQString &)), - this, TQT_SIGNAL( mailClick(const TQString &, const TQString &))); -} - - -void TDEAboutContainer::addTitle( const TQString &title, int alignment, - bool showFrame, bool showBold ) -{ - - TQLabel* const label = new TQLabel( title, this, "title" ); - if( showBold ) - { - TQFont labelFont( font() ); - labelFont.setBold( true ); - label->setFont( labelFont ); - } - if( showFrame ) - { - label->setFrameStyle(TQFrame::Panel | TQFrame::Raised); - } - label->setAlignment( alignment ); -} - - -void TDEAboutContainer::addImage( const TQString &fileName, int alignment ) -{ - if( fileName.isNull() ) - { - return; - } - - KImageTrackLabel* const label = new KImageTrackLabel( this, "image" ); - const TQImage logo( fileName ); - if( !logo.isNull() ) - { - TQPixmap pix; - pix = logo; - label->setPixmap( pix ); - } - label->setAlignment( alignment ); -} - -#if 0 -//MOC_SKIP_BEGIN - -/** Every person displayed is stored in a TDEAboutContributor object. - * Every contributor, the author and/or the maintainer of the application are - * stored in objects of this local class. Every single field may be empty. - * To add a contributor, create a TDEAboutContributor object as a child of your - * @ref TDEAboutDialog, set its contents and add it using add addContributor. */ -class TDEAboutContributor : public QFrame -{ - // ############################################################################ - Q_OBJECT - // ---------------------------------------------------------------------------- -public: - /** The Qt constructor. */ - TDEAboutContributor(TQWidget* parent=0, const char* name=0); - /** Set the name (a literal string). */ - void setName(const TQString&); - /** Get the name. */ - TQString getName(); - /** The email address (dito). */ - void setEmail(const TQString&); - /** Get the email address. */ - TQString getEmail(); - /** The URL (dito). */ - void setURL(const TQString&); - /** Get the URL. */ - TQString getURL(); - /** The tasks the person worked on (a literal string). More than one line is - * possible, but very long texts might look ugly. */ - void setWork(const TQString&); - /** The size hint. Very important here, since TDEAboutWidget relies on it for - * geometry management. */ - TQSize sizeHint(); - TQSize minimumSizeHint(void); - virtual void show( void ); - - // ---------------------------------------------------------------------------- -protected: - // events: - /** The resize event. */ - void resizeEvent(TQResizeEvent*); - /** The paint event. */ - void paintEvent(TQPaintEvent*); - /** The label showing the program version. */ - TQLabel *name; - /** The clickable URL label showing the email address. It is only visible if - * its text is not empty. */ - KURLLabel *email; - /** Another interactive part that displays the homepage URL. */ - KURLLabel *url; - /** The description of the contributions of the person. */ - TQString work; - // ---------------------------------------------------------------------------- -protected slots: - /** The homepage URL has been clicked. */ - void urlClickedSlot(const TQString&); - /** The email address has been clicked. */ - void emailClickedSlot(const TQString& emailaddress); - // ---------------------------------------------------------------------------- -signals: - /** The email address has been clicked. */ - void sendEmail(const TQString& name, const TQString& email); - /** The URL has been clicked. */ - void openURL(const TQString& url); - // ############################################################################ -}; - - - -TDEAboutContributor::TDEAboutContributor(TQWidget* parent, const char* n) - : TQFrame(parent, n), - name(new TQLabel(this)), - email(new KURLLabel(this)), - url(new KURLLabel(this)) -{ - // ############################################################ - if(name==0 || email==0) - { // this will nearly never happen (out of memory in about box?) - kdDebug() << "TDEAboutContributor::TDEAboutContributor: Out of memory." << endl; - tqApp->quit(); - } - setFrameStyle(TQFrame::Panel | TQFrame::Raised); - // ----- - connect(email, TQT_SIGNAL(leftClickedURL(const TQString&)), - TQT_SLOT(emailClickedSlot(const TQString&))); - connect(url, TQT_SIGNAL(leftClickedURL(const TQString&)), - TQT_SLOT(urlClickedSlot(const TQString&))); - // ############################################################ -} - -void -TDEAboutContributor::setName(const TQString& n) -{ - // ############################################################ - name->setText(n); - // ############################################################ -} - -QString -TDEAboutContributor::getName() -{ - // ########################################################### - return name->text(); - // ########################################################### -} -void -TDEAboutContributor::setURL(const TQString& u) -{ - // ########################################################### - url->setText(u); - // ########################################################### -} - -QString -TDEAboutContributor::getURL() -{ - // ########################################################### - return url->text(); - // ########################################################### -} - -void -TDEAboutContributor::setEmail(const TQString& e) -{ - // ########################################################### - email->setText(e); - // ########################################################### -} - -QString -TDEAboutContributor::getEmail() -{ - // ########################################################### - return email->text(); - // ########################################################### -} - -void -TDEAboutContributor::emailClickedSlot(const TQString& e) -{ - // ########################################################### - kdDebug() << "TDEAboutContributor::emailClickedSlot: called." << endl; - emit(sendEmail(name->text(), e)); - // ########################################################### -} - -void -TDEAboutContributor::urlClickedSlot(const TQString& u) -{ - // ########################################################### - kdDebug() << "TDEAboutContributor::urlClickedSlot: called." << endl; - emit(openURL(u)); - // ########################################################### -} - -void -TDEAboutContributor::setWork(const TQString& w) -{ - // ########################################################### - work=w; - // ########################################################### -} - -#endif - - -#if 0 -QSize -TDEAboutContributor::sizeHint() -{ - // ############################################################################ - const int FrameWidth=frameWidth(); - const int WorkTextWidth=200; - int maxx, maxy; - TQRect rect; - // ----- first calculate name and email width: - maxx=name->sizeHint().width(); - maxx=QMAX(maxx, email->sizeHint().width()+WORKTEXT_IDENTATION); - // ----- now determine "work" text rectangle: - if(!work.isEmpty()) // save time - { - rect=fontMetrics().boundingRect - (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); - } - if(maxx<rect.width()) - { - maxx=WorkTextWidth+WORKTEXT_IDENTATION; - } - maxx=QMAX(maxx, url->sizeHint().width()+WORKTEXT_IDENTATION); - // ----- - maxy=2*(name->sizeHint().height()+Grid); // need a space above the KURLLabels - maxy+=/* email */ name->sizeHint().height(); - maxy+=rect.height(); - // ----- - maxx+=2*FrameWidth; - maxy+=2*FrameWidth; - return TQSize(maxx, maxy); - // ############################################################################ -} - -TQSize TDEAboutContributor::minimumSizeHint(void) -{ - return( sizeHint() ); -} - - -void TDEAboutContributor::show( void ) -{ - TQFrame::show(); - setMinimumSize( sizeHint() ); -} - - - -void -TDEAboutContributor::resizeEvent(TQResizeEvent*) -{ // the widgets are simply aligned from top to bottom, since the parent is - // expected to respect the size hint - // ############################################################################ - int framewidth=frameWidth(), childwidth=width()-2*framewidth; - int cy=framewidth; - // ----- - name->setGeometry - (framewidth, framewidth, childwidth, name->sizeHint().height()); - cy=name->height()+Grid; - email->setGeometry - (framewidth+WORKTEXT_IDENTATION, cy, - childwidth-WORKTEXT_IDENTATION, /* email */ name->sizeHint().height()); - cy+=name->height()+Grid; - url->setGeometry - (framewidth+WORKTEXT_IDENTATION, cy, - childwidth-WORKTEXT_IDENTATION, /* url */ name->sizeHint().height()); - // the work text is drawn in the paint event - // ############################################################################ -} - - -void -TDEAboutContributor::paintEvent(TQPaintEvent* e) -{ // the widgets are simply aligned from top to bottom, since the parent is - // expected to respect the size hint (the widget is only used locally by now) - // ############################################################################ - int cy=frameWidth()+name->height()+email->height()+Grid+url->height()+Grid; - int h=height()-cy-frameWidth(); - int w=width()-WORKTEXT_IDENTATION-2*frameWidth(); - // ----- - TQFrame::paintEvent(e); - if(work.isEmpty()) return; - TQPainter paint(this); // construct painter only if there is something to draw - // ----- - paint.drawText(WORKTEXT_IDENTATION, cy, w, h, AlignLeft | WordBreak, work); - // ############################################################################ -} -// MOC_SKIP_END -#endif - - -#if 0 -TQSize TDEAboutContributor::sizeHint( void ) -{ - int s = KDialog::spacingHint(); - int h = fontMetrics().lineSpacing()*3 + 2*s; - int m = frameWidth(); - - int w = name->sizeHint().width(); - w = QMAX( w, email->sizeHint().width()+s); - w = QMAX( w, url->sizeHint().width()+s); - - if( work.isEmpty() == false ) - { - const int WorkTextWidth=200; - TQRect r = fontMetrics().boundingRect - (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); - if( w < r.width() ) - { - w = QMAX( w, WorkTextWidth+s ); - } - h += QMAX( fontMetrics().lineSpacing(), r.height() ) + s; - } - return( TQSize( w + 2*m, h + 2*m ) ); - - - /* - int s = 3; - int m = frameWidth() + KDialog::spacingHint(); - int h = ls * 3 + s * 2; - int w = name->sizeHint().width(); - - w = QMAX( w, email->sizeHint().width()+WORKTEXT_IDENTATION); - w = QMAX( w, url->sizeHint().width()+WORKTEXT_IDENTATION); - if( work.isEmpty() == false ) - { - const int WorkTextWidth=200; - - TQRect r = fontMetrics().boundingRect - (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); - if( w < r.width() ) - { - w = QMAX( w, WorkTextWidth + WORKTEXT_IDENTATION ); - } - h += r.height() + s; - } - return( TQSize( w + 2*m, h + 2*m ) ); - */ -} - - -// -// The widgets are simply aligned from top to bottom, since the parent is -// expected to respect the size hint -// -void TDEAboutContributor::resizeEvent(TQResizeEvent*) -{ - int x = frameWidth(); - int s = KDialog::spacingHint(); - int h = fontMetrics().lineSpacing(); - int w = width() - 2*x; - int y = x; - - name->setGeometry( x, y, w, h ); - y += h + s; - email->setGeometry( x+s, y, w-s, h ); - y += h + s; - url->setGeometry( x+s, y, w-s, h ); - - /* - int x = frameWidth() + KDialog::spacingHint(); - int y = x; - int w = width() - 2*x; - int h = name->sizeHint().height(); - int s = 3; - - name->setGeometry( x, y, w, h ); - y += h + s; - email->setGeometry( x+WORKTEXT_IDENTATION, y, w-WORKTEXT_IDENTATION, h ); - y += h + s; - url->setGeometry( x+WORKTEXT_IDENTATION, y, w-WORKTEXT_IDENTATION, h ); - // - // the work text is drawn in the paint event - // - */ -} - - - -void TDEAboutContributor::paintEvent( TQPaintEvent *e ) -{ - TQFrame::paintEvent(e); - if(work.isEmpty()) return; - - int x = frameWidth() + KDialog::spacingHint(); - int h = fontMetrics().lineSpacing(); - int y = height() - frameWidth() - fontMetrics().lineSpacing(); - int w = width() - frameWidth()*2 - KDialog::spacingHint(); - - TQPainter paint( this ); - paint.drawText( x, y, w, h, AlignLeft | WordBreak, work ); - - /* - - int s = 3; - int x = frameWidth() + KDialog::spacingHint() + WORKTEXT_IDENTATION; - int w = width()-WORKTEXT_IDENTATION-2*(frameWidth()+KDialog::spacingHint()); - int y = frameWidth()+KDialog::spacingHint()+(name->sizeHint().height()+s)*3; - int h = height()-y-frameWidth(); - - TQPainter paint( this ); - paint.drawText( x, y, w, h, AlignLeft | WordBreak, work ); - */ -} -#endif - - - - - - -TDEAboutWidget::TDEAboutWidget(TQWidget *_parent, const char *_name) - : TQWidget(_parent, _name), - version(new TQLabel(this)), - cont(new TQLabel(this)), - logo(new TQLabel(this)), - author(new TDEAboutContributor(this)), - maintainer(new TDEAboutContributor(this)), - showMaintainer(false), - d(0) -{ - // ################################################################# - if( !version || !cont || !logo || !author || !maintainer ) - { - // this will nearly never happen (out of memory in about box?) - kdDebug() << "TDEAboutWidget::TDEAboutWidget: Out of memory." << endl; - tqApp->quit(); - } - // ----- - cont->setText(i18n("Other Contributors:")); - logo->setText(i18n("(No logo available)")); - logo->setFrameStyle(TQFrame::Panel | TQFrame::Raised); - version->setAlignment(AlignCenter); - // ----- - connect(author, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), - TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); - connect(author, TQT_SIGNAL(openURL(const TQString&)), - TQT_SLOT(openURLSlot(const TQString&))); - connect(maintainer, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), - TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); - connect(maintainer, TQT_SIGNAL(openURL(const TQString&)), - TQT_SLOT(openURLSlot(const TQString&))); - // ################################################################# -} - - -void -TDEAboutWidget::adjust() -{ - // ################################################################# - int cx, cy, tempx; - int maintWidth, maintHeight; - TQSize total_size; - // ----- - if(showMaintainer) - { - total_size=maintainer->sizeHint(); - maintWidth=total_size.width(); - maintHeight=total_size.height(); - } else { - maintWidth=0; - maintHeight=0; - } - total_size=author->sizeHint(); - logo->adjustSize(); - cy=version->sizeHint().height()+Grid; - cx=logo->width(); - tempx=QMAX(total_size.width(), maintWidth); - cx+=Grid+tempx; - cx=QMAX(cx, version->sizeHint().width()); - cy+=QMAX(logo->height(), - total_size.height()+(showMaintainer ? Grid+maintHeight : 0)); - // ----- - if(!contributors.isEmpty()) - { - cx=QMAX(cx, cont->sizeHint().width()); - cy+=cont->sizeHint().height()+Grid; - TQPtrListIterator<TDEAboutContributor> _pos(contributors); - TDEAboutContributor* currEntry; - while ( (currEntry = _pos.current()) ) - { - ++_pos; - cy+=currEntry->sizeHint().height(); - } - } - // ----- - setMinimumSize(cx, cy); - // ################################################################# -} - -void -TDEAboutWidget::setLogo(const TQPixmap& i) -{ - // ############################################################################ - logo->setPixmap(i); - // ############################################################################ -} - -void TDEAboutWidget::sendEmailSlot(const TQString &_name, const TQString &_email) -{ - emit(sendEmail(_name, _email)); -} - -void TDEAboutWidget::openURLSlot(const TQString& _url) -{ - emit(openURL(_url)); -} - -void -TDEAboutWidget::setAuthor(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ############################################################################ - author->setName(_name); - author->setEmail(_email); - author->setURL(_url); - author->setWork(_w); - // ############################################################################ -} - -void -TDEAboutWidget::setMaintainer(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ############################################################################ - maintainer->setName(_name); - maintainer->setEmail(_email); - maintainer->setWork(_w); - maintainer->setURL(_url); - showMaintainer=true; - // ############################################################################ -} - -void -TDEAboutWidget::addContributor(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ############################################################################ - TDEAboutContributor* const c=new TDEAboutContributor(this); - // ----- - c->setName(_name); - c->setEmail(_email); - c->setURL(_url); - c->setWork(_w); - contributors.append(c); - connect(c, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), - TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); - connect(c, TQT_SIGNAL(openURL(const TQString&)), TQT_SLOT(openURLSlot(const TQString&))); - // ############################################################################ -} - -void -TDEAboutWidget::setVersion(const TQString &_name) -{ - // ############################################################################ - version->setText(_name); - // ############################################################################ -} - -void -TDEAboutWidget::resizeEvent(TQResizeEvent*) -{ - // ############################################################################ - int _x=0, _y, cx, tempx, tempy; - // ----- set version label geometry: - version->setGeometry(0, 0, width(), version->sizeHint().height()); - _y=version->height()+Grid; - // ----- move logo to correct position: - logo->adjustSize(); - logo->move(0, _y); - // ----- move author and maintainer right to it: - tempx=logo->width()+Grid; - cx=width()-tempx; - author->setGeometry - (tempx, _y, cx, author->sizeHint().height()); - maintainer->setGeometry - (tempx, _y+author->height()+Grid, cx, maintainer->sizeHint().height()); - - _y+=QMAX(logo->height(), - author->height()+(showMaintainer ? Grid+maintainer->height() : 0)); - // ----- - if(!contributors.isEmpty()) - { - tempy=cont->sizeHint().height(); - cont->setGeometry(0, _y, width(), tempy); - cont->show(); - _y+=tempy+Grid; - } else { - cont->hide(); - } - TQPtrListIterator<TDEAboutContributor> _pos(contributors); - TDEAboutContributor* currEntry; - while( (currEntry = _pos.current()) ) - { - ++_pos; - tempy=currEntry->sizeHint().height(); - // y+=Grid; - currEntry->setGeometry(_x, _y, width(), tempy); - _y+=tempy; - } - if(showMaintainer) - { - maintainer->show(); - } else { - maintainer->hide(); - } - // ############################################################################ -} - -TDEAboutDialog::TDEAboutDialog(TQWidget *_parent, const char *_name, bool modal) - : KDialogBase(_parent, _name, modal, TQString::null, Ok, Ok ), - about(new TDEAboutWidget(this)), mContainerBase(0), d(0) -{ - // ################################################################# - if(!about) - { - // this will nearly never happen (out of memory in about box?) - kdDebug() << "TDEAboutDialog::TDEAboutDialog: Out of memory." << endl; - tqApp->quit(); - } - setMainWidget(about); - connect(about, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), - TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); - connect(about, TQT_SIGNAL(openURL(const TQString&)), - TQT_SLOT(openURLSlot(const TQString&))); - // ################################################################# -} - - -TDEAboutDialog::TDEAboutDialog( int layoutType, const TQString &_caption, - int buttonMask, ButtonCode defaultButton, - TQWidget *_parent, const char *_name, bool modal, - bool separator, const TQString &user1, - const TQString &user2, const TQString &user3 ) - :KDialogBase( _parent, _name, modal, TQString::null, buttonMask, defaultButton, - separator, user1, user2, user3 ), - about(0), d(0) -{ - setPlainCaption( i18n("About %1").arg(_caption) ); - - mContainerBase = new TDEAboutContainerBase( layoutType, this ); - setMainWidget(mContainerBase); - - connect( mContainerBase, TQT_SIGNAL(urlClick(const TQString &)), - this, TQT_SLOT(openURLSlot(const TQString &))); - connect( mContainerBase, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), - this, TQT_SLOT(sendEmailSlot(const TQString &,const TQString &))); - connect( mContainerBase, TQT_SIGNAL(mouseTrack(int, const TQMouseEvent *)), - this, TQT_SLOT(mouseTrackSlot(int, const TQMouseEvent *))); -} - - -void TDEAboutDialog::show( void ) -{ - adjust(); - if( mContainerBase ) { mContainerBase->show(); } - TQDialog::show(); -} - - -void TDEAboutDialog::show( TQWidget * /*centerParent*/ ) -{ - adjust(); - if( mContainerBase ) { mContainerBase->show(); } - TQDialog::show(); -} - - -void TDEAboutDialog::adjust() -{ - if( !about ) { return; } - about->adjust(); - //initializeGeometry(); - resize( sizeHint() ); -} - - -void TDEAboutDialog::setLogo(const TQPixmap& i) -{ - if( !about ) { return; } - about->setLogo(i); -} - - -void TDEAboutDialog::setMaintainer(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ################################################################# - if( !about ) { return; } - about->setMaintainer(_name, _email, _url, _w); - // ################################################################# -} - -void TDEAboutDialog::setAuthor(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_work) -{ - // ################################################################# - if( !about ) { return; } - about->setAuthor(_name, _email, _url, _work); - // ################################################################# -} - -void TDEAboutDialog::addContributor(const TQString &_name, const TQString &_email, - const TQString &_url, const TQString &_w) -{ - // ################################################################# - if( !about ) { return; } - about->addContributor(_name, _email, _url, _w); - // ################################################################# -} - -void TDEAboutDialog::setVersion(const TQString &_name) -{ - // ################################################################# - if( !about ) { return; } - about->setVersion(_name); - // ################################################################# -} - -void TDEAboutDialog::sendEmailSlot(const TQString& /*name*/, const TQString& email) -{ - if ( kapp ) - kapp->invokeMailer( email, TQString::null ); - /* - kdDebug() << "TDEAboutDialog::sendEmailSlot: request to send an email to " - << name << ", " << email << endl; - emit(sendEmail(name, email)); - */ -} - -void TDEAboutDialog::openURLSlot(const TQString& url) -{ - if ( kapp ) - kapp->invokeBrowser( url ); - //kdDebug() << "TDEAboutDialog::openURLSlot: request to open URL " << url << endl; - //emit(openURL(url)); -} - - -void TDEAboutDialog::mouseTrackSlot( int /*mode*/, const TQMouseEvent * /*e*/ ) -{ - // By default we do nothing. This method must be reimplemented. -} - - -TQFrame *TDEAboutDialog::addTextPage( const TQString &title, const TQString &text, - bool richText, int numLines ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addTextPage( title, text, richText, numLines ); -} - -TQFrame *TDEAboutDialog::addLicensePage( const TQString &title, const TQString &text, - int numLines ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addLicensePage( title, text, numLines ); -} - - -TDEAboutContainer *TDEAboutDialog::addContainerPage( const TQString &title, - int childAlignment, int innerAlignment ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addContainerPage( title, childAlignment, - innerAlignment); -} - - -TDEAboutContainer *TDEAboutDialog::addScrolledContainerPage( const TQString &title, - int childAlignment, int innerAlignment ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addScrolledContainerPage( title, childAlignment, - innerAlignment); -} - - - -TQFrame *TDEAboutDialog::addPage( const TQString &title ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addEmptyPage( title ); -} - - -TDEAboutContainer *TDEAboutDialog::addContainer( int childAlignment, - int innerAlignment ) -{ - if( !mContainerBase ) { return 0; } - return mContainerBase->addContainer( childAlignment, innerAlignment ); -} - - -void TDEAboutDialog::setTitle( const TQString &title ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setTitle( title ); -} - - -void TDEAboutDialog::setImage( const TQString &fileName ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setImage( fileName ); -} - -// KDE4: remove -void TDEAboutDialog::setIcon( const TQString &fileName ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setProgramLogo( fileName ); -} - -void TDEAboutDialog::setProgramLogo( const TQString &fileName ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setProgramLogo( fileName ); -} - -void TDEAboutDialog::setProgramLogo( const TQPixmap &pixmap ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setProgramLogo( pixmap ); -} - -void TDEAboutDialog::setImageBackgroundColor( const TQColor &color ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setImageBackgroundColor( color ); -} - - -void TDEAboutDialog::setImageFrame( bool state ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setImageFrame( state ); -} - - -void TDEAboutDialog::setProduct( const TQString &appName, const TQString &version, - const TQString &author, const TQString &year ) -{ - if( !mContainerBase ) { return; } - mContainerBase->setProduct( appName, version, author, year ); -} - - - -void TDEAboutDialog::imageURL( TQWidget *_parent, const TQString &_caption, - const TQString &_path, const TQColor &_imageColor, - const TQString &_url ) -{ - TDEAboutDialog a( AbtImageOnly, TQString::null, Close, Close, _parent, "image", true ); - a.setPlainCaption( _caption ); - a.setImage( _path ); - a.setImageBackgroundColor( _imageColor ); - - TDEAboutContainer* const c = a.addContainer( AlignCenter, AlignCenter ); - if( c ) - { - c->addPerson( TQString::null, TQString::null, _url, TQString::null ); - } - a.exec(); -} - - - - -// -// A class that can can monitor mouse movements on the image -// -KImageTrackLabel::KImageTrackLabel( TQWidget *_parent, const char *_name, WFlags f ) - : TQLabel( _parent, _name, f ) -{ - setText( i18n("Image missing")); -} - -void KImageTrackLabel::mousePressEvent( TQMouseEvent *e ) -{ - emit mouseTrack( MousePress, e ); -} - -void KImageTrackLabel::mouseReleaseEvent( TQMouseEvent *e ) -{ - emit mouseTrack( MouseRelease, e ); -} - -void KImageTrackLabel::mouseDoubleClickEvent( TQMouseEvent *e ) -{ - emit mouseTrack( MouseDoubleClick, e ); -} - -void KImageTrackLabel::mouseMoveEvent ( TQMouseEvent *e ) -{ - emit mouseTrack( MouseDoubleClick, e ); -} - -void TDEAboutDialog::virtual_hook( int id, void* data ) -{ KDialogBase::virtual_hook( id, data ); } - diff --git a/tdeui/kaboutdialog.h b/tdeui/kaboutdialog.h deleted file mode 100644 index fbb19b98e..000000000 --- a/tdeui/kaboutdialog.h +++ /dev/null @@ -1,633 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 1999-2001 Mirko Boehm (mirko@kde.org) and - * Espen Sand (espen@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. - * - */ - -/* - * This file declares a class for creating "About ..." dialogs - * in a general way. It provides geometry management and some - * options to connect for, like emailing the author or maintainer. - */ - - -#ifndef _KABOUTDIALOG_H_ -#define _KABOUTDIALOG_H_ - -#include <kdialogbase.h> -#include <tqstring.h> - -class TQFrame; -class TQLabel; -class TQVBoxLayout; -class TQTabWidget; -class KURLLabel; -class TDEAboutContainer; -class TDEAboutContainerBase; - -class TDEAboutWidgetPrivate; - -class TDEAboutContainerPrivate; -/** - * TDEAboutContainer can be used to make a application specific AboutDialog. - */ -class TDEUI_EXPORT TDEAboutContainer : public TQFrame -{ - Q_OBJECT - - public: - TDEAboutContainer( TQWidget *parent=0, const char *name=0, - int margin=0, int spacing=0, - int childAlignment = AlignCenter, - int innerAlignment = AlignCenter ); - - void addWidget( TQWidget *widget ); - void addPerson( const TQString &name, const TQString &email, - const TQString &url, const TQString &task, - bool showHeader = false, bool showframe = false, - bool showBold = false ); - void addTitle( const TQString &title, int alignment=AlignLeft, - bool showframe = false, bool showBold = false ); - void addImage( const TQString &fileName, int alignment=AlignLeft ); - - virtual TQSize sizeHint( void ) const; - virtual TQSize minimumSizeHint( void ) const; - - protected: - virtual void childEvent( TQChildEvent *e ); - - signals: - void urlClick( const TQString &url ); - void mailClick( const TQString &name, const TQString &address ); - - - private: - TQVBoxLayout *mVbox; - int mAlignment; - TDEAboutContainerPrivate* const d; -}; - -class TDEAboutContributorPrivate; - -/** - * Used internally by TDEAboutWidget - * @internal - */ -class TDEUI_EXPORT TDEAboutContributor : public TQFrame -{ - Q_OBJECT - - public: - TDEAboutContributor( TQWidget *parent=0, const char *name=0, - const TQString &username=TQString::null, - const TQString &email=TQString::null, - const TQString &url=TQString::null, - const TQString &work=TQString::null, - bool showHeader=false, bool showFrame=true, - bool showBold=false ); - - void setName( const TQString &text, const TQString &header=TQString::null, - bool update = true ); - void setEmail( const TQString &text, const TQString &header=TQString::null, - bool update = true ); - void setURL( const TQString &text, const TQString &header=TQString::null, - bool update = true ); - void setWork( const TQString &text, const TQString &header=TQString::null, - bool update = true ); - TQString getName( void ) const; - TQString getEmail( void ) const; - TQString getURL( void ) const; - TQString getWork( void ) const; - - virtual TQSize sizeHint( void ) const; - - protected: - virtual void fontChange( const TQFont &oldFont ); - - protected slots: - void urlClickedSlot( const TQString& ); - void emailClickedSlot( const TQString& emailaddress ); - - private: - void updateLayout( void ); - - signals: - void sendEmail(const TQString& name, const TQString& email); - void openURL(const TQString& url); - - private: - TQLabel *mLabel[4]; - TQLabel *mText[4]; - bool mShowHeader; - bool mShowBold; - - TDEAboutContributorPrivate* const d; - - virtual void setName(const char *_name) { TQFrame::setName(_name); } -}; - -/** - * TDEAboutWidget is the main widget for TDEAboutDialog. - * - * It has a minimum size set. - */ -class TDEUI_EXPORT TDEAboutWidget : public TQWidget -{ - Q_OBJECT - -public: - - /** - * The Qt constructor. - */ - TDEAboutWidget(TQWidget* parent=0, const char* name=0 ); - - /** - * Adjust the minimum size (after setting the properties of the image and - * the labels. - */ - void adjust(); - - /** - * Sets the image as the application logo. - */ - void setLogo(const TQPixmap&); - /** - * Sets the author's name and email address. - */ - void setAuthor(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - /** - * Sets the maintainers name and email address. - */ - void setMaintainer(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - /** - * Shows this person as one of the major contributors. - */ - void addContributor(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - /** - * Sets the text describing the version. - */ - void setVersion(const TQString& name); - // ------------------------------------------------------------------------- -protected slots: - /** - * Catches the signals from the contributors elements. - */ - void sendEmailSlot(const TQString& name, const TQString& email); - /** - * Catches the clicked URLs. - */ - void openURLSlot(const TQString& url); - // ------------------------------------------------------------------------- -signals: - /** - * An email address has been selected by the user. - */ - void sendEmail(const TQString& name, const TQString& email); - /** - * An URL has been clicked. - */ - void openURL(const TQString& url); - // ------------------------------------------------------------------------- -protected: - // events: - /** - * The resize event. - */ - void resizeEvent(TQResizeEvent*); - /** - * The label showing the program version. - */ - TQLabel *version; - /** - * The label showing the text "Other contributors:". - */ - TQLabel *cont; - /** - * The frame showing the logo. - */ - TQLabel *logo; - /** - * The application developer. - */ - TDEAboutContributor *author; - /** - * The application maintainer. - */ - TDEAboutContributor *maintainer; - /** - * Show the maintainer? - */ - bool showMaintainer; - /** - * A set of people who contributed to the application. - */ - TQPtrList<TDEAboutContributor> contributors; - // ######################################################################### - // -private: - TDEAboutWidgetPrivate* const d; -}; - -class TDEAboutDialogPrivate; -/** - * A KDialogBase with predefined main widget. - * - * As a KDialogBase it uses your application wide settings - * for KDialogBase - * objects (base frame tiles, main frame tiles etc). - * To use it, simply create a TDEAboutDialog object, set all (or some) of its - * properties and show it. Do not derive it to create your own about dialog - * until you need some cool features that are unsupported and you have - * contacted me to add them. - * - * The dialog can be created using two different constructors. The - * difference between these constructors is the available components that - * can be used to build the contents of the dialog. The first (Constructor I) - * provides a number of easy to use methods. Basically it allows you - * to add the components of choice, and the components are placed in a - * predefined layout. You do not have to plan the layout. Everything is - * taken care of. - * - * The second constructor (Constructor II) works in quite the same manner - * as the first, but you have better control on where the components - * are postioned in the layout and you have access to an extended number - * of components you can install such as titles, product information, - * a tabbed pages (where you can display rich text with url links) and - * a person (developer) information field. The "About KDE" dialog box is - * created with Constructor II. - * - * For the derived features, see the basic class KDialogBase. - * @author Mirko Boehm (mirko@kde.org) and Espen Sand (espensa@online.no) - * @see KDialogBase - */ -class TDEUI_EXPORT TDEAboutDialog : public KDialogBase -{ - Q_OBJECT - - public: - /** - * Layout formats. - **/ - enum LayoutType - { - AbtPlain = 0x0001, - AbtTabbed = 0x0002, - AbtTitle = 0x0004, - AbtImageLeft = 0x0008, - AbtImageRight = 0x0010, - AbtImageOnly = 0x0020, - AbtProduct = 0x0040, - AbtKDEStandard = AbtTabbed|AbtTitle|AbtImageLeft, - AbtAppStandard = AbtTabbed|AbtTitle|AbtProduct, - AbtImageAndTitle = AbtPlain|AbtTitle|AbtImageOnly - }; - - public: - /** - * The standard Qt constructor (Constructor I). - * - * Add components with the following methods: - * setLogo(), setAuthor(), setMaintainer(), - * addContributor(), or setVersion(). - * The dialog will be laid out automatically. - */ - TDEAboutDialog( TQWidget *parent=0, const char *name=0, bool modal=true ); - - /** - * The extended constructor. (Constructor II). - * - * Add components with the methods: - * setTitle(), setImage(), setImageBackgroundColor(), - * setImageFrame(), setProduct(), addTextPage(), - * addContainerPage(), addContainer(), or addPage(). - * - * @param dialogLayout Use a mask of LayoutType flags. - * @param caption The dialog caption. The text you specify is prepended - * by i18n("About"). - * @param buttonMask Specifies what buttons will be visible. - * @param defaultButton Specifies what button will be marked as the default. - * @param parent Parent of the dialog. - * @param name Dialog name (for internal use only) - * @param modal Sets dialog modality. If false, the rest of the - * program interface (other dialogs, for example) is accessible while - * the dialog is open. - * @param separator If true, a separator line is drawn between the action - * buttons an the main widget. - * @param user1 User button1 text. - * @param user2 User button2 text. - * @param user3 User button3 text. - * - */ - TDEAboutDialog( int dialogLayout, const TQString &caption, int buttonMask, - ButtonCode defaultButton, TQWidget *parent=0, - const char *name=0, bool modal=false, bool separator = false, - const TQString &user1 = TQString::null, - const TQString &user2 = TQString::null, - const TQString &user3 = TQString::null ); - - /** - * Adjusts the dialog. - * - * You can call this method after you have set up all - * the contents but it is not required. It is done automatically when - * show() is executed. - */ - void adjust(); - - /** - * Makes a modeless (modal = false in constructor) dialog visible. - * - * If you reimplement this method make sure you run it - * in the new method (e.g., show()). Reimplemented - * from KDialogBase. - */ - virtual void show( void ); - - /** - * Makes a modeless (modal = false in constructor) dialog visible. - * - * If you reimplmement this method make sure you run it - * in the new method (i.e., show( parent )). - * - * @param centerParent Center the dialog with respect to this widget. - */ - virtual void show( TQWidget *centerParent ); - - /** - * (Constructor II only) - * Sets a title (not caption) in the uppermost area of the dialog. - * - * @param title Title string. - */ - void setTitle( const TQString &title ); - - /** - * (Constructor II only) - * Define an image to be shown in the dialog. The position is dependent - * on the @p dialogLayout in the constructor - * - * @param fileName Path to image file. - */ - void setImage( const TQString &fileName ); - - /** - * (Constructor II only) - * Define the program logo to be shown in the dialog. Use this to override the - * default program logo. For example, use this function if the - * TDEAboutDialog is for a panel applet and you want to override the - * appletproxy logo with your own pixmap. - * - * @param fileName Path to file containing logo data in a format that - * can be loaded by TQPixmap. - * - * @since 3.3 - */ - void setIcon( const TQString &fileName ) KDE_DEPRECATED; // KDE4: remove - - /** - * Overloaded version of setProgramLogo(const TQPixmap& pixmap). - * - * @since 3.4 - */ - void setProgramLogo( const TQString &fileName ); - - /** - * (Constructor II only) - * Define the program logo to be shown in the dialog. Use this to override the - * default program logo. For example, use this function if the - * TDEAboutDialog is for a panel applet and you want to override the - * appletproxy logo with your own pixmap. - * - * @param pixmap The logo pixmap. - * - * @since 3.4 - */ - void setProgramLogo( const TQPixmap &pixmap ); - - /** - * (Constructor II only) - * The image has a minimum size, but is centered within an area if the - * dialog box is enlarged by the user. You set the background color - * of the area with this method. - * - * @param color Background color. - */ - void setImageBackgroundColor( const TQColor &color ); - - /** - * (Constructor II only) - * Enables or disables a frame around the image. The frame is, by default, - * enabled in the constructor - * - * @param state A value of @p true enables the frame - */ - void setImageFrame( bool state ); - - /** - * (Constructor II only) - * Prints the application name, KDE version, author, a copyright sign - * and a year string. To the left of the text the standard application - * icon is displayed. - * - * @param appName The application name. - * @param version Application version. - * @param author One or more authors. - * @param year A string telling when the application was made. - */ - void setProduct( const TQString &appName, const TQString &version, - const TQString &author, const TQString &year ); - - /** - * (Constructor II only) - * Adds a text page to a tab box. The text can be regular text or - * rich text. The rich text can contain URLs and mail links. - * - * @param title Tab name. - * @param text The text to display. - * @param richText Set this to @p true if 'text' is rich text. - * @param numLines The text area height will be adjusted so that this - * is the minimum number of lines of text that are visible. - * @return The frame that contains the page. - */ - TQFrame *addTextPage( const TQString &title, const TQString &text, - bool richText=false, int numLines=10 ); - - /** - * (Constructor II only) - * Adds a license page to a tab box. - * - * @param title Tab name. - * @param text The text to display. - * @param numLines The text area height will be adjusted so that this - * is the minimum number of lines of text that are visible. - * @return The frame that contains the page. - */ - TQFrame *addLicensePage( const TQString &title, const TQString &text, - int numLines=10 ); - - /** - * (Constructor II only) - * Adds a container to a tab box. You can add text and images to a - * container. - * - * @param title Tab name. - * @param childAlignment Specifies how the children of the container are - * aligned with respect to the container. - * @param innerAlignment Specifies how the children are aligned with - * respect to each other. - * @return The new container. - */ - TDEAboutContainer *addContainerPage( const TQString &title, - int childAlignment = AlignCenter, int innerAlignment = AlignCenter ); - - /** - * (Constructor II only) - * Adds a container inside a TQScrollView to a tab box. You can add text - * and images to a container. - * - * @param title Tab name. - * @param childAlignment Specifies how the children of the container are - * aligned with respect to the container. - * @param innerAlignment Specifies how the children are aligned with - * respect to each other. - * @return The new container. - */ - TDEAboutContainer *addScrolledContainerPage( const TQString &title, - int childAlignment = AlignCenter, int innerAlignment = AlignCenter ); - - /** - * (Constructor II only) - * Adds a container. You can add text and images to a container. - * - * @param childAlignment Specifies how the children of the container are - * aligned with respect to the container. - * @param innerAlignment Specifies how the children are aligned with - * respect to each other. - * @return The new container. - */ - TDEAboutContainer *addContainer( int childAlignment, int innerAlignment ); - - /** - * (Constructor II only) - * Adds an empty page to a tab box. - * - * @param title Tab name - * @return The new page. - */ - TQFrame *addPage( const TQString &title ); - - - /** - * (Constructor I only) - * Sets the image as the application logo. - */ - void setLogo(const TQPixmap&); - - /** - * (Constructor I only) - * Sets the author's name and email address. - */ - void setAuthor(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - - /** - * (Constructor I only) - * Sets the maintainer's name and email address. - */ - void setMaintainer(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - - /** - * (Constructor I only) - * Show this person as one of the major contributors. - */ - void addContributor(const TQString& name, const TQString& email, - const TQString& url, const TQString& work); - - /** - * (Constructor I only) - * Sets the text describing the version. - */ - void setVersion(const TQString& name); - - /** - * Create a modal dialog with an image in the upper area with a - * URL link below. - */ - static void imageURL( TQWidget *parent, const TQString &caption, - const TQString &path, const TQColor &imageColor, - const TQString &url ); - -signals: - /** - * Send an email to this person. - * - * The application must provide the - * functionality. - */ - void sendEmail(const TQString& name, const TQString& email); - - /** - * Open the selected URL. - */ - void openURL(const TQString& url); - // ---------------------------------------------------------------------------- -protected: - /** - * The main widget (Constructor I) - */ - TDEAboutWidget * about; - - /** - * The main widget (Constructor II) - */ - TDEAboutContainerBase *mContainerBase; - - // ------------------------------------------------------------------------- -protected slots: - - /** - * Connected to widget->sendEmail. - */ - void sendEmailSlot(const TQString& name, const TQString& email); - - /** - * Open this URL. - */ - void openURLSlot(const TQString& url); - - /** - * (Constructor II only) - * Tells the position of the mouse cursor when the left mouse button - * is pressed above an image - */ - virtual void mouseTrackSlot( int mode, const TQMouseEvent *e ); - - // ######################################################################### -protected: - virtual void virtual_hook( int id, void* data ); -private: - TDEAboutDialogPrivate* const d; -}; - -#endif // defined KABOUTDIALOG_H diff --git a/tdeui/kaboutkde.cpp b/tdeui/kaboutkde.cpp deleted file mode 100644 index 5ccd8822a..000000000 --- a/tdeui/kaboutkde.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Espen Sand (espen@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. - * - */ - -// I (espen) prefer that header files are included alphabetically -#include <kaboutkde.h> -#include <kapplication.h> -#include <klocale.h> -#include <kstandarddirs.h> - - -TDEAboutKDE::TDEAboutKDE( TQWidget *parent, const char *name, bool modal ) - :TDEAboutDialog( TDEAboutDialog::AbtKDEStandard, TQString::fromLatin1("TDE"), - KDialogBase::Help|KDialogBase::Close, KDialogBase::Close, - parent, name, modal ) -{ - const TQString text1 = i18n("" - "The <b>Trinity Desktop Environment</b> is a fork of the " - "K Desktop Environment version 3.5, which was originally written by the KDE Team, " - "a world-wide network of software engineers committed to <a " - "href=\"http://www.gnu.org/philosophy/free-sw.html\">Free Software</a> " - "development.<br><br>No single group, company or organization controls the " - "Trinity source code. Everyone is welcome to contribute to Trinity.<br><br>Visit <A " - "HREF=\"http://www.trinitydesktop.org/\">http://www.trinitydesktop.org</A> for more information " - "about Trinity, and <A HREF=\"http://www.kde.org/\">http://www.kde.org</A> " - "for more information on the KDE project. "); - - const TQString text2 = i18n("" - "Software can always be improved, and the Trinity Team is ready to " - "do so. However, you - the user - must tell us when " - "something does not work as expected or could be done better.<br><br>" - "The Trinity Desktop Environment has a bug tracking system. Visit " - "<A HREF=\"http://bugs.pearsoncomputing.net/\">http://bugs.pearsoncomputing.net</A> or " - "use the \"Report Bug...\" dialog from the \"Help\" menu to report bugs.<br><br>" - "If you have a suggestion for improvement then you are welcome to use " - "the bug tracking system to register your wish. Make sure you use the " - "severity called \"Wishlist\"." ); - - const TQString text3 = i18n("" - "You do not have to be a software developer to be a member of the " - "Trinity team. You can join the national teams that translate " - "program interfaces. You can provide graphics, themes, sounds, and " - "improved documentation. You decide!" - "<br><br>" - "Visit " - "<A HREF=\"http://www.trinitydesktop.org/jobs/\">http://www.trinitydesktop.org/jobs/</A> " - "for information on some projects in which you can participate." - "<br><br>" - "If you need more information or documentation, then a visit to " - "<A HREF=\"http://www.trinitydesktop.org/docs/\">http://www.trinitydesktop.org/docs/</A> " - "will provide you with what you need."); - const TQString text4 = i18n("" - "Trinity is available free of charge, but making it is not free.<br><br>" - "<br><br>" - "The Trinity team does need financial support. Most of the money is used to " - "reimburse members and others on expenses they experienced when " - "contributing to Trinity. You are encouraged to support Trinity through a financial " - "donation, using one of the ways described at " - "<a href=\"http://www.trinitydesktop.org/donate.php\">http://www.trinitydesktop.org/donate.php</a>." - "<br><br>Thank you very much in advance for your support!"); - setHelp( TQString::fromLatin1("khelpcenter/main.html"), TQString::null ); - setTitle(i18n("Trinity Desktop Environment. Release %1"). - arg(TQString::fromLatin1(TDE_VERSION_STRING)) ); - addTextPage( i18n("About Trinity","&About"), text1, true ); - addTextPage( i18n("&Report Bugs/Request Enhancements"), text2, true ); - addTextPage( i18n("&Join the Trinity Team"), text3, true ); - addTextPage( i18n("&Support Trinity"), text4, true ); - setImage( locate( "data", TQString::fromLatin1("tdeui/pics/aboutkde.png")) ); - setImageBackgroundColor( white ); -} diff --git a/tdeui/kaboutkde.h b/tdeui/kaboutkde.h deleted file mode 100644 index 8013d093d..000000000 --- a/tdeui/kaboutkde.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of the KDE Libraries - * Copyright (C) 2000 Espen Sand (espen@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 _KABOUT_KDE_H_ -#define _KABOUT_KDE_H_ - -#include <kaboutdialog.h> - -/** - * @short Standard "About KDE" dialog box, - * - * This class provides the standard "About KDE" dialog box that is used - * KHelpMenu Normally you should not use this class directly but - * rather the KHelpMenu class or even better just subclass your - * toplevel window from TDEMainWindow. If you do the latter, the help - * menu and thereby this dialog box is available through the - * TDEMainWindow::helpMenu() function. - * - * @author Espen Sand (espen@kde.org) - */ - -class TDEUI_EXPORT TDEAboutKDE : public TDEAboutDialog -{ - public: - /** - * Constructor. Creates a fully featured "About KDE" dialog box. - * Note that this dialog is made modeless in the KHelpMenu class so - * the users may expect a modeless dialog. - * - * @param parent The parent of the dialog box. You should use the - * toplevel window so that the dialog becomes centered. - * @param name Internal name of the widget. This name in not used in the - * caption. - * @param modal If false, this widget will be modeless and must be - * made visible using TQWidget::show(). Otherwise it will be - * modal and must be made visible using TQWidget::exec() - */ - TDEAboutKDE( TQWidget *parent=0, const char *name=0, bool modal=true ); -}; - - -#endif - - diff --git a/tdeui/kactivelabel.cpp b/tdeui/kactivelabel.cpp index a30fac7f4..0e5abc5ad 100644 --- a/tdeui/kactivelabel.cpp +++ b/tdeui/kactivelabel.cpp @@ -19,7 +19,7 @@ #include "kactivelabel.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <tqregexp.h> #include <tqwhatsthis.h> #include <tqsimplerichtext.h> diff --git a/tdeui/kbugreport.cpp b/tdeui/kbugreport.cpp index efee22366..91c6aa66c 100644 --- a/tdeui/kbugreport.cpp +++ b/tdeui/kbugreport.cpp @@ -26,8 +26,8 @@ #include <tqwhatsthis.h> #include <tqregexp.h> -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <klineedit.h> diff --git a/tdeui/kcharselect.cpp b/tdeui/kcharselect.cpp index ace147496..a623b3efa 100644 --- a/tdeui/kcharselect.cpp +++ b/tdeui/kcharselect.cpp @@ -36,7 +36,7 @@ #include <tqtooltip.h> #include <tqvalidator.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kdialog.h> #include <klineedit.h> diff --git a/tdeui/kcolorcombo.cpp b/tdeui/kcolorcombo.cpp index 0449550fd..7e9353cf4 100644 --- a/tdeui/kcolorcombo.cpp +++ b/tdeui/kcolorcombo.cpp @@ -44,7 +44,7 @@ #include <tqpushbutton.h> #include <tqtimer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kglobal.h> #include <kglobalsettings.h> diff --git a/tdeui/kcolordialog.cpp b/tdeui/kcolordialog.cpp index 16f16d07e..29292f960 100644 --- a/tdeui/kcolordialog.cpp +++ b/tdeui/kcolordialog.cpp @@ -45,7 +45,7 @@ #include <tqspinbox.h> #include <tqtimer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kglobal.h> #include <kglobalsettings.h> diff --git a/tdeui/kdatepicker.cpp b/tdeui/kdatepicker.cpp index 91cafddbd..98d72030d 100644 --- a/tdeui/kdatepicker.cpp +++ b/tdeui/kdatepicker.cpp @@ -33,7 +33,7 @@ #include "kdatepicker.h" #include <kglobal.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdialog.h> #include <klocale.h> #include <kiconloader.h> diff --git a/tdeui/kdatetbl.cpp b/tdeui/kdatetbl.cpp index 2fd593493..542f89f08 100644 --- a/tdeui/kdatetbl.cpp +++ b/tdeui/kdatetbl.cpp @@ -35,7 +35,7 @@ #include <tdeconfig.h> #include <kglobal.h> #include <kglobalsettings.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeaccel.h> #include <klocale.h> #include <kdebug.h> diff --git a/tdeui/kdcopactionproxy.cpp b/tdeui/kdcopactionproxy.cpp index c8444cfdf..028c90883 100644 --- a/tdeui/kdcopactionproxy.cpp +++ b/tdeui/kdcopactionproxy.cpp @@ -20,7 +20,7 @@ #include "kdcopactionproxy.h" #include <dcopclient.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeaction.h> #include <kdebug.h> #include <kdcoppropertyproxy.h> diff --git a/tdeui/kdetrayproxy/kdetrayproxy.cpp b/tdeui/kdetrayproxy/kdetrayproxy.cpp index f1e6995ee..d0e7a84cf 100644 --- a/tdeui/kdetrayproxy/kdetrayproxy.cpp +++ b/tdeui/kdetrayproxy/kdetrayproxy.cpp @@ -19,7 +19,7 @@ #include "kdetrayproxy.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <netwm.h> #include <X11/Xlib.h> @@ -182,7 +182,7 @@ void KDETrayProxy::withdrawWindow( Window w ) #include "kdetrayproxy.moc" #if 0 -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> int main( int argc, char* argv[] ) { TDECmdLineArgs::init( argc, argv, "a", "b", "c", "d" ); diff --git a/tdeui/kdialog.cpp b/tdeui/kdialog.cpp index ddac1ddd8..f6b2b8b56 100644 --- a/tdeui/kdialog.cpp +++ b/tdeui/kdialog.cpp @@ -19,7 +19,7 @@ */ #include <tdeconfig.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdialog.h> #include <kwhatsthismanager_p.h> #include <kdebug.h> diff --git a/tdeui/kdialogbase.cpp b/tdeui/kdialogbase.cpp index 46d0697d5..6656d6803 100644 --- a/tdeui/kdialogbase.cpp +++ b/tdeui/kdialogbase.cpp @@ -33,7 +33,7 @@ #include <tqtimer.h> #include <tqfocusdata.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <tdeconfig.h> #include <kiconloader.h> diff --git a/tdeui/keditcl1.cpp b/tdeui/keditcl1.cpp index baff8db25..37cee99fb 100644 --- a/tdeui/keditcl1.cpp +++ b/tdeui/keditcl1.cpp @@ -24,7 +24,7 @@ #include <tqtextstream.h> #include <tqtimer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kcursor.h> #include <kdebug.h> #include <kcmenumngr.h> diff --git a/tdeui/keditcl2.cpp b/tdeui/keditcl2.cpp index 92ca542d4..a7db92555 100644 --- a/tdeui/keditcl2.cpp +++ b/tdeui/keditcl2.cpp @@ -31,7 +31,7 @@ #include <tqhbox.h> #include <tqpopupmenu.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kcombobox.h> #include <knuminput.h> #include <kmessagebox.h> diff --git a/tdeui/keditlistbox.cpp b/tdeui/keditlistbox.cpp index 040e77c70..1a31bbaa4 100644 --- a/tdeui/keditlistbox.cpp +++ b/tdeui/keditlistbox.cpp @@ -31,7 +31,7 @@ #include <kdialog.h> #include <klineedit.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <knotifyclient.h> #include "keditlistbox.h" diff --git a/tdeui/khelpmenu.cpp b/tdeui/khelpmenu.cpp index dd6b7d174..41fa063c2 100644 --- a/tdeui/khelpmenu.cpp +++ b/tdeui/khelpmenu.cpp @@ -27,11 +27,11 @@ #include <tqwhatsthis.h> #include <tqwidget.h> -#include <kaboutapplication.h> -#include <kaboutdata.h> -#include <kaboutkde.h> +#include <tdeaboutapplication.h> +#include <tdeaboutdata.h> +#include <tdeabouttde.h> #include <tdeaction.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kbugreport.h> #include <kdialogbase.h> #include <khelpmenu.h> diff --git a/tdeui/kiconview.cpp b/tdeui/kiconview.cpp index 3a139985a..bcf9550b4 100644 --- a/tdeui/kiconview.cpp +++ b/tdeui/kiconview.cpp @@ -29,7 +29,7 @@ #include <kdebug.h> #include <kglobal.h> #include <kglobalsettings.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kipc.h> #include <kcursor.h> diff --git a/tdeui/kjanuswidget.cpp b/tdeui/kjanuswidget.cpp index fc1a04e7e..e9dd9df85 100644 --- a/tdeui/kjanuswidget.cpp +++ b/tdeui/kjanuswidget.cpp @@ -33,7 +33,7 @@ #include <tqpainter.h> #include <tqstyle.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdialog.h> // Access to some static members #include <klocale.h> #include <kglobal.h> diff --git a/tdeui/kkeybutton.cpp b/tdeui/kkeybutton.cpp index e0a41ce5d..24191aa45 100644 --- a/tdeui/kkeybutton.cpp +++ b/tdeui/kkeybutton.cpp @@ -24,7 +24,7 @@ #include <tqcursor.h> #include <tqdrawutil.h> #include <tqpainter.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kglobalaccel.h> #include <klocale.h> diff --git a/tdeui/kkeydialog.cpp b/tdeui/kkeydialog.cpp index b6db9bb71..7faad35c4 100644 --- a/tdeui/kkeydialog.cpp +++ b/tdeui/kkeydialog.cpp @@ -39,7 +39,7 @@ #include <tdeaction.h> #include <tdeaccelaction.h> #include <tdeactionshortcutlist.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <kglobal.h> @@ -51,7 +51,7 @@ #include <tdeshortcut.h> #include <tdeshortcutlist.h> #include <kxmlguifactory.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <kstaticdeleter.h> #ifdef Q_WS_X11 diff --git a/tdeui/kled.cpp b/tdeui/kled.cpp index dc245cd6f..6b29ac0ca 100644 --- a/tdeui/kled.cpp +++ b/tdeui/kled.cpp @@ -30,7 +30,7 @@ #include <tqpainter.h> #include <tqimage.h> #include <tqcolor.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kpixmapeffect.h> #include "kled.h" diff --git a/tdeui/klineedit.cpp b/tdeui/klineedit.cpp index 4e11f5fa3..a1c05aaab 100644 --- a/tdeui/klineedit.cpp +++ b/tdeui/klineedit.cpp @@ -40,7 +40,7 @@ #include <kurl.h> #include <kurldrag.h> #include <kiconloader.h> -#include <kapplication.h> +#include <tdeapplication.h> #include "klineedit.h" #include "klineedit.moc" diff --git a/tdeui/klineeditdlg.cpp b/tdeui/klineeditdlg.cpp index 9551fc1f6..ca4fd8266 100644 --- a/tdeui/klineeditdlg.cpp +++ b/tdeui/klineeditdlg.cpp @@ -28,7 +28,7 @@ #include <kbuttonbox.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klineedit.h> #include <kstdguiitem.h> diff --git a/tdeui/kmenubar.cpp b/tdeui/kmenubar.cpp index 9f21ce300..71158370b 100644 --- a/tdeui/kmenubar.cpp +++ b/tdeui/kmenubar.cpp @@ -35,7 +35,7 @@ #include <tdeconfig.h> #include <kglobalsettings.h> #include <kmenubar.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> #include <kdebug.h> #include <kmanagerselection.h> diff --git a/tdeui/kmessagebox.cpp b/tdeui/kmessagebox.cpp index 1e3c0bfda..5684c6484 100644 --- a/tdeui/kmessagebox.cpp +++ b/tdeui/kmessagebox.cpp @@ -31,7 +31,7 @@ #include <tqpushbutton.h> #include <tqlayout.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <kdialogbase.h> diff --git a/tdeui/kpanelapplet.cpp b/tdeui/kpanelapplet.cpp index 02a098283..f88cb5a8a 100644 --- a/tdeui/kpanelapplet.cpp +++ b/tdeui/kpanelapplet.cpp @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "kpanelapplet.h" #include "kpanelapplet.moc" -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> class KPanelApplet::KPanelAppletPrivate diff --git a/tdeui/kpanelappmenu.cpp b/tdeui/kpanelappmenu.cpp index 4cc77b5fe..247d844de 100644 --- a/tdeui/kpanelappmenu.cpp +++ b/tdeui/kpanelappmenu.cpp @@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "kpanelappmenu.h" #include <tqstringlist.h> #include <dcopclient.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> static int panelmenu_get_seq_id() diff --git a/tdeui/kpassdlg.cpp b/tdeui/kpassdlg.cpp index e2ca0bb80..302b4e679 100644 --- a/tdeui/kpassdlg.cpp +++ b/tdeui/kpassdlg.cpp @@ -36,11 +36,11 @@ #include <kglobal.h> #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <kiconloader.h> #include <kmessagebox.h> -#include <kaboutdialog.h> +#include <tdeaboutdialog.h> #include <tdeconfig.h> #include <kstandarddirs.h> #include <kprogress.h> diff --git a/tdeui/kprogress.cpp b/tdeui/kprogress.cpp index 9b72dcf2c..3f0186e3d 100644 --- a/tdeui/kprogress.cpp +++ b/tdeui/kprogress.cpp @@ -34,7 +34,7 @@ #include "kprogress.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <twin.h> diff --git a/tdeui/kprogressbox.cpp b/tdeui/kprogressbox.cpp index 4638f78fb..6dda25a33 100644 --- a/tdeui/kprogressbox.cpp +++ b/tdeui/kprogressbox.cpp @@ -37,7 +37,7 @@ #include "ktextedit.h" #include "kprogressbox.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <twin.h> diff --git a/tdeui/kpushbutton.cpp b/tdeui/kpushbutton.cpp index 35bf0928f..e92fe8583 100644 --- a/tdeui/kpushbutton.cpp +++ b/tdeui/kpushbutton.cpp @@ -29,7 +29,7 @@ #include <tdeconfig.h> #include <kglobal.h> #include <kipc.h> -#include <kapplication.h> +#include <tdeapplication.h> class KPushButton::KPushButtonPrivate { diff --git a/tdeui/krootpixmap.cpp b/tdeui/krootpixmap.cpp index 71b1d86ca..6be62d157 100644 --- a/tdeui/krootpixmap.cpp +++ b/tdeui/krootpixmap.cpp @@ -14,7 +14,7 @@ #include <tqrect.h> #include <tqimage.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kimageeffect.h> #include <kpixmapio.h> #include <twinmodule.h> diff --git a/tdeui/ksconfig.cpp b/tdeui/ksconfig.cpp index 363a9b8b4..d27ae07ca 100644 --- a/tdeui/ksconfig.cpp +++ b/tdeui/ksconfig.cpp @@ -25,7 +25,7 @@ #include <tqlayout.h> #include <tqtimer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <kdialog.h> diff --git a/tdeui/kseparator.cpp b/tdeui/kseparator.cpp index 9e860f3cf..c5a4879d8 100644 --- a/tdeui/kseparator.cpp +++ b/tdeui/kseparator.cpp @@ -20,7 +20,7 @@ #include <tqstyle.h> #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> #include "kseparator.moc" diff --git a/tdeui/ksharedpixmap.cpp b/tdeui/ksharedpixmap.cpp index b9e0e69c4..33eca17e4 100644 --- a/tdeui/ksharedpixmap.cpp +++ b/tdeui/ksharedpixmap.cpp @@ -22,7 +22,7 @@ #ifdef Q_WS_X11 -#include <kapplication.h> +#include <tdeapplication.h> #include <krootprop.h> #include <ksharedpixmap.h> #include <kdebug.h> diff --git a/tdeui/kstdaction.cpp b/tdeui/kstdaction.cpp index a0e840e5a..8dd874a9d 100644 --- a/tdeui/kstdaction.cpp +++ b/tdeui/kstdaction.cpp @@ -21,9 +21,9 @@ #include <tqtoolbutton.h> #include <tqwhatsthis.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <tdeaction.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kglobal.h> #include <kiconloader.h> diff --git a/tdeui/kstdguiitem.cpp b/tdeui/kstdguiitem.cpp index 2367804a8..78f3fd6f6 100644 --- a/tdeui/kstdguiitem.cpp +++ b/tdeui/kstdguiitem.cpp @@ -20,7 +20,7 @@ #include <kguiitem.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> KGuiItem KStdGuiItem::guiItem ( StdItem ui_enum ) { diff --git a/tdeui/ksyntaxhighlighter.cpp b/tdeui/ksyntaxhighlighter.cpp index 1d0ce4159..ba938382b 100644 --- a/tdeui/ksyntaxhighlighter.cpp +++ b/tdeui/ksyntaxhighlighter.cpp @@ -31,7 +31,7 @@ #include <kdebug.h> #include <kglobal.h> #include <tdespell.h> -#include <kapplication.h> +#include <tdeapplication.h> #include "ksyntaxhighlighter.h" diff --git a/tdeui/ksystemtray.cpp b/tdeui/ksystemtray.cpp index 572616833..fcd0389da 100644 --- a/tdeui/ksystemtray.cpp +++ b/tdeui/ksystemtray.cpp @@ -24,9 +24,9 @@ #include "tdeshortcut.h" #include "ksystemtray.h" #include "tdepopupmenu.h" -#include "kapplication.h" +#include "tdeapplication.h" #include "klocale.h" -#include "kaboutdata.h" +#include "tdeaboutdata.h" #ifdef Q_WS_X11 #include <twin.h> diff --git a/tdeui/ktextbrowser.cpp b/tdeui/ktextbrowser.cpp index 15f14d711..b17e38067 100644 --- a/tdeui/ktextbrowser.cpp +++ b/tdeui/ktextbrowser.cpp @@ -19,7 +19,7 @@ #include <tqpopupmenu.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobalsettings.h> #include <ktextbrowser.h> #include <kcursor.h> diff --git a/tdeui/ktip.cpp b/tdeui/ktip.cpp index d52e134b6..44f710fb9 100644 --- a/tdeui/ktip.cpp +++ b/tdeui/ktip.cpp @@ -33,8 +33,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <tqtextstream.h> #include <tqimage.h> -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <kglobal.h> diff --git a/tdeui/kwhatsthismanager.cpp b/tdeui/kwhatsthismanager.cpp index 2f4d1750f..bcf48438c 100644 --- a/tdeui/kwhatsthismanager.cpp +++ b/tdeui/kwhatsthismanager.cpp @@ -22,7 +22,7 @@ #include <kdebug.h> #include <tqtextedit.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> KWhatsThisManager *KWhatsThisManager::s_instance = 0; diff --git a/tdeui/kxmlguibuilder.cpp b/tdeui/kxmlguibuilder.cpp index 3eb756678..6fd472ad5 100644 --- a/tdeui/kxmlguibuilder.cpp +++ b/tdeui/kxmlguibuilder.cpp @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ -#include "kapplication.h" +#include "tdeapplication.h" #include "kxmlguibuilder.h" #include "kmenubar.h" #include "tdepopupmenu.h" diff --git a/tdeui/kxmlguiclient.cpp b/tdeui/kxmlguiclient.cpp index a02718f0a..de015b5a4 100644 --- a/tdeui/kxmlguiclient.cpp +++ b/tdeui/kxmlguiclient.cpp @@ -32,7 +32,7 @@ #include <kstandarddirs.h> #include <kdebug.h> #include <tdeaction.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <assert.h> diff --git a/tdeui/tdeaboutapplication.cpp b/tdeui/tdeaboutapplication.cpp new file mode 100644 index 000000000..08ee46450 --- /dev/null +++ b/tdeui/tdeaboutapplication.cpp @@ -0,0 +1,188 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Waldo Bastian (bastian@kde.org) and + * Espen Sand (espen@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. + * + */ + +// I (espen) prefer that header files are included alphabetically + +#include <tqlabel.h> +#include <tdeaboutapplication.h> +#include <kaboutdialog_private.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kglobal.h> +#include <klocale.h> +#include <kurllabel.h> +#include <kactivelabel.h> +#include "ktextedit.h" + +TDEAboutApplication::TDEAboutApplication( TQWidget *parent, const char *name, + bool modal ) + :TDEAboutDialog( AbtTabbed|AbtProduct, + kapp ? kapp->caption() : TQString::null, + Close, Close, + parent, name, modal ) +{ + buildDialog(TDEGlobal::instance()->aboutData()); +} + +TDEAboutApplication::TDEAboutApplication( const TDEAboutData *aboutData, TQWidget *parent, + const char *name, bool modal ) + :TDEAboutDialog( AbtTabbed|AbtProduct, aboutData->programName(), Close, Close, + parent, name, modal ) +{ + buildDialog(aboutData); +} + +void TDEAboutApplication::buildDialog( const TDEAboutData *aboutData ) +{ + if( !aboutData ) + { + // + // Recovery + // + + //i18n "??" is displayed as (pseudo-)version when no data is known about the application + setProduct( kapp ? kapp->caption() : TQString::null, i18n("??"), TQString::null, TQString::null ); + TDEAboutContainer *appPage = addContainerPage( i18n("&About")); + + TQString appPageText = + i18n("No information available.\n" + "The supplied TDEAboutData object does not exist."); + TQLabel *appPageLabel = new TQLabel( "\n\n\n\n"+appPageText+"\n\n\n\n", 0 ); + appPage->addWidget( appPageLabel ); + return; + } + + setProduct( aboutData->programName(), aboutData->version(), + TQString::null, TQString::null ); + + if (!aboutData->programLogo().isNull()) + setProgramLogo( aboutData->programLogo() ); + + TQString appPageText = aboutData->shortDescription() + "\n"; + + if (!aboutData->otherText().isEmpty()) + appPageText += "\n" + aboutData->otherText()+"\n"; + + if (!aboutData->copyrightStatement().isEmpty()) + appPageText += "\n" + aboutData->copyrightStatement()+"\n"; + + TDEAboutContainer *appPage = addContainerPage( i18n("&About")); + + TQLabel *appPageLabel = new TQLabel( appPageText, 0 ); + appPage->addWidget( appPageLabel ); + + if (!aboutData->homepage().isEmpty()) + { + KURLLabel *url = new KURLLabel(); + url->setText(aboutData->homepage()); + url->setURL(aboutData->homepage()); + appPage->addWidget( url ); + connect( url, TQT_SIGNAL(leftClickedURL(const TQString &)), + this, TQT_SLOT(openURLSlot(const TQString &))); + } + + int authorCount = aboutData->authors().count(); + if (authorCount) + { + TQString authorPageTitle = authorCount == 1 ? + i18n("A&uthor") : i18n("A&uthors"); + TDEAboutContainer *authorPage = addScrolledContainerPage( authorPageTitle ); + + if (!aboutData->customAuthorTextEnabled() || !aboutData->customAuthorRichText().isEmpty ()) + { + TQString text; + KActiveLabel* activeLabel = new KActiveLabel( authorPage ); + if (!aboutData->customAuthorTextEnabled()) + { + if ( aboutData->bugAddress().isEmpty() || aboutData->bugAddress() == "submit@bugs.pearsoncomputing.net") + text = i18n( "Please use <a href=\"http://bugs.pearsoncomputing.net\">http://bugs.pearsoncomputing.net</a> to report bugs.\n" ); + else { + if( aboutData->authors().count() == 1 && ( aboutData->authors().first().emailAddress() == aboutData->bugAddress() ) ) + { + text = i18n( "Please report bugs to <a href=\"mailto:%1\">%2</a>.\n" ).arg( aboutData->authors().first().emailAddress() ).arg( aboutData->authors().first().emailAddress() ); + } + else { + text = i18n( "Please report bugs to <a href=\"mailto:%1\">%2</a>.\n" ).arg(aboutData->bugAddress()).arg(aboutData->bugAddress() ); + } + } + } + else + { + text = aboutData->customAuthorRichText(); + } + activeLabel->setText( text ); + authorPage->addWidget( activeLabel ); + } + + TQValueList<TDEAboutPerson>::ConstIterator it; + for (it = aboutData->authors().begin(); + it != aboutData->authors().end(); ++it) + { + authorPage->addPerson( (*it).name(), (*it).emailAddress(), + (*it).webAddress(), (*it).task() ); + } + } + + int creditsCount = aboutData->credits().count(); + if (creditsCount) + { + TDEAboutContainer *creditsPage = + addScrolledContainerPage( i18n("&Thanks To") ); + TQValueList<TDEAboutPerson>::ConstIterator it; + for (it = aboutData->credits().begin(); + it != aboutData->credits().end(); ++it) + { + creditsPage->addPerson( (*it).name(), (*it).emailAddress(), + (*it).webAddress(), (*it).task() ); + } + } + + const TQValueList<TDEAboutTranslator> translatorList = aboutData->translators(); + + if(translatorList.count() > 0) + { + TQString text = "<qt>"; + + TQValueList<TDEAboutTranslator>::ConstIterator it; + for(it = translatorList.begin(); it != translatorList.end(); ++it) + { + text += TQString("<p>%1<br>   " + "<a href=\"mailto:%2\">%2</a></p>") + .arg((*it).name()) + .arg((*it).emailAddress()) + .arg((*it).emailAddress()); + } + + text += TDEAboutData::aboutTranslationTeam() + "</qt>"; + addTextPage( i18n("T&ranslation"), text, true); + } + + if (!aboutData->license().isEmpty() ) + { + addLicensePage( i18n("&License Agreement"), aboutData->license() ); + } + + // + // Make sure the dialog has a reasonable width + // + setInitialSize( TQSize(400,1) ); +} diff --git a/tdeui/tdeaboutapplication.h b/tdeui/tdeaboutapplication.h new file mode 100644 index 000000000..19fa0fe61 --- /dev/null +++ b/tdeui/tdeaboutapplication.h @@ -0,0 +1,94 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Waldo Bastian (bastian@kde.org) and + * Espen Sand (espen@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 _KABOUT_APPLICATION_H_ +#define _KABOUT_APPLICATION_H_ + +#include <tdeaboutdata.h> +#include <tdeaboutdialog.h> + +/** + * @short Standard "About Application" dialog box. + * + * This class provides the standard "About Application" dialog box + * that is used by KHelpMenu. It uses the information of the global + * TDEAboutData that is specified at the start of your program in + * main(). Normally you should not use this class directly but rather + * the KHelpMenu class or even better just subclass your toplevel + * window from TDEMainWindow. If you do the latter, the help menu and + * thereby this dialog box is available through the + * TDEMainWindow::helpMenu() function. + * + * @author Waldo Bastian (bastian@kde.org) and Espen Sand (espen@kde.org) + */ + +class TDEUI_EXPORT TDEAboutApplication : public TDEAboutDialog +{ + public: + /** + * Constructor. Creates a fully featured "About Application" dialog box. + * Note that this dialog is made modeless in the KHelpMenu class so + * the users may expect a modeless dialog. + * + * @param parent The parent of the dialog box. You should use the + * toplevel window so that the dialog becomes centered. + * @param name Internal name of the widget. This name is not used in the + * caption. + * @param modal If false, this widget will be modeless and must be + * made visible using TQWidget::show(). Otherwise it will be + * modal and must be made visible using TQWidget::exec(). + */ + TDEAboutApplication( TQWidget *parent=0, const char *name=0, bool modal=true ); + + /** + * Constructor. Mostly does the same stuff as the previous constructor, except + * that it can take a custom TDEAboutData object instead of the one specified + * in your main() function. This is especially useful for applications + * which are implemented as (dynamically loaded) libraries, e.g. panel + * applets. + * + * @param aboutData A pointer to a TDEAboutData object which data + * will be used for filling the dialog. + * @param parent The parent of the dialog box. You should use the + * toplevel window so that the dialog becomes centered. + * @param name Internal name of the widget. This name is not used in the + * caption. + * @param modal If false, this widget will be modeless and must be + * made visible using TQWidget::show(). Otherwise it will be + * modal and must be made visible using TQWidget::exec(). + */ + TDEAboutApplication( const TDEAboutData *aboutData, TQWidget *parent=0, const char *name=0, bool modal=true ); + +/* + FIXME: The two constructors should be replaced with the following after the lib freeze: + + TDEAboutApplication( const TDEAboutData *aboutData=0, TQWidget *parent=0, const char *name=0, bool modal=true ); + + This will make buildDialog() obsolete as well (Frerich). +*/ + protected: + void buildDialog( const TDEAboutData *aboutData ); +}; + + +#endif + diff --git a/tdeui/tdeaboutdialog.cpp b/tdeui/tdeaboutdialog.cpp new file mode 100644 index 000000000..b46c0b959 --- /dev/null +++ b/tdeui/tdeaboutdialog.cpp @@ -0,0 +1,1797 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 1999-2001 Mirko Boehm <mirko@kde.org> and + * Espen Sand <espensa@online.no> + * + * 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 <tqclipboard.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <ktextedit.h> +#include <tqobjectlist.h> +#include <tqpainter.h> +#include <tqrect.h> +#include <tqtabwidget.h> +#include <tqtabbar.h> + +#include <tdeapplication.h> +#include <kglobal.h> +#include <kglobalsettings.h> +#include <klocale.h> +#include <ktextbrowser.h> +#include <kurllabel.h> +#include <tdeaboutdialog.h> +#include <kaboutdialog_private.h> +#include <kdebug.h> + +//MOC_SKIP_BEGIN +template class TQPtrList<TDEAboutContributor>; +//MOC_SKIP_END + +#define WORKTEXT_IDENTATION 16 +#define Grid 3 + +// ############################################################## +// MOC OUTPUT FILES: +#include "tdeaboutdialog.moc" +#include "kaboutdialog_private.moc" +// ############################################################## + +class TDEAboutTabWidget : public TQTabWidget +{ +public: + TDEAboutTabWidget( TQWidget* parent ) : TQTabWidget( parent ) {} + TQSize sizeHint() const { + return TQTabWidget::sizeHint().expandedTo( tabBar()->sizeHint() + TQSize(4,4) ); + } +}; + + + + +TDEAboutContributor::TDEAboutContributor( TQWidget *_parent, const char *wname, + const TQString &_name,const TQString &_email, + const TQString &_url, const TQString &_work, + bool showHeader, bool showFrame, + bool showBold ) + : TQFrame( _parent, wname ), mShowHeader(showHeader), mShowBold(showBold), d(0) +{ + if( showFrame ) + { + setFrameStyle(TQFrame::Panel | TQFrame::Raised); + } + + mLabel[0] = new TQLabel( this ); + mLabel[1] = new TQLabel( this ); + mLabel[2] = new TQLabel( this ); + mLabel[3] = new TQLabel( this ); + mText[0] = new TQLabel( this ); + mText[1] = new KURLLabel( this ); + mText[2] = new KURLLabel( this ); + mText[3] = new TQLabel( this ); + + setName( _name, i18n("Author"), false ); + setEmail( _email, i18n("Email"), false ); + setURL( _url, i18n("Homepage"), false ); + setWork( _work, i18n("Task"), false ); + + KURLLabel *kurl = static_cast<KURLLabel *>(mText[1]); + kurl->setFloat(true); + kurl->setUnderline(true); + kurl->setMargin(0); + connect(kurl, TQT_SIGNAL(leftClickedURL(const TQString &)), + TQT_SLOT(emailClickedSlot(const TQString &))); + + kurl = static_cast<KURLLabel *>(mText[2]); + kurl->setFloat(true); + kurl->setUnderline(true); + kurl->setMargin(0); + connect(kurl, TQT_SIGNAL(leftClickedURL(const TQString &)), + TQT_SLOT(urlClickedSlot(const TQString &))); + + mLabel[3]->setAlignment( AlignTop ); + + fontChange( font() ); + updateLayout(); +} + + +void TDEAboutContributor::setName( const TQString &_text, const TQString &_header, + bool _update ) +{ + mLabel[0]->setText(_header); + mText[0]->setText(_text); + if( _update ) { updateLayout(); } +} + + +void TDEAboutContributor::setEmail( const TQString &_text, const TQString &_header, + bool _update ) +{ + mLabel[1]->setText(_header); + KURLLabel* const kurl = static_cast<KURLLabel *>(mText[1]); + kurl->setText(_text); + kurl->setURL(_text); + if( _update ) { updateLayout(); } +} + + +void TDEAboutContributor::setURL( const TQString &_text, const TQString &_header, + bool _update ) +{ + mLabel[2]->setText(_header); + KURLLabel* const kurl = static_cast<KURLLabel *>(mText[2]); + kurl->setText(_text); + kurl->setURL(_text); + if( _update ) { updateLayout(); } +} + + +void TDEAboutContributor::setWork( const TQString &_text, const TQString &_header, + bool _update ) +{ + mLabel[3]->setText(_header); + mText[3]->setText(_text); + if( _update ) { updateLayout(); } +} + + +TQString TDEAboutContributor::getName( void ) const +{ + return mText[0]->text(); +} + + +TQString TDEAboutContributor::getEmail( void ) const +{ + return mText[1]->text(); +} + + +TQString TDEAboutContributor::getURL( void ) const +{ + return mText[2]->text(); +} + + +TQString TDEAboutContributor::getWork( void ) const +{ + return mText[3]->text(); +} + + + +void TDEAboutContributor::updateLayout( void ) +{ + delete layout(); + + int row = 0; + if( !mText[0]->text().isEmpty() ) { ++row; } + if( !mText[1]->text().isEmpty() ) { ++row; } + if( !mText[2]->text().isEmpty() ) { ++row; } + if( !mText[3]->text().isEmpty() ) { ++row; } + + + TQGridLayout *gbox; + if( row == 0 ) + { + gbox = new TQGridLayout( this, 1, 1, 0 ); + for( int i=0; i<4; ++i ) + { + mLabel[i]->hide(); + mText[i]->hide(); + } + } + else + { + if( mText[0]->text().isEmpty() && !mShowHeader ) + { + gbox = new TQGridLayout( this, row, 1, frameWidth()+1, 2 ); + } + else + { + gbox = new TQGridLayout( this, row, 2, frameWidth()+1, 2 ); + if( !mShowHeader ) + { + gbox->addColSpacing( 0, KDialog::spacingHint()*2 ); + } + gbox->setColStretch( 1, 10 ); + } + + for( int i=0, r=0; i<4; ++i ) + { + mLabel[i]->setFixedHeight( fontMetrics().lineSpacing() ); + if( i != 3 ) + { + mText[i]->setFixedHeight( fontMetrics().lineSpacing() ); + } + + if( !mText[i]->text().isEmpty() ) + { + if( mShowHeader ) + { + gbox->addWidget( TQT_TQWIDGET(mLabel[i]), r, 0, (TQ_Alignment)AlignLeft ); + gbox->addWidget( TQT_TQWIDGET(mText[i]), r, 1, (TQ_Alignment)AlignLeft ); + mLabel[i]->show(); + mText[i]->show(); + } + else + { + mLabel[i]->hide(); + if( !i ) + { + gbox->addMultiCellWidget( TQT_TQWIDGET(mText[i]), r, r, 0, 1, (TQ_Alignment)AlignLeft ); + } + else + { + gbox->addWidget( TQT_TQWIDGET(mText[i]), r, 1, (TQ_Alignment)AlignLeft ); + } + mText[i]->show(); + } + ++r; + } + else + { + mLabel[i]->hide(); + mText[i]->hide(); + } + } + } + + gbox->activate(); + setMinimumSize( sizeHint() ); +} + + +void TDEAboutContributor::fontChange( const TQFont &/*oldFont*/ ) +{ + if( mShowBold ) + { + TQFont f( font() ); + f.setBold( true ); + mText[0]->setFont( f ); + } + update(); +} + + +TQSize TDEAboutContributor::sizeHint( void ) const +{ + return minimumSizeHint(); +} + + +void TDEAboutContributor::urlClickedSlot( const TQString &u ) +{ + emit openURL(u); +} + + +void TDEAboutContributor::emailClickedSlot( const TQString &e ) +{ + emit sendEmail( mText[0]->text(), e ) ; +} + + +// +// Internal widget for the TDEAboutDialog class. +// +TDEAboutContainerBase::TDEAboutContainerBase( int layoutType, TQWidget *_parent, + char *_name ) + : TQWidget( _parent, _name ), + mImageLabel(0), mTitleLabel(0), mIconLabel(0),mVersionLabel(0), + mAuthorLabel(0), mImageFrame(0),mPageTab(0),mPlainSpace(0),d(0) +{ + mTopLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint() ); + if( !mTopLayout ) { return; } + + if( layoutType & AbtImageOnly ) + { + layoutType &= ~(AbtImageLeft|AbtImageRight|AbtTabbed|AbtPlain); + } + if( layoutType & AbtImageLeft ) + { + layoutType &= ~AbtImageRight; + } + + if( layoutType & AbtTitle ) + { + mTitleLabel = new TQLabel( this, "title" ); + mTitleLabel->setAlignment(AlignCenter); + mTopLayout->addWidget( mTitleLabel ); + mTopLayout->addSpacing( KDialog::spacingHint() ); + } + + if( layoutType & AbtProduct ) + { + TQWidget* const productArea = new TQWidget( this, "area" ); + mTopLayout->addWidget( productArea, 0, TQApplication::reverseLayout() ? AlignRight : AlignLeft ); + + TQHBoxLayout* const hbox = new TQHBoxLayout(productArea,0,KDialog::spacingHint()); + if( !hbox ) { return; } + + mIconLabel = new TQLabel( productArea ); + hbox->addWidget( mIconLabel, 0, AlignLeft|AlignHCenter ); + + TQVBoxLayout* const vbox = new TQVBoxLayout(); + if( !vbox ) { return; } + hbox->addLayout( vbox ); + + mVersionLabel = new TQLabel( productArea, "version" ); + mAuthorLabel = new TQLabel( productArea, "author" ); + vbox->addWidget( mVersionLabel ); + vbox->addWidget( mAuthorLabel ); + hbox->activate(); + + mTopLayout->addSpacing( KDialog::spacingHint() ); + } + + TQHBoxLayout* const hbox = new TQHBoxLayout(); + if( !hbox ) { return; } + mTopLayout->addLayout( hbox, 10 ); + + if( layoutType & AbtImageLeft ) + { + TQVBoxLayout* vbox = new TQVBoxLayout(); + hbox->addLayout(vbox); + vbox->addSpacing(1); + mImageFrame = new TQFrame( this ); + setImageFrame( true ); + vbox->addWidget( mImageFrame ); + vbox->addSpacing(1); + + vbox = new TQVBoxLayout( mImageFrame, 1 ); + mImageLabel = new KImageTrackLabel( mImageFrame ); + connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), + TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); + vbox->addStretch(10); + vbox->addWidget( mImageLabel ); + vbox->addStretch(10); + vbox->activate(); + } + + if( layoutType & AbtTabbed ) + { + mPageTab = new TDEAboutTabWidget( this ); + if( !mPageTab ) { return; } + hbox->addWidget( mPageTab, 10 ); + } + else if( layoutType & AbtImageOnly ) + { + mImageFrame = new TQFrame( this ); + setImageFrame( true ); + hbox->addWidget( mImageFrame, 10 ); + + TQGridLayout* const gbox = new TQGridLayout(mImageFrame, 3, 3, 1, 0 ); + gbox->setRowStretch( 0, 10 ); + gbox->setRowStretch( 2, 10 ); + gbox->setColStretch( 0, 10 ); + gbox->setColStretch( 2, 10 ); + + mImageLabel = new KImageTrackLabel( mImageFrame ); + connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), + TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); + gbox->addWidget( mImageLabel, 1, 1 ); + gbox->activate(); + } + else + { + mPlainSpace = new TQFrame( this ); + if( !mPlainSpace ) { return; } + hbox->addWidget( mPlainSpace, 10 ); + } + + if( layoutType & AbtImageRight ) + { + TQVBoxLayout *vbox = new TQVBoxLayout(); + hbox->addLayout(vbox); + vbox->addSpacing(1); + mImageFrame = new TQFrame( this ); + setImageFrame( true ); + vbox->addWidget( mImageFrame ); + vbox->addSpacing(1); + + vbox = new TQVBoxLayout( mImageFrame, 1 ); + mImageLabel = new KImageTrackLabel( mImageFrame ); + connect( mImageLabel, TQT_SIGNAL(mouseTrack( int, const TQMouseEvent * )), + TQT_SLOT( slotMouseTrack( int, const TQMouseEvent * )) ); + vbox->addStretch(10); + vbox->addWidget( mImageLabel ); + vbox->addStretch(10); + vbox->activate(); + } + + fontChange( font() ); +} + + +void TDEAboutContainerBase::show( void ) +{ + TQWidget::show(); +} + +TQSize TDEAboutContainerBase::sizeHint( void ) const +{ + return minimumSize().expandedTo( TQSize( TQWidget::sizeHint().width(), 0 ) ); +} + +void TDEAboutContainerBase::fontChange( const TQFont &/*oldFont*/ ) +{ + if( mTitleLabel ) + { + TQFont f( TDEGlobalSettings::generalFont() ); + f.setBold( true ); + int fs = f.pointSize(); + if (fs == -1) + fs = TQFontInfo(f).pointSize(); + f.setPointSize( fs+2 ); // Lets not make it too big + mTitleLabel->setFont(f); + } + + if( mVersionLabel ) + { + TQFont f( TDEGlobalSettings::generalFont() ); + f.setBold( true ); + mVersionLabel->setFont(f); + mAuthorLabel->setFont(f); + mVersionLabel->parentWidget()->layout()->activate(); + } + + update(); +} + +TQFrame *TDEAboutContainerBase::addTextPage( const TQString &title, + const TQString &text, + bool richText, int numLines ) +{ + TQFrame* const page = addEmptyPage( title ); + if( !page ) { return 0; } + if( numLines <= 0 ) { numLines = 10; } + + TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); + + if( richText ) + { + KTextBrowser* const browser = new KTextBrowser( page, "browser" ); + browser->setHScrollBarMode( TQScrollView::AlwaysOff ); + browser->setText( text ); + browser->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); + + vbox->addWidget(browser); + connect(browser, TQT_SIGNAL(urlClick(const TQString &)), + TQT_SLOT(slotUrlClick(const TQString &))); + connect(browser, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + TQT_SLOT(slotMailClick(const TQString &,const TQString &))); + } + else + { + KTextEdit* const textEdit = new KTextEdit( page, "text" ); + textEdit->setReadOnly( true ); + textEdit->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); + textEdit->setWordWrap( TQTextEdit::NoWrap ); + vbox->addWidget( textEdit ); + } + + return page; +} + +TQFrame *TDEAboutContainerBase::addLicensePage( const TQString &title, + const TQString &text, int numLines) +{ + TQFrame* const page = addEmptyPage( title ); + if( !page ) { return 0; } + if( numLines <= 0 ) { numLines = 10; } + + TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); + + KTextEdit* const textEdit = new KTextEdit( page, "license" ); + textEdit->setFont( TDEGlobalSettings::fixedFont() ); + textEdit->setReadOnly( true ); + textEdit->setWordWrap( TQTextEdit::NoWrap ); + textEdit->setText( text ); + textEdit->setMinimumHeight( fontMetrics().lineSpacing()*numLines ); + vbox->addWidget( textEdit ); + return page; +} + + +TDEAboutContainer *TDEAboutContainerBase::addContainerPage( const TQString &title, + int childAlignment, + int innerAlignment ) +{ + if( !mPageTab ) + { + kdDebug(291) << "addPage: " << "Invalid layout" << endl; + return 0; + } + + TDEAboutContainer* const container = new TDEAboutContainer( mPageTab, "container", + KDialog::spacingHint(), KDialog::spacingHint(), childAlignment, + innerAlignment ); + mPageTab->addTab( container, title ); + + connect(container, TQT_SIGNAL(urlClick(const TQString &)), + TQT_SLOT(slotUrlClick(const TQString &))); + connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + TQT_SLOT(slotMailClick(const TQString &,const TQString &))); + + return container; +} + + +TDEAboutContainer *TDEAboutContainerBase::addScrolledContainerPage( + const TQString &title, + int childAlignment, + int innerAlignment ) +{ + if( !mPageTab ) + { + kdDebug(291) << "addPage: " << "Invalid layout" << endl; + return 0; + } + + TQFrame* const page = addEmptyPage( title ); + TQVBoxLayout* const vbox = new TQVBoxLayout( page, KDialog::spacingHint() ); + TQScrollView* const scrollView = new TQScrollView( page ); + scrollView->viewport()->setBackgroundMode( PaletteBackground ); + vbox->addWidget( scrollView ); + + TDEAboutContainer* const container = new TDEAboutContainer( scrollView, "container", + KDialog::spacingHint(), KDialog::spacingHint(), childAlignment, + innerAlignment ); + scrollView->addChild( container ); + + + connect(container, TQT_SIGNAL(urlClick(const TQString &)), + TQT_SLOT(slotUrlClick(const TQString &))); + connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + TQT_SLOT(slotMailClick(const TQString &,const TQString &))); + + return container; +} + + +TQFrame *TDEAboutContainerBase::addEmptyPage( const TQString &title ) +{ + if( !mPageTab ) + { + kdDebug(291) << "addPage: " << "Invalid layout" << endl; + return 0; + } + + TQFrame* const page = new TQFrame( mPageTab, title.latin1() ); + page->setFrameStyle( TQFrame::NoFrame ); + + mPageTab->addTab( page, title ); + return page; +} + + +TDEAboutContainer *TDEAboutContainerBase::addContainer( int childAlignment, + int innerAlignment ) +{ + TDEAboutContainer* const container = new TDEAboutContainer( this, "container", + 0, KDialog::spacingHint(), childAlignment, innerAlignment ); + mTopLayout->addWidget( container, 0, childAlignment ); + + connect(container, TQT_SIGNAL(urlClick(const TQString &)), + TQT_SLOT(slotUrlClick(const TQString &))); + connect(container, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + TQT_SLOT(slotMailClick(const TQString &,const TQString &))); + + return container; +} + + + +void TDEAboutContainerBase::setTitle( const TQString &title ) +{ + if( !mTitleLabel ) + { + kdDebug(291) << "setTitle: " << "Invalid layout" << endl; + return; + } + mTitleLabel->setText(title); +} + + +void TDEAboutContainerBase::setImage( const TQString &fileName ) +{ + if( !mImageLabel ) + { + kdDebug(291) << "setImage: " << "Invalid layout" << endl; + return; + } + if( fileName.isNull() ) + { + return; + } + + const TQPixmap logo( fileName ); + if( !logo.isNull() ) + mImageLabel->setPixmap( logo ); + + mImageFrame->layout()->activate(); +} + +void TDEAboutContainerBase::setProgramLogo( const TQString &fileName ) +{ + if( fileName.isNull() ) + { + return; + } + + const TQPixmap logo( fileName ); + setProgramLogo( logo ); +} + +void TDEAboutContainerBase::setProgramLogo( const TQPixmap &pixmap ) +{ + if( !mIconLabel ) + { + kdDebug(291) << "setProgramLogo: " << "Invalid layout" << endl; + return; + } + if( !pixmap.isNull() ) + { + mIconLabel->setPixmap( pixmap ); + } +} + +void TDEAboutContainerBase::setImageBackgroundColor( const TQColor &color ) +{ + if( mImageFrame ) + { + mImageFrame->setBackgroundColor( color ); + } +} + + +void TDEAboutContainerBase::setImageFrame( bool state ) +{ + if( mImageFrame ) + { + if( state ) + { + mImageFrame->setFrameStyle( TQFrame::Panel | TQFrame::Sunken ); + mImageFrame->setLineWidth(1); + } + else + { + mImageFrame->setFrameStyle( TQFrame::NoFrame ); + mImageFrame->setLineWidth(0); + } + } +} + + +void TDEAboutContainerBase::setProduct( const TQString &appName, + const TQString &version, + const TQString &author, + const TQString &year ) +{ + if( !mIconLabel ) + { + kdDebug(291) << "setProduct: " << "Invalid layout" << endl; + return; + } + + if ( kapp ) + { + mIconLabel->setPixmap( kapp->icon() ); + kdDebug(291) << "setPixmap (iconName): " << kapp->iconName() << endl; + } + else + kdDebug(291) << "no kapp" << endl; + + const TQString msg1 = i18n("%1 %2 (Using Trinity %3)").arg(appName).arg(version). + arg(TQString::fromLatin1(TDE_VERSION_STRING)); + const TQString msg2 = !year.isEmpty() ? i18n("%1 %2, %3").arg('©').arg(year). + arg(author) : TQString::fromLatin1(""); + + //if (!year.isEmpty()) + // msg2 = i18n("%1 %2, %3").arg('©').arg(year).arg(author); + + mVersionLabel->setText( msg1 ); + mAuthorLabel->setText( msg2 ); + if( msg2.isEmpty() ) + { + mAuthorLabel->hide(); + } + + mIconLabel->parentWidget()->layout()->activate(); +} + + +void TDEAboutContainerBase::slotMouseTrack( int mode, const TQMouseEvent *e ) +{ + emit mouseTrack( mode, e ); +} + + +void TDEAboutContainerBase::slotUrlClick( const TQString &url ) +{ + emit urlClick( url ); +} + +void TDEAboutContainerBase::slotMailClick( const TQString &_name, + const TQString &_address ) +{ + emit mailClick( _name, _address ); +} + + + +TDEAboutContainer::TDEAboutContainer( TQWidget *_parent, const char *_name, + int _margin, int _spacing, + int childAlignment, int innerAlignment ) + : TQFrame( _parent, _name ), d(0) +{ + mAlignment = innerAlignment; + + TQGridLayout* const gbox = new TQGridLayout( this, 3, 3, _margin, _spacing ); + if( childAlignment & AlignHCenter ) + { + gbox->setColStretch( 0, 10 ); + gbox->setColStretch( 2, 10 ); + } + else if( childAlignment & AlignRight ) + { + gbox->setColStretch( 0, 10 ); + } + else + { + gbox->setColStretch( 2, 10 ); + } + + if( childAlignment & AlignVCenter ) + { + gbox->setRowStretch( 0, 10 ); + gbox->setRowStretch( 2, 10 ); + } + else if( childAlignment & AlignRight ) + { + gbox->setRowStretch( 0, 10 ); + } + else + { + gbox->setRowStretch( 2, 10 ); + } + + mVbox = new TQVBoxLayout( _spacing ); + gbox->addLayout( mVbox, 1, 1 ); + gbox->activate(); +} + + +void TDEAboutContainer::childEvent( TQChildEvent *e ) +{ + if( !e->inserted() || !e->child()->isWidgetType() ) + { + return; + } + + TQWidget* const w = static_cast<TQWidget *>(e->child()); + mVbox->addWidget( w, 0, mAlignment ); + const TQSize s( sizeHint() ); + setMinimumSize( s ); + + TQObjectList const l = childrenListObject(); // silence please + TQObjectListIterator itr( l ); + TQObject * o; + while ( (o = itr.current()) ) { + ++itr; + if( o->isWidgetType() ) + { + TQT_TQWIDGET(o)->setMinimumWidth( s.width() ); + } + } +} + + +TQSize TDEAboutContainer::sizeHint( void ) const +{ + // + // The size is computed by adding the sizeHint().height() of all + // widget children and taking the width of the widest child and adding + // layout()->margin() and layout()->spacing() + // + + TQSize total_size; + + int numChild = 0; + TQObjectList const l = childrenListObject(); // silence please + + TQObjectListIterator itr( l ); + TQObject * o; + while ( (o = itr.current()) ) { + ++itr; + if( o->isWidgetType() ) + { + ++numChild; + TQWidget* const w= TQT_TQWIDGET(o); + + TQSize s = w->minimumSize(); + if( s.isEmpty() ) + { + s = w->minimumSizeHint(); + if( s.isEmpty() ) + { + s = w->sizeHint(); + if( s.isEmpty() ) + { + s = TQSize( 100, 100 ); // Default size + } + } + } + total_size.setHeight( total_size.height() + s.height() ); + if( s.width() > total_size.width() ) { total_size.setWidth( s.width() ); } + } + } + + if( numChild > 0 ) + { + // + // Seems I have to add 1 to the height to properly show the border + // of the last entry if layout()->margin() is 0 + // + + total_size.setHeight( total_size.height() + layout()->spacing()*(numChild-1) ); + total_size += TQSize( layout()->margin()*2, layout()->margin()*2 + 1 ); + } + else + { + total_size = TQSize( 1, 1 ); + } + return total_size; +} + + +TQSize TDEAboutContainer::minimumSizeHint( void ) const +{ + return sizeHint(); +} + + +void TDEAboutContainer::addWidget( TQWidget *widget ) +{ + widget->reparent( this, 0, TQPoint(0,0) ); +} + + +void TDEAboutContainer::addPerson( const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_task, + bool showHeader, bool showFrame,bool showBold) +{ + + TDEAboutContributor* const cont = new TDEAboutContributor( this, "pers", + _name, _email, _url, _task, showHeader, showFrame, showBold ); + connect( cont, TQT_SIGNAL( openURL(const TQString&)), + this, TQT_SIGNAL( urlClick(const TQString &))); + connect( cont, TQT_SIGNAL( sendEmail(const TQString &, const TQString &)), + this, TQT_SIGNAL( mailClick(const TQString &, const TQString &))); +} + + +void TDEAboutContainer::addTitle( const TQString &title, int alignment, + bool showFrame, bool showBold ) +{ + + TQLabel* const label = new TQLabel( title, this, "title" ); + if( showBold ) + { + TQFont labelFont( font() ); + labelFont.setBold( true ); + label->setFont( labelFont ); + } + if( showFrame ) + { + label->setFrameStyle(TQFrame::Panel | TQFrame::Raised); + } + label->setAlignment( alignment ); +} + + +void TDEAboutContainer::addImage( const TQString &fileName, int alignment ) +{ + if( fileName.isNull() ) + { + return; + } + + KImageTrackLabel* const label = new KImageTrackLabel( this, "image" ); + const TQImage logo( fileName ); + if( !logo.isNull() ) + { + TQPixmap pix; + pix = logo; + label->setPixmap( pix ); + } + label->setAlignment( alignment ); +} + +#if 0 +//MOC_SKIP_BEGIN + +/** Every person displayed is stored in a TDEAboutContributor object. + * Every contributor, the author and/or the maintainer of the application are + * stored in objects of this local class. Every single field may be empty. + * To add a contributor, create a TDEAboutContributor object as a child of your + * @ref TDEAboutDialog, set its contents and add it using add addContributor. */ +class TDEAboutContributor : public QFrame +{ + // ############################################################################ + Q_OBJECT + // ---------------------------------------------------------------------------- +public: + /** The Qt constructor. */ + TDEAboutContributor(TQWidget* parent=0, const char* name=0); + /** Set the name (a literal string). */ + void setName(const TQString&); + /** Get the name. */ + TQString getName(); + /** The email address (dito). */ + void setEmail(const TQString&); + /** Get the email address. */ + TQString getEmail(); + /** The URL (dito). */ + void setURL(const TQString&); + /** Get the URL. */ + TQString getURL(); + /** The tasks the person worked on (a literal string). More than one line is + * possible, but very long texts might look ugly. */ + void setWork(const TQString&); + /** The size hint. Very important here, since TDEAboutWidget relies on it for + * geometry management. */ + TQSize sizeHint(); + TQSize minimumSizeHint(void); + virtual void show( void ); + + // ---------------------------------------------------------------------------- +protected: + // events: + /** The resize event. */ + void resizeEvent(TQResizeEvent*); + /** The paint event. */ + void paintEvent(TQPaintEvent*); + /** The label showing the program version. */ + TQLabel *name; + /** The clickable URL label showing the email address. It is only visible if + * its text is not empty. */ + KURLLabel *email; + /** Another interactive part that displays the homepage URL. */ + KURLLabel *url; + /** The description of the contributions of the person. */ + TQString work; + // ---------------------------------------------------------------------------- +protected slots: + /** The homepage URL has been clicked. */ + void urlClickedSlot(const TQString&); + /** The email address has been clicked. */ + void emailClickedSlot(const TQString& emailaddress); + // ---------------------------------------------------------------------------- +signals: + /** The email address has been clicked. */ + void sendEmail(const TQString& name, const TQString& email); + /** The URL has been clicked. */ + void openURL(const TQString& url); + // ############################################################################ +}; + + + +TDEAboutContributor::TDEAboutContributor(TQWidget* parent, const char* n) + : TQFrame(parent, n), + name(new TQLabel(this)), + email(new KURLLabel(this)), + url(new KURLLabel(this)) +{ + // ############################################################ + if(name==0 || email==0) + { // this will nearly never happen (out of memory in about box?) + kdDebug() << "TDEAboutContributor::TDEAboutContributor: Out of memory." << endl; + tqApp->quit(); + } + setFrameStyle(TQFrame::Panel | TQFrame::Raised); + // ----- + connect(email, TQT_SIGNAL(leftClickedURL(const TQString&)), + TQT_SLOT(emailClickedSlot(const TQString&))); + connect(url, TQT_SIGNAL(leftClickedURL(const TQString&)), + TQT_SLOT(urlClickedSlot(const TQString&))); + // ############################################################ +} + +void +TDEAboutContributor::setName(const TQString& n) +{ + // ############################################################ + name->setText(n); + // ############################################################ +} + +QString +TDEAboutContributor::getName() +{ + // ########################################################### + return name->text(); + // ########################################################### +} +void +TDEAboutContributor::setURL(const TQString& u) +{ + // ########################################################### + url->setText(u); + // ########################################################### +} + +QString +TDEAboutContributor::getURL() +{ + // ########################################################### + return url->text(); + // ########################################################### +} + +void +TDEAboutContributor::setEmail(const TQString& e) +{ + // ########################################################### + email->setText(e); + // ########################################################### +} + +QString +TDEAboutContributor::getEmail() +{ + // ########################################################### + return email->text(); + // ########################################################### +} + +void +TDEAboutContributor::emailClickedSlot(const TQString& e) +{ + // ########################################################### + kdDebug() << "TDEAboutContributor::emailClickedSlot: called." << endl; + emit(sendEmail(name->text(), e)); + // ########################################################### +} + +void +TDEAboutContributor::urlClickedSlot(const TQString& u) +{ + // ########################################################### + kdDebug() << "TDEAboutContributor::urlClickedSlot: called." << endl; + emit(openURL(u)); + // ########################################################### +} + +void +TDEAboutContributor::setWork(const TQString& w) +{ + // ########################################################### + work=w; + // ########################################################### +} + +#endif + + +#if 0 +QSize +TDEAboutContributor::sizeHint() +{ + // ############################################################################ + const int FrameWidth=frameWidth(); + const int WorkTextWidth=200; + int maxx, maxy; + TQRect rect; + // ----- first calculate name and email width: + maxx=name->sizeHint().width(); + maxx=QMAX(maxx, email->sizeHint().width()+WORKTEXT_IDENTATION); + // ----- now determine "work" text rectangle: + if(!work.isEmpty()) // save time + { + rect=fontMetrics().boundingRect + (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); + } + if(maxx<rect.width()) + { + maxx=WorkTextWidth+WORKTEXT_IDENTATION; + } + maxx=QMAX(maxx, url->sizeHint().width()+WORKTEXT_IDENTATION); + // ----- + maxy=2*(name->sizeHint().height()+Grid); // need a space above the KURLLabels + maxy+=/* email */ name->sizeHint().height(); + maxy+=rect.height(); + // ----- + maxx+=2*FrameWidth; + maxy+=2*FrameWidth; + return TQSize(maxx, maxy); + // ############################################################################ +} + +TQSize TDEAboutContributor::minimumSizeHint(void) +{ + return( sizeHint() ); +} + + +void TDEAboutContributor::show( void ) +{ + TQFrame::show(); + setMinimumSize( sizeHint() ); +} + + + +void +TDEAboutContributor::resizeEvent(TQResizeEvent*) +{ // the widgets are simply aligned from top to bottom, since the parent is + // expected to respect the size hint + // ############################################################################ + int framewidth=frameWidth(), childwidth=width()-2*framewidth; + int cy=framewidth; + // ----- + name->setGeometry + (framewidth, framewidth, childwidth, name->sizeHint().height()); + cy=name->height()+Grid; + email->setGeometry + (framewidth+WORKTEXT_IDENTATION, cy, + childwidth-WORKTEXT_IDENTATION, /* email */ name->sizeHint().height()); + cy+=name->height()+Grid; + url->setGeometry + (framewidth+WORKTEXT_IDENTATION, cy, + childwidth-WORKTEXT_IDENTATION, /* url */ name->sizeHint().height()); + // the work text is drawn in the paint event + // ############################################################################ +} + + +void +TDEAboutContributor::paintEvent(TQPaintEvent* e) +{ // the widgets are simply aligned from top to bottom, since the parent is + // expected to respect the size hint (the widget is only used locally by now) + // ############################################################################ + int cy=frameWidth()+name->height()+email->height()+Grid+url->height()+Grid; + int h=height()-cy-frameWidth(); + int w=width()-WORKTEXT_IDENTATION-2*frameWidth(); + // ----- + TQFrame::paintEvent(e); + if(work.isEmpty()) return; + TQPainter paint(this); // construct painter only if there is something to draw + // ----- + paint.drawText(WORKTEXT_IDENTATION, cy, w, h, AlignLeft | WordBreak, work); + // ############################################################################ +} +// MOC_SKIP_END +#endif + + +#if 0 +TQSize TDEAboutContributor::sizeHint( void ) +{ + int s = KDialog::spacingHint(); + int h = fontMetrics().lineSpacing()*3 + 2*s; + int m = frameWidth(); + + int w = name->sizeHint().width(); + w = QMAX( w, email->sizeHint().width()+s); + w = QMAX( w, url->sizeHint().width()+s); + + if( work.isEmpty() == false ) + { + const int WorkTextWidth=200; + TQRect r = fontMetrics().boundingRect + (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); + if( w < r.width() ) + { + w = QMAX( w, WorkTextWidth+s ); + } + h += QMAX( fontMetrics().lineSpacing(), r.height() ) + s; + } + return( TQSize( w + 2*m, h + 2*m ) ); + + + /* + int s = 3; + int m = frameWidth() + KDialog::spacingHint(); + int h = ls * 3 + s * 2; + int w = name->sizeHint().width(); + + w = QMAX( w, email->sizeHint().width()+WORKTEXT_IDENTATION); + w = QMAX( w, url->sizeHint().width()+WORKTEXT_IDENTATION); + if( work.isEmpty() == false ) + { + const int WorkTextWidth=200; + + TQRect r = fontMetrics().boundingRect + (0, 0, WorkTextWidth, 32000, WordBreak | AlignLeft, work); + if( w < r.width() ) + { + w = QMAX( w, WorkTextWidth + WORKTEXT_IDENTATION ); + } + h += r.height() + s; + } + return( TQSize( w + 2*m, h + 2*m ) ); + */ +} + + +// +// The widgets are simply aligned from top to bottom, since the parent is +// expected to respect the size hint +// +void TDEAboutContributor::resizeEvent(TQResizeEvent*) +{ + int x = frameWidth(); + int s = KDialog::spacingHint(); + int h = fontMetrics().lineSpacing(); + int w = width() - 2*x; + int y = x; + + name->setGeometry( x, y, w, h ); + y += h + s; + email->setGeometry( x+s, y, w-s, h ); + y += h + s; + url->setGeometry( x+s, y, w-s, h ); + + /* + int x = frameWidth() + KDialog::spacingHint(); + int y = x; + int w = width() - 2*x; + int h = name->sizeHint().height(); + int s = 3; + + name->setGeometry( x, y, w, h ); + y += h + s; + email->setGeometry( x+WORKTEXT_IDENTATION, y, w-WORKTEXT_IDENTATION, h ); + y += h + s; + url->setGeometry( x+WORKTEXT_IDENTATION, y, w-WORKTEXT_IDENTATION, h ); + // + // the work text is drawn in the paint event + // + */ +} + + + +void TDEAboutContributor::paintEvent( TQPaintEvent *e ) +{ + TQFrame::paintEvent(e); + if(work.isEmpty()) return; + + int x = frameWidth() + KDialog::spacingHint(); + int h = fontMetrics().lineSpacing(); + int y = height() - frameWidth() - fontMetrics().lineSpacing(); + int w = width() - frameWidth()*2 - KDialog::spacingHint(); + + TQPainter paint( this ); + paint.drawText( x, y, w, h, AlignLeft | WordBreak, work ); + + /* + + int s = 3; + int x = frameWidth() + KDialog::spacingHint() + WORKTEXT_IDENTATION; + int w = width()-WORKTEXT_IDENTATION-2*(frameWidth()+KDialog::spacingHint()); + int y = frameWidth()+KDialog::spacingHint()+(name->sizeHint().height()+s)*3; + int h = height()-y-frameWidth(); + + TQPainter paint( this ); + paint.drawText( x, y, w, h, AlignLeft | WordBreak, work ); + */ +} +#endif + + + + + + +TDEAboutWidget::TDEAboutWidget(TQWidget *_parent, const char *_name) + : TQWidget(_parent, _name), + version(new TQLabel(this)), + cont(new TQLabel(this)), + logo(new TQLabel(this)), + author(new TDEAboutContributor(this)), + maintainer(new TDEAboutContributor(this)), + showMaintainer(false), + d(0) +{ + // ################################################################# + if( !version || !cont || !logo || !author || !maintainer ) + { + // this will nearly never happen (out of memory in about box?) + kdDebug() << "TDEAboutWidget::TDEAboutWidget: Out of memory." << endl; + tqApp->quit(); + } + // ----- + cont->setText(i18n("Other Contributors:")); + logo->setText(i18n("(No logo available)")); + logo->setFrameStyle(TQFrame::Panel | TQFrame::Raised); + version->setAlignment(AlignCenter); + // ----- + connect(author, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), + TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); + connect(author, TQT_SIGNAL(openURL(const TQString&)), + TQT_SLOT(openURLSlot(const TQString&))); + connect(maintainer, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), + TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); + connect(maintainer, TQT_SIGNAL(openURL(const TQString&)), + TQT_SLOT(openURLSlot(const TQString&))); + // ################################################################# +} + + +void +TDEAboutWidget::adjust() +{ + // ################################################################# + int cx, cy, tempx; + int maintWidth, maintHeight; + TQSize total_size; + // ----- + if(showMaintainer) + { + total_size=maintainer->sizeHint(); + maintWidth=total_size.width(); + maintHeight=total_size.height(); + } else { + maintWidth=0; + maintHeight=0; + } + total_size=author->sizeHint(); + logo->adjustSize(); + cy=version->sizeHint().height()+Grid; + cx=logo->width(); + tempx=QMAX(total_size.width(), maintWidth); + cx+=Grid+tempx; + cx=QMAX(cx, version->sizeHint().width()); + cy+=QMAX(logo->height(), + total_size.height()+(showMaintainer ? Grid+maintHeight : 0)); + // ----- + if(!contributors.isEmpty()) + { + cx=QMAX(cx, cont->sizeHint().width()); + cy+=cont->sizeHint().height()+Grid; + TQPtrListIterator<TDEAboutContributor> _pos(contributors); + TDEAboutContributor* currEntry; + while ( (currEntry = _pos.current()) ) + { + ++_pos; + cy+=currEntry->sizeHint().height(); + } + } + // ----- + setMinimumSize(cx, cy); + // ################################################################# +} + +void +TDEAboutWidget::setLogo(const TQPixmap& i) +{ + // ############################################################################ + logo->setPixmap(i); + // ############################################################################ +} + +void TDEAboutWidget::sendEmailSlot(const TQString &_name, const TQString &_email) +{ + emit(sendEmail(_name, _email)); +} + +void TDEAboutWidget::openURLSlot(const TQString& _url) +{ + emit(openURL(_url)); +} + +void +TDEAboutWidget::setAuthor(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ############################################################################ + author->setName(_name); + author->setEmail(_email); + author->setURL(_url); + author->setWork(_w); + // ############################################################################ +} + +void +TDEAboutWidget::setMaintainer(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ############################################################################ + maintainer->setName(_name); + maintainer->setEmail(_email); + maintainer->setWork(_w); + maintainer->setURL(_url); + showMaintainer=true; + // ############################################################################ +} + +void +TDEAboutWidget::addContributor(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ############################################################################ + TDEAboutContributor* const c=new TDEAboutContributor(this); + // ----- + c->setName(_name); + c->setEmail(_email); + c->setURL(_url); + c->setWork(_w); + contributors.append(c); + connect(c, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), + TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); + connect(c, TQT_SIGNAL(openURL(const TQString&)), TQT_SLOT(openURLSlot(const TQString&))); + // ############################################################################ +} + +void +TDEAboutWidget::setVersion(const TQString &_name) +{ + // ############################################################################ + version->setText(_name); + // ############################################################################ +} + +void +TDEAboutWidget::resizeEvent(TQResizeEvent*) +{ + // ############################################################################ + int _x=0, _y, cx, tempx, tempy; + // ----- set version label geometry: + version->setGeometry(0, 0, width(), version->sizeHint().height()); + _y=version->height()+Grid; + // ----- move logo to correct position: + logo->adjustSize(); + logo->move(0, _y); + // ----- move author and maintainer right to it: + tempx=logo->width()+Grid; + cx=width()-tempx; + author->setGeometry + (tempx, _y, cx, author->sizeHint().height()); + maintainer->setGeometry + (tempx, _y+author->height()+Grid, cx, maintainer->sizeHint().height()); + + _y+=QMAX(logo->height(), + author->height()+(showMaintainer ? Grid+maintainer->height() : 0)); + // ----- + if(!contributors.isEmpty()) + { + tempy=cont->sizeHint().height(); + cont->setGeometry(0, _y, width(), tempy); + cont->show(); + _y+=tempy+Grid; + } else { + cont->hide(); + } + TQPtrListIterator<TDEAboutContributor> _pos(contributors); + TDEAboutContributor* currEntry; + while( (currEntry = _pos.current()) ) + { + ++_pos; + tempy=currEntry->sizeHint().height(); + // y+=Grid; + currEntry->setGeometry(_x, _y, width(), tempy); + _y+=tempy; + } + if(showMaintainer) + { + maintainer->show(); + } else { + maintainer->hide(); + } + // ############################################################################ +} + +TDEAboutDialog::TDEAboutDialog(TQWidget *_parent, const char *_name, bool modal) + : KDialogBase(_parent, _name, modal, TQString::null, Ok, Ok ), + about(new TDEAboutWidget(this)), mContainerBase(0), d(0) +{ + // ################################################################# + if(!about) + { + // this will nearly never happen (out of memory in about box?) + kdDebug() << "TDEAboutDialog::TDEAboutDialog: Out of memory." << endl; + tqApp->quit(); + } + setMainWidget(about); + connect(about, TQT_SIGNAL(sendEmail(const TQString&, const TQString&)), + TQT_SLOT(sendEmailSlot(const TQString&, const TQString&))); + connect(about, TQT_SIGNAL(openURL(const TQString&)), + TQT_SLOT(openURLSlot(const TQString&))); + // ################################################################# +} + + +TDEAboutDialog::TDEAboutDialog( int layoutType, const TQString &_caption, + int buttonMask, ButtonCode defaultButton, + TQWidget *_parent, const char *_name, bool modal, + bool separator, const TQString &user1, + const TQString &user2, const TQString &user3 ) + :KDialogBase( _parent, _name, modal, TQString::null, buttonMask, defaultButton, + separator, user1, user2, user3 ), + about(0), d(0) +{ + setPlainCaption( i18n("About %1").arg(_caption) ); + + mContainerBase = new TDEAboutContainerBase( layoutType, this ); + setMainWidget(mContainerBase); + + connect( mContainerBase, TQT_SIGNAL(urlClick(const TQString &)), + this, TQT_SLOT(openURLSlot(const TQString &))); + connect( mContainerBase, TQT_SIGNAL(mailClick(const TQString &,const TQString &)), + this, TQT_SLOT(sendEmailSlot(const TQString &,const TQString &))); + connect( mContainerBase, TQT_SIGNAL(mouseTrack(int, const TQMouseEvent *)), + this, TQT_SLOT(mouseTrackSlot(int, const TQMouseEvent *))); +} + + +void TDEAboutDialog::show( void ) +{ + adjust(); + if( mContainerBase ) { mContainerBase->show(); } + TQDialog::show(); +} + + +void TDEAboutDialog::show( TQWidget * /*centerParent*/ ) +{ + adjust(); + if( mContainerBase ) { mContainerBase->show(); } + TQDialog::show(); +} + + +void TDEAboutDialog::adjust() +{ + if( !about ) { return; } + about->adjust(); + //initializeGeometry(); + resize( sizeHint() ); +} + + +void TDEAboutDialog::setLogo(const TQPixmap& i) +{ + if( !about ) { return; } + about->setLogo(i); +} + + +void TDEAboutDialog::setMaintainer(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ################################################################# + if( !about ) { return; } + about->setMaintainer(_name, _email, _url, _w); + // ################################################################# +} + +void TDEAboutDialog::setAuthor(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_work) +{ + // ################################################################# + if( !about ) { return; } + about->setAuthor(_name, _email, _url, _work); + // ################################################################# +} + +void TDEAboutDialog::addContributor(const TQString &_name, const TQString &_email, + const TQString &_url, const TQString &_w) +{ + // ################################################################# + if( !about ) { return; } + about->addContributor(_name, _email, _url, _w); + // ################################################################# +} + +void TDEAboutDialog::setVersion(const TQString &_name) +{ + // ################################################################# + if( !about ) { return; } + about->setVersion(_name); + // ################################################################# +} + +void TDEAboutDialog::sendEmailSlot(const TQString& /*name*/, const TQString& email) +{ + if ( kapp ) + kapp->invokeMailer( email, TQString::null ); + /* + kdDebug() << "TDEAboutDialog::sendEmailSlot: request to send an email to " + << name << ", " << email << endl; + emit(sendEmail(name, email)); + */ +} + +void TDEAboutDialog::openURLSlot(const TQString& url) +{ + if ( kapp ) + kapp->invokeBrowser( url ); + //kdDebug() << "TDEAboutDialog::openURLSlot: request to open URL " << url << endl; + //emit(openURL(url)); +} + + +void TDEAboutDialog::mouseTrackSlot( int /*mode*/, const TQMouseEvent * /*e*/ ) +{ + // By default we do nothing. This method must be reimplemented. +} + + +TQFrame *TDEAboutDialog::addTextPage( const TQString &title, const TQString &text, + bool richText, int numLines ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addTextPage( title, text, richText, numLines ); +} + +TQFrame *TDEAboutDialog::addLicensePage( const TQString &title, const TQString &text, + int numLines ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addLicensePage( title, text, numLines ); +} + + +TDEAboutContainer *TDEAboutDialog::addContainerPage( const TQString &title, + int childAlignment, int innerAlignment ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addContainerPage( title, childAlignment, + innerAlignment); +} + + +TDEAboutContainer *TDEAboutDialog::addScrolledContainerPage( const TQString &title, + int childAlignment, int innerAlignment ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addScrolledContainerPage( title, childAlignment, + innerAlignment); +} + + + +TQFrame *TDEAboutDialog::addPage( const TQString &title ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addEmptyPage( title ); +} + + +TDEAboutContainer *TDEAboutDialog::addContainer( int childAlignment, + int innerAlignment ) +{ + if( !mContainerBase ) { return 0; } + return mContainerBase->addContainer( childAlignment, innerAlignment ); +} + + +void TDEAboutDialog::setTitle( const TQString &title ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setTitle( title ); +} + + +void TDEAboutDialog::setImage( const TQString &fileName ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setImage( fileName ); +} + +// KDE4: remove +void TDEAboutDialog::setIcon( const TQString &fileName ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setProgramLogo( fileName ); +} + +void TDEAboutDialog::setProgramLogo( const TQString &fileName ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setProgramLogo( fileName ); +} + +void TDEAboutDialog::setProgramLogo( const TQPixmap &pixmap ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setProgramLogo( pixmap ); +} + +void TDEAboutDialog::setImageBackgroundColor( const TQColor &color ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setImageBackgroundColor( color ); +} + + +void TDEAboutDialog::setImageFrame( bool state ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setImageFrame( state ); +} + + +void TDEAboutDialog::setProduct( const TQString &appName, const TQString &version, + const TQString &author, const TQString &year ) +{ + if( !mContainerBase ) { return; } + mContainerBase->setProduct( appName, version, author, year ); +} + + + +void TDEAboutDialog::imageURL( TQWidget *_parent, const TQString &_caption, + const TQString &_path, const TQColor &_imageColor, + const TQString &_url ) +{ + TDEAboutDialog a( AbtImageOnly, TQString::null, Close, Close, _parent, "image", true ); + a.setPlainCaption( _caption ); + a.setImage( _path ); + a.setImageBackgroundColor( _imageColor ); + + TDEAboutContainer* const c = a.addContainer( AlignCenter, AlignCenter ); + if( c ) + { + c->addPerson( TQString::null, TQString::null, _url, TQString::null ); + } + a.exec(); +} + + + + +// +// A class that can can monitor mouse movements on the image +// +KImageTrackLabel::KImageTrackLabel( TQWidget *_parent, const char *_name, WFlags f ) + : TQLabel( _parent, _name, f ) +{ + setText( i18n("Image missing")); +} + +void KImageTrackLabel::mousePressEvent( TQMouseEvent *e ) +{ + emit mouseTrack( MousePress, e ); +} + +void KImageTrackLabel::mouseReleaseEvent( TQMouseEvent *e ) +{ + emit mouseTrack( MouseRelease, e ); +} + +void KImageTrackLabel::mouseDoubleClickEvent( TQMouseEvent *e ) +{ + emit mouseTrack( MouseDoubleClick, e ); +} + +void KImageTrackLabel::mouseMoveEvent ( TQMouseEvent *e ) +{ + emit mouseTrack( MouseDoubleClick, e ); +} + +void TDEAboutDialog::virtual_hook( int id, void* data ) +{ KDialogBase::virtual_hook( id, data ); } + diff --git a/tdeui/tdeaboutdialog.h b/tdeui/tdeaboutdialog.h new file mode 100644 index 000000000..fbb19b98e --- /dev/null +++ b/tdeui/tdeaboutdialog.h @@ -0,0 +1,633 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 1999-2001 Mirko Boehm (mirko@kde.org) and + * Espen Sand (espen@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. + * + */ + +/* + * This file declares a class for creating "About ..." dialogs + * in a general way. It provides geometry management and some + * options to connect for, like emailing the author or maintainer. + */ + + +#ifndef _KABOUTDIALOG_H_ +#define _KABOUTDIALOG_H_ + +#include <kdialogbase.h> +#include <tqstring.h> + +class TQFrame; +class TQLabel; +class TQVBoxLayout; +class TQTabWidget; +class KURLLabel; +class TDEAboutContainer; +class TDEAboutContainerBase; + +class TDEAboutWidgetPrivate; + +class TDEAboutContainerPrivate; +/** + * TDEAboutContainer can be used to make a application specific AboutDialog. + */ +class TDEUI_EXPORT TDEAboutContainer : public TQFrame +{ + Q_OBJECT + + public: + TDEAboutContainer( TQWidget *parent=0, const char *name=0, + int margin=0, int spacing=0, + int childAlignment = AlignCenter, + int innerAlignment = AlignCenter ); + + void addWidget( TQWidget *widget ); + void addPerson( const TQString &name, const TQString &email, + const TQString &url, const TQString &task, + bool showHeader = false, bool showframe = false, + bool showBold = false ); + void addTitle( const TQString &title, int alignment=AlignLeft, + bool showframe = false, bool showBold = false ); + void addImage( const TQString &fileName, int alignment=AlignLeft ); + + virtual TQSize sizeHint( void ) const; + virtual TQSize minimumSizeHint( void ) const; + + protected: + virtual void childEvent( TQChildEvent *e ); + + signals: + void urlClick( const TQString &url ); + void mailClick( const TQString &name, const TQString &address ); + + + private: + TQVBoxLayout *mVbox; + int mAlignment; + TDEAboutContainerPrivate* const d; +}; + +class TDEAboutContributorPrivate; + +/** + * Used internally by TDEAboutWidget + * @internal + */ +class TDEUI_EXPORT TDEAboutContributor : public TQFrame +{ + Q_OBJECT + + public: + TDEAboutContributor( TQWidget *parent=0, const char *name=0, + const TQString &username=TQString::null, + const TQString &email=TQString::null, + const TQString &url=TQString::null, + const TQString &work=TQString::null, + bool showHeader=false, bool showFrame=true, + bool showBold=false ); + + void setName( const TQString &text, const TQString &header=TQString::null, + bool update = true ); + void setEmail( const TQString &text, const TQString &header=TQString::null, + bool update = true ); + void setURL( const TQString &text, const TQString &header=TQString::null, + bool update = true ); + void setWork( const TQString &text, const TQString &header=TQString::null, + bool update = true ); + TQString getName( void ) const; + TQString getEmail( void ) const; + TQString getURL( void ) const; + TQString getWork( void ) const; + + virtual TQSize sizeHint( void ) const; + + protected: + virtual void fontChange( const TQFont &oldFont ); + + protected slots: + void urlClickedSlot( const TQString& ); + void emailClickedSlot( const TQString& emailaddress ); + + private: + void updateLayout( void ); + + signals: + void sendEmail(const TQString& name, const TQString& email); + void openURL(const TQString& url); + + private: + TQLabel *mLabel[4]; + TQLabel *mText[4]; + bool mShowHeader; + bool mShowBold; + + TDEAboutContributorPrivate* const d; + + virtual void setName(const char *_name) { TQFrame::setName(_name); } +}; + +/** + * TDEAboutWidget is the main widget for TDEAboutDialog. + * + * It has a minimum size set. + */ +class TDEUI_EXPORT TDEAboutWidget : public TQWidget +{ + Q_OBJECT + +public: + + /** + * The Qt constructor. + */ + TDEAboutWidget(TQWidget* parent=0, const char* name=0 ); + + /** + * Adjust the minimum size (after setting the properties of the image and + * the labels. + */ + void adjust(); + + /** + * Sets the image as the application logo. + */ + void setLogo(const TQPixmap&); + /** + * Sets the author's name and email address. + */ + void setAuthor(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + /** + * Sets the maintainers name and email address. + */ + void setMaintainer(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + /** + * Shows this person as one of the major contributors. + */ + void addContributor(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + /** + * Sets the text describing the version. + */ + void setVersion(const TQString& name); + // ------------------------------------------------------------------------- +protected slots: + /** + * Catches the signals from the contributors elements. + */ + void sendEmailSlot(const TQString& name, const TQString& email); + /** + * Catches the clicked URLs. + */ + void openURLSlot(const TQString& url); + // ------------------------------------------------------------------------- +signals: + /** + * An email address has been selected by the user. + */ + void sendEmail(const TQString& name, const TQString& email); + /** + * An URL has been clicked. + */ + void openURL(const TQString& url); + // ------------------------------------------------------------------------- +protected: + // events: + /** + * The resize event. + */ + void resizeEvent(TQResizeEvent*); + /** + * The label showing the program version. + */ + TQLabel *version; + /** + * The label showing the text "Other contributors:". + */ + TQLabel *cont; + /** + * The frame showing the logo. + */ + TQLabel *logo; + /** + * The application developer. + */ + TDEAboutContributor *author; + /** + * The application maintainer. + */ + TDEAboutContributor *maintainer; + /** + * Show the maintainer? + */ + bool showMaintainer; + /** + * A set of people who contributed to the application. + */ + TQPtrList<TDEAboutContributor> contributors; + // ######################################################################### + // +private: + TDEAboutWidgetPrivate* const d; +}; + +class TDEAboutDialogPrivate; +/** + * A KDialogBase with predefined main widget. + * + * As a KDialogBase it uses your application wide settings + * for KDialogBase + * objects (base frame tiles, main frame tiles etc). + * To use it, simply create a TDEAboutDialog object, set all (or some) of its + * properties and show it. Do not derive it to create your own about dialog + * until you need some cool features that are unsupported and you have + * contacted me to add them. + * + * The dialog can be created using two different constructors. The + * difference between these constructors is the available components that + * can be used to build the contents of the dialog. The first (Constructor I) + * provides a number of easy to use methods. Basically it allows you + * to add the components of choice, and the components are placed in a + * predefined layout. You do not have to plan the layout. Everything is + * taken care of. + * + * The second constructor (Constructor II) works in quite the same manner + * as the first, but you have better control on where the components + * are postioned in the layout and you have access to an extended number + * of components you can install such as titles, product information, + * a tabbed pages (where you can display rich text with url links) and + * a person (developer) information field. The "About KDE" dialog box is + * created with Constructor II. + * + * For the derived features, see the basic class KDialogBase. + * @author Mirko Boehm (mirko@kde.org) and Espen Sand (espensa@online.no) + * @see KDialogBase + */ +class TDEUI_EXPORT TDEAboutDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + * Layout formats. + **/ + enum LayoutType + { + AbtPlain = 0x0001, + AbtTabbed = 0x0002, + AbtTitle = 0x0004, + AbtImageLeft = 0x0008, + AbtImageRight = 0x0010, + AbtImageOnly = 0x0020, + AbtProduct = 0x0040, + AbtKDEStandard = AbtTabbed|AbtTitle|AbtImageLeft, + AbtAppStandard = AbtTabbed|AbtTitle|AbtProduct, + AbtImageAndTitle = AbtPlain|AbtTitle|AbtImageOnly + }; + + public: + /** + * The standard Qt constructor (Constructor I). + * + * Add components with the following methods: + * setLogo(), setAuthor(), setMaintainer(), + * addContributor(), or setVersion(). + * The dialog will be laid out automatically. + */ + TDEAboutDialog( TQWidget *parent=0, const char *name=0, bool modal=true ); + + /** + * The extended constructor. (Constructor II). + * + * Add components with the methods: + * setTitle(), setImage(), setImageBackgroundColor(), + * setImageFrame(), setProduct(), addTextPage(), + * addContainerPage(), addContainer(), or addPage(). + * + * @param dialogLayout Use a mask of LayoutType flags. + * @param caption The dialog caption. The text you specify is prepended + * by i18n("About"). + * @param buttonMask Specifies what buttons will be visible. + * @param defaultButton Specifies what button will be marked as the default. + * @param parent Parent of the dialog. + * @param name Dialog name (for internal use only) + * @param modal Sets dialog modality. If false, the rest of the + * program interface (other dialogs, for example) is accessible while + * the dialog is open. + * @param separator If true, a separator line is drawn between the action + * buttons an the main widget. + * @param user1 User button1 text. + * @param user2 User button2 text. + * @param user3 User button3 text. + * + */ + TDEAboutDialog( int dialogLayout, const TQString &caption, int buttonMask, + ButtonCode defaultButton, TQWidget *parent=0, + const char *name=0, bool modal=false, bool separator = false, + const TQString &user1 = TQString::null, + const TQString &user2 = TQString::null, + const TQString &user3 = TQString::null ); + + /** + * Adjusts the dialog. + * + * You can call this method after you have set up all + * the contents but it is not required. It is done automatically when + * show() is executed. + */ + void adjust(); + + /** + * Makes a modeless (modal = false in constructor) dialog visible. + * + * If you reimplement this method make sure you run it + * in the new method (e.g., show()). Reimplemented + * from KDialogBase. + */ + virtual void show( void ); + + /** + * Makes a modeless (modal = false in constructor) dialog visible. + * + * If you reimplmement this method make sure you run it + * in the new method (i.e., show( parent )). + * + * @param centerParent Center the dialog with respect to this widget. + */ + virtual void show( TQWidget *centerParent ); + + /** + * (Constructor II only) + * Sets a title (not caption) in the uppermost area of the dialog. + * + * @param title Title string. + */ + void setTitle( const TQString &title ); + + /** + * (Constructor II only) + * Define an image to be shown in the dialog. The position is dependent + * on the @p dialogLayout in the constructor + * + * @param fileName Path to image file. + */ + void setImage( const TQString &fileName ); + + /** + * (Constructor II only) + * Define the program logo to be shown in the dialog. Use this to override the + * default program logo. For example, use this function if the + * TDEAboutDialog is for a panel applet and you want to override the + * appletproxy logo with your own pixmap. + * + * @param fileName Path to file containing logo data in a format that + * can be loaded by TQPixmap. + * + * @since 3.3 + */ + void setIcon( const TQString &fileName ) KDE_DEPRECATED; // KDE4: remove + + /** + * Overloaded version of setProgramLogo(const TQPixmap& pixmap). + * + * @since 3.4 + */ + void setProgramLogo( const TQString &fileName ); + + /** + * (Constructor II only) + * Define the program logo to be shown in the dialog. Use this to override the + * default program logo. For example, use this function if the + * TDEAboutDialog is for a panel applet and you want to override the + * appletproxy logo with your own pixmap. + * + * @param pixmap The logo pixmap. + * + * @since 3.4 + */ + void setProgramLogo( const TQPixmap &pixmap ); + + /** + * (Constructor II only) + * The image has a minimum size, but is centered within an area if the + * dialog box is enlarged by the user. You set the background color + * of the area with this method. + * + * @param color Background color. + */ + void setImageBackgroundColor( const TQColor &color ); + + /** + * (Constructor II only) + * Enables or disables a frame around the image. The frame is, by default, + * enabled in the constructor + * + * @param state A value of @p true enables the frame + */ + void setImageFrame( bool state ); + + /** + * (Constructor II only) + * Prints the application name, KDE version, author, a copyright sign + * and a year string. To the left of the text the standard application + * icon is displayed. + * + * @param appName The application name. + * @param version Application version. + * @param author One or more authors. + * @param year A string telling when the application was made. + */ + void setProduct( const TQString &appName, const TQString &version, + const TQString &author, const TQString &year ); + + /** + * (Constructor II only) + * Adds a text page to a tab box. The text can be regular text or + * rich text. The rich text can contain URLs and mail links. + * + * @param title Tab name. + * @param text The text to display. + * @param richText Set this to @p true if 'text' is rich text. + * @param numLines The text area height will be adjusted so that this + * is the minimum number of lines of text that are visible. + * @return The frame that contains the page. + */ + TQFrame *addTextPage( const TQString &title, const TQString &text, + bool richText=false, int numLines=10 ); + + /** + * (Constructor II only) + * Adds a license page to a tab box. + * + * @param title Tab name. + * @param text The text to display. + * @param numLines The text area height will be adjusted so that this + * is the minimum number of lines of text that are visible. + * @return The frame that contains the page. + */ + TQFrame *addLicensePage( const TQString &title, const TQString &text, + int numLines=10 ); + + /** + * (Constructor II only) + * Adds a container to a tab box. You can add text and images to a + * container. + * + * @param title Tab name. + * @param childAlignment Specifies how the children of the container are + * aligned with respect to the container. + * @param innerAlignment Specifies how the children are aligned with + * respect to each other. + * @return The new container. + */ + TDEAboutContainer *addContainerPage( const TQString &title, + int childAlignment = AlignCenter, int innerAlignment = AlignCenter ); + + /** + * (Constructor II only) + * Adds a container inside a TQScrollView to a tab box. You can add text + * and images to a container. + * + * @param title Tab name. + * @param childAlignment Specifies how the children of the container are + * aligned with respect to the container. + * @param innerAlignment Specifies how the children are aligned with + * respect to each other. + * @return The new container. + */ + TDEAboutContainer *addScrolledContainerPage( const TQString &title, + int childAlignment = AlignCenter, int innerAlignment = AlignCenter ); + + /** + * (Constructor II only) + * Adds a container. You can add text and images to a container. + * + * @param childAlignment Specifies how the children of the container are + * aligned with respect to the container. + * @param innerAlignment Specifies how the children are aligned with + * respect to each other. + * @return The new container. + */ + TDEAboutContainer *addContainer( int childAlignment, int innerAlignment ); + + /** + * (Constructor II only) + * Adds an empty page to a tab box. + * + * @param title Tab name + * @return The new page. + */ + TQFrame *addPage( const TQString &title ); + + + /** + * (Constructor I only) + * Sets the image as the application logo. + */ + void setLogo(const TQPixmap&); + + /** + * (Constructor I only) + * Sets the author's name and email address. + */ + void setAuthor(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + + /** + * (Constructor I only) + * Sets the maintainer's name and email address. + */ + void setMaintainer(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + + /** + * (Constructor I only) + * Show this person as one of the major contributors. + */ + void addContributor(const TQString& name, const TQString& email, + const TQString& url, const TQString& work); + + /** + * (Constructor I only) + * Sets the text describing the version. + */ + void setVersion(const TQString& name); + + /** + * Create a modal dialog with an image in the upper area with a + * URL link below. + */ + static void imageURL( TQWidget *parent, const TQString &caption, + const TQString &path, const TQColor &imageColor, + const TQString &url ); + +signals: + /** + * Send an email to this person. + * + * The application must provide the + * functionality. + */ + void sendEmail(const TQString& name, const TQString& email); + + /** + * Open the selected URL. + */ + void openURL(const TQString& url); + // ---------------------------------------------------------------------------- +protected: + /** + * The main widget (Constructor I) + */ + TDEAboutWidget * about; + + /** + * The main widget (Constructor II) + */ + TDEAboutContainerBase *mContainerBase; + + // ------------------------------------------------------------------------- +protected slots: + + /** + * Connected to widget->sendEmail. + */ + void sendEmailSlot(const TQString& name, const TQString& email); + + /** + * Open this URL. + */ + void openURLSlot(const TQString& url); + + /** + * (Constructor II only) + * Tells the position of the mouse cursor when the left mouse button + * is pressed above an image + */ + virtual void mouseTrackSlot( int mode, const TQMouseEvent *e ); + + // ######################################################################### +protected: + virtual void virtual_hook( int id, void* data ); +private: + TDEAboutDialogPrivate* const d; +}; + +#endif // defined KABOUTDIALOG_H diff --git a/tdeui/tdeabouttde.cpp b/tdeui/tdeabouttde.cpp new file mode 100644 index 000000000..0e7078af4 --- /dev/null +++ b/tdeui/tdeabouttde.cpp @@ -0,0 +1,87 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Espen Sand (espen@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. + * + */ + +// I (espen) prefer that header files are included alphabetically +#include <tdeabouttde.h> +#include <tdeapplication.h> +#include <klocale.h> +#include <kstandarddirs.h> + + +TDEAboutKDE::TDEAboutKDE( TQWidget *parent, const char *name, bool modal ) + :TDEAboutDialog( TDEAboutDialog::AbtKDEStandard, TQString::fromLatin1("TDE"), + KDialogBase::Help|KDialogBase::Close, KDialogBase::Close, + parent, name, modal ) +{ + const TQString text1 = i18n("" + "The <b>Trinity Desktop Environment</b> is a fork of the " + "K Desktop Environment version 3.5, which was originally written by the KDE Team, " + "a world-wide network of software engineers committed to <a " + "href=\"http://www.gnu.org/philosophy/free-sw.html\">Free Software</a> " + "development.<br><br>No single group, company or organization controls the " + "Trinity source code. Everyone is welcome to contribute to Trinity.<br><br>Visit <A " + "HREF=\"http://www.trinitydesktop.org/\">http://www.trinitydesktop.org</A> for more information " + "about Trinity, and <A HREF=\"http://www.kde.org/\">http://www.kde.org</A> " + "for more information on the KDE project. "); + + const TQString text2 = i18n("" + "Software can always be improved, and the Trinity Team is ready to " + "do so. However, you - the user - must tell us when " + "something does not work as expected or could be done better.<br><br>" + "The Trinity Desktop Environment has a bug tracking system. Visit " + "<A HREF=\"http://bugs.pearsoncomputing.net/\">http://bugs.pearsoncomputing.net</A> or " + "use the \"Report Bug...\" dialog from the \"Help\" menu to report bugs.<br><br>" + "If you have a suggestion for improvement then you are welcome to use " + "the bug tracking system to register your wish. Make sure you use the " + "severity called \"Wishlist\"." ); + + const TQString text3 = i18n("" + "You do not have to be a software developer to be a member of the " + "Trinity team. You can join the national teams that translate " + "program interfaces. You can provide graphics, themes, sounds, and " + "improved documentation. You decide!" + "<br><br>" + "Visit " + "<A HREF=\"http://www.trinitydesktop.org/jobs/\">http://www.trinitydesktop.org/jobs/</A> " + "for information on some projects in which you can participate." + "<br><br>" + "If you need more information or documentation, then a visit to " + "<A HREF=\"http://www.trinitydesktop.org/docs/\">http://www.trinitydesktop.org/docs/</A> " + "will provide you with what you need."); + const TQString text4 = i18n("" + "Trinity is available free of charge, but making it is not free.<br><br>" + "<br><br>" + "The Trinity team does need financial support. Most of the money is used to " + "reimburse members and others on expenses they experienced when " + "contributing to Trinity. You are encouraged to support Trinity through a financial " + "donation, using one of the ways described at " + "<a href=\"http://www.trinitydesktop.org/donate.php\">http://www.trinitydesktop.org/donate.php</a>." + "<br><br>Thank you very much in advance for your support!"); + setHelp( TQString::fromLatin1("khelpcenter/main.html"), TQString::null ); + setTitle(i18n("Trinity Desktop Environment. Release %1"). + arg(TQString::fromLatin1(TDE_VERSION_STRING)) ); + addTextPage( i18n("About Trinity","&About"), text1, true ); + addTextPage( i18n("&Report Bugs/Request Enhancements"), text2, true ); + addTextPage( i18n("&Join the Trinity Team"), text3, true ); + addTextPage( i18n("&Support Trinity"), text4, true ); + setImage( locate( "data", TQString::fromLatin1("tdeui/pics/aboutkde.png")) ); + setImageBackgroundColor( white ); +} diff --git a/tdeui/tdeabouttde.h b/tdeui/tdeabouttde.h new file mode 100644 index 000000000..a75b92904 --- /dev/null +++ b/tdeui/tdeabouttde.h @@ -0,0 +1,62 @@ +/* + * This file is part of the KDE Libraries + * Copyright (C) 2000 Espen Sand (espen@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 _KABOUT_KDE_H_ +#define _KABOUT_KDE_H_ + +#include <tdeaboutdialog.h> + +/** + * @short Standard "About KDE" dialog box, + * + * This class provides the standard "About KDE" dialog box that is used + * KHelpMenu Normally you should not use this class directly but + * rather the KHelpMenu class or even better just subclass your + * toplevel window from TDEMainWindow. If you do the latter, the help + * menu and thereby this dialog box is available through the + * TDEMainWindow::helpMenu() function. + * + * @author Espen Sand (espen@kde.org) + */ + +class TDEUI_EXPORT TDEAboutKDE : public TDEAboutDialog +{ + public: + /** + * Constructor. Creates a fully featured "About KDE" dialog box. + * Note that this dialog is made modeless in the KHelpMenu class so + * the users may expect a modeless dialog. + * + * @param parent The parent of the dialog box. You should use the + * toplevel window so that the dialog becomes centered. + * @param name Internal name of the widget. This name in not used in the + * caption. + * @param modal If false, this widget will be modeless and must be + * made visible using TQWidget::show(). Otherwise it will be + * modal and must be made visible using TQWidget::exec() + */ + TDEAboutKDE( TQWidget *parent=0, const char *name=0, bool modal=true ); +}; + + +#endif + + diff --git a/tdeui/tdeaction.cpp b/tdeui/tdeaction.cpp index 1cae013a2..d817a5ba4 100644 --- a/tdeui/tdeaction.cpp +++ b/tdeui/tdeaction.cpp @@ -33,7 +33,7 @@ #include <tdeaccel.h> #include <tdeaccelbase.h> #include <tdeaccelprivate.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kguiitem.h> #include <tdemainwindow.h> diff --git a/tdeui/tdeactionclasses.cpp b/tdeui/tdeactionclasses.cpp index 3b07f56ca..1fc963887 100644 --- a/tdeui/tdeactionclasses.cpp +++ b/tdeui/tdeactionclasses.cpp @@ -42,7 +42,7 @@ #include <dcopclient.h> #include <dcopref.h> #include <tdeaccel.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <tdefontcombo.h> diff --git a/tdeui/tdeactioncollection.cpp b/tdeui/tdeactioncollection.cpp index 9181fca89..16104e242 100644 --- a/tdeui/tdeactioncollection.cpp +++ b/tdeui/tdeactioncollection.cpp @@ -31,7 +31,7 @@ #include <tdeaccel.h> #include <tdeaccelbase.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tqpopupmenu.h> diff --git a/tdeui/tdecmodule.cpp b/tdeui/tdecmodule.cpp index 85a23341e..4e6ce943f 100644 --- a/tdeui/tdecmodule.cpp +++ b/tdeui/tdecmodule.cpp @@ -23,7 +23,7 @@ #include <tqlayout.h> -#include <kaboutdata.h> +#include <tdeaboutdata.h> #include <tdeconfigskeleton.h> #include <tdeconfigdialogmanager.h> #include <kdebug.h> diff --git a/tdeui/tdefontdialog.cpp b/tdeui/tdefontdialog.cpp index 2a8398419..15c687e13 100644 --- a/tdeui/tdefontdialog.cpp +++ b/tdeui/tdefontdialog.cpp @@ -41,7 +41,7 @@ #include <tqwhatsthis.h> #include <tqtooltip.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kcharsets.h> #include <tdeconfig.h> #include <kdialog.h> diff --git a/tdeui/tdelistbox.cpp b/tdeui/tdelistbox.cpp index 02ecf2fd1..9f7c23688 100644 --- a/tdeui/tdelistbox.cpp +++ b/tdeui/tdelistbox.cpp @@ -21,7 +21,7 @@ #include <kglobalsettings.h> #include <kcursor.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kipc.h> #include <kdebug.h> diff --git a/tdeui/tdelistview.cpp b/tdeui/tdelistview.cpp index 158eac5ab..020f18679 100644 --- a/tdeui/tdelistview.cpp +++ b/tdeui/tdelistview.cpp @@ -30,7 +30,7 @@ #include <kglobalsettings.h> #include <tdeconfig.h> #include <kcursor.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kipc.h> #include <kdebug.h> diff --git a/tdeui/tdemainwindow.cpp b/tdeui/tdemainwindow.cpp index b7596c262..01b6a09e0 100644 --- a/tdeui/tdemainwindow.cpp +++ b/tdeui/tdemainwindow.cpp @@ -36,7 +36,7 @@ #include <tdeaccel.h> #include <tdeaction.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <khelpmenu.h> diff --git a/tdeui/tdemainwindowiface.cpp b/tdeui/tdemainwindowiface.cpp index fc864d9fa..8f8a9d40c 100644 --- a/tdeui/tdemainwindowiface.cpp +++ b/tdeui/tdemainwindowiface.cpp @@ -20,7 +20,7 @@ #include "tdemainwindowiface.h" #include <dcopclient.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdcopactionproxy.h> #include <kdcoppropertyproxy.h> #include <tdemainwindow.h> diff --git a/tdeui/tdepopupmenu.cpp b/tdeui/tdepopupmenu.cpp index 62ac6f4ad..46d5c758f 100644 --- a/tdeui/tdepopupmenu.cpp +++ b/tdeui/tdepopupmenu.cpp @@ -30,7 +30,7 @@ #include "tdepopupmenu.h" #include <kdebug.h> -#include <kapplication.h> +#include <tdeapplication.h> TDEPopupTitle::TDEPopupTitle(TQWidget *parent, const char *name) : TQWidget(parent, name) diff --git a/tdeui/tdeshortcutdialog.cpp b/tdeui/tdeshortcutdialog.cpp index 73f06581f..fe3593b7e 100644 --- a/tdeui/tdeshortcutdialog.cpp +++ b/tdeui/tdeshortcutdialog.cpp @@ -52,7 +52,7 @@ #include <tqtimer.h> #include <tqvbox.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> #include <kglobal.h> diff --git a/tdeui/tdespell.cpp b/tdeui/tdespell.cpp index 8eac3bde2..629013121 100644 --- a/tdeui/tdespell.cpp +++ b/tdeui/tdespell.cpp @@ -37,7 +37,7 @@ #include <tqtextcodec.h> #include <tqtimer.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kmessagebox.h> #include <kdebug.h> #include <klocale.h> diff --git a/tdeui/tdespelldlg.cpp b/tdeui/tdespelldlg.cpp index ac0ccb984..280ddf861 100644 --- a/tdeui/tdespelldlg.cpp +++ b/tdeui/tdespelldlg.cpp @@ -24,7 +24,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <tdelistbox.h> #include <kcombobox.h> diff --git a/tdeui/tdetoolbar.cpp b/tdeui/tdetoolbar.cpp index 02173e41b..a095f1493 100644 --- a/tdeui/tdetoolbar.cpp +++ b/tdeui/tdetoolbar.cpp @@ -47,7 +47,7 @@ #include <klineedit.h> #include <kseparator.h> #include <klocale.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeaction.h> #include <kstdaction.h> #include <kglobal.h> diff --git a/tdeui/tdetoolbarbutton.cpp b/tdeui/tdetoolbarbutton.cpp index da5fc7b9b..608c31a32 100644 --- a/tdeui/tdetoolbarbutton.cpp +++ b/tdeui/tdetoolbarbutton.cpp @@ -38,7 +38,7 @@ #include <tqpainter.h> #include <tqlayout.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kglobal.h> #include <kglobalsettings.h> diff --git a/tdeui/tdetoolbarhandler.cpp b/tdeui/tdetoolbarhandler.cpp index e03880bad..4242a119e 100644 --- a/tdeui/tdetoolbarhandler.cpp +++ b/tdeui/tdetoolbarhandler.cpp @@ -19,7 +19,7 @@ #include "tdetoolbarhandler.h" #include <tqpopupmenu.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdetoolbar.h> #include <tdemainwindow.h> #include <klocale.h> diff --git a/tdeui/tests/itemcontainertest.cpp b/tdeui/tests/itemcontainertest.cpp index af7fb41e2..c96d6a4eb 100644 --- a/tdeui/tests/itemcontainertest.cpp +++ b/tdeui/tests/itemcontainertest.cpp @@ -16,7 +16,7 @@ #include <tqcheckbox.h> #include <tqlabel.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> #include <tdeconfig.h> #include <kiconview.h> diff --git a/tdeui/tests/kaboutdialogtest.cpp b/tdeui/tests/kaboutdialogtest.cpp index 0555070a6..c3be2de25 100644 --- a/tdeui/tests/kaboutdialogtest.cpp +++ b/tdeui/tests/kaboutdialogtest.cpp @@ -8,10 +8,10 @@ * $Revision$ */ -#include "kaboutdialog.h" +#include "tdeaboutdialog.h" // #include <kimgio.h> #include <tqimage.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> int main(int argc, char** argv) diff --git a/tdeui/tests/kblendtest.cpp b/tdeui/tests/kblendtest.cpp index dc708f2b5..4672b76ee 100644 --- a/tdeui/tests/kblendtest.cpp +++ b/tdeui/tests/kblendtest.cpp @@ -1,5 +1,5 @@ #include "kblendtest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kimageeffect.h> #include <tqpainter.h> #include <tqdatetime.h> diff --git a/tdeui/tests/kbuttonboxtest.cpp b/tdeui/tests/kbuttonboxtest.cpp index 8f2052b28..c9eb1134b 100644 --- a/tdeui/tests/kbuttonboxtest.cpp +++ b/tdeui/tests/kbuttonboxtest.cpp @@ -16,7 +16,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include "kbuttonbox.h" #include <tqlayout.h> #include <tqlabel.h> diff --git a/tdeui/tests/kcharselecttest.cpp b/tdeui/tests/kcharselecttest.cpp index 019f6bd43..ccd6cd10a 100644 --- a/tdeui/tests/kcharselecttest.cpp +++ b/tdeui/tests/kcharselecttest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include "kcharselect.h" diff --git a/tdeui/tests/kcolordlgtest.cpp b/tdeui/tests/kcolordlgtest.cpp index 23c0b89ea..f45df0de7 100644 --- a/tdeui/tests/kcolordlgtest.cpp +++ b/tdeui/tests/kcolordlgtest.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include "kcolordialog.h" #include <tdeconfig.h> #include <klocale.h> diff --git a/tdeui/tests/kcolortest.cpp b/tdeui/tests/kcolortest.cpp index 3f61da00f..243de265b 100644 --- a/tdeui/tests/kcolortest.cpp +++ b/tdeui/tests/kcolortest.cpp @@ -1,6 +1,6 @@ #include "kcolortest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kimageeffect.h> #include <stdio.h> #include <tqdatetime.h> diff --git a/tdeui/tests/kcomboboxtest.cpp b/tdeui/tests/kcomboboxtest.cpp index 701710891..225c80c0f 100644 --- a/tdeui/tests/kcomboboxtest.cpp +++ b/tdeui/tests/kcomboboxtest.cpp @@ -6,7 +6,7 @@ #include <assert.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kdialog.h> #include <klocale.h> diff --git a/tdeui/tests/kcompletiontest.cpp b/tdeui/tests/kcompletiontest.cpp index 617957b4c..12e3835dc 100644 --- a/tdeui/tests/kcompletiontest.cpp +++ b/tdeui/tests/kcompletiontest.cpp @@ -18,7 +18,7 @@ #include <tqtooltip.h> #include <tqwhatsthis.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klineedit.h> #include <kcombobox.h> /* diff --git a/tdeui/tests/kdatepicktest.cpp b/tdeui/tests/kdatepicktest.cpp index df8bc7013..abcfeb24a 100644 --- a/tdeui/tests/kdatepicktest.cpp +++ b/tdeui/tests/kdatepicktest.cpp @@ -1,6 +1,6 @@ #include "kdatepicker.h" #include <tqlineedit.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> int main(int argc, char** argv) diff --git a/tdeui/tests/kdatetimewidgettest.cpp b/tdeui/tests/kdatetimewidgettest.cpp index 9b158faf8..721f86492 100644 --- a/tdeui/tests/kdatetimewidgettest.cpp +++ b/tdeui/tests/kdatetimewidgettest.cpp @@ -1,5 +1,5 @@ #include "kdatetimewidget.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> int main(int argc, char** argv) diff --git a/tdeui/tests/kdatewidgettest.cpp b/tdeui/tests/kdatewidgettest.cpp index 16521da20..11fb243f3 100644 --- a/tdeui/tests/kdatewidgettest.cpp +++ b/tdeui/tests/kdatewidgettest.cpp @@ -1,6 +1,6 @@ #include "kdatewidget.h" #include <tqlineedit.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> int main(int argc, char** argv) diff --git a/tdeui/tests/kdesattest.cpp b/tdeui/tests/kdesattest.cpp index fbf93bfe8..8eab0b125 100644 --- a/tdeui/tests/kdesattest.cpp +++ b/tdeui/tests/kdesattest.cpp @@ -1,5 +1,5 @@ #include "kdesattest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kimageeffect.h> #include <tqpainter.h> #include <tqdatetime.h> diff --git a/tdeui/tests/kdialogbasetest.cpp b/tdeui/tests/kdialogbasetest.cpp index b1c7d422c..7f8023bd2 100644 --- a/tdeui/tests/kdialogbasetest.cpp +++ b/tdeui/tests/kdialogbasetest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <kdialogbase.h> #include <tqstring.h> diff --git a/tdeui/tests/kdocktest.cpp b/tdeui/tests/kdocktest.cpp index fbbb799fc..538e2b888 100644 --- a/tdeui/tests/kdocktest.cpp +++ b/tdeui/tests/kdocktest.cpp @@ -1,6 +1,6 @@ #include "kdocktest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kiconloader.h> #include <tqwidget.h> diff --git a/tdeui/tests/kdockwidgetdemo.cpp b/tdeui/tests/kdockwidgetdemo.cpp index c252c7cf8..a922acf2d 100644 --- a/tdeui/tests/kdockwidgetdemo.cpp +++ b/tdeui/tests/kdockwidgetdemo.cpp @@ -20,7 +20,7 @@ #include <tqpainter.h> #include <tdeconfig.h> -#include <kapplication.h> +#include <tdeapplication.h> //#include <kimgio.h> #include <stdlib.h> diff --git a/tdeui/tests/kdockwidgettest.cpp b/tdeui/tests/kdockwidgettest.cpp index 144391f50..683d42acd 100644 --- a/tdeui/tests/kdockwidgettest.cpp +++ b/tdeui/tests/kdockwidgettest.cpp @@ -15,7 +15,7 @@ #include "kdockwidgettest.h" #include <tqpushbutton.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kiconloader.h> #include <kstatusbar.h> #include <kmenubar.h> diff --git a/tdeui/tests/kdualcolortest.cpp b/tdeui/tests/kdualcolortest.cpp index ea749cd6e..e52d6e671 100644 --- a/tdeui/tests/kdualcolortest.cpp +++ b/tdeui/tests/kdualcolortest.cpp @@ -1,6 +1,6 @@ #include "kdualcolortest.h" #include <kdualcolorbutton.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <tqlayout.h> #include <tqpalette.h> diff --git a/tdeui/tests/keditlistboxtest.cpp b/tdeui/tests/keditlistboxtest.cpp index 177a8b6ec..5b4e45ddb 100644 --- a/tdeui/tests/keditlistboxtest.cpp +++ b/tdeui/tests/keditlistboxtest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <keditlistbox.h> #include <kcombobox.h> diff --git a/tdeui/tests/kedittest.cpp b/tdeui/tests/kedittest.cpp index 42d6f659f..f806c3bdf 100644 --- a/tdeui/tests/kedittest.cpp +++ b/tdeui/tests/kedittest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <keditcl.h> #include <tqpopupmenu.h> diff --git a/tdeui/tests/kgradienttest.cpp b/tdeui/tests/kgradienttest.cpp index dcd45673c..4ee8c0f93 100644 --- a/tdeui/tests/kgradienttest.cpp +++ b/tdeui/tests/kgradienttest.cpp @@ -1,5 +1,5 @@ #include "kgradienttest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kpixmapeffect.h> #include <tqpainter.h> #include <tqdatetime.h> diff --git a/tdeui/tests/khashtest.cpp b/tdeui/tests/khashtest.cpp index af7cc60cd..d392fcbc5 100644 --- a/tdeui/tests/khashtest.cpp +++ b/tdeui/tests/khashtest.cpp @@ -1,5 +1,5 @@ #include "khashtest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kpixmapeffect.h> #include <kimageeffect.h> #include <tqpainter.h> diff --git a/tdeui/tests/kinputdialogtest.cpp b/tdeui/tests/kinputdialogtest.cpp index 5db3babff..b40b5c562 100644 --- a/tdeui/tests/kinputdialogtest.cpp +++ b/tdeui/tests/kinputdialogtest.cpp @@ -3,7 +3,7 @@ * License: GPL V2 */ -#include <kapplication.h> +#include <tdeapplication.h> #include <kinputdialog.h> #include <kdebug.h> diff --git a/tdeui/tests/kjanuswidgettest.cpp b/tdeui/tests/kjanuswidgettest.cpp index 12a267a02..71e72fb13 100644 --- a/tdeui/tests/kjanuswidgettest.cpp +++ b/tdeui/tests/kjanuswidgettest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <kjanuswidget.h> #include <tqstring.h> diff --git a/tdeui/tests/kledtest.cpp b/tdeui/tests/kledtest.cpp index 48f2f1430..4ba158776 100644 --- a/tdeui/tests/kledtest.cpp +++ b/tdeui/tests/kledtest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <tqwidget.h> #include <tqtimer.h> #include <stdlib.h> diff --git a/tdeui/tests/klineeditdlgtest.cpp b/tdeui/tests/klineeditdlgtest.cpp index 012a22b7f..ecc6ac984 100644 --- a/tdeui/tests/klineeditdlgtest.cpp +++ b/tdeui/tests/klineeditdlgtest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <klineeditdlg.h> #include <tqstring.h> diff --git a/tdeui/tests/klineedittest.cpp b/tdeui/tests/klineedittest.cpp index 5146b7d15..793988968 100644 --- a/tdeui/tests/klineedittest.cpp +++ b/tdeui/tests/klineedittest.cpp @@ -4,9 +4,9 @@ #include <tqhbox.h> #include <tqtimer.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kdialog.h> #include <klocale.h> diff --git a/tdeui/tests/kmessageboxtest.cpp b/tdeui/tests/kmessageboxtest.cpp index 69f28e8c6..ce333edee 100644 --- a/tdeui/tests/kmessageboxtest.cpp +++ b/tdeui/tests/kmessageboxtest.cpp @@ -8,7 +8,7 @@ #include <stdio.h> #include <kstatusbar.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kglobal.h> diff --git a/tdeui/tests/knuminputtest.cpp b/tdeui/tests/knuminputtest.cpp index fad4cd50a..9a333dfda 100644 --- a/tdeui/tests/knuminputtest.cpp +++ b/tdeui/tests/knuminputtest.cpp @@ -11,7 +11,7 @@ #include <tqlayout.h> #include <tqvgroupbox.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <knuminput.h> #include "knuminputtest.h" diff --git a/tdeui/tests/kpalettetest.cpp b/tdeui/tests/kpalettetest.cpp index 8edb97a57..94036244e 100644 --- a/tdeui/tests/kpalettetest.cpp +++ b/tdeui/tests/kpalettetest.cpp @@ -1,5 +1,5 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <tqwidget.h> #include <tqtimer.h> #include <stdlib.h> diff --git a/tdeui/tests/kpanelmenutest.cpp b/tdeui/tests/kpanelmenutest.cpp index 1890ff13e..a14cb3366 100644 --- a/tdeui/tests/kpanelmenutest.cpp +++ b/tdeui/tests/kpanelmenutest.cpp @@ -1,5 +1,5 @@ #include "kpanelmenutest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kstandarddirs.h> #include <dcopclient.h> diff --git a/tdeui/tests/kpixmapregionselectordialogtest.cpp b/tdeui/tests/kpixmapregionselectordialogtest.cpp index 8c5cb545e..28a51a3f7 100644 --- a/tdeui/tests/kpixmapregionselectordialogtest.cpp +++ b/tdeui/tests/kpixmapregionselectordialogtest.cpp @@ -1,8 +1,8 @@ #include "kpixmapregionselectordialog.h" #include <tqpixmap.h> #include <tqimage.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <iostream> static const TDECmdLineOptions options[] = diff --git a/tdeui/tests/kprogresstest.cpp b/tdeui/tests/kprogresstest.cpp index c3665865d..6106a236b 100644 --- a/tdeui/tests/kprogresstest.cpp +++ b/tdeui/tests/kprogresstest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <tqwidget.h> #include "kprogress.h" diff --git a/tdeui/tests/krulertest.h b/tdeui/tests/krulertest.h index cf1abc155..0242fb5d7 100644 --- a/tdeui/tests/krulertest.h +++ b/tdeui/tests/krulertest.h @@ -3,7 +3,7 @@ #ifndef krulertest_h #define krulertest_h -#include <kapplication.h> +#include <tdeapplication.h> #include <tdemainwindow.h> #include <tqwidget.h> #include <tqcheckbox.h> diff --git a/tdeui/tests/kseparatortest.cpp b/tdeui/tests/kseparatortest.cpp index 17e965ca8..a791fa930 100644 --- a/tdeui/tests/kseparatortest.cpp +++ b/tdeui/tests/kseparatortest.cpp @@ -18,7 +18,7 @@ */ -#include <kapplication.h> +#include <tdeapplication.h> #include <tqlayout.h> #include <tqwidget.h> diff --git a/tdeui/tests/ksqueezedtextlabeltest.cpp b/tdeui/tests/ksqueezedtextlabeltest.cpp index a0a0e400f..7c3fd413c 100644 --- a/tdeui/tests/ksqueezedtextlabeltest.cpp +++ b/tdeui/tests/ksqueezedtextlabeltest.cpp @@ -1,5 +1,5 @@ #include "ksqueezedtextlabel.h" -#include <kapplication.h> +#include <tdeapplication.h> int main( int argc, char **argv ) { diff --git a/tdeui/tests/kstatusbartest.cpp b/tdeui/tests/kstatusbartest.cpp index c06f18b51..82c03e271 100644 --- a/tdeui/tests/kstatusbartest.cpp +++ b/tdeui/tests/kstatusbartest.cpp @@ -10,7 +10,7 @@ #include <stdlib.h> #include "kstatusbar.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <tdemainwindow.h> #include <kmenubar.h> #include "kstatusbartest.h" diff --git a/tdeui/tests/ksystemtraytest.cpp b/tdeui/tests/ksystemtraytest.cpp index 07572f8d3..27a6629d9 100644 --- a/tdeui/tests/ksystemtraytest.cpp +++ b/tdeui/tests/ksystemtraytest.cpp @@ -1,5 +1,5 @@ #include <ksystemtray.h> -#include <kapplication.h> +#include <tdeapplication.h> int main(int argc, char **argv) { diff --git a/tdeui/tests/ktabctltest.cpp b/tdeui/tests/ktabctltest.cpp index b864017b0..05fe2aeb3 100644 --- a/tdeui/tests/ktabctltest.cpp +++ b/tdeui/tests/ktabctltest.cpp @@ -2,7 +2,7 @@ * */ -#include <kapplication.h> +#include <tdeapplication.h> #include <tqpushbutton.h> #include <tqlabel.h> #include <tqobject.h> diff --git a/tdeui/tests/ktabwidgettest.cpp b/tdeui/tests/ktabwidgettest.cpp index 84a35952f..64d2795fc 100644 --- a/tdeui/tests/ktabwidgettest.cpp +++ b/tdeui/tests/ktabwidgettest.cpp @@ -2,8 +2,8 @@ #include <tqlayout.h> #include <tqdragobject.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kinputdialog.h> #include <kdebug.h> diff --git a/tdeui/tests/ktextedittest.cpp b/tdeui/tests/ktextedittest.cpp index 6af109d5a..6570bf26d 100644 --- a/tdeui/tests/ktextedittest.cpp +++ b/tdeui/tests/ktextedittest.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include <ktextedit.h> #include <tqfile.h> diff --git a/tdeui/tests/ktimewidgettest.cpp b/tdeui/tests/ktimewidgettest.cpp index f4465fbf7..bbff45648 100644 --- a/tdeui/tests/ktimewidgettest.cpp +++ b/tdeui/tests/ktimewidgettest.cpp @@ -1,5 +1,5 @@ #include "ktimewidget.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> int main(int argc, char** argv) diff --git a/tdeui/tests/kunbalancedgrdtest.cpp b/tdeui/tests/kunbalancedgrdtest.cpp index d9e7448d8..40904000b 100644 --- a/tdeui/tests/kunbalancedgrdtest.cpp +++ b/tdeui/tests/kunbalancedgrdtest.cpp @@ -1,5 +1,5 @@ #include "kunbalancedgrdtest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kpixmapeffect.h> #include <tqpainter.h> #include <tqstring.h> diff --git a/tdeui/tests/kwizardtest.cpp b/tdeui/tests/kwizardtest.cpp index f103a114f..0635188d0 100644 --- a/tdeui/tests/kwizardtest.cpp +++ b/tdeui/tests/kwizardtest.cpp @@ -20,7 +20,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kwizard.h> int main(int argc, char **argv) diff --git a/tdeui/tests/kwordwraptest.cpp b/tdeui/tests/kwordwraptest.cpp index bd51800e8..690fbf157 100644 --- a/tdeui/tests/kwordwraptest.cpp +++ b/tdeui/tests/kwordwraptest.cpp @@ -16,7 +16,7 @@ * Boston, MA 02110-1301, USA. */ -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tqwidget.h> #include "kwordwrap.h" diff --git a/tdeui/tests/kxmlguitest.cpp b/tdeui/tests/kxmlguitest.cpp index 89c5caf30..1a79526aa 100644 --- a/tdeui/tests/kxmlguitest.cpp +++ b/tdeui/tests/kxmlguitest.cpp @@ -1,5 +1,5 @@ #include "kxmlguitest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <tdemainwindow.h> #include <kxmlguifactory.h> #include <kxmlguiclient.h> diff --git a/tdeui/tests/tdeactiontest.cpp b/tdeui/tests/tdeactiontest.cpp index d62d9c3fc..dcec16189 100644 --- a/tdeui/tests/tdeactiontest.cpp +++ b/tdeui/tests/tdeactiontest.cpp @@ -1,7 +1,7 @@ #include <tqguardedptr.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdeaction.h> #include <assert.h> diff --git a/tdeui/tests/tdefontdialogtest.cpp b/tdeui/tests/tdefontdialogtest.cpp index 2d4e187b2..ff7ac2840 100644 --- a/tdeui/tests/tdefontdialogtest.cpp +++ b/tdeui/tests/tdefontdialogtest.cpp @@ -24,7 +24,7 @@ */ -#include <kapplication.h> +#include <tdeapplication.h> #include "tdefontdialog.h" #include <tdeconfig.h> diff --git a/tdeui/tests/tdelistviewtest.cpp b/tdeui/tests/tdelistviewtest.cpp index d73baf087..c2a0e78cf 100644 --- a/tdeui/tests/tdelistviewtest.cpp +++ b/tdeui/tests/tdelistviewtest.cpp @@ -1,5 +1,5 @@ #include <tdelistview.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdialogbase.h> #include <tqvbox.h> diff --git a/tdeui/tests/tdemainwindowrestoretest.cpp b/tdeui/tests/tdemainwindowrestoretest.cpp index 7b477f8f7..559348ec0 100644 --- a/tdeui/tests/tdemainwindowrestoretest.cpp +++ b/tdeui/tests/tdemainwindowrestoretest.cpp @@ -1,7 +1,7 @@ #include "tdemainwindowrestoretest.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <tqlabel.h> diff --git a/tdeui/tests/tdemainwindowtest.cpp b/tdeui/tests/tdemainwindowtest.cpp index b83123dde..c8ace159e 100644 --- a/tdeui/tests/tdemainwindowtest.cpp +++ b/tdeui/tests/tdemainwindowtest.cpp @@ -1,7 +1,7 @@ #include <tqtimer.h> #include <tqlabel.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kstatusbar.h> #include <kmenubar.h> diff --git a/tdeui/tests/tdepopuptest.cpp b/tdeui/tests/tdepopuptest.cpp index c830525f1..f9a97bad4 100644 --- a/tdeui/tests/tdepopuptest.cpp +++ b/tdeui/tests/tdepopuptest.cpp @@ -1,4 +1,4 @@ -#include <kapplication.h> +#include <tdeapplication.h> #include <tqwidget.h> #include <tqcursor.h> #include "tdepopupmenu.h" diff --git a/tdeui/tests/tdespelltest.cpp b/tdeui/tests/tdespelltest.cpp index b4b5e571e..5ec103b99 100644 --- a/tdeui/tests/tdespelltest.cpp +++ b/tdeui/tests/tdespelltest.cpp @@ -17,7 +17,7 @@ */ #include "tdespell.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <tqstring.h> diff --git a/tdeui/tests/tdetoolbarlabelactiontest.cpp b/tdeui/tests/tdetoolbarlabelactiontest.cpp index ae12e56d8..b919c2725 100644 --- a/tdeui/tests/tdetoolbarlabelactiontest.cpp +++ b/tdeui/tests/tdetoolbarlabelactiontest.cpp @@ -18,7 +18,7 @@ #include <tqguardedptr.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdemainwindow.h> #include <klineedit.h> #include <tdelistview.h> diff --git a/tdeui/tests/twindowtest.cpp b/tdeui/tests/twindowtest.cpp index d45bc2554..3823ab46f 100644 --- a/tdeui/tests/twindowtest.cpp +++ b/tdeui/tests/twindowtest.cpp @@ -9,10 +9,10 @@ #include <stdlib.h> #include <kstatusbar.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kcombobox.h> #include <khelpmenu.h> -#include <kcmdlineargs.h> +#include <tdecmdlineargs.h> #include <kmenubar.h> #include <tdetoolbarradiogroup.h> #include <kiconloader.h> diff --git a/tdeui/twindowlistmenu.cpp b/tdeui/twindowlistmenu.cpp index e23cf18da..7ca8fda3f 100644 --- a/tdeui/twindowlistmenu.cpp +++ b/tdeui/twindowlistmenu.cpp @@ -37,8 +37,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <kstringhandler.h> #include <netwm.h> -#include <kapplication.h> -#include <kstyle.h> +#include <tdeapplication.h> +#include <tdestyle.h> #include <dcopclient.h> #undef Bool diff --git a/tdeunittest/modrunner.cpp b/tdeunittest/modrunner.cpp index f5e29efa1..4caa2d609 100644 --- a/tdeunittest/modrunner.cpp +++ b/tdeunittest/modrunner.cpp @@ -26,8 +26,8 @@ #include <kdebug.h> #include <kglobal.h> #include <kinstance.h> -#include <kaboutdata.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdecmdlineargs.h> #include <klocale.h> #include "runner.h" diff --git a/tdeunittest/tester.h b/tdeunittest/tester.h index c193cc158..332381ec8 100644 --- a/tdeunittest/tester.h +++ b/tdeunittest/tester.h @@ -134,10 +134,10 @@ SampleTest - 1 test passed, 1 test failed * looks like this: * * @code - * #include <kaboutdata.h> - * #include <kapplication.h> - * #include <kcmdlineargs.h> - * #include <kcmdlineargs.h> + * #include <tdeaboutdata.h> + * #include <tdeapplication.h> + * #include <tdecmdlineargs.h> + * #include <tdecmdlineargs.h> * #include <klocale.h> * #include <tdeunittest/runnergui.h> * diff --git a/tdeutils/kcmultidialog.cpp b/tdeutils/kcmultidialog.cpp index 8c09b8be9..9bb067ca0 100644 --- a/tdeutils/kcmultidialog.cpp +++ b/tdeutils/kcmultidialog.cpp @@ -26,8 +26,8 @@ #include <tqlayout.h> #include <tqpushbutton.h> -#include <kaboutdata.h> -#include <kapplication.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> #include <kdebug.h> #include <kiconloader.h> #include <klibloader.h> diff --git a/tdeutils/kfind.cpp b/tdeutils/kfind.cpp index 7b2da6899..99ef317b6 100644 --- a/tdeutils/kfind.cpp +++ b/tdeutils/kfind.cpp @@ -21,7 +21,7 @@ #include "kfind.h" #include "kfinddialog.h" -#include <kapplication.h> +#include <tdeapplication.h> #include <klocale.h> #include <kmessagebox.h> #include <tqlabel.h> diff --git a/tdeutils/kreplace.cpp b/tdeutils/kreplace.cpp index f825e93cc..0aad733da 100644 --- a/tdeutils/kreplace.cpp +++ b/tdeutils/kreplace.cpp @@ -19,7 +19,7 @@ */ #include <tqlabel.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> diff --git a/tdeutils/tdecmoduleloader.cpp b/tdeutils/tdecmoduleloader.cpp index 3627e1777..73f92379f 100644 --- a/tdeutils/tdecmoduleloader.cpp +++ b/tdeutils/tdecmoduleloader.cpp @@ -25,7 +25,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> diff --git a/tdeutils/tdecmoduleproxy.cpp b/tdeutils/tdecmoduleproxy.cpp index 473b8a667..2d3150935 100644 --- a/tdeutils/tdecmoduleproxy.cpp +++ b/tdeutils/tdecmoduleproxy.cpp @@ -35,8 +35,8 @@ #include <dcopclient.h> #include <qxembed.h> -#include <kapplication.h> -#include <kaboutdata.h> +#include <tdeapplication.h> +#include <tdeaboutdata.h> #include <tdecmodule.h> #include <tdecmoduleinfo.h> #include <tdecmoduleloader.h> diff --git a/tdeutils/tdecmoduleproxyIfaceImpl.cpp b/tdeutils/tdecmoduleproxyIfaceImpl.cpp index 127831b02..5b1bcc339 100644 --- a/tdeutils/tdecmoduleproxyIfaceImpl.cpp +++ b/tdeutils/tdecmoduleproxyIfaceImpl.cpp @@ -21,7 +21,7 @@ #include <dcopclient.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tdecmoduleproxy.h> #include <kdebug.h> diff --git a/tdeutils/tests/kfindtest.cpp b/tdeutils/tests/kfindtest.cpp index 6c64245dc..c913e5ec6 100644 --- a/tdeutils/tests/kfindtest.cpp +++ b/tdeutils/tests/kfindtest.cpp @@ -21,8 +21,8 @@ #include "../kfinddialog.h" #include "kfindtest.h" -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kdebug.h> #include <stdlib.h> diff --git a/tdeutils/tests/kreplacetest.cpp b/tdeutils/tests/kreplacetest.cpp index 26b0f7c9e..19ead8e77 100644 --- a/tdeutils/tests/kreplacetest.cpp +++ b/tdeutils/tests/kreplacetest.cpp @@ -19,8 +19,8 @@ #include <assert.h> -#include <kcmdlineargs.h> -#include <kapplication.h> +#include <tdecmdlineargs.h> +#include <tdeapplication.h> #include <tqeventloop.h> #include <kpushbutton.h> #include "../kreplace.h" diff --git a/tdewallet/backend/tests/backendtest.cpp b/tdewallet/backend/tests/backendtest.cpp index 4e19ce43f..76d59b153 100644 --- a/tdewallet/backend/tests/backendtest.cpp +++ b/tdewallet/backend/tests/backendtest.cpp @@ -1,7 +1,7 @@ #include <stdlib.h> #include <stdio.h> -#include <kapplication.h> +#include <tdeapplication.h> #include <tqstring.h> #include "tdewalletbackend.h" diff --git a/tdewallet/tests/tdewalletasync.cpp b/tdewallet/tests/tdewalletasync.cpp index 3512cc799..7668b90a7 100644 --- a/tdewallet/tests/tdewalletasync.cpp +++ b/tdewallet/tests/tdewalletasync.cpp @@ -1,9 +1,9 @@ #include <tqtextstream.h> #include <tqtimer.h> -#include <kaboutdata.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kdebug.h> #include <kglobal.h> #include <kstandarddirs.h> diff --git a/tdewallet/tests/tdewalletboth.cpp b/tdewallet/tests/tdewalletboth.cpp index eabb26eaa..a5ba26711 100644 --- a/tdewallet/tests/tdewalletboth.cpp +++ b/tdewallet/tests/tdewalletboth.cpp @@ -1,9 +1,9 @@ #include <tqtextstream.h> #include <tqtimer.h> -#include <kaboutdata.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kdebug.h> #include <kglobal.h> #include <kstandarddirs.h> diff --git a/tdewallet/tests/tdewalletsync.cpp b/tdewallet/tests/tdewalletsync.cpp index 54ffd6a12..4774e289e 100644 --- a/tdewallet/tests/tdewalletsync.cpp +++ b/tdewallet/tests/tdewalletsync.cpp @@ -1,9 +1,9 @@ #include <tqtextstream.h> #include <tqtimer.h> -#include <kaboutdata.h> -#include <kapplication.h> -#include <kcmdlineargs.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> #include <kdebug.h> #include <kglobal.h> #include <kstandarddirs.h> diff --git a/win/pro_files/kstyles/thinkeramik/widget-engine/thinkeramik_rel.pro b/win/pro_files/kstyles/thinkeramik/widget-engine/thinkeramik_rel.pro index 7a81aa820..62b5d6b39 100644 --- a/win/pro_files/kstyles/thinkeramik/widget-engine/thinkeramik_rel.pro +++ b/win/pro_files/kstyles/thinkeramik/widget-engine/thinkeramik_rel.pro @@ -37,13 +37,13 @@ pixmaploader.cpp #compile in tdefx SOURCES += \ -../../../tdefx/kstyle.cpp \ +../../../tdefx/tdestyle.cpp \ ../../../tdefx/kimageeffect.cpp \ ../../../tdefx/kpixmapeffect.cpp \ ../../../tdefx/kpixmap.cpp system( moc thinkeramik.h -o moc/thinkeramik.moc ) -system( moc ../../../tdefx/kstyle.h -o moc/kstyle.moc ) +system( moc ../../../tdefx/tdestyle.h -o moc/tdestyle.moc ) system( bash ./genemb.sh ) diff --git a/win/pro_files/tdecore/tdecore.pro b/win/pro_files/tdecore/tdecore.pro index 56db79c55..7e564a250 100644 --- a/win/pro_files/tdecore/tdecore.pro +++ b/win/pro_files/tdecore/tdecore.pro @@ -38,9 +38,9 @@ kcalendarsystemgregorian.cpp \ kcalendarsystemhebrew.cpp \ kcalendarsystemhijri.cpp \ kcalendarsystemjalali.cpp \ -kaboutdata.cpp \ +tdeaboutdata.cpp \ kstringhandler.cpp \ -kcmdlineargs.cpp \ +tdecmdlineargs.cpp \ kurldrag.cpp \ kurl.cpp \ kidna.cpp \ @@ -83,7 +83,7 @@ kuniqueapplication.cpp \ tdesycoca.cpp \ tdesycocadict.cpp \ tdesycocafactory.cpp \ -kapplication.cpp \ +tdeapplication.cpp \ kapplication_win.cpp \ kappdcopiface.cpp \ kprocctrl.cpp \ diff --git a/win/pro_files/tdefx/tdefx.pro b/win/pro_files/tdefx/tdefx.pro index f37639f92..f88c90381 100644 --- a/win/pro_files/tdefx/tdefx.pro +++ b/win/pro_files/tdefx/tdefx.pro @@ -15,7 +15,7 @@ kimageeffect.cpp \ kpixmapeffect.cpp \ kpixmapsplitter.cpp \ kpixmap.cpp \ -kstyle.cpp \ +tdestyle.cpp \ kdrawutil.cpp \ kcpuinfo.cpp diff --git a/win/pro_files/tdefx/tdefx_rel.pro b/win/pro_files/tdefx/tdefx_rel.pro index 0f013895c..358f60dc4 100644 --- a/win/pro_files/tdefx/tdefx_rel.pro +++ b/win/pro_files/tdefx/tdefx_rel.pro @@ -10,7 +10,7 @@ include( $(KDELIBS)/win/common.pro ) # needed to export library classes: DEFINES += MAKE_TDEFX_LIB -system( moc kstyle.h -o moc/kstyle.moc ) +system( moc tdestyle.h -o moc/tdestyle.moc ) LIBS -= "$(TDEDIR)\lib\kdewin32_$(KDE_VER).lib" "$(TDEDIR)\lib\ltdl_$(KDE_VER).lib" @@ -18,7 +18,7 @@ SOURCES = \ kimageeffect.cpp \ kpixmapeffect.cpp \ kpixmap.cpp \ -kstyle.cpp \ +tdestyle.cpp \ kdrawutil.cpp \ kcpuinfo.cpp diff --git a/win/pro_files/tdeui/tdeui.pro b/win/pro_files/tdeui/tdeui.pro index 29924203c..b5a506f8b 100644 --- a/win/pro_files/tdeui/tdeui.pro +++ b/win/pro_files/tdeui/tdeui.pro @@ -15,9 +15,9 @@ system( bash kdcopidl ) TARGET = tdeui$$KDEBUG SOURCES = \ -kaboutapplication.cpp \ -kaboutdialog.cpp \ -kaboutkde.cpp \ +tdeaboutapplication.cpp \ +tdeaboutdialog.cpp \ +tdeabouttde.cpp \ tdeactionclasses.cpp \ tdeactioncollection.cpp \ tdeaction.cpp \ -- cgit v1.2.3 From ed99a30644c19b0a3cf0d2147243532df4daa16b Mon Sep 17 00:00:00 2001 From: Timothy Pearson <kb9vqf@pearsoncomputing.net> Date: Fri, 15 Feb 2013 21:57:54 -0600 Subject: Rename additional header files to avoid conflicts with KDE4 --- CMakeLists.txt | 2 +- KDE2PORTING.html | 4 +- Mainpage.dox | 4 +- Makefile.am.in | 2 +- arts/kde/kaudioplaystream.cpp | 2 +- arts/kde/kaudiorecordstream.cpp | 2 +- arts/kde/kconverttest.cc | 2 +- arts/kde/kiotest.cc | 2 +- arts/kde/kiotestslow.cc | 2 +- arts/kde/kvideowidget.cpp | 2 +- arts/kde/mcop-dcop/kmcop.cpp | 2 +- arts/knotify/knotify.cpp | 6 +- arts/message/artsmessage.cc | 6 +- configure.in.in | 2 +- interfaces/tdeimproxy/library/tdeimproxy.cpp | 2 +- .../tdefileaudiopreview/tdefileaudiopreview.cpp | 4 +- interfaces/tdescript/scriptloader.cpp | 4 +- interfaces/tdescript/scriptmanager.cpp | 4 +- interfaces/tdetexteditor/CMakeLists.txt | 2 +- interfaces/tdetexteditor/Makefile.am | 2 +- interfaces/tdetexteditor/editorchooser.cpp | 2 +- interfaces/tdetexteditor/templateinterface.cpp | 6 +- interfaces/terminal/test/main.cc | 2 +- kab/addressbook.cc | 6 +- kab/kabapi.cc | 4 +- kabc/CMakeLists.txt | 123 - kabc/HACKING | 100 - kabc/HOWTO | 372 - kabc/Makefile.am | 72 - kabc/README | 28 - kabc/README.AddressFormat | 66 - kabc/TODO | 1 - kabc/address.cpp | 592 - kabc/address.h | 341 - kabc/addressbook.cpp | 842 -- kabc/addressbook.h | 431 - kabc/addresseedialog.cpp | 259 - kabc/addresseedialog.h | 161 - kabc/addresseehelper.cpp | 111 - kabc/addresseehelper.h | 66 - kabc/addresseelist.cpp | 256 - kabc/addresseelist.h | 221 - kabc/addresslineedit.cpp | 610 - kabc/addresslineedit.h | 123 - kabc/agent.cpp | 148 - kabc/agent.h | 128 - kabc/countrytransl.map | 12381 ------------------- kabc/distributionlist.cpp | 298 - kabc/distributionlist.h | 217 - kabc/distributionlistdialog.cpp | 399 - kabc/distributionlistdialog.h | 139 - kabc/distributionlisteditor.cpp | 310 - kabc/distributionlisteditor.h | 86 - kabc/errorhandler.cpp | 55 - kabc/errorhandler.h | 95 - kabc/field.h | 176 - kabc/format.h | 49 - kabc/formatfactory.cpp | 168 - kabc/formatfactory.h | 101 - kabc/formatplugin.h | 73 - kabc/formats/CMakeLists.txt | 47 - kabc/formats/Makefile.am | 22 - kabc/formats/binary.desktop | 89 - kabc/formats/binaryformat.cpp | 221 - kabc/formats/binaryformat.h | 69 - kabc/geo.cpp | 109 - kabc/geo.h | 101 - kabc/kabc_manager.desktop | 76 - kabc/key.cpp | 153 - kabc/key.h | 150 - kabc/ldapclient.cpp | 427 - kabc/ldapclient.h | 248 - kabc/ldapconfigwidget.cpp | 626 - kabc/ldapconfigwidget.h | 300 - kabc/ldapurl.cpp | 201 - kabc/ldapurl.h | 110 - kabc/ldif.cpp | 365 - kabc/ldif.h | 182 - kabc/ldifconverter.cpp | 573 - kabc/ldifconverter.h | 100 - kabc/lock.cpp | 162 - kabc/lock.h | 88 - kabc/locknull.cpp | 63 - kabc/locknull.h | 54 - kabc/phonenumber.cpp | 213 - kabc/phonenumber.h | 161 - kabc/picture.cpp | 120 - kabc/picture.h | 128 - kabc/plugin.cpp | 61 - kabc/plugin.h | 52 - kabc/plugins/CMakeLists.txt | 15 - kabc/plugins/Makefile.am | 1 - kabc/plugins/dir/CMakeLists.txt | 73 - kabc/plugins/dir/Makefile.am | 28 - kabc/plugins/dir/dir.desktop | 92 - kabc/plugins/dir/resourcedir.cpp | 310 - kabc/plugins/dir/resourcedir.h | 113 - kabc/plugins/dir/resourcedirconfig.cpp | 107 - kabc/plugins/dir/resourcedirconfig.h | 54 - kabc/plugins/dir/resourcedirplugin.cpp | 32 - kabc/plugins/evolution/Makefile.am | 19 - kabc/plugins/evolution/README | 15 - kabc/plugins/evolution/dbwrapper.cpp | 187 - kabc/plugins/evolution/dbwrapper.h | 60 - kabc/plugins/evolution/evolution.desktop | 26 - kabc/plugins/evolution/resourceevo.cpp | 132 - kabc/plugins/evolution/resourceevo.h | 23 - kabc/plugins/file/CMakeLists.txt | 73 - kabc/plugins/file/Makefile.am | 28 - kabc/plugins/file/file.desktop | 82 - kabc/plugins/file/resourcefile.cpp | 395 - kabc/plugins/file/resourcefile.h | 162 - kabc/plugins/file/resourcefileconfig.cpp | 118 - kabc/plugins/file/resourcefileconfig.h | 57 - kabc/plugins/file/resourcefileplugin.cpp | 32 - kabc/plugins/ldaptdeio/CMakeLists.txt | 73 - kabc/plugins/ldaptdeio/Makefile.am | 28 - kabc/plugins/ldaptdeio/ldaptdeio.desktop | 10 - kabc/plugins/ldaptdeio/resourceldaptdeio.cpp | 1041 -- kabc/plugins/ldaptdeio/resourceldaptdeio.h | 171 - kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp | 388 - kabc/plugins/ldaptdeio/resourceldaptdeioconfig.h | 118 - kabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp | 36 - kabc/plugins/net/CMakeLists.txt | 73 - kabc/plugins/net/Makefile.am | 28 - kabc/plugins/net/net.desktop | 90 - kabc/plugins/net/resourcenet.cpp | 393 - kabc/plugins/net/resourcenet.h | 117 - kabc/plugins/net/resourcenetconfig.cpp | 102 - kabc/plugins/net/resourcenetconfig.h | 53 - kabc/plugins/net/resourcenetplugin.cpp | 32 - kabc/plugins/sql/Makefile.am | 20 - kabc/plugins/sql/resourcesql.cpp | 338 - kabc/plugins/sql/resourcesql.h | 63 - kabc/plugins/sql/resourcesqlconfig.cpp | 95 - kabc/plugins/sql/resourcesqlconfig.h | 51 - kabc/plugins/sql/sql.desktop | 10 - kabc/resource.cpp | 351 - kabc/resource.h | 319 - kabc/resourceselectdialog.cpp | 111 - kabc/resourceselectdialog.h | 57 - kabc/scripts/Makefile.am | 6 - kabc/scripts/addressee.src.cpp | 1127 -- kabc/scripts/addressee.src.h | 407 - kabc/scripts/createisomap.pl | 35 - kabc/scripts/entrylist | 82 - kabc/scripts/field.src.cpp | 512 - kabc/scripts/makeaddressee | 215 - kabc/secrecy.cpp | 100 - kabc/secrecy.h | 100 - kabc/sortmode.cpp | 79 - kabc/sortmode.h | 114 - kabc/sound.cpp | 118 - kabc/sound.h | 153 - kabc/stdaddressbook.cpp | 203 - kabc/stdaddressbook.h | 153 - kabc/tdeab2tdeabc.cpp | 476 - kabc/tdeab2tdeabc.desktop | 105 - kabc/tests/Makefile.am | 55 - kabc/tests/bigread.cpp | 65 - kabc/tests/bigwrite.cpp | 70 - kabc/tests/kabcargl.cpp | 70 - kabc/tests/testaddressee.cpp | 57 - kabc/tests/testaddresseelist.cpp | 196 - kabc/tests/testaddressfmt.cpp | 63 - kabc/tests/testaddresslineedit.cpp | 29 - kabc/tests/testdb.cpp | 33 - kabc/tests/testdistlist.cpp | 59 - kabc/tests/testkabc.cpp | 62 - kabc/tests/testkabcdlg.cpp | 45 - kabc/tests/testldapclient.cpp | 161 - kabc/tests/testldapclient.h | 51 - kabc/tests/testlock.cpp | 206 - kabc/tests/testlock.h | 51 - kabc/timezone.cpp | 85 - kabc/timezone.h | 89 - kabc/vcard/AdrParam.cpp | 126 - kabc/vcard/AdrValue.cpp | 140 - kabc/vcard/AgentParam.cpp | 103 - kabc/vcard/AgentValue.cpp | 81 - kabc/vcard/CMakeLists.txt | 40 - kabc/vcard/ClassValue.cpp | 120 - kabc/vcard/ContentLine.cpp | 302 - kabc/vcard/DateParam.cpp | 82 - kabc/vcard/DateValue.cpp | 434 - kabc/vcard/EmailParam.cpp | 116 - kabc/vcard/Entity.cpp | 134 - kabc/vcard/Enum.cpp | 490 - kabc/vcard/FloatValue.cpp | 120 - kabc/vcard/GeoValue.cpp | 100 - kabc/vcard/ImageParam.cpp | 81 - kabc/vcard/ImageValue.cpp | 81 - kabc/vcard/ImgValue.cpp | 81 - kabc/vcard/LangValue.cpp | 127 - kabc/vcard/Makefile.am | 21 - kabc/vcard/NValue.cpp | 128 - kabc/vcard/OrgValue.cpp | 107 - kabc/vcard/Param.cpp | 129 - kabc/vcard/PhoneNumberValue.cpp | 81 - kabc/vcard/README | 15 - kabc/vcard/RToken.cpp | 88 - kabc/vcard/SoundValue.cpp | 81 - kabc/vcard/SourceParam.cpp | 112 - kabc/vcard/TelParam.cpp | 81 - kabc/vcard/TelValue.cpp | 81 - kabc/vcard/TextBinParam.cpp | 81 - kabc/vcard/TextBinValue.cpp | 104 - kabc/vcard/TextListValue.cpp | 107 - kabc/vcard/TextParam.cpp | 82 - kabc/vcard/TextValue.cpp | 86 - kabc/vcard/URIValue.cpp | 133 - kabc/vcard/UTCValue.cpp | 110 - kabc/vcard/VCard.cpp | 283 - kabc/vcard/VCardEntity.cpp | 119 - kabc/vcard/Value.cpp | 81 - kabc/vcard/include/VCard.h | 43 - kabc/vcard/include/VCardAdrParam.h | 64 - kabc/vcard/include/VCardAdrValue.h | 83 - kabc/vcard/include/VCardAgentParam.h | 60 - kabc/vcard/include/VCardAgentValue.h | 44 - kabc/vcard/include/VCardClassValue.h | 56 - kabc/vcard/include/VCardContentLine.h | 77 - kabc/vcard/include/VCardDateParam.h | 44 - kabc/vcard/include/VCardDateValue.h | 99 - kabc/vcard/include/VCardDefines.h | 52 - kabc/vcard/include/VCardEmailParam.h | 56 - kabc/vcard/include/VCardEntity.h | 68 - kabc/vcard/include/VCardEnum.h | 123 - kabc/vcard/include/VCardFloatValue.h | 51 - kabc/vcard/include/VCardGeoValue.h | 49 - kabc/vcard/include/VCardGroup.h | 39 - kabc/vcard/include/VCardImageParam.h | 44 - kabc/vcard/include/VCardImageValue.h | 44 - kabc/vcard/include/VCardImgValue.h | 39 - kabc/vcard/include/VCardLangValue.h | 51 - kabc/vcard/include/VCardNValue.h | 56 - kabc/vcard/include/VCardOrgValue.h | 50 - kabc/vcard/include/VCardParam.h | 59 - kabc/vcard/include/VCardPhoneNumberValue.h | 39 - kabc/vcard/include/VCardRToken.h | 40 - kabc/vcard/include/VCardSndValue.h | 39 - kabc/vcard/include/VCardSoundValue.h | 44 - kabc/vcard/include/VCardSourceParam.h | 58 - kabc/vcard/include/VCardTelParam.h | 51 - kabc/vcard/include/VCardTelValue.h | 44 - kabc/vcard/include/VCardTextBinParam.h | 44 - kabc/vcard/include/VCardTextBinValue.h | 67 - kabc/vcard/include/VCardTextListValue.h | 51 - kabc/vcard/include/VCardTextParam.h | 44 - kabc/vcard/include/VCardTextValue.h | 41 - kabc/vcard/include/VCardURIValue.h | 52 - kabc/vcard/include/VCardUTCValue.h | 58 - kabc/vcard/include/VCardVCard.h | 63 - kabc/vcard/include/VCardVCardEntity.h | 56 - kabc/vcard/include/VCardValue.h | 46 - kabc/vcard/include/generated/AdrParam-generated.h | 23 - kabc/vcard/include/generated/AdrValue-generated.h | 23 - .../vcard/include/generated/AgentParam-generated.h | 23 - .../vcard/include/generated/AgentValue-generated.h | 23 - .../vcard/include/generated/ClassValue-generated.h | 23 - .../include/generated/ContentLine-generated.h | 23 - kabc/vcard/include/generated/DateParam-generated.h | 23 - kabc/vcard/include/generated/DateValue-generated.h | 23 - .../vcard/include/generated/EmailParam-generated.h | 23 - .../vcard/include/generated/FloatValue-generated.h | 23 - kabc/vcard/include/generated/GeoValue-generated.h | 23 - kabc/vcard/include/generated/Group-generated.h | 23 - .../vcard/include/generated/ImageParam-generated.h | 23 - .../vcard/include/generated/ImageValue-generated.h | 23 - kabc/vcard/include/generated/ImgParam-generated.h | 23 - kabc/vcard/include/generated/ImgValue-generated.h | 23 - kabc/vcard/include/generated/LangValue-generated.h | 23 - kabc/vcard/include/generated/NValue-generated.h | 23 - kabc/vcard/include/generated/Name-generated.h | 22 - kabc/vcard/include/generated/OrgValue-generated.h | 23 - kabc/vcard/include/generated/Param-generated.h | 23 - kabc/vcard/include/generated/ParamName-generated.h | 22 - .../vcard/include/generated/ParamValue-generated.h | 22 - .../include/generated/PhoneNumberValue-generated.h | 23 - .../vcard/include/generated/SoundValue-generated.h | 23 - .../include/generated/SourceParam-generated.h | 23 - kabc/vcard/include/generated/TelParam-generated.h | 23 - kabc/vcard/include/generated/TelValue-generated.h | 23 - .../include/generated/TextBinParam-generated.h | 23 - .../include/generated/TextBinValue-generated.h | 23 - .../include/generated/TextListValue-generated.h | 23 - .../include/generated/TextNSParam-generated.h | 23 - kabc/vcard/include/generated/TextParam-generated.h | 23 - kabc/vcard/include/generated/TextValue-generated.h | 23 - kabc/vcard/include/generated/URIValue-generated.h | 23 - kabc/vcard/include/generated/UTCValue-generated.h | 23 - kabc/vcard/include/generated/VCard-generated.h | 23 - .../include/generated/VCardEntity-generated.h | 23 - kabc/vcard/include/generated/Value-generated.h | 23 - kabc/vcard/include/generated/generate | 2 - kabc/vcard/include/generated/generateHeaders.awk | 41 - kabc/vcard/include/generated/headerBodies | 34 - kabc/vcard/testread.cpp | 129 - kabc/vcard/testwrite.cpp | 41 - kabc/vcard/vCard-all.cpp | 37 - kabc/vcard21parser.cpp | 608 - kabc/vcard21parser.h | 221 - kabc/vcardconverter.cpp | 129 - kabc/vcardconverter.h | 163 - kabc/vcardformat.cpp | 59 - kabc/vcardformat.h | 49 - kabc/vcardformatimpl.cpp | 1001 -- kabc/vcardformatimpl.h | 106 - kabc/vcardformatplugin.cpp | 120 - kabc/vcardformatplugin.h | 56 - kabc/vcardparser/CMakeLists.txt | 40 - kabc/vcardparser/Makefile.am | 31 - kabc/vcardparser/README.testing | 15 - kabc/vcardparser/checkvcard.pl | 75 - kabc/vcardparser/testread.cpp | 89 - kabc/vcardparser/testread2.cpp | 42 - kabc/vcardparser/tests/vcard1.vcf | 13 - kabc/vcardparser/tests/vcard1.vcf.ref | 15 - kabc/vcardparser/tests/vcard2.vcf | 11 - kabc/vcardparser/tests/vcard2.vcf.ref | 12 - kabc/vcardparser/tests/vcard3.vcf | 11 - kabc/vcardparser/tests/vcard3.vcf.ref | 12 - kabc/vcardparser/tests/vcard4.vcf | 14 - kabc/vcardparser/tests/vcard4.vcf.ref | 14 - kabc/vcardparser/tests/vcard5.vcf | 313 - kabc/vcardparser/tests/vcard5.vcf.ref | 313 - kabc/vcardparser/tests/vcard6.vcf | 10 - kabc/vcardparser/tests/vcard6.vcf.ref | 10 - kabc/vcardparser/tests/vcard7.vcf | 7 - kabc/vcardparser/tests/vcard7.vcf.ref | 8 - kabc/vcardparser/testutils.cpp | 99 - kabc/vcardparser/testutils.h | 14 - kabc/vcardparser/testwrite.cpp | 134 - kabc/vcardparser/vcard.cpp | 109 - kabc/vcardparser/vcard.h | 91 - kabc/vcardparser/vcardline.cpp | 151 - kabc/vcardparser/vcardline.h | 115 - kabc/vcardparser/vcardparser.cpp | 297 - kabc/vcardparser/vcardparser.h | 44 - kabc/vcardtool.cpp | 896 -- kabc/vcardtool.h | 88 - kate/part/kateautoindent.cpp | 2 +- kate/part/katebookmarks.cpp | 2 +- kate/part/katebuffer.cpp | 2 +- kate/part/katecmds.cpp | 2 +- kate/part/kateconfig.cpp | 4 +- kate/part/katedialogs.cpp | 10 +- kate/part/katedocument.cpp | 10 +- kate/part/katedocument.h | 2 +- kate/part/katedocumenthelpers.cpp | 2 +- kate/part/katefactory.cpp | 2 +- kate/part/katefiletype.cpp | 2 +- kate/part/katefont.cpp | 2 +- kate/part/katehighlight.cpp | 8 +- kate/part/katejscript.cpp | 4 +- kate/part/kateluaindentscript.cpp | 4 +- kate/part/kateprinter.cpp | 2 +- kate/part/kateschema.cpp | 4 +- kate/part/katesearch.cpp | 4 +- kate/part/katespell.cpp | 2 +- kate/part/katesyntaxdocument.cpp | 4 +- kate/part/katetextline.cpp | 2 +- kate/part/kateview.cpp | 8 +- kate/part/kateviewhelpers.cpp | 6 +- kate/part/kateviewinternal.cpp | 2 +- kate/part/test_regression.cpp | 2 +- kate/plugins/autobookmarker/autobookmarker.cpp | 2 +- kate/plugins/insertfile/insertfileplugin.cpp | 6 +- kate/plugins/isearch/ISearchPlugin.cpp | 2 +- kate/plugins/kdatatool/kate_kdatatool.cpp | 2 +- kate/plugins/wordcompletion/docwordcompletion.cpp | 2 +- kded/kbuildimageiofactory.cpp | 4 +- kded/kbuildprotocolinfofactory.cpp | 4 +- kded/kbuildservicefactory.cpp | 4 +- kded/kbuildservicegroupfactory.cpp | 4 +- kded/kbuildservicetypefactory.cpp | 4 +- kded/kded.cpp | 4 +- kded/khostname.cpp | 4 +- kded/tde-menu.cpp | 4 +- kded/tdebuildsycoca.cpp | 6 +- kded/vfolder_menu.cpp | 2 +- kdewidgets/CMakeLists.txt | 2 +- kdewidgets/kde.widgets | 2 +- kdewidgets/tests/test.widgets | 2 +- kdoctools/meinproc.cpp | 2 +- kdoctools/tdeio_help.cpp | 4 +- kdoctools/xslt.cpp | 2 +- kimgio/dds.cpp | 2 +- kimgio/eps.cpp | 2 +- kimgio/exr.cpp | 2 +- kimgio/gimp.h | 2 +- kimgio/hdr.cpp | 2 +- kimgio/jp2.cpp | 2 +- kinit/autostart.cpp | 2 +- kinit/kinit.cpp | 6 +- kinit/tdelauncher.cpp | 8 +- kinit/tdelauncher_main.cpp | 2 +- knewstuff/downloaddialog.cpp | 4 +- knewstuff/engine.cpp | 4 +- knewstuff/entry.cpp | 4 +- knewstuff/ghns.cpp | 2 +- knewstuff/knewstuff.cpp | 2 +- knewstuff/knewstuffbutton.cpp | 2 +- knewstuff/knewstuffgeneric.cpp | 4 +- knewstuff/knewstuffsecure.cpp | 6 +- knewstuff/provider.cpp | 6 +- knewstuff/providerdialog.cpp | 4 +- knewstuff/security.cpp | 4 +- knewstuff/tdehotnewstuff.cpp | 2 +- knewstuff/testnewstuff.cpp | 2 +- knewstuff/uploaddialog.cpp | 4 +- kstyles/highcontrast/config/highcontrastconfig.cpp | 4 +- kstyles/klegacy/klegacystyle.cpp | 2 +- kstyles/klegacy/plugin.cpp | 2 +- kstyles/kthemestyle/kthemestyle.cpp | 2 +- kstyles/plastik/config/plastitdeconf.cpp | 4 +- kstyles/utils/installtheme/main.cpp | 4 +- kstyles/web/plugin.cpp | 2 +- kstyles/web/webstyle.cpp | 2 +- libtdemid/deviceman.cc | 2 +- libtdescreensaver/main.cpp | 4 +- networkstatus/connectionmanager.cpp | 4 +- networkstatus/networkstatusindicator.cpp | 2 +- tdeabc/CMakeLists.txt | 123 + tdeabc/HACKING | 100 + tdeabc/HOWTO | 372 + tdeabc/Makefile.am | 72 + tdeabc/README | 28 + tdeabc/README.AddressFormat | 66 + tdeabc/TODO | 1 + tdeabc/address.cpp | 592 + tdeabc/address.h | 341 + tdeabc/addressbook.cpp | 842 ++ tdeabc/addressbook.h | 431 + tdeabc/addresseedialog.cpp | 259 + tdeabc/addresseedialog.h | 161 + tdeabc/addresseehelper.cpp | 111 + tdeabc/addresseehelper.h | 66 + tdeabc/addresseelist.cpp | 256 + tdeabc/addresseelist.h | 221 + tdeabc/addresslineedit.cpp | 610 + tdeabc/addresslineedit.h | 123 + tdeabc/agent.cpp | 148 + tdeabc/agent.h | 128 + tdeabc/countrytransl.map | 12381 +++++++++++++++++++ tdeabc/distributionlist.cpp | 298 + tdeabc/distributionlist.h | 217 + tdeabc/distributionlistdialog.cpp | 399 + tdeabc/distributionlistdialog.h | 139 + tdeabc/distributionlisteditor.cpp | 310 + tdeabc/distributionlisteditor.h | 86 + tdeabc/errorhandler.cpp | 55 + tdeabc/errorhandler.h | 95 + tdeabc/field.h | 176 + tdeabc/format.h | 49 + tdeabc/formatfactory.cpp | 168 + tdeabc/formatfactory.h | 101 + tdeabc/formatplugin.h | 73 + tdeabc/formats/CMakeLists.txt | 47 + tdeabc/formats/Makefile.am | 22 + tdeabc/formats/binary.desktop | 89 + tdeabc/formats/binaryformat.cpp | 221 + tdeabc/formats/binaryformat.h | 69 + tdeabc/geo.cpp | 109 + tdeabc/geo.h | 101 + tdeabc/kabc_manager.desktop | 76 + tdeabc/key.cpp | 153 + tdeabc/key.h | 150 + tdeabc/ldapclient.cpp | 427 + tdeabc/ldapclient.h | 248 + tdeabc/ldapconfigwidget.cpp | 626 + tdeabc/ldapconfigwidget.h | 300 + tdeabc/ldapurl.cpp | 201 + tdeabc/ldapurl.h | 110 + tdeabc/ldif.cpp | 365 + tdeabc/ldif.h | 182 + tdeabc/ldifconverter.cpp | 573 + tdeabc/ldifconverter.h | 100 + tdeabc/lock.cpp | 162 + tdeabc/lock.h | 88 + tdeabc/locknull.cpp | 63 + tdeabc/locknull.h | 54 + tdeabc/phonenumber.cpp | 213 + tdeabc/phonenumber.h | 161 + tdeabc/picture.cpp | 120 + tdeabc/picture.h | 128 + tdeabc/plugin.cpp | 61 + tdeabc/plugin.h | 52 + tdeabc/plugins/CMakeLists.txt | 15 + tdeabc/plugins/Makefile.am | 1 + tdeabc/plugins/dir/CMakeLists.txt | 73 + tdeabc/plugins/dir/Makefile.am | 28 + tdeabc/plugins/dir/dir.desktop | 92 + tdeabc/plugins/dir/resourcedir.cpp | 310 + tdeabc/plugins/dir/resourcedir.h | 113 + tdeabc/plugins/dir/resourcedirconfig.cpp | 107 + tdeabc/plugins/dir/resourcedirconfig.h | 54 + tdeabc/plugins/dir/resourcedirplugin.cpp | 32 + tdeabc/plugins/evolution/Makefile.am | 19 + tdeabc/plugins/evolution/README | 15 + tdeabc/plugins/evolution/dbwrapper.cpp | 187 + tdeabc/plugins/evolution/dbwrapper.h | 60 + tdeabc/plugins/evolution/evolution.desktop | 26 + tdeabc/plugins/evolution/resourceevo.cpp | 132 + tdeabc/plugins/evolution/resourceevo.h | 23 + tdeabc/plugins/file/CMakeLists.txt | 73 + tdeabc/plugins/file/Makefile.am | 28 + tdeabc/plugins/file/file.desktop | 82 + tdeabc/plugins/file/resourcefile.cpp | 395 + tdeabc/plugins/file/resourcefile.h | 162 + tdeabc/plugins/file/resourcefileconfig.cpp | 118 + tdeabc/plugins/file/resourcefileconfig.h | 57 + tdeabc/plugins/file/resourcefileplugin.cpp | 32 + tdeabc/plugins/ldaptdeio/CMakeLists.txt | 73 + tdeabc/plugins/ldaptdeio/Makefile.am | 28 + tdeabc/plugins/ldaptdeio/ldaptdeio.desktop | 10 + tdeabc/plugins/ldaptdeio/resourceldaptdeio.cpp | 1041 ++ tdeabc/plugins/ldaptdeio/resourceldaptdeio.h | 171 + .../plugins/ldaptdeio/resourceldaptdeioconfig.cpp | 388 + tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.h | 118 + .../plugins/ldaptdeio/resourceldaptdeioplugin.cpp | 36 + tdeabc/plugins/net/CMakeLists.txt | 73 + tdeabc/plugins/net/Makefile.am | 28 + tdeabc/plugins/net/net.desktop | 90 + tdeabc/plugins/net/resourcenet.cpp | 393 + tdeabc/plugins/net/resourcenet.h | 117 + tdeabc/plugins/net/resourcenetconfig.cpp | 102 + tdeabc/plugins/net/resourcenetconfig.h | 53 + tdeabc/plugins/net/resourcenetplugin.cpp | 32 + tdeabc/plugins/sql/Makefile.am | 20 + tdeabc/plugins/sql/resourcesql.cpp | 338 + tdeabc/plugins/sql/resourcesql.h | 63 + tdeabc/plugins/sql/resourcesqlconfig.cpp | 95 + tdeabc/plugins/sql/resourcesqlconfig.h | 51 + tdeabc/plugins/sql/sql.desktop | 10 + tdeabc/resource.cpp | 351 + tdeabc/resource.h | 319 + tdeabc/resourceselectdialog.cpp | 111 + tdeabc/resourceselectdialog.h | 57 + tdeabc/scripts/Makefile.am | 6 + tdeabc/scripts/addressee.src.cpp | 1127 ++ tdeabc/scripts/addressee.src.h | 407 + tdeabc/scripts/createisomap.pl | 35 + tdeabc/scripts/entrylist | 82 + tdeabc/scripts/field.src.cpp | 512 + tdeabc/scripts/makeaddressee | 215 + tdeabc/secrecy.cpp | 100 + tdeabc/secrecy.h | 100 + tdeabc/sortmode.cpp | 79 + tdeabc/sortmode.h | 114 + tdeabc/sound.cpp | 118 + tdeabc/sound.h | 153 + tdeabc/stdaddressbook.cpp | 203 + tdeabc/stdaddressbook.h | 153 + tdeabc/tdeab2tdeabc.cpp | 476 + tdeabc/tdeab2tdeabc.desktop | 105 + tdeabc/tests/Makefile.am | 55 + tdeabc/tests/bigread.cpp | 65 + tdeabc/tests/bigwrite.cpp | 70 + tdeabc/tests/kabcargl.cpp | 70 + tdeabc/tests/testaddressee.cpp | 57 + tdeabc/tests/testaddresseelist.cpp | 196 + tdeabc/tests/testaddressfmt.cpp | 63 + tdeabc/tests/testaddresslineedit.cpp | 29 + tdeabc/tests/testdb.cpp | 33 + tdeabc/tests/testdistlist.cpp | 59 + tdeabc/tests/testkabc.cpp | 62 + tdeabc/tests/testkabcdlg.cpp | 45 + tdeabc/tests/testldapclient.cpp | 161 + tdeabc/tests/testldapclient.h | 51 + tdeabc/tests/testlock.cpp | 206 + tdeabc/tests/testlock.h | 51 + tdeabc/timezone.cpp | 85 + tdeabc/timezone.h | 89 + tdeabc/vcard/AdrParam.cpp | 126 + tdeabc/vcard/AdrValue.cpp | 140 + tdeabc/vcard/AgentParam.cpp | 103 + tdeabc/vcard/AgentValue.cpp | 81 + tdeabc/vcard/CMakeLists.txt | 40 + tdeabc/vcard/ClassValue.cpp | 120 + tdeabc/vcard/ContentLine.cpp | 302 + tdeabc/vcard/DateParam.cpp | 82 + tdeabc/vcard/DateValue.cpp | 434 + tdeabc/vcard/EmailParam.cpp | 116 + tdeabc/vcard/Entity.cpp | 134 + tdeabc/vcard/Enum.cpp | 490 + tdeabc/vcard/FloatValue.cpp | 120 + tdeabc/vcard/GeoValue.cpp | 100 + tdeabc/vcard/ImageParam.cpp | 81 + tdeabc/vcard/ImageValue.cpp | 81 + tdeabc/vcard/ImgValue.cpp | 81 + tdeabc/vcard/LangValue.cpp | 127 + tdeabc/vcard/Makefile.am | 21 + tdeabc/vcard/NValue.cpp | 128 + tdeabc/vcard/OrgValue.cpp | 107 + tdeabc/vcard/Param.cpp | 129 + tdeabc/vcard/PhoneNumberValue.cpp | 81 + tdeabc/vcard/README | 15 + tdeabc/vcard/RToken.cpp | 88 + tdeabc/vcard/SoundValue.cpp | 81 + tdeabc/vcard/SourceParam.cpp | 112 + tdeabc/vcard/TelParam.cpp | 81 + tdeabc/vcard/TelValue.cpp | 81 + tdeabc/vcard/TextBinParam.cpp | 81 + tdeabc/vcard/TextBinValue.cpp | 104 + tdeabc/vcard/TextListValue.cpp | 107 + tdeabc/vcard/TextParam.cpp | 82 + tdeabc/vcard/TextValue.cpp | 86 + tdeabc/vcard/URIValue.cpp | 133 + tdeabc/vcard/UTCValue.cpp | 110 + tdeabc/vcard/VCard.cpp | 283 + tdeabc/vcard/VCardEntity.cpp | 119 + tdeabc/vcard/Value.cpp | 81 + tdeabc/vcard/include/VCard.h | 43 + tdeabc/vcard/include/VCardAdrParam.h | 64 + tdeabc/vcard/include/VCardAdrValue.h | 83 + tdeabc/vcard/include/VCardAgentParam.h | 60 + tdeabc/vcard/include/VCardAgentValue.h | 44 + tdeabc/vcard/include/VCardClassValue.h | 56 + tdeabc/vcard/include/VCardContentLine.h | 77 + tdeabc/vcard/include/VCardDateParam.h | 44 + tdeabc/vcard/include/VCardDateValue.h | 99 + tdeabc/vcard/include/VCardDefines.h | 52 + tdeabc/vcard/include/VCardEmailParam.h | 56 + tdeabc/vcard/include/VCardEntity.h | 68 + tdeabc/vcard/include/VCardEnum.h | 123 + tdeabc/vcard/include/VCardFloatValue.h | 51 + tdeabc/vcard/include/VCardGeoValue.h | 49 + tdeabc/vcard/include/VCardGroup.h | 39 + tdeabc/vcard/include/VCardImageParam.h | 44 + tdeabc/vcard/include/VCardImageValue.h | 44 + tdeabc/vcard/include/VCardImgValue.h | 39 + tdeabc/vcard/include/VCardLangValue.h | 51 + tdeabc/vcard/include/VCardNValue.h | 56 + tdeabc/vcard/include/VCardOrgValue.h | 50 + tdeabc/vcard/include/VCardParam.h | 59 + tdeabc/vcard/include/VCardPhoneNumberValue.h | 39 + tdeabc/vcard/include/VCardRToken.h | 40 + tdeabc/vcard/include/VCardSndValue.h | 39 + tdeabc/vcard/include/VCardSoundValue.h | 44 + tdeabc/vcard/include/VCardSourceParam.h | 58 + tdeabc/vcard/include/VCardTelParam.h | 51 + tdeabc/vcard/include/VCardTelValue.h | 44 + tdeabc/vcard/include/VCardTextBinParam.h | 44 + tdeabc/vcard/include/VCardTextBinValue.h | 67 + tdeabc/vcard/include/VCardTextListValue.h | 51 + tdeabc/vcard/include/VCardTextParam.h | 44 + tdeabc/vcard/include/VCardTextValue.h | 41 + tdeabc/vcard/include/VCardURIValue.h | 52 + tdeabc/vcard/include/VCardUTCValue.h | 58 + tdeabc/vcard/include/VCardVCard.h | 63 + tdeabc/vcard/include/VCardVCardEntity.h | 56 + tdeabc/vcard/include/VCardValue.h | 46 + .../vcard/include/generated/AdrParam-generated.h | 23 + .../vcard/include/generated/AdrValue-generated.h | 23 + .../vcard/include/generated/AgentParam-generated.h | 23 + .../vcard/include/generated/AgentValue-generated.h | 23 + .../vcard/include/generated/ClassValue-generated.h | 23 + .../include/generated/ContentLine-generated.h | 23 + .../vcard/include/generated/DateParam-generated.h | 23 + .../vcard/include/generated/DateValue-generated.h | 23 + .../vcard/include/generated/EmailParam-generated.h | 23 + .../vcard/include/generated/FloatValue-generated.h | 23 + .../vcard/include/generated/GeoValue-generated.h | 23 + tdeabc/vcard/include/generated/Group-generated.h | 23 + .../vcard/include/generated/ImageParam-generated.h | 23 + .../vcard/include/generated/ImageValue-generated.h | 23 + .../vcard/include/generated/ImgParam-generated.h | 23 + .../vcard/include/generated/ImgValue-generated.h | 23 + .../vcard/include/generated/LangValue-generated.h | 23 + tdeabc/vcard/include/generated/NValue-generated.h | 23 + tdeabc/vcard/include/generated/Name-generated.h | 22 + .../vcard/include/generated/OrgValue-generated.h | 23 + tdeabc/vcard/include/generated/Param-generated.h | 23 + .../vcard/include/generated/ParamName-generated.h | 22 + .../vcard/include/generated/ParamValue-generated.h | 22 + .../include/generated/PhoneNumberValue-generated.h | 23 + .../vcard/include/generated/SoundValue-generated.h | 23 + .../include/generated/SourceParam-generated.h | 23 + .../vcard/include/generated/TelParam-generated.h | 23 + .../vcard/include/generated/TelValue-generated.h | 23 + .../include/generated/TextBinParam-generated.h | 23 + .../include/generated/TextBinValue-generated.h | 23 + .../include/generated/TextListValue-generated.h | 23 + .../include/generated/TextNSParam-generated.h | 23 + .../vcard/include/generated/TextParam-generated.h | 23 + .../vcard/include/generated/TextValue-generated.h | 23 + .../vcard/include/generated/URIValue-generated.h | 23 + .../vcard/include/generated/UTCValue-generated.h | 23 + tdeabc/vcard/include/generated/VCard-generated.h | 23 + .../include/generated/VCardEntity-generated.h | 23 + tdeabc/vcard/include/generated/Value-generated.h | 23 + tdeabc/vcard/include/generated/generate | 2 + tdeabc/vcard/include/generated/generateHeaders.awk | 41 + tdeabc/vcard/include/generated/headerBodies | 34 + tdeabc/vcard/testread.cpp | 129 + tdeabc/vcard/testwrite.cpp | 41 + tdeabc/vcard/vCard-all.cpp | 37 + tdeabc/vcard21parser.cpp | 608 + tdeabc/vcard21parser.h | 221 + tdeabc/vcardconverter.cpp | 129 + tdeabc/vcardconverter.h | 163 + tdeabc/vcardformat.cpp | 59 + tdeabc/vcardformat.h | 49 + tdeabc/vcardformatimpl.cpp | 1001 ++ tdeabc/vcardformatimpl.h | 106 + tdeabc/vcardformatplugin.cpp | 120 + tdeabc/vcardformatplugin.h | 56 + tdeabc/vcardparser/CMakeLists.txt | 40 + tdeabc/vcardparser/Makefile.am | 31 + tdeabc/vcardparser/README.testing | 15 + tdeabc/vcardparser/checkvcard.pl | 75 + tdeabc/vcardparser/testread.cpp | 89 + tdeabc/vcardparser/testread2.cpp | 42 + tdeabc/vcardparser/tests/vcard1.vcf | 13 + tdeabc/vcardparser/tests/vcard1.vcf.ref | 15 + tdeabc/vcardparser/tests/vcard2.vcf | 11 + tdeabc/vcardparser/tests/vcard2.vcf.ref | 12 + tdeabc/vcardparser/tests/vcard3.vcf | 11 + tdeabc/vcardparser/tests/vcard3.vcf.ref | 12 + tdeabc/vcardparser/tests/vcard4.vcf | 14 + tdeabc/vcardparser/tests/vcard4.vcf.ref | 14 + tdeabc/vcardparser/tests/vcard5.vcf | 313 + tdeabc/vcardparser/tests/vcard5.vcf.ref | 313 + tdeabc/vcardparser/tests/vcard6.vcf | 10 + tdeabc/vcardparser/tests/vcard6.vcf.ref | 10 + tdeabc/vcardparser/tests/vcard7.vcf | 7 + tdeabc/vcardparser/tests/vcard7.vcf.ref | 8 + tdeabc/vcardparser/testutils.cpp | 99 + tdeabc/vcardparser/testutils.h | 14 + tdeabc/vcardparser/testwrite.cpp | 134 + tdeabc/vcardparser/vcard.cpp | 109 + tdeabc/vcardparser/vcard.h | 91 + tdeabc/vcardparser/vcardline.cpp | 151 + tdeabc/vcardparser/vcardline.h | 115 + tdeabc/vcardparser/vcardparser.cpp | 297 + tdeabc/vcardparser/vcardparser.h | 44 + tdeabc/vcardtool.cpp | 896 ++ tdeabc/vcardtool.h | 88 + tdecert/tdecertpart.cc | 4 +- tdecmshell/main.cpp | 6 +- tdeconf_update/tdeconf_update.cpp | 6 +- tdecore/CMakeLists.txt | 16 +- tdecore/MAINTAINERS | 10 +- tdecore/Makefile.am | 16 +- tdecore/kappdcopiface.cpp | 2 +- tdecore/kapplication_win.cpp | 2 +- tdecore/kcalendarsystem.cpp | 4 +- tdecore/kcalendarsystemgregorian.cpp | 2 +- tdecore/kcalendarsystemhebrew.cpp | 2 +- tdecore/kcalendarsystemhijri.cpp | 2 +- tdecore/kcalendarsystemjalali.cpp | 4 +- tdecore/kcharsets.cpp | 4 +- tdecore/kcheckaccelerators.cpp | 4 +- tdecore/kclipboard.cpp | 2 +- tdecore/kcompletion.cpp | 4 +- tdecore/kcompletion.h | 2 +- tdecore/kcrash.cpp | 2 +- tdecore/kdebug.areas | 2 +- tdecore/kdebug.cpp | 4 +- tdecore/kdebugrc | 2 +- tdecore/kdesktopfile.cpp | 2 +- tdecore/kdetcompmgr.cpp | 2 +- tdecore/kgenericfactory.h | 4 +- tdecore/kglobal.cpp | 6 +- tdecore/kglobalaccel.cpp | 2 +- tdecore/kglobalsettings.cpp | 6 +- tdecore/kiconeffect.cpp | 4 +- tdecore/kiconloader.cpp | 2 +- tdecore/kiconloader.h | 2 +- tdecore/kicontheme.cpp | 2 +- tdecore/kinstance.cpp | 4 +- tdecore/kkeynative_x11.cpp | 2 +- tdecore/kkeyserver_x11.cpp | 4 +- tdecore/klibloader.cpp | 2 +- tdecore/klibloader.h | 2 +- tdecore/klocale.cpp | 4 +- tdecore/klocale.h | 2 +- tdecore/klockfile.cpp | 4 +- tdecore/kmimesourcefactory.cpp | 2 +- tdecore/kmimesourcefactory.h | 2 +- tdecore/kpalette.cpp | 2 +- tdecore/kprotocolinfo_tdecore.cpp | 2 +- tdecore/kprotocolinfofactory.cpp | 2 +- tdecore/krootprop.cpp | 4 +- tdecore/ksavefile.h | 2 +- tdecore/ksimpleconfig.cpp | 2 +- tdecore/ksimpledirwatch.cpp | 2 +- tdecore/ksockaddr.cpp | 2 +- tdecore/ksocks.cpp | 2 +- tdecore/kstandarddirs.h | 2 +- tdecore/kstartupinfo.cpp | 4 +- tdecore/kstartupinfo.h | 2 +- tdecore/kstaticdeleter.h | 2 +- tdecore/kstringhandler.cpp | 2 +- tdecore/ktempdir.cpp | 2 +- tdecore/ktempfile.cpp | 4 +- tdecore/ktimezones.cpp | 2 +- tdecore/kuniqueapplication.cpp | 2 +- tdecore/kurl.cpp | 2 +- tdecore/kurldrag.cpp | 4 +- tdecore/kvmallocator.cpp | 2 +- tdecore/netsupp.cpp | 2 +- tdecore/network/kresolver.cpp | 2 +- tdecore/network/kresolverstandardworkers.cpp | 2 +- tdecore/network/tdesocketaddress.cpp | 2 +- tdecore/network/tdesocketbase.cpp | 2 +- .../network-manager/network-manager_p.h | 2 +- tdecore/tde-config.cpp.cmake | 6 +- tdecore/tde-config.cpp.in | 6 +- tdecore/tdeaboutdata.h | 2 +- tdecore/tdeaccel.cpp | 2 +- tdecore/tdeaccelaction.cpp | 4 +- tdecore/tdeaccelbase.cpp | 4 +- tdecore/tdeapplication.cpp | 8 +- tdecore/tdecmdlineargs.cpp | 4 +- tdecore/tdeconfig.cpp | 2 +- tdecore/tdeconfig_compiler/example/autoexample.cpp | 4 +- tdecore/tdeconfig_compiler/example/example.cpp | 4 +- tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp | 8 +- tdecore/tdeconfig_compiler/tests/test2.cpp.ref | 2 +- tdecore/tdeconfig_compiler/tests/test8a.h.ref | 2 +- .../tdeconfig_compiler/tests/test_dpointer.cpp.ref | 2 +- tdecore/tdeconfigbackend.cpp | 4 +- tdecore/tdeconfigbackend.h | 2 +- tdecore/tdeconfigbase.cpp | 4 +- tdecore/tdeconfigdialogmanager.cpp | 2 +- tdecore/tdeconfigskeleton.cpp | 4 +- tdecore/tdeconfigskeleton.h | 2 +- tdecore/tdehardwaredevices.cpp | 6 +- tdecore/tdenetworkconnections.cpp | 2 +- tdecore/tdeshortcut.cpp | 4 +- tdecore/tdeshortcutlist.cpp | 2 +- tdecore/tdeshortcutmenu.cpp | 2 +- tdecore/tdestdaccel.cpp | 4 +- tdecore/tdesycoca.cpp | 2 +- tdecore/tests/Makefile.am | 2 +- tdecore/tests/kapptest.cpp | 2 +- tdecore/tests/kcalendartest.cpp | 4 +- tdecore/tests/kcmdlineargstest.cpp | 2 +- tdecore/tests/kglobaltest.cpp | 2 +- tdecore/tests/klocaletest.cpp | 6 +- tdecore/tests/kmdcodectest.cpp | 2 +- tdecore/tests/krfcdatetest.cpp | 2 +- tdecore/tests/ksocktest.cpp | 2 +- tdecore/tests/ktempfiletest.cpp | 2 +- tdecore/tests/kuniqueapptest.cpp | 2 +- tdecore/tests/kurltest.cpp | 2 +- tdecore/tests/startserviceby.cpp | 2 +- tdecore/tests/testqtargs.cpp | 2 +- tdecore/twin.cpp | 6 +- tdecore/twinmodule.cpp | 2 +- tdefile-plugins/elf/tdefile_elf.cpp | 2 +- tdehtml/css/csshelper.cpp | 2 +- tdehtml/css/cssparser.cpp | 2 +- tdehtml/css/cssstyleselector.cpp | 2 +- tdehtml/ecma/kjs_debugwin.cpp | 10 +- tdehtml/ecma/kjs_html.cpp | 4 +- tdehtml/ecma/kjs_mozilla.cpp | 2 +- tdehtml/ecma/kjs_navigator.cpp | 4 +- tdehtml/ecma/kjs_proxy.cpp | 6 +- tdehtml/ecma/kjs_window.cpp | 6 +- tdehtml/html/dtd.cpp | 2 +- tdehtml/html/html_documentimpl.cpp | 4 +- tdehtml/html/html_elementimpl.cpp | 2 +- tdehtml/html/html_formimpl.cpp | 6 +- tdehtml/html/html_imageimpl.cpp | 2 +- tdehtml/html/html_tableimpl.cpp | 2 +- tdehtml/html/htmlparser.cpp | 2 +- tdehtml/html/htmltokenizer.cpp | 2 +- tdehtml/java/kjavaapplet.cpp | 2 +- tdehtml/java/kjavaappletcontext.cpp | 4 +- tdehtml/java/kjavaappletserver.cpp | 4 +- tdehtml/java/kjavaappletviewer.cpp | 2 +- tdehtml/java/kjavaappletwidget.cpp | 2 +- tdehtml/java/kjavaprocess.cpp | 2 +- tdehtml/misc/arena.cpp | 2 +- tdehtml/misc/decoder.cpp | 4 +- tdehtml/misc/htmlhashes.cpp | 2 +- tdehtml/misc/htmltags.h | 2 +- tdehtml/misc/knsplugininstaller.cpp | 6 +- tdehtml/misc/loader.cpp | 4 +- tdehtml/misc/loader_jpeg.cpp | 2 +- tdehtml/misc/maketags | 2 +- tdehtml/rendering/font.cpp | 2 +- tdehtml/rendering/render_applet.cpp | 2 +- tdehtml/rendering/render_body.cpp | 2 +- tdehtml/rendering/render_box.cpp | 2 +- tdehtml/rendering/render_canvas.cpp | 2 +- tdehtml/rendering/render_flow.cpp | 2 +- tdehtml/rendering/render_form.cpp | 4 +- tdehtml/rendering/render_frames.cpp | 4 +- tdehtml/rendering/render_image.cpp | 2 +- tdehtml/rendering/render_inline.cpp | 2 +- tdehtml/rendering/render_line.cpp | 2 +- tdehtml/rendering/render_list.cpp | 2 +- tdehtml/rendering/render_object.cpp | 2 +- tdehtml/rendering/render_object.h | 2 +- tdehtml/rendering/render_replaced.cpp | 2 +- tdehtml/rendering/render_table.cpp | 2 +- tdehtml/rendering/render_text.cpp | 2 +- tdehtml/rendering/table_layout.cpp | 2 +- tdehtml/tdehtml_ext.cpp | 4 +- tdehtml/tdehtml_factory.cpp | 2 +- tdehtml/tdehtml_pagecache.cpp | 2 +- tdehtml/tdehtml_part.cpp | 10 +- tdehtml/tdehtml_printsettings.cpp | 2 +- tdehtml/tdehtml_run.cpp | 2 +- tdehtml/tdehtml_settings.cc | 8 +- tdehtml/tdehtmlimage.cpp | 2 +- tdehtml/tdehtmlview.cpp | 2 +- tdehtml/tdemultipart/tdemultipart.cpp | 6 +- tdehtml/test_regression.cpp | 2 +- tdehtml/xml/dom_docimpl.cpp | 4 +- tdehtml/xml/dom_nodeimpl.cpp | 2 +- tdehtml/xml/xml_tokenizer.cpp | 2 +- tdeio/bookmarks/kbookmark.cc | 4 +- tdeio/bookmarks/kbookmarkexporter.cc | 2 +- tdeio/bookmarks/kbookmarkimporter.cc | 2 +- tdeio/bookmarks/kbookmarkimporter_crash.cc | 2 +- tdeio/bookmarks/kbookmarkimporter_ie.cc | 2 +- tdeio/bookmarks/kbookmarkimporter_kde1.cc | 2 +- tdeio/bookmarks/kbookmarkimporter_ns.cc | 2 +- tdeio/bookmarks/kbookmarkimporter_opera.cc | 2 +- tdeio/bookmarks/kbookmarkmanager.cc | 4 +- tdeio/bookmarks/kbookmarkmenu.cc | 4 +- tdeio/bookmarks/kbookmarkmenu.h | 2 +- tdeio/bookmarks/kbookmarkmenu_p.h | 2 +- tdeio/httpfilter/httpfilter.cc | 2 +- tdeio/kpasswdserver/kpasswdserver.cpp | 4 +- tdeio/kssl/kssl.cc | 2 +- tdeio/kssl/ksslcertdlg.cc | 6 +- tdeio/kssl/ksslcertificate.cc | 4 +- tdeio/kssl/ksslinfodlg.cc | 6 +- tdeio/kssl/ksslkeygen.cc | 6 +- tdeio/kssl/ksslpemcallback.cc | 2 +- tdeio/kssl/ksslpkcs12.cc | 2 +- tdeio/kssl/ksslpkcs7.cc | 2 +- tdeio/kssl/ksslsettings.cc | 2 +- tdeio/kssl/ksslutils.cc | 4 +- tdeio/misc/kpac/discovery.cpp | 2 +- tdeio/misc/kpac/downloader.cpp | 4 +- tdeio/misc/kpac/proxyscout.cpp | 4 +- tdeio/misc/kssld/kssld.cpp | 2 +- tdeio/misc/tdefile/fileprops.cpp | 2 +- tdeio/misc/tdemailservice.cpp | 2 +- tdeio/misc/tdesendbugmail/main.cpp | 4 +- tdeio/misc/tdetelnetservice.cpp | 4 +- tdeio/misc/tdewalletd/tdewalletd.cpp | 6 +- tdeio/misc/tdewalletd/tdewalletwizard.ui | 2 +- tdeio/misc/uiserver.cpp | 6 +- tdeio/tdefile/CMakeLists.txt | 4 +- tdeio/tdefile/ChangeLog | 14 +- tdeio/tdefile/Makefile.am | 4 +- tdeio/tdefile/kacleditwidget.cpp | 2 +- tdeio/tdefile/kcombiview.cpp | 2 +- tdeio/tdefile/kcombiview.h | 2 +- tdeio/tdefile/kcustommenueditor.cpp | 4 +- tdeio/tdefile/kdiroperator.cpp | 8 +- tdeio/tdefile/kdirselectdialog.cpp | 6 +- tdeio/tdefile/kdirsize.cpp | 2 +- tdeio/tdefile/kencodingfiledialog.cpp | 6 +- tdeio/tdefile/kicondialog.cpp | 4 +- tdeio/tdefile/kimagefilepreview.cpp | 4 +- tdeio/tdefile/kmetaprops.cpp | 6 +- tdeio/tdefile/knotifydialog.cpp | 4 +- tdeio/tdefile/knotifydialog.h | 2 +- tdeio/tdefile/kopenwith.cpp | 4 +- tdeio/tdefile/kpreviewprops.cpp | 4 +- tdeio/tdefile/kpropertiesdialog.cpp | 8 +- tdeio/tdefile/kurlbar.cpp | 4 +- tdeio/tdefile/kurlcombobox.cpp | 4 +- tdeio/tdefile/kurlrequester.cpp | 4 +- tdeio/tdefile/kurlrequesterdlg.cpp | 4 +- tdeio/tdefile/tdefiledetailview.cpp | 6 +- tdeio/tdefile/tdefiledialog.cpp | 10 +- tdeio/tdefile/tdefilefiltercombo.cpp | 2 +- tdeio/tdefile/tdefileiconview.cpp | 4 +- tdeio/tdefile/tdefilemetainfowidget.cpp | 2 +- tdeio/tdefile/tdefilepreview.cpp | 2 +- tdeio/tdefile/tdefilesharedlg.cpp | 6 +- tdeio/tdefile/tdefilespeedbar.cpp | 6 +- tdeio/tdefile/tdefiletreeview.cpp | 2 +- tdeio/tdefile/tdefileview.cpp | 4 +- tdeio/tdefile/tderecentdirs.cpp | 2 +- tdeio/tdefile/tests/kcustommenueditortest.cpp | 2 +- tdeio/tdefile/tests/kdirselectdialogtest.cpp | 2 +- tdeio/tdefile/tests/kfdtest.cpp | 2 +- tdeio/tdefile/tests/kfstest.cpp | 4 +- tdeio/tdefile/tests/tdefiletreeviewtest.cpp | 2 +- tdeio/tdeio/CMakeLists.txt | 8 +- tdeio/tdeio/Makefile.am | 8 +- tdeio/tdeio/chmodjob.cpp | 4 +- tdeio/tdeio/dataslave.cpp | 2 +- tdeio/tdeio/defaultprogress.cpp | 4 +- tdeio/tdeio/global.cpp | 6 +- tdeio/tdeio/job.cpp | 10 +- tdeio/tdeio/kdcopservicestarter.cpp | 2 +- tdeio/tdeio/kdirlister.cpp | 8 +- tdeio/tdeio/kdirwatch.cpp | 2 +- tdeio/tdeio/kemailsettings.cpp | 4 +- tdeio/tdeio/kimageio.cpp | 4 +- tdeio/tdeio/kmessageboxwrapper.h | 2 +- tdeio/tdeio/kmimetype.cpp | 2 +- tdeio/tdeio/kmimetypechooser.cpp | 2 +- tdeio/tdeio/kprotocolinfo.cpp | 2 +- tdeio/tdeio/kprotocolmanager.cpp | 6 +- tdeio/tdeio/krun.cpp | 4 +- tdeio/tdeio/krun.h | 2 +- tdeio/tdeio/kscan.cpp | 2 +- tdeio/tdeio/kservice.cpp | 4 +- tdeio/tdeio/kservicefactory.cpp | 4 +- tdeio/tdeio/kservicegroup.cpp | 4 +- tdeio/tdeio/kservicegroupfactory.cpp | 4 +- tdeio/tdeio/kshred.cpp | 2 +- tdeio/tdeio/ktar.cpp | 2 +- tdeio/tdeio/kurlcompletion.cpp | 4 +- tdeio/tdeio/kuserprofile.cpp | 2 +- tdeio/tdeio/netaccess.cpp | 4 +- tdeio/tdeio/observer.cpp | 4 +- tdeio/tdeio/passdlg.cpp | 2 +- tdeio/tdeio/paste.cpp | 8 +- tdeio/tdeio/pastedialog.cpp | 2 +- tdeio/tdeio/previewjob.cpp | 4 +- tdeio/tdeio/renamedlg.cpp | 6 +- tdeio/tdeio/scheduler.cpp | 4 +- tdeio/tdeio/sessiondata.cpp | 6 +- tdeio/tdeio/skipdlg.cpp | 2 +- tdeio/tdeio/slave.cpp | 8 +- tdeio/tdeio/slavebase.cpp | 2 +- tdeio/tdeio/slaveconfig.cpp | 2 +- tdeio/tdeio/statusbarprogress.cpp | 2 +- tdeio/tdeio/tcpslavebase.cpp | 6 +- tdeio/tdeio/tdefilefilter.cpp | 2 +- tdeio/tdeio/tdefileitem.cpp | 6 +- tdeio/tdeio/tdefilemetainfo.cpp | 2 +- tdeio/tdeio/tdefileshare.cpp | 2 +- tdeio/tdeioexec/main.cpp | 6 +- tdeio/tests/kiopassdlgtest.cpp | 4 +- tdeio/tests/kpropsdlgtest.cpp | 2 +- tdeio/tests/kprotocolinfotest.cpp | 4 +- tdeio/tests/tdeioslavetest.cpp | 2 +- tdeioslave/file/file.cc | 6 +- tdeioslave/ftp/ftp.cc | 2 +- tdeioslave/http/http.cc | 2 +- tdeioslave/http/http_cache_cleaner.cpp | 6 +- tdeioslave/http/kcookiejar/kcookiewin.cpp | 4 +- tdeioslave/http/kcookiejar/main.cpp | 2 +- tdeioslave/metainfo/metainfo.cpp | 2 +- tdelfeditor/tdelfeditor.cpp | 2 +- tdemdi/tdemdi/dockcontainer.cpp | 4 +- tdemdi/tdemdi/guiclient.cpp | 2 +- tdemdi/tdemdi/mainwindow.cpp | 4 +- tdemdi/tdemdi/mainwindow.h | 2 +- tdemdi/tdemdichildarea.cpp | 4 +- tdemdi/tdemdichildfrm.cpp | 2 +- tdemdi/tdemdichildfrmcaption.cpp | 2 +- tdemdi/tdemdichildview.cpp | 2 +- tdemdi/tdemdidockcontainer.cpp | 4 +- tdemdi/tdemdiguiclient.cpp | 2 +- tdemdi/tdemdimainfrm.cpp | 4 +- tdemdi/tdemdimainfrm.h | 2 +- tdeparts/browserextension.cpp | 4 +- tdeparts/browserrun.cpp | 6 +- tdeparts/factory.cpp | 4 +- tdeparts/part.cpp | 6 +- tdeparts/partmanager.cpp | 2 +- tdeparts/plugin.cpp | 2 +- tdeparts/tests/example.cpp | 4 +- tdeparts/tests/ghostview.cpp | 4 +- tdeparts/tests/normalktm.cpp | 6 +- tdeparts/tests/notepad.cpp | 2 +- tdeparts/tests/parts.cpp | 4 +- tdeparts/tests/plugin_spellcheck.cpp | 4 +- tdeprint/cups/cupsaddsmb2.cpp | 4 +- tdeprint/cups/cupsdconf2/addressdialog.cpp | 2 +- tdeprint/cups/cupsdconf2/browsedialog.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsdbrowsingpage.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsdcomment.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsdconf.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsddialog.cpp | 6 +- tdeprint/cups/cupsdconf2/cupsddirpage.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsdfilterpage.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsdjobspage.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsdlogpage.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsdnetworkpage.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsdsecuritypage.cpp | 4 +- tdeprint/cups/cupsdconf2/cupsdserverpage.cpp | 2 +- tdeprint/cups/cupsdconf2/cupsdsplash.cpp | 2 +- tdeprint/cups/cupsdconf2/editlist.cpp | 2 +- tdeprint/cups/cupsdconf2/locationdialog.cpp | 2 +- tdeprint/cups/cupsdconf2/main.cpp | 2 +- tdeprint/cups/cupsdconf2/portdialog.cpp | 2 +- tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp | 2 +- tdeprint/cups/cupsdconf2/sizewidget.cpp | 2 +- tdeprint/cups/cupsinfos.cpp | 2 +- tdeprint/cups/ippreportdlg.cpp | 4 +- tdeprint/cups/ipprequest.cpp | 4 +- tdeprint/cups/kmconfigcups.cpp | 2 +- tdeprint/cups/kmconfigcupsdir.cpp | 2 +- tdeprint/cups/kmcupsconfigwidget.cpp | 2 +- tdeprint/cups/kmcupsfactory.cpp | 2 +- tdeprint/cups/kmcupsjobmanager.cpp | 2 +- tdeprint/cups/kmcupsmanager.cpp | 4 +- tdeprint/cups/kmcupsuimanager.cpp | 4 +- tdeprint/cups/kmpropbanners.cpp | 2 +- tdeprint/cups/kmpropquota.cpp | 2 +- tdeprint/cups/kmpropusers.cpp | 2 +- tdeprint/cups/kmwbanners.cpp | 2 +- tdeprint/cups/kmwfax.cpp | 2 +- tdeprint/cups/kmwipp.cpp | 2 +- tdeprint/cups/kmwippprinter.cpp | 4 +- tdeprint/cups/kmwippselect.cpp | 2 +- tdeprint/cups/kmwother.cpp | 2 +- tdeprint/cups/kmwquota.cpp | 2 +- tdeprint/cups/kmwusers.cpp | 2 +- tdeprint/cups/kphpgl2page.cpp | 2 +- tdeprint/cups/kpimagepage.cpp | 2 +- tdeprint/cups/kpschedulepage.cpp | 2 +- tdeprint/cups/kptagspage.cpp | 2 +- tdeprint/cups/kptextpage.cpp | 2 +- tdeprint/driver.cpp | 2 +- tdeprint/driverview.cpp | 2 +- tdeprint/droptionview.cpp | 2 +- tdeprint/ext/kextprinterimpl.cpp | 2 +- tdeprint/ext/kmextmanager.cpp | 2 +- tdeprint/ext/kmextuimanager.cpp | 2 +- tdeprint/foomatic/kfoomaticprinterimpl.cpp | 2 +- tdeprint/foomatic/kmfoomaticmanager.cpp | 2 +- tdeprint/foomatic2loader.cpp | 2 +- tdeprint/kmfactory.cpp | 4 +- tdeprint/kmjob.cpp | 2 +- tdeprint/kmmanager.cpp | 2 +- tdeprint/kmprinter.cpp | 2 +- tdeprint/kmspecialmanager.cpp | 4 +- tdeprint/kmuimanager.cpp | 2 +- tdeprint/kmvirtualmanager.cpp | 4 +- tdeprint/kpcopiespage.cpp | 2 +- tdeprint/kpdriverpage.cpp | 2 +- tdeprint/kpfileselectpage.cpp | 2 +- tdeprint/kpfilterpage.cpp | 4 +- tdeprint/kpgeneralpage.cpp | 2 +- tdeprint/kpmarginpage.cpp | 4 +- tdeprint/kpposterpage.cpp | 2 +- tdeprint/kpqtpage.cpp | 2 +- tdeprint/kprintaction.cpp | 2 +- tdeprint/kprintdialog.cpp | 6 +- tdeprint/kprinter.cpp | 6 +- tdeprint/kprinterimpl.cpp | 4 +- tdeprint/kprinterpropertydialog.cpp | 4 +- tdeprint/kprintpreview.cpp | 4 +- tdeprint/kprintprocess.cpp | 2 +- tdeprint/kxmlcommand.cpp | 4 +- tdeprint/lpd/klpdprinterimpl.cpp | 2 +- tdeprint/lpd/kmlpdmanager.cpp | 2 +- tdeprint/lpd/kmlpduimanager.cpp | 2 +- tdeprint/lpd/lpdtools.cpp | 2 +- tdeprint/lpdunix/klpdunixprinterimpl.cpp | 2 +- tdeprint/lpdunix/kmlpdunixmanager.cpp | 2 +- tdeprint/lpdunix/kmlpdunixuimanager.cpp | 2 +- tdeprint/lpr/apshandler.cpp | 2 +- tdeprint/lpr/editentrydialog.cpp | 2 +- tdeprint/lpr/kmconfiglpr.cpp | 2 +- tdeprint/lpr/kmlprjobmanager.cpp | 2 +- tdeprint/lpr/kmlprmanager.cpp | 4 +- tdeprint/lpr/kmlpruimanager.cpp | 2 +- tdeprint/lpr/lpchelper.cpp | 2 +- tdeprint/lpr/lprhandler.cpp | 2 +- tdeprint/lpr/lprngtoolhandler.cpp | 2 +- tdeprint/lpr/matichandler.cpp | 2 +- tdeprint/management/kaddprinterwizard.cpp | 6 +- tdeprint/management/kmconfigcommand.cpp | 2 +- tdeprint/management/kmconfigdialog.cpp | 2 +- tdeprint/management/kmconfigfilter.cpp | 2 +- tdeprint/management/kmconfigfonts.cpp | 2 +- tdeprint/management/kmconfiggeneral.cpp | 4 +- tdeprint/management/kmconfigjobs.cpp | 2 +- tdeprint/management/kmconfigpreview.cpp | 2 +- tdeprint/management/kmdbcreator.cpp | 2 +- tdeprint/management/kmdriverdb.cpp | 2 +- tdeprint/management/kmdriverdbwidget.cpp | 4 +- tdeprint/management/kmdriverdialog.cpp | 4 +- tdeprint/management/kminfopage.cpp | 2 +- tdeprint/management/kminstancepage.cpp | 4 +- tdeprint/management/kmjobviewer.cpp | 6 +- tdeprint/management/kmlistview.cpp | 2 +- tdeprint/management/kmmainview.cpp | 6 +- tdeprint/management/kmpages.cpp | 2 +- tdeprint/management/kmprinterview.cpp | 2 +- tdeprint/management/kmpropbackend.cpp | 2 +- tdeprint/management/kmpropcontainer.cpp | 2 +- tdeprint/management/kmpropdriver.cpp | 2 +- tdeprint/management/kmpropgeneral.cpp | 2 +- tdeprint/management/kmpropmembers.cpp | 2 +- tdeprint/management/kmpropwidget.cpp | 4 +- tdeprint/management/kmspecialprinterdlg.cpp | 4 +- tdeprint/management/kmwbackend.cpp | 2 +- tdeprint/management/kmwclass.cpp | 2 +- tdeprint/management/kmwdriver.cpp | 2 +- tdeprint/management/kmwdriverselect.cpp | 4 +- tdeprint/management/kmwdrivertest.cpp | 4 +- tdeprint/management/kmwend.cpp | 2 +- tdeprint/management/kmwfile.cpp | 2 +- tdeprint/management/kmwinfopage.cpp | 2 +- tdeprint/management/kmwizard.cpp | 4 +- tdeprint/management/kmwlocal.cpp | 4 +- tdeprint/management/kmwlpd.cpp | 4 +- tdeprint/management/kmwname.cpp | 4 +- tdeprint/management/kmwpassword.cpp | 2 +- tdeprint/management/kmwsmb.cpp | 2 +- tdeprint/management/kmwsocket.cpp | 4 +- tdeprint/management/kmwsocketutil.cpp | 4 +- tdeprint/management/kxmlcommanddlg.cpp | 4 +- tdeprint/management/kxmlcommandselector.cpp | 4 +- tdeprint/management/networkscanner.cpp | 4 +- tdeprint/management/smbview.cpp | 6 +- tdeprint/management/tdeprint_management_module.cpp | 4 +- tdeprint/marginpreview.cpp | 2 +- tdeprint/marginwidget.cpp | 4 +- tdeprint/plugincombobox.cpp | 2 +- tdeprint/posterpreview.cpp | 4 +- tdeprint/ppdloader.cpp | 2 +- tdeprint/printerfilter.cpp | 2 +- tdeprint/rlpr/kmconfigproxy.cpp | 2 +- tdeprint/rlpr/kmproprlpr.cpp | 2 +- tdeprint/rlpr/kmproxywidget.cpp | 2 +- tdeprint/rlpr/kmrlprmanager.cpp | 2 +- tdeprint/rlpr/kmrlpruimanager.cpp | 2 +- tdeprint/rlpr/kmwrlpr.cpp | 2 +- tdeprint/rlpr/krlprprinterimpl.cpp | 2 +- tdeprint/tdefilelist.cpp | 2 +- tdeprint/tdeprintd.cpp | 4 +- tdeprint/tests/helpwindow.cpp | 2 +- tdeprint/tools/escputil/escpwidget.cpp | 4 +- tdeprint/util.h | 2 +- tderandr/ktimerdialog.cpp | 2 +- tderandr/libtderandr.cc | 4 +- tderandr/randr.cpp | 4 +- tderesources/configdialog.cpp | 4 +- tderesources/configpage.cpp | 4 +- tderesources/factory.cpp | 2 +- tderesources/kcmtderesources.cpp | 2 +- tderesources/resource.cpp | 2 +- tderesources/selectdialog.cpp | 4 +- tdersync/rsyncconfigdialog.cpp | 4 +- tdersync/tdersync.h | 4 +- tdespell2/settings.cpp | 4 +- tdespell2/ui/configdialog.cpp | 2 +- tdespell2/ui/configwidget.cpp | 2 +- tdespell2/ui/dialog.cpp | 2 +- tdesu/ssh.cpp | 2 +- tdesu/su.cpp | 2 +- tdeui/CMakeLists.txt | 8 +- tdeui/MAINTAINERS | 4 +- tdeui/Makefile.am | 8 +- tdeui/kauthicon.cpp | 2 +- tdeui/kbugreport.cpp | 6 +- tdeui/kbuttonbox.cpp | 2 +- tdeui/kcharselect.cpp | 2 +- tdeui/kcmenumngr.cpp | 2 +- tdeui/kcolorbutton.cpp | 2 +- tdeui/kcolorcombo.cpp | 8 +- tdeui/kcolordialog.cpp | 8 +- tdeui/kcombobox.cpp | 2 +- tdeui/kcommand.cpp | 2 +- tdeui/kcursor.cpp | 2 +- tdeui/kdatepicker.cpp | 4 +- tdeui/kdatetbl.cpp | 6 +- tdeui/kdatewidget.cpp | 4 +- tdeui/kdialog.cpp | 4 +- tdeui/kdialogbase.cpp | 6 +- tdeui/kdockwidget.cpp | 6 +- tdeui/kdualcolorbutton.cpp | 2 +- tdeui/keditcl1.cpp | 4 +- tdeui/keditcl2.cpp | 4 +- tdeui/keditlistbox.cpp | 2 +- tdeui/kedittoolbar.cpp | 4 +- tdeui/kguiitem.h | 2 +- tdeui/khelpmenu.cpp | 4 +- tdeui/kiconview.cpp | 4 +- tdeui/kiconviewsearchline.cpp | 2 +- tdeui/kjanuswidget.cpp | 6 +- tdeui/kkeybutton.cpp | 2 +- tdeui/kkeydialog.cpp | 6 +- tdeui/klineedit.cpp | 2 +- tdeui/klineeditdlg.cpp | 2 +- tdeui/kmenubar.cpp | 8 +- tdeui/kmessagebox.cpp | 6 +- tdeui/knuminput.cpp | 4 +- tdeui/knumvalidator.cpp | 4 +- tdeui/kpanelmenu.cpp | 2 +- tdeui/kpassdlg.cpp | 6 +- tdeui/kpassivepopup.cpp | 2 +- tdeui/kpixmapio.cpp | 2 +- tdeui/kpixmapregionselectordialog.cpp | 2 +- tdeui/kpixmapregionselectorwidget.cpp | 2 +- tdeui/kprogress.cpp | 2 +- tdeui/kprogressbox.cpp | 2 +- tdeui/kpushbutton.cpp | 4 +- tdeui/ksconfig.cpp | 4 +- tdeui/kscrollview.cpp | 2 +- tdeui/ksplashscreen.cpp | 4 +- tdeui/kstatusbar.cpp | 2 +- tdeui/kstdaction.cpp | 4 +- tdeui/kstdaction_p.h | 2 +- tdeui/kstdguiitem.cpp | 2 +- tdeui/kswitchlanguagedialog.cpp | 4 +- tdeui/ksyntaxhighlighter.cpp | 4 +- tdeui/ksystemtray.cpp | 4 +- tdeui/ksystemtray.h | 2 +- tdeui/ktabbar.cpp | 4 +- tdeui/ktextbrowser.cpp | 2 +- tdeui/ktextedit.cpp | 4 +- tdeui/ktimezonewidget.cpp | 2 +- tdeui/ktip.cpp | 6 +- tdeui/kurllabel.cpp | 2 +- tdeui/kwhatsthismanager.cpp | 2 +- tdeui/kwizard.cpp | 4 +- tdeui/kxmlguibuilder.cpp | 6 +- tdeui/kxmlguifactory.cpp | 2 +- tdeui/kxmlguifactory_p.cpp | 2 +- tdeui/tdeaboutapplication.cpp | 4 +- tdeui/tdeaboutdialog.cpp | 6 +- tdeui/tdeabouttde.cpp | 2 +- tdeui/tdeaction.cpp | 2 +- tdeui/tdeactionclasses.cpp | 4 +- tdeui/tdeactionselector.cpp | 2 +- tdeui/tdecmodule.cpp | 4 +- tdeui/tdecompletionbox.cpp | 2 +- tdeui/tdeconfigdialog.cpp | 2 +- tdeui/tdefontcombo.cpp | 2 +- tdeui/tdefontdialog.cpp | 6 +- tdeui/tdefontrequester.cpp | 2 +- tdeui/tdelistbox.cpp | 2 +- tdeui/tdelistview.cpp | 2 +- tdeui/tdelistviewsearchline.cpp | 2 +- tdeui/tdemainwindow.cpp | 4 +- tdeui/tdeshortcutdialog.cpp | 4 +- tdeui/tdespell.cpp | 4 +- tdeui/tdespelldlg.cpp | 2 +- tdeui/tdetoolbar.cpp | 4 +- tdeui/tdetoolbar.h | 2 +- tdeui/tdetoolbarbutton.cpp | 4 +- tdeui/tdetoolbarbutton.h | 2 +- tdeui/tdetoolbarhandler.cpp | 2 +- tdeui/tests/itemcontainertest.cpp | 2 +- tdeui/tests/kaboutdialogtest.cpp | 2 +- tdeui/tests/kcharselecttest.cpp | 2 +- tdeui/tests/kcolordlgtest.cpp | 2 +- tdeui/tests/kcomboboxtest.cpp | 2 +- tdeui/tests/kcompletiontest.cpp | 2 +- tdeui/tests/kdatepicktest.cpp | 2 +- tdeui/tests/kdatetimewidgettest.cpp | 2 +- tdeui/tests/kdatewidgettest.cpp | 2 +- tdeui/tests/kdockwidgettest.cpp | 2 +- tdeui/tests/kdualcolortest.cpp | 2 +- tdeui/tests/klineedittest.cpp | 4 +- tdeui/tests/kmessageboxtest.cpp | 4 +- tdeui/tests/kstatusbartest.cpp | 2 +- tdeui/tests/kstatusbartest.h | 2 +- tdeui/tests/ktimewidgettest.cpp | 2 +- tdeui/tests/tdemainwindowtest.cpp | 2 +- tdeui/tests/twindowtest.cpp | 4 +- tdeui/tests/twindowtest.h | 2 +- tdeui/twindowlistmenu.cpp | 2 +- tdeunittest/modrunner.cpp | 4 +- tdeunittest/runner.cpp | 2 +- tdeunittest/tester.h | 2 +- tdeutils/kcmultidialog.cpp | 4 +- tdeutils/kcmultidialog.h | 2 +- tdeutils/kfind.cpp | 4 +- tdeutils/kfinddialog.cpp | 4 +- tdeutils/kplugininfo.cpp | 2 +- tdeutils/kpluginselector.cpp | 6 +- tdeutils/kreplace.cpp | 4 +- tdeutils/kreplacedialog.cpp | 4 +- tdeutils/ksettings/componentsdialog.cpp | 2 +- tdeutils/ksettings/dialog.cpp | 2 +- tdeutils/tdecmodulecontainer.cpp | 2 +- tdeutils/tdecmoduleinfo.cpp | 4 +- tdeutils/tdecmoduleloader.cpp | 4 +- tdeutils/tdecmoduleproxy.cpp | 2 +- tdewallet/backend/tdewalletbackend.cc | 4 +- tdewallet/tests/tdewalletasync.cpp | 2 +- tdewallet/tests/tdewalletboth.cpp | 2 +- tdewallet/tests/tdewalletsync.cpp | 2 +- win/pro_files/kabc/kabc.pro | 4 +- win/pro_files/kabc/vcard/vcard.pro | 4 +- win/pro_files/kio/kio.pro | 6 +- win/pro_files/tdecore/tdecore.pro | 10 +- win/pro_files/tdeui/tdeui.pro | 4 +- win/tools/build_tdelibs_dbg | 2 +- win/tools/build_tdelibs_rel | 2 +- 1393 files changed, 51761 insertions(+), 51761 deletions(-) delete mode 100644 kabc/CMakeLists.txt delete mode 100644 kabc/HACKING delete mode 100644 kabc/HOWTO delete mode 100644 kabc/Makefile.am delete mode 100644 kabc/README delete mode 100644 kabc/README.AddressFormat delete mode 100644 kabc/TODO delete mode 100644 kabc/address.cpp delete mode 100644 kabc/address.h delete mode 100644 kabc/addressbook.cpp delete mode 100644 kabc/addressbook.h delete mode 100644 kabc/addresseedialog.cpp delete mode 100644 kabc/addresseedialog.h delete mode 100644 kabc/addresseehelper.cpp delete mode 100644 kabc/addresseehelper.h delete mode 100644 kabc/addresseelist.cpp delete mode 100644 kabc/addresseelist.h delete mode 100644 kabc/addresslineedit.cpp delete mode 100644 kabc/addresslineedit.h delete mode 100644 kabc/agent.cpp delete mode 100644 kabc/agent.h delete mode 100644 kabc/countrytransl.map delete mode 100644 kabc/distributionlist.cpp delete mode 100644 kabc/distributionlist.h delete mode 100644 kabc/distributionlistdialog.cpp delete mode 100644 kabc/distributionlistdialog.h delete mode 100644 kabc/distributionlisteditor.cpp delete mode 100644 kabc/distributionlisteditor.h delete mode 100644 kabc/errorhandler.cpp delete mode 100644 kabc/errorhandler.h delete mode 100644 kabc/field.h delete mode 100644 kabc/format.h delete mode 100644 kabc/formatfactory.cpp delete mode 100644 kabc/formatfactory.h delete mode 100644 kabc/formatplugin.h delete mode 100644 kabc/formats/CMakeLists.txt delete mode 100644 kabc/formats/Makefile.am delete mode 100644 kabc/formats/binary.desktop delete mode 100644 kabc/formats/binaryformat.cpp delete mode 100644 kabc/formats/binaryformat.h delete mode 100644 kabc/geo.cpp delete mode 100644 kabc/geo.h delete mode 100644 kabc/kabc_manager.desktop delete mode 100644 kabc/key.cpp delete mode 100644 kabc/key.h delete mode 100644 kabc/ldapclient.cpp delete mode 100644 kabc/ldapclient.h delete mode 100644 kabc/ldapconfigwidget.cpp delete mode 100644 kabc/ldapconfigwidget.h delete mode 100644 kabc/ldapurl.cpp delete mode 100644 kabc/ldapurl.h delete mode 100644 kabc/ldif.cpp delete mode 100644 kabc/ldif.h delete mode 100644 kabc/ldifconverter.cpp delete mode 100644 kabc/ldifconverter.h delete mode 100644 kabc/lock.cpp delete mode 100644 kabc/lock.h delete mode 100644 kabc/locknull.cpp delete mode 100644 kabc/locknull.h delete mode 100644 kabc/phonenumber.cpp delete mode 100644 kabc/phonenumber.h delete mode 100644 kabc/picture.cpp delete mode 100644 kabc/picture.h delete mode 100644 kabc/plugin.cpp delete mode 100644 kabc/plugin.h delete mode 100644 kabc/plugins/CMakeLists.txt delete mode 100644 kabc/plugins/Makefile.am delete mode 100644 kabc/plugins/dir/CMakeLists.txt delete mode 100644 kabc/plugins/dir/Makefile.am delete mode 100644 kabc/plugins/dir/dir.desktop delete mode 100644 kabc/plugins/dir/resourcedir.cpp delete mode 100644 kabc/plugins/dir/resourcedir.h delete mode 100644 kabc/plugins/dir/resourcedirconfig.cpp delete mode 100644 kabc/plugins/dir/resourcedirconfig.h delete mode 100644 kabc/plugins/dir/resourcedirplugin.cpp delete mode 100644 kabc/plugins/evolution/Makefile.am delete mode 100644 kabc/plugins/evolution/README delete mode 100644 kabc/plugins/evolution/dbwrapper.cpp delete mode 100644 kabc/plugins/evolution/dbwrapper.h delete mode 100644 kabc/plugins/evolution/evolution.desktop delete mode 100644 kabc/plugins/evolution/resourceevo.cpp delete mode 100644 kabc/plugins/evolution/resourceevo.h delete mode 100644 kabc/plugins/file/CMakeLists.txt delete mode 100644 kabc/plugins/file/Makefile.am delete mode 100644 kabc/plugins/file/file.desktop delete mode 100644 kabc/plugins/file/resourcefile.cpp delete mode 100644 kabc/plugins/file/resourcefile.h delete mode 100644 kabc/plugins/file/resourcefileconfig.cpp delete mode 100644 kabc/plugins/file/resourcefileconfig.h delete mode 100644 kabc/plugins/file/resourcefileplugin.cpp delete mode 100644 kabc/plugins/ldaptdeio/CMakeLists.txt delete mode 100644 kabc/plugins/ldaptdeio/Makefile.am delete mode 100644 kabc/plugins/ldaptdeio/ldaptdeio.desktop delete mode 100644 kabc/plugins/ldaptdeio/resourceldaptdeio.cpp delete mode 100644 kabc/plugins/ldaptdeio/resourceldaptdeio.h delete mode 100644 kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp delete mode 100644 kabc/plugins/ldaptdeio/resourceldaptdeioconfig.h delete mode 100644 kabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp delete mode 100644 kabc/plugins/net/CMakeLists.txt delete mode 100644 kabc/plugins/net/Makefile.am delete mode 100644 kabc/plugins/net/net.desktop delete mode 100644 kabc/plugins/net/resourcenet.cpp delete mode 100644 kabc/plugins/net/resourcenet.h delete mode 100644 kabc/plugins/net/resourcenetconfig.cpp delete mode 100644 kabc/plugins/net/resourcenetconfig.h delete mode 100644 kabc/plugins/net/resourcenetplugin.cpp delete mode 100644 kabc/plugins/sql/Makefile.am delete mode 100644 kabc/plugins/sql/resourcesql.cpp delete mode 100644 kabc/plugins/sql/resourcesql.h delete mode 100644 kabc/plugins/sql/resourcesqlconfig.cpp delete mode 100644 kabc/plugins/sql/resourcesqlconfig.h delete mode 100644 kabc/plugins/sql/sql.desktop delete mode 100644 kabc/resource.cpp delete mode 100644 kabc/resource.h delete mode 100644 kabc/resourceselectdialog.cpp delete mode 100644 kabc/resourceselectdialog.h delete mode 100644 kabc/scripts/Makefile.am delete mode 100644 kabc/scripts/addressee.src.cpp delete mode 100644 kabc/scripts/addressee.src.h delete mode 100755 kabc/scripts/createisomap.pl delete mode 100644 kabc/scripts/entrylist delete mode 100644 kabc/scripts/field.src.cpp delete mode 100755 kabc/scripts/makeaddressee delete mode 100644 kabc/secrecy.cpp delete mode 100644 kabc/secrecy.h delete mode 100644 kabc/sortmode.cpp delete mode 100644 kabc/sortmode.h delete mode 100644 kabc/sound.cpp delete mode 100644 kabc/sound.h delete mode 100644 kabc/stdaddressbook.cpp delete mode 100644 kabc/stdaddressbook.h delete mode 100644 kabc/tdeab2tdeabc.cpp delete mode 100644 kabc/tdeab2tdeabc.desktop delete mode 100644 kabc/tests/Makefile.am delete mode 100644 kabc/tests/bigread.cpp delete mode 100644 kabc/tests/bigwrite.cpp delete mode 100644 kabc/tests/kabcargl.cpp delete mode 100644 kabc/tests/testaddressee.cpp delete mode 100644 kabc/tests/testaddresseelist.cpp delete mode 100644 kabc/tests/testaddressfmt.cpp delete mode 100644 kabc/tests/testaddresslineedit.cpp delete mode 100644 kabc/tests/testdb.cpp delete mode 100644 kabc/tests/testdistlist.cpp delete mode 100644 kabc/tests/testkabc.cpp delete mode 100644 kabc/tests/testkabcdlg.cpp delete mode 100644 kabc/tests/testldapclient.cpp delete mode 100644 kabc/tests/testldapclient.h delete mode 100644 kabc/tests/testlock.cpp delete mode 100644 kabc/tests/testlock.h delete mode 100644 kabc/timezone.cpp delete mode 100644 kabc/timezone.h delete mode 100644 kabc/vcard/AdrParam.cpp delete mode 100644 kabc/vcard/AdrValue.cpp delete mode 100644 kabc/vcard/AgentParam.cpp delete mode 100644 kabc/vcard/AgentValue.cpp delete mode 100644 kabc/vcard/CMakeLists.txt delete mode 100644 kabc/vcard/ClassValue.cpp delete mode 100644 kabc/vcard/ContentLine.cpp delete mode 100644 kabc/vcard/DateParam.cpp delete mode 100644 kabc/vcard/DateValue.cpp delete mode 100644 kabc/vcard/EmailParam.cpp delete mode 100644 kabc/vcard/Entity.cpp delete mode 100644 kabc/vcard/Enum.cpp delete mode 100644 kabc/vcard/FloatValue.cpp delete mode 100644 kabc/vcard/GeoValue.cpp delete mode 100644 kabc/vcard/ImageParam.cpp delete mode 100644 kabc/vcard/ImageValue.cpp delete mode 100644 kabc/vcard/ImgValue.cpp delete mode 100644 kabc/vcard/LangValue.cpp delete mode 100644 kabc/vcard/Makefile.am delete mode 100644 kabc/vcard/NValue.cpp delete mode 100644 kabc/vcard/OrgValue.cpp delete mode 100644 kabc/vcard/Param.cpp delete mode 100644 kabc/vcard/PhoneNumberValue.cpp delete mode 100644 kabc/vcard/README delete mode 100644 kabc/vcard/RToken.cpp delete mode 100644 kabc/vcard/SoundValue.cpp delete mode 100644 kabc/vcard/SourceParam.cpp delete mode 100644 kabc/vcard/TelParam.cpp delete mode 100644 kabc/vcard/TelValue.cpp delete mode 100644 kabc/vcard/TextBinParam.cpp delete mode 100644 kabc/vcard/TextBinValue.cpp delete mode 100644 kabc/vcard/TextListValue.cpp delete mode 100644 kabc/vcard/TextParam.cpp delete mode 100644 kabc/vcard/TextValue.cpp delete mode 100644 kabc/vcard/URIValue.cpp delete mode 100644 kabc/vcard/UTCValue.cpp delete mode 100644 kabc/vcard/VCard.cpp delete mode 100644 kabc/vcard/VCardEntity.cpp delete mode 100644 kabc/vcard/Value.cpp delete mode 100644 kabc/vcard/include/VCard.h delete mode 100644 kabc/vcard/include/VCardAdrParam.h delete mode 100644 kabc/vcard/include/VCardAdrValue.h delete mode 100644 kabc/vcard/include/VCardAgentParam.h delete mode 100644 kabc/vcard/include/VCardAgentValue.h delete mode 100644 kabc/vcard/include/VCardClassValue.h delete mode 100644 kabc/vcard/include/VCardContentLine.h delete mode 100644 kabc/vcard/include/VCardDateParam.h delete mode 100644 kabc/vcard/include/VCardDateValue.h delete mode 100644 kabc/vcard/include/VCardDefines.h delete mode 100644 kabc/vcard/include/VCardEmailParam.h delete mode 100644 kabc/vcard/include/VCardEntity.h delete mode 100644 kabc/vcard/include/VCardEnum.h delete mode 100644 kabc/vcard/include/VCardFloatValue.h delete mode 100644 kabc/vcard/include/VCardGeoValue.h delete mode 100644 kabc/vcard/include/VCardGroup.h delete mode 100644 kabc/vcard/include/VCardImageParam.h delete mode 100644 kabc/vcard/include/VCardImageValue.h delete mode 100644 kabc/vcard/include/VCardImgValue.h delete mode 100644 kabc/vcard/include/VCardLangValue.h delete mode 100644 kabc/vcard/include/VCardNValue.h delete mode 100644 kabc/vcard/include/VCardOrgValue.h delete mode 100644 kabc/vcard/include/VCardParam.h delete mode 100644 kabc/vcard/include/VCardPhoneNumberValue.h delete mode 100644 kabc/vcard/include/VCardRToken.h delete mode 100644 kabc/vcard/include/VCardSndValue.h delete mode 100644 kabc/vcard/include/VCardSoundValue.h delete mode 100644 kabc/vcard/include/VCardSourceParam.h delete mode 100644 kabc/vcard/include/VCardTelParam.h delete mode 100644 kabc/vcard/include/VCardTelValue.h delete mode 100644 kabc/vcard/include/VCardTextBinParam.h delete mode 100644 kabc/vcard/include/VCardTextBinValue.h delete mode 100644 kabc/vcard/include/VCardTextListValue.h delete mode 100644 kabc/vcard/include/VCardTextParam.h delete mode 100644 kabc/vcard/include/VCardTextValue.h delete mode 100644 kabc/vcard/include/VCardURIValue.h delete mode 100644 kabc/vcard/include/VCardUTCValue.h delete mode 100644 kabc/vcard/include/VCardVCard.h delete mode 100644 kabc/vcard/include/VCardVCardEntity.h delete mode 100644 kabc/vcard/include/VCardValue.h delete mode 100644 kabc/vcard/include/generated/AdrParam-generated.h delete mode 100644 kabc/vcard/include/generated/AdrValue-generated.h delete mode 100644 kabc/vcard/include/generated/AgentParam-generated.h delete mode 100644 kabc/vcard/include/generated/AgentValue-generated.h delete mode 100644 kabc/vcard/include/generated/ClassValue-generated.h delete mode 100644 kabc/vcard/include/generated/ContentLine-generated.h delete mode 100644 kabc/vcard/include/generated/DateParam-generated.h delete mode 100644 kabc/vcard/include/generated/DateValue-generated.h delete mode 100644 kabc/vcard/include/generated/EmailParam-generated.h delete mode 100644 kabc/vcard/include/generated/FloatValue-generated.h delete mode 100644 kabc/vcard/include/generated/GeoValue-generated.h delete mode 100644 kabc/vcard/include/generated/Group-generated.h delete mode 100644 kabc/vcard/include/generated/ImageParam-generated.h delete mode 100644 kabc/vcard/include/generated/ImageValue-generated.h delete mode 100644 kabc/vcard/include/generated/ImgParam-generated.h delete mode 100644 kabc/vcard/include/generated/ImgValue-generated.h delete mode 100644 kabc/vcard/include/generated/LangValue-generated.h delete mode 100644 kabc/vcard/include/generated/NValue-generated.h delete mode 100644 kabc/vcard/include/generated/Name-generated.h delete mode 100644 kabc/vcard/include/generated/OrgValue-generated.h delete mode 100644 kabc/vcard/include/generated/Param-generated.h delete mode 100644 kabc/vcard/include/generated/ParamName-generated.h delete mode 100644 kabc/vcard/include/generated/ParamValue-generated.h delete mode 100644 kabc/vcard/include/generated/PhoneNumberValue-generated.h delete mode 100644 kabc/vcard/include/generated/SoundValue-generated.h delete mode 100644 kabc/vcard/include/generated/SourceParam-generated.h delete mode 100644 kabc/vcard/include/generated/TelParam-generated.h delete mode 100644 kabc/vcard/include/generated/TelValue-generated.h delete mode 100644 kabc/vcard/include/generated/TextBinParam-generated.h delete mode 100644 kabc/vcard/include/generated/TextBinValue-generated.h delete mode 100644 kabc/vcard/include/generated/TextListValue-generated.h delete mode 100644 kabc/vcard/include/generated/TextNSParam-generated.h delete mode 100644 kabc/vcard/include/generated/TextParam-generated.h delete mode 100644 kabc/vcard/include/generated/TextValue-generated.h delete mode 100644 kabc/vcard/include/generated/URIValue-generated.h delete mode 100644 kabc/vcard/include/generated/UTCValue-generated.h delete mode 100644 kabc/vcard/include/generated/VCard-generated.h delete mode 100644 kabc/vcard/include/generated/VCardEntity-generated.h delete mode 100644 kabc/vcard/include/generated/Value-generated.h delete mode 100755 kabc/vcard/include/generated/generate delete mode 100755 kabc/vcard/include/generated/generateHeaders.awk delete mode 100644 kabc/vcard/include/generated/headerBodies delete mode 100644 kabc/vcard/testread.cpp delete mode 100644 kabc/vcard/testwrite.cpp delete mode 100644 kabc/vcard/vCard-all.cpp delete mode 100644 kabc/vcard21parser.cpp delete mode 100644 kabc/vcard21parser.h delete mode 100644 kabc/vcardconverter.cpp delete mode 100644 kabc/vcardconverter.h delete mode 100644 kabc/vcardformat.cpp delete mode 100644 kabc/vcardformat.h delete mode 100644 kabc/vcardformatimpl.cpp delete mode 100644 kabc/vcardformatimpl.h delete mode 100644 kabc/vcardformatplugin.cpp delete mode 100644 kabc/vcardformatplugin.h delete mode 100644 kabc/vcardparser/CMakeLists.txt delete mode 100644 kabc/vcardparser/Makefile.am delete mode 100644 kabc/vcardparser/README.testing delete mode 100755 kabc/vcardparser/checkvcard.pl delete mode 100644 kabc/vcardparser/testread.cpp delete mode 100644 kabc/vcardparser/testread2.cpp delete mode 100644 kabc/vcardparser/tests/vcard1.vcf delete mode 100644 kabc/vcardparser/tests/vcard1.vcf.ref delete mode 100644 kabc/vcardparser/tests/vcard2.vcf delete mode 100644 kabc/vcardparser/tests/vcard2.vcf.ref delete mode 100644 kabc/vcardparser/tests/vcard3.vcf delete mode 100644 kabc/vcardparser/tests/vcard3.vcf.ref delete mode 100644 kabc/vcardparser/tests/vcard4.vcf delete mode 100644 kabc/vcardparser/tests/vcard4.vcf.ref delete mode 100644 kabc/vcardparser/tests/vcard5.vcf delete mode 100644 kabc/vcardparser/tests/vcard5.vcf.ref delete mode 100644 kabc/vcardparser/tests/vcard6.vcf delete mode 100644 kabc/vcardparser/tests/vcard6.vcf.ref delete mode 100644 kabc/vcardparser/tests/vcard7.vcf delete mode 100644 kabc/vcardparser/tests/vcard7.vcf.ref delete mode 100644 kabc/vcardparser/testutils.cpp delete mode 100644 kabc/vcardparser/testutils.h delete mode 100644 kabc/vcardparser/testwrite.cpp delete mode 100644 kabc/vcardparser/vcard.cpp delete mode 100644 kabc/vcardparser/vcard.h delete mode 100644 kabc/vcardparser/vcardline.cpp delete mode 100644 kabc/vcardparser/vcardline.h delete mode 100644 kabc/vcardparser/vcardparser.cpp delete mode 100644 kabc/vcardparser/vcardparser.h delete mode 100644 kabc/vcardtool.cpp delete mode 100644 kabc/vcardtool.h create mode 100644 tdeabc/CMakeLists.txt create mode 100644 tdeabc/HACKING create mode 100644 tdeabc/HOWTO create mode 100644 tdeabc/Makefile.am create mode 100644 tdeabc/README create mode 100644 tdeabc/README.AddressFormat create mode 100644 tdeabc/TODO create mode 100644 tdeabc/address.cpp create mode 100644 tdeabc/address.h create mode 100644 tdeabc/addressbook.cpp create mode 100644 tdeabc/addressbook.h create mode 100644 tdeabc/addresseedialog.cpp create mode 100644 tdeabc/addresseedialog.h create mode 100644 tdeabc/addresseehelper.cpp create mode 100644 tdeabc/addresseehelper.h create mode 100644 tdeabc/addresseelist.cpp create mode 100644 tdeabc/addresseelist.h create mode 100644 tdeabc/addresslineedit.cpp create mode 100644 tdeabc/addresslineedit.h create mode 100644 tdeabc/agent.cpp create mode 100644 tdeabc/agent.h create mode 100644 tdeabc/countrytransl.map create mode 100644 tdeabc/distributionlist.cpp create mode 100644 tdeabc/distributionlist.h create mode 100644 tdeabc/distributionlistdialog.cpp create mode 100644 tdeabc/distributionlistdialog.h create mode 100644 tdeabc/distributionlisteditor.cpp create mode 100644 tdeabc/distributionlisteditor.h create mode 100644 tdeabc/errorhandler.cpp create mode 100644 tdeabc/errorhandler.h create mode 100644 tdeabc/field.h create mode 100644 tdeabc/format.h create mode 100644 tdeabc/formatfactory.cpp create mode 100644 tdeabc/formatfactory.h create mode 100644 tdeabc/formatplugin.h create mode 100644 tdeabc/formats/CMakeLists.txt create mode 100644 tdeabc/formats/Makefile.am create mode 100644 tdeabc/formats/binary.desktop create mode 100644 tdeabc/formats/binaryformat.cpp create mode 100644 tdeabc/formats/binaryformat.h create mode 100644 tdeabc/geo.cpp create mode 100644 tdeabc/geo.h create mode 100644 tdeabc/kabc_manager.desktop create mode 100644 tdeabc/key.cpp create mode 100644 tdeabc/key.h create mode 100644 tdeabc/ldapclient.cpp create mode 100644 tdeabc/ldapclient.h create mode 100644 tdeabc/ldapconfigwidget.cpp create mode 100644 tdeabc/ldapconfigwidget.h create mode 100644 tdeabc/ldapurl.cpp create mode 100644 tdeabc/ldapurl.h create mode 100644 tdeabc/ldif.cpp create mode 100644 tdeabc/ldif.h create mode 100644 tdeabc/ldifconverter.cpp create mode 100644 tdeabc/ldifconverter.h create mode 100644 tdeabc/lock.cpp create mode 100644 tdeabc/lock.h create mode 100644 tdeabc/locknull.cpp create mode 100644 tdeabc/locknull.h create mode 100644 tdeabc/phonenumber.cpp create mode 100644 tdeabc/phonenumber.h create mode 100644 tdeabc/picture.cpp create mode 100644 tdeabc/picture.h create mode 100644 tdeabc/plugin.cpp create mode 100644 tdeabc/plugin.h create mode 100644 tdeabc/plugins/CMakeLists.txt create mode 100644 tdeabc/plugins/Makefile.am create mode 100644 tdeabc/plugins/dir/CMakeLists.txt create mode 100644 tdeabc/plugins/dir/Makefile.am create mode 100644 tdeabc/plugins/dir/dir.desktop create mode 100644 tdeabc/plugins/dir/resourcedir.cpp create mode 100644 tdeabc/plugins/dir/resourcedir.h create mode 100644 tdeabc/plugins/dir/resourcedirconfig.cpp create mode 100644 tdeabc/plugins/dir/resourcedirconfig.h create mode 100644 tdeabc/plugins/dir/resourcedirplugin.cpp create mode 100644 tdeabc/plugins/evolution/Makefile.am create mode 100644 tdeabc/plugins/evolution/README create mode 100644 tdeabc/plugins/evolution/dbwrapper.cpp create mode 100644 tdeabc/plugins/evolution/dbwrapper.h create mode 100644 tdeabc/plugins/evolution/evolution.desktop create mode 100644 tdeabc/plugins/evolution/resourceevo.cpp create mode 100644 tdeabc/plugins/evolution/resourceevo.h create mode 100644 tdeabc/plugins/file/CMakeLists.txt create mode 100644 tdeabc/plugins/file/Makefile.am create mode 100644 tdeabc/plugins/file/file.desktop create mode 100644 tdeabc/plugins/file/resourcefile.cpp create mode 100644 tdeabc/plugins/file/resourcefile.h create mode 100644 tdeabc/plugins/file/resourcefileconfig.cpp create mode 100644 tdeabc/plugins/file/resourcefileconfig.h create mode 100644 tdeabc/plugins/file/resourcefileplugin.cpp create mode 100644 tdeabc/plugins/ldaptdeio/CMakeLists.txt create mode 100644 tdeabc/plugins/ldaptdeio/Makefile.am create mode 100644 tdeabc/plugins/ldaptdeio/ldaptdeio.desktop create mode 100644 tdeabc/plugins/ldaptdeio/resourceldaptdeio.cpp create mode 100644 tdeabc/plugins/ldaptdeio/resourceldaptdeio.h create mode 100644 tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp create mode 100644 tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.h create mode 100644 tdeabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp create mode 100644 tdeabc/plugins/net/CMakeLists.txt create mode 100644 tdeabc/plugins/net/Makefile.am create mode 100644 tdeabc/plugins/net/net.desktop create mode 100644 tdeabc/plugins/net/resourcenet.cpp create mode 100644 tdeabc/plugins/net/resourcenet.h create mode 100644 tdeabc/plugins/net/resourcenetconfig.cpp create mode 100644 tdeabc/plugins/net/resourcenetconfig.h create mode 100644 tdeabc/plugins/net/resourcenetplugin.cpp create mode 100644 tdeabc/plugins/sql/Makefile.am create mode 100644 tdeabc/plugins/sql/resourcesql.cpp create mode 100644 tdeabc/plugins/sql/resourcesql.h create mode 100644 tdeabc/plugins/sql/resourcesqlconfig.cpp create mode 100644 tdeabc/plugins/sql/resourcesqlconfig.h create mode 100644 tdeabc/plugins/sql/sql.desktop create mode 100644 tdeabc/resource.cpp create mode 100644 tdeabc/resource.h create mode 100644 tdeabc/resourceselectdialog.cpp create mode 100644 tdeabc/resourceselectdialog.h create mode 100644 tdeabc/scripts/Makefile.am create mode 100644 tdeabc/scripts/addressee.src.cpp create mode 100644 tdeabc/scripts/addressee.src.h create mode 100755 tdeabc/scripts/createisomap.pl create mode 100644 tdeabc/scripts/entrylist create mode 100644 tdeabc/scripts/field.src.cpp create mode 100755 tdeabc/scripts/makeaddressee create mode 100644 tdeabc/secrecy.cpp create mode 100644 tdeabc/secrecy.h create mode 100644 tdeabc/sortmode.cpp create mode 100644 tdeabc/sortmode.h create mode 100644 tdeabc/sound.cpp create mode 100644 tdeabc/sound.h create mode 100644 tdeabc/stdaddressbook.cpp create mode 100644 tdeabc/stdaddressbook.h create mode 100644 tdeabc/tdeab2tdeabc.cpp create mode 100644 tdeabc/tdeab2tdeabc.desktop create mode 100644 tdeabc/tests/Makefile.am create mode 100644 tdeabc/tests/bigread.cpp create mode 100644 tdeabc/tests/bigwrite.cpp create mode 100644 tdeabc/tests/kabcargl.cpp create mode 100644 tdeabc/tests/testaddressee.cpp create mode 100644 tdeabc/tests/testaddresseelist.cpp create mode 100644 tdeabc/tests/testaddressfmt.cpp create mode 100644 tdeabc/tests/testaddresslineedit.cpp create mode 100644 tdeabc/tests/testdb.cpp create mode 100644 tdeabc/tests/testdistlist.cpp create mode 100644 tdeabc/tests/testkabc.cpp create mode 100644 tdeabc/tests/testkabcdlg.cpp create mode 100644 tdeabc/tests/testldapclient.cpp create mode 100644 tdeabc/tests/testldapclient.h create mode 100644 tdeabc/tests/testlock.cpp create mode 100644 tdeabc/tests/testlock.h create mode 100644 tdeabc/timezone.cpp create mode 100644 tdeabc/timezone.h create mode 100644 tdeabc/vcard/AdrParam.cpp create mode 100644 tdeabc/vcard/AdrValue.cpp create mode 100644 tdeabc/vcard/AgentParam.cpp create mode 100644 tdeabc/vcard/AgentValue.cpp create mode 100644 tdeabc/vcard/CMakeLists.txt create mode 100644 tdeabc/vcard/ClassValue.cpp create mode 100644 tdeabc/vcard/ContentLine.cpp create mode 100644 tdeabc/vcard/DateParam.cpp create mode 100644 tdeabc/vcard/DateValue.cpp create mode 100644 tdeabc/vcard/EmailParam.cpp create mode 100644 tdeabc/vcard/Entity.cpp create mode 100644 tdeabc/vcard/Enum.cpp create mode 100644 tdeabc/vcard/FloatValue.cpp create mode 100644 tdeabc/vcard/GeoValue.cpp create mode 100644 tdeabc/vcard/ImageParam.cpp create mode 100644 tdeabc/vcard/ImageValue.cpp create mode 100644 tdeabc/vcard/ImgValue.cpp create mode 100644 tdeabc/vcard/LangValue.cpp create mode 100644 tdeabc/vcard/Makefile.am create mode 100644 tdeabc/vcard/NValue.cpp create mode 100644 tdeabc/vcard/OrgValue.cpp create mode 100644 tdeabc/vcard/Param.cpp create mode 100644 tdeabc/vcard/PhoneNumberValue.cpp create mode 100644 tdeabc/vcard/README create mode 100644 tdeabc/vcard/RToken.cpp create mode 100644 tdeabc/vcard/SoundValue.cpp create mode 100644 tdeabc/vcard/SourceParam.cpp create mode 100644 tdeabc/vcard/TelParam.cpp create mode 100644 tdeabc/vcard/TelValue.cpp create mode 100644 tdeabc/vcard/TextBinParam.cpp create mode 100644 tdeabc/vcard/TextBinValue.cpp create mode 100644 tdeabc/vcard/TextListValue.cpp create mode 100644 tdeabc/vcard/TextParam.cpp create mode 100644 tdeabc/vcard/TextValue.cpp create mode 100644 tdeabc/vcard/URIValue.cpp create mode 100644 tdeabc/vcard/UTCValue.cpp create mode 100644 tdeabc/vcard/VCard.cpp create mode 100644 tdeabc/vcard/VCardEntity.cpp create mode 100644 tdeabc/vcard/Value.cpp create mode 100644 tdeabc/vcard/include/VCard.h create mode 100644 tdeabc/vcard/include/VCardAdrParam.h create mode 100644 tdeabc/vcard/include/VCardAdrValue.h create mode 100644 tdeabc/vcard/include/VCardAgentParam.h create mode 100644 tdeabc/vcard/include/VCardAgentValue.h create mode 100644 tdeabc/vcard/include/VCardClassValue.h create mode 100644 tdeabc/vcard/include/VCardContentLine.h create mode 100644 tdeabc/vcard/include/VCardDateParam.h create mode 100644 tdeabc/vcard/include/VCardDateValue.h create mode 100644 tdeabc/vcard/include/VCardDefines.h create mode 100644 tdeabc/vcard/include/VCardEmailParam.h create mode 100644 tdeabc/vcard/include/VCardEntity.h create mode 100644 tdeabc/vcard/include/VCardEnum.h create mode 100644 tdeabc/vcard/include/VCardFloatValue.h create mode 100644 tdeabc/vcard/include/VCardGeoValue.h create mode 100644 tdeabc/vcard/include/VCardGroup.h create mode 100644 tdeabc/vcard/include/VCardImageParam.h create mode 100644 tdeabc/vcard/include/VCardImageValue.h create mode 100644 tdeabc/vcard/include/VCardImgValue.h create mode 100644 tdeabc/vcard/include/VCardLangValue.h create mode 100644 tdeabc/vcard/include/VCardNValue.h create mode 100644 tdeabc/vcard/include/VCardOrgValue.h create mode 100644 tdeabc/vcard/include/VCardParam.h create mode 100644 tdeabc/vcard/include/VCardPhoneNumberValue.h create mode 100644 tdeabc/vcard/include/VCardRToken.h create mode 100644 tdeabc/vcard/include/VCardSndValue.h create mode 100644 tdeabc/vcard/include/VCardSoundValue.h create mode 100644 tdeabc/vcard/include/VCardSourceParam.h create mode 100644 tdeabc/vcard/include/VCardTelParam.h create mode 100644 tdeabc/vcard/include/VCardTelValue.h create mode 100644 tdeabc/vcard/include/VCardTextBinParam.h create mode 100644 tdeabc/vcard/include/VCardTextBinValue.h create mode 100644 tdeabc/vcard/include/VCardTextListValue.h create mode 100644 tdeabc/vcard/include/VCardTextParam.h create mode 100644 tdeabc/vcard/include/VCardTextValue.h create mode 100644 tdeabc/vcard/include/VCardURIValue.h create mode 100644 tdeabc/vcard/include/VCardUTCValue.h create mode 100644 tdeabc/vcard/include/VCardVCard.h create mode 100644 tdeabc/vcard/include/VCardVCardEntity.h create mode 100644 tdeabc/vcard/include/VCardValue.h create mode 100644 tdeabc/vcard/include/generated/AdrParam-generated.h create mode 100644 tdeabc/vcard/include/generated/AdrValue-generated.h create mode 100644 tdeabc/vcard/include/generated/AgentParam-generated.h create mode 100644 tdeabc/vcard/include/generated/AgentValue-generated.h create mode 100644 tdeabc/vcard/include/generated/ClassValue-generated.h create mode 100644 tdeabc/vcard/include/generated/ContentLine-generated.h create mode 100644 tdeabc/vcard/include/generated/DateParam-generated.h create mode 100644 tdeabc/vcard/include/generated/DateValue-generated.h create mode 100644 tdeabc/vcard/include/generated/EmailParam-generated.h create mode 100644 tdeabc/vcard/include/generated/FloatValue-generated.h create mode 100644 tdeabc/vcard/include/generated/GeoValue-generated.h create mode 100644 tdeabc/vcard/include/generated/Group-generated.h create mode 100644 tdeabc/vcard/include/generated/ImageParam-generated.h create mode 100644 tdeabc/vcard/include/generated/ImageValue-generated.h create mode 100644 tdeabc/vcard/include/generated/ImgParam-generated.h create mode 100644 tdeabc/vcard/include/generated/ImgValue-generated.h create mode 100644 tdeabc/vcard/include/generated/LangValue-generated.h create mode 100644 tdeabc/vcard/include/generated/NValue-generated.h create mode 100644 tdeabc/vcard/include/generated/Name-generated.h create mode 100644 tdeabc/vcard/include/generated/OrgValue-generated.h create mode 100644 tdeabc/vcard/include/generated/Param-generated.h create mode 100644 tdeabc/vcard/include/generated/ParamName-generated.h create mode 100644 tdeabc/vcard/include/generated/ParamValue-generated.h create mode 100644 tdeabc/vcard/include/generated/PhoneNumberValue-generated.h create mode 100644 tdeabc/vcard/include/generated/SoundValue-generated.h create mode 100644 tdeabc/vcard/include/generated/SourceParam-generated.h create mode 100644 tdeabc/vcard/include/generated/TelParam-generated.h create mode 100644 tdeabc/vcard/include/generated/TelValue-generated.h create mode 100644 tdeabc/vcard/include/generated/TextBinParam-generated.h create mode 100644 tdeabc/vcard/include/generated/TextBinValue-generated.h create mode 100644 tdeabc/vcard/include/generated/TextListValue-generated.h create mode 100644 tdeabc/vcard/include/generated/TextNSParam-generated.h create mode 100644 tdeabc/vcard/include/generated/TextParam-generated.h create mode 100644 tdeabc/vcard/include/generated/TextValue-generated.h create mode 100644 tdeabc/vcard/include/generated/URIValue-generated.h create mode 100644 tdeabc/vcard/include/generated/UTCValue-generated.h create mode 100644 tdeabc/vcard/include/generated/VCard-generated.h create mode 100644 tdeabc/vcard/include/generated/VCardEntity-generated.h create mode 100644 tdeabc/vcard/include/generated/Value-generated.h create mode 100755 tdeabc/vcard/include/generated/generate create mode 100755 tdeabc/vcard/include/generated/generateHeaders.awk create mode 100644 tdeabc/vcard/include/generated/headerBodies create mode 100644 tdeabc/vcard/testread.cpp create mode 100644 tdeabc/vcard/testwrite.cpp create mode 100644 tdeabc/vcard/vCard-all.cpp create mode 100644 tdeabc/vcard21parser.cpp create mode 100644 tdeabc/vcard21parser.h create mode 100644 tdeabc/vcardconverter.cpp create mode 100644 tdeabc/vcardconverter.h create mode 100644 tdeabc/vcardformat.cpp create mode 100644 tdeabc/vcardformat.h create mode 100644 tdeabc/vcardformatimpl.cpp create mode 100644 tdeabc/vcardformatimpl.h create mode 100644 tdeabc/vcardformatplugin.cpp create mode 100644 tdeabc/vcardformatplugin.h create mode 100644 tdeabc/vcardparser/CMakeLists.txt create mode 100644 tdeabc/vcardparser/Makefile.am create mode 100644 tdeabc/vcardparser/README.testing create mode 100755 tdeabc/vcardparser/checkvcard.pl create mode 100644 tdeabc/vcardparser/testread.cpp create mode 100644 tdeabc/vcardparser/testread2.cpp create mode 100644 tdeabc/vcardparser/tests/vcard1.vcf create mode 100644 tdeabc/vcardparser/tests/vcard1.vcf.ref create mode 100644 tdeabc/vcardparser/tests/vcard2.vcf create mode 100644 tdeabc/vcardparser/tests/vcard2.vcf.ref create mode 100644 tdeabc/vcardparser/tests/vcard3.vcf create mode 100644 tdeabc/vcardparser/tests/vcard3.vcf.ref create mode 100644 tdeabc/vcardparser/tests/vcard4.vcf create mode 100644 tdeabc/vcardparser/tests/vcard4.vcf.ref create mode 100644 tdeabc/vcardparser/tests/vcard5.vcf create mode 100644 tdeabc/vcardparser/tests/vcard5.vcf.ref create mode 100644 tdeabc/vcardparser/tests/vcard6.vcf create mode 100644 tdeabc/vcardparser/tests/vcard6.vcf.ref create mode 100644 tdeabc/vcardparser/tests/vcard7.vcf create mode 100644 tdeabc/vcardparser/tests/vcard7.vcf.ref create mode 100644 tdeabc/vcardparser/testutils.cpp create mode 100644 tdeabc/vcardparser/testutils.h create mode 100644 tdeabc/vcardparser/testwrite.cpp create mode 100644 tdeabc/vcardparser/vcard.cpp create mode 100644 tdeabc/vcardparser/vcard.h create mode 100644 tdeabc/vcardparser/vcardline.cpp create mode 100644 tdeabc/vcardparser/vcardline.h create mode 100644 tdeabc/vcardparser/vcardparser.cpp create mode 100644 tdeabc/vcardparser/vcardparser.h create mode 100644 tdeabc/vcardtool.cpp create mode 100644 tdeabc/vcardtool.h (limited to 'tderandr/randr.cpp') diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a9f23a4d..ac1ecf1a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -953,7 +953,7 @@ add_subdirectory( kinit ) add_subdirectory( tdeprint ) add_subdirectory( kab ) add_subdirectory( tderesources ) -add_subdirectory( kabc ) +add_subdirectory( tdeabc ) add_subdirectory( arts ) add_subdirectory( interfaces ) add_subdirectory( kate ) diff --git a/KDE2PORTING.html b/KDE2PORTING.html index b375854de..322efffb2 100644 --- a/KDE2PORTING.html +++ b/KDE2PORTING.html @@ -204,9 +204,9 @@ must have created a TDEApplication object before the methods can be used.<P> <TR> <TD COLSPAN="2"> <PRE> - #include <kglobal.h> + #include <tdeglobal.h> #include <tdeconfig.h> // Needed to use TDEConfig - #include <klocale.h> // Needed to use TDELocale + #include <tdelocale.h> // Needed to use TDELocale #include <kiconloader.h> // Needed to use TDEIconLoader </PRE> </TD> diff --git a/Mainpage.dox b/Mainpage.dox index 15904678c..702510fc5 100644 --- a/Mainpage.dox +++ b/Mainpage.dox @@ -49,8 +49,8 @@ * (<a target="_top" href="interfaces/html/classes.html">classes</a>)\n * <i>Defines interfaces for common components so that new implementations * can be dropped in.</i> - * - <a target="_top" href="kabc/html/index.html"><b>kabc</b></a> - * (<a target="_top" href="kabc/html/classes.html">classes</a>)\n + * - <a target="_top" href="tdeabc/html/index.html"><b>kabc</b></a> + * (<a target="_top" href="tdeabc/html/classes.html">classes</a>)\n * <i>Access to the Trinity address book.</i> * - <a target="_top" href="tderesources/html/index.html"><b>tderesources</b></a> * (<a target="_top" href="tderesources/html/classes.html">classes</a>)\n diff --git a/Makefile.am.in b/Makefile.am.in index 83d0901fa..2ebb4f8c6 100644 --- a/Makefile.am.in +++ b/Makefile.am.in @@ -39,7 +39,7 @@ potdir = $(kde_includes) pot_DATA = kde.pot messages: - cd kabc/scripts && perl ./makeaddressee + cd tdeabc/scripts && perl ./makeaddressee find . -type d | grep -v '\.svn' | sed -e 's,$$,/,' > dirs mfs=`find . -name Makefile.am | xargs egrep -l '^messages:'` ;\ for dir in $$mfs; do \ diff --git a/arts/kde/kaudioplaystream.cpp b/arts/kde/kaudioplaystream.cpp index 52743a67e..0ef5b8332 100644 --- a/arts/kde/kaudioplaystream.cpp +++ b/arts/kde/kaudioplaystream.cpp @@ -26,7 +26,7 @@ #include <artsflow.h> #include <soundserver.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <tqstring.h> diff --git a/arts/kde/kaudiorecordstream.cpp b/arts/kde/kaudiorecordstream.cpp index 0d180d1f1..0c11bcf04 100644 --- a/arts/kde/kaudiorecordstream.cpp +++ b/arts/kde/kaudiorecordstream.cpp @@ -29,7 +29,7 @@ #include <artsflow.h> #include <soundserver.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <tqstring.h> diff --git a/arts/kde/kconverttest.cc b/arts/kde/kconverttest.cc index 70c4b7918..647c2f320 100644 --- a/arts/kde/kconverttest.cc +++ b/arts/kde/kconverttest.cc @@ -3,7 +3,7 @@ #include <tqfile.h> #include <tqobject.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaboutdata.h> #include <tdecmdlineargs.h> #include <tdeapplication.h> diff --git a/arts/kde/kiotest.cc b/arts/kde/kiotest.cc index 01ce8f3f1..ed9a3fadf 100644 --- a/arts/kde/kiotest.cc +++ b/arts/kde/kiotest.cc @@ -2,7 +2,7 @@ #include <kmedia2.h> #include <tdecmdlineargs.h> #include <connect.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> #include <tdeaboutdata.h> #include "qiomanager.h" diff --git a/arts/kde/kiotestslow.cc b/arts/kde/kiotestslow.cc index df6ed645f..93bfac388 100644 --- a/arts/kde/kiotestslow.cc +++ b/arts/kde/kiotestslow.cc @@ -2,7 +2,7 @@ #include <kmedia2.h> #include <tdecmdlineargs.h> #include <connect.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> #include <tdeaboutdata.h> #include <stdsynthmodule.h> diff --git a/arts/kde/kvideowidget.cpp b/arts/kde/kvideowidget.cpp index 389228d99..c03a18c21 100644 --- a/arts/kde/kvideowidget.cpp +++ b/arts/kde/kvideowidget.cpp @@ -27,7 +27,7 @@ #endif #include <tdeaction.h> -#include <klocale.h> +#include <tdelocale.h> #include "kvideowidget.h" diff --git a/arts/kde/mcop-dcop/kmcop.cpp b/arts/kde/mcop-dcop/kmcop.cpp index d134aeca4..d5e8c8642 100644 --- a/arts/kde/mcop-dcop/kmcop.cpp +++ b/arts/kde/mcop-dcop/kmcop.cpp @@ -20,7 +20,7 @@ #include <kuniqueapplication.h> #include <tdeaboutdata.h> #include <tdecmdlineargs.h> -#include <klocale.h> +#include <tdelocale.h> #include <dcopclient.h> #include <tqvaluelist.h> diff --git a/arts/knotify/knotify.cpp b/arts/knotify/knotify.cpp index 3d0e45d02..313a7a993 100644 --- a/arts/knotify/knotify.cpp +++ b/arts/knotify/knotify.cpp @@ -52,9 +52,9 @@ #include <tdecmdlineargs.h> #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdeglobal.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kpassivepopup.h> #include <kiconloader.h> #include <kmacroexpander.h> diff --git a/arts/message/artsmessage.cc b/arts/message/artsmessage.cc index 4eb62f1fb..eaa5c8e2c 100644 --- a/arts/message/artsmessage.cc +++ b/arts/message/artsmessage.cc @@ -31,11 +31,11 @@ Gnome, etc. and used instead. #include <tqregexp.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <tdeapplication.h> #include <tdeaboutdata.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdecmdlineargs.h> // command line options diff --git a/configure.in.in b/configure.in.in index 651d6f2eb..c414bafdb 100644 --- a/configure.in.in +++ b/configure.in.in @@ -249,7 +249,7 @@ AC_SUBST(LIBRESOLV) AC_SUBST(LIBICE) AC_SUBST(LIB_KAB, '$(top_builddir)/kab/libkab.la') -AC_SUBST(LIB_KABC, '$(top_builddir)/kabc/libkabc.la') +AC_SUBST(LIB_KABC, '$(top_builddir)/tdeabc/libkabc.la') AC_SUBST(LIB_TDECORE, '$(top_builddir)/tdecore/libtdecore.la') AC_SUBST(LIB_TDEUI, '$(top_builddir)/tdeui/libtdeui.la') AC_SUBST(LIB_KIO, '$(top_builddir)/tdeio/libtdeio.la') diff --git a/interfaces/tdeimproxy/library/tdeimproxy.cpp b/interfaces/tdeimproxy/library/tdeimproxy.cpp index c4d77c61e..fb2db0eb4 100644 --- a/interfaces/tdeimproxy/library/tdeimproxy.cpp +++ b/interfaces/tdeimproxy/library/tdeimproxy.cpp @@ -27,7 +27,7 @@ #include <tdeapplication.h> #include <kdcopservicestarter.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <ksimpleconfig.h> #include <kiconloader.h> #include <kservice.h> diff --git a/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp index 7dd746c4f..370805a74 100644 --- a/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp +++ b/interfaces/tdemediaplayer/tdefileaudiopreview/tdefileaudiopreview.cpp @@ -5,10 +5,10 @@ #include <tqlayout.h> #include <tqvgroupbox.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <klibloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdemediaplayer/player.h> #include <kmimetype.h> #include <tdeparts/componentfactory.h> diff --git a/interfaces/tdescript/scriptloader.cpp b/interfaces/tdescript/scriptloader.cpp index ad6c8df20..803feb3a6 100644 --- a/interfaces/tdescript/scriptloader.cpp +++ b/interfaces/tdescript/scriptloader.cpp @@ -21,8 +21,8 @@ #include <tdeapplication.h> #include <tdeparts/part.h> #include <tdeparts/componentfactory.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kdesktopfile.h> #include <kstandarsdirs.h> diff --git a/interfaces/tdescript/scriptmanager.cpp b/interfaces/tdescript/scriptmanager.cpp index 42e20cd5b..a0dfbe921 100644 --- a/interfaces/tdescript/scriptmanager.cpp +++ b/interfaces/tdescript/scriptmanager.cpp @@ -5,8 +5,8 @@ #include <kdesktopfile.h> #include <kstandarddirs.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kdebug.h> //using namespace KScriptInterface; diff --git a/interfaces/tdetexteditor/CMakeLists.txt b/interfaces/tdetexteditor/CMakeLists.txt index 0808a84f3..ca0176ce7 100644 --- a/interfaces/tdetexteditor/CMakeLists.txt +++ b/interfaces/tdetexteditor/CMakeLists.txt @@ -90,7 +90,7 @@ set( ${target}_SRCS tde_add_library( ${target} SHARED AUTOMOC SOURCES ${${target}_SRCS} VERSION 0.0.0 - LINK tdeui-shared kabc-shared tdeparts-shared + LINK tdeui-shared tdeabc-shared tdeparts-shared DEPENDENCIES dcopidl dcopidl2cpp DESTINATION ${LIB_INSTALL_DIR} ) diff --git a/interfaces/tdetexteditor/Makefile.am b/interfaces/tdetexteditor/Makefile.am index b535b39cc..4b1590abe 100644 --- a/interfaces/tdetexteditor/Makefile.am +++ b/interfaces/tdetexteditor/Makefile.am @@ -46,7 +46,7 @@ servicetype_DATA = tdetexteditor.desktop tdetexteditoreditor.desktop tdetextedit kcm_tdetexteditor_DATA = kcm_tdetexteditor.desktop kcm_tdetexteditordir = $(kde_datadir)/kcm_componentchooser -templateinterface.lo: $(top_builddir)/kabc/addressee.h +templateinterface.lo: $(top_builddir)/tdeabc/addressee.h include ../../admin/Doxyfile.am diff --git a/interfaces/tdetexteditor/editorchooser.cpp b/interfaces/tdetexteditor/editorchooser.cpp index aed904c54..1eddfb8d6 100644 --- a/interfaces/tdetexteditor/editorchooser.cpp +++ b/interfaces/tdetexteditor/editorchooser.cpp @@ -6,7 +6,7 @@ #include <tdeconfig.h> #include <tqstringlist.h> #include <kservice.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqlabel.h> #include <tdeapplication.h> #include <tqlayout.h> diff --git a/interfaces/tdetexteditor/templateinterface.cpp b/interfaces/tdetexteditor/templateinterface.cpp index ecc34c7e2..01e0c292f 100644 --- a/interfaces/tdetexteditor/templateinterface.cpp +++ b/interfaces/tdetexteditor/templateinterface.cpp @@ -22,11 +22,11 @@ #include <addressee.h> #include <addresseedialog.h> #include <tqstring.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <tqdatetime.h> #include <tqregexp.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kcalendarsystem.h> #include <unistd.h> diff --git a/interfaces/terminal/test/main.cc b/interfaces/terminal/test/main.cc index bcce6fdbc..8130f85d6 100644 --- a/interfaces/terminal/test/main.cc +++ b/interfaces/terminal/test/main.cc @@ -8,7 +8,7 @@ #include <tdeapplication.h> #include <tqdir.h> #include <assert.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <cassert> #include "main.h" #include "main.moc" diff --git a/kab/addressbook.cc b/kab/addressbook.cc index ab73111be..852f56d57 100644 --- a/kab/addressbook.cc +++ b/kab/addressbook.cc @@ -22,11 +22,11 @@ #include <tqstringlist.h> #include <tdeapplication.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> extern "C" { #include <sys/stat.h> diff --git a/kab/kabapi.cc b/kab/kabapi.cc index 05cffe946..7f2159e24 100644 --- a/kab/kabapi.cc +++ b/kab/kabapi.cc @@ -18,8 +18,8 @@ #include "kabapi.h" #include <tdelistbox.h> -#include <kmessagebox.h> -#include <klocale.h> +#include <tdemessagebox.h> +#include <tdelocale.h> #include <kdebug.h> diff --git a/kabc/CMakeLists.txt b/kabc/CMakeLists.txt deleted file mode 100644 index 57c4741fe..000000000 --- a/kabc/CMakeLists.txt +++ /dev/null @@ -1,123 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_subdirectory( vcard ) -add_subdirectory( vcardparser ) -add_subdirectory( formats ) -add_subdirectory( plugins ) - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/vcard/include - ${CMAKE_CURRENT_SOURCE_DIR}/vcard/include/generated - ${CMAKE_CURRENT_SOURCE_DIR}/vcardparser - - # external includes - ${TQT_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdeio - ${CMAKE_SOURCE_DIR}/kab -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - address.h addressbook.h addresseedialog.h - agent.h distributionlist.h distributionlistdialog.h - distributionlisteditor.h errorhandler.h field.h - format.h formatfactory.h formatplugin.h geo.h key.h - phonenumber.h picture.h plugin.h resource.h secrecy.h - resourceselectdialog.h sound.h stdaddressbook.h - timezone.h vcardconverter.h vcardformat.h lock.h - vcardformatplugin.h ldifconverter.h addresslineedit.h - ldapclient.h addresseelist.h locknull.h ldif.h - ldapurl.h ldapconfigwidget.h sortmode.h - ${CMAKE_CURRENT_BINARY_DIR}/addressee.h - DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) - - -##### other data ################################ - -install( FILES tdeab2tdeabc.desktop DESTINATION ${AUTOSTART_INSTALL_DIR} ) -install( FILES kabc_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources ) -install( FILES countrytransl.map DESTINATION ${DATA_INSTALL_DIR}/kabc ) - - -##### generated files ########################### -# FIXME this hack make compatibility with out-of-source mode - -file( COPY - scripts/makeaddressee scripts/addressee.src.cpp - scripts/addressee.src.h scripts/entrylist scripts/field.src.cpp - DESTINATION scripts ) - -add_custom_command( - OUTPUT addressee.cpp addressee.h field.cpp - COMMAND perl - ARGS makeaddressee - DEPENDS scripts/addressee.src.cpp scripts/addressee.src.h scripts/entrylist scripts/field.src.cpp - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts -) - - -##### kabc ###################################### - -set( target kabc ) - -set( ${target}_SRCS - address.cpp addressbook.cpp addressee.cpp addresseedialog.cpp - agent.cpp distributionlist.cpp distributionlistdialog.cpp - distributionlisteditor.cpp errorhandler.cpp field.cpp - formatfactory.cpp geo.cpp key.cpp phonenumber.cpp - picture.cpp plugin.cpp resource.cpp resourceselectdialog.cpp - secrecy.cpp sound.cpp stdaddressbook.cpp timezone.cpp - vcard21parser.cpp vcardconverter.cpp vcardformat.cpp - vcardformatimpl.cpp vcardformatplugin.cpp ldifconverter.cpp - addresslineedit.cpp ldapclient.cpp addresseelist.cpp - vcardtool.cpp addresseehelper.cpp lock.cpp locknull.cpp - ldif.cpp ldapurl.cpp ldapconfigwidget.cpp sortmode.cpp - addresseehelper.skel -) - -tde_add_library( ${target} SHARED AUTOMOC - SOURCES ${${target}_SRCS} - VERSION 1.2.0 - LINK vcards-static vcard-shared tdeio-shared tderesources-shared - DEPENDENCIES addressee.h dcopidl - DESTINATION ${LIB_INSTALL_DIR} -) - - -##### tdeab2tdeabc ################################## - -set( target tdeab2tdeabc ) - -set( ${target}_SRCS - tdeab2tdeabc.cpp -) - -tde_add_executable( ${target} - SOURCES ${${target}_SRCS} - LINK kab-static kabc-shared - DESTINATION ${BIN_INSTALL_DIR} -) diff --git a/kabc/HACKING b/kabc/HACKING deleted file mode 100644 index 429ae0865..000000000 --- a/kabc/HACKING +++ /dev/null @@ -1,100 +0,0 @@ -Coding Style -============ - -See http://korganizer.kde.org/hacking.html for an HTML version. - -Formatting ----------- - -- No Tabs. -- Indent with 2 spaces. -- A line must not have more than 80 chars. -- Put Spaces between brackets and arguments of functions. -- For if, else, while and similar statements put the brackets on the same line - as the statement. -- Function and class definitions have their brackets on separate lines. - -Example: - -void MyClass::myFunction() -{ - if ( blah == fasel ) { - blubbVariable = arglValue; - } else { - blubbVariable = oerxValue; - } -} - - -Header Formatting ------------------ - -- General formatting rules apply. -- Access modifiers are indented. -- Put curly brackets of class definition on its own line. -- Double inclusion protection defines are all upper case letters and are - composed of the namespace (if available), the classname and a H suffix - separated by underscores. -- Inside a namespace there is no indentation. - -Example: - -#ifndef XKJ_MYCLASS_H -#define XKJ_MYCLASS_H - -namespace XKJ { - -class MyClass -{ - public: - MyClass(); - - private: - int mMyInt; -}; - -} - -#endif - - -API docs --------- - -- Each public function must have a Doxygen compatible comment in the header -- Use C-style comments without additional asterisks -- Indent correctly. -- Comments should be grammatically correct, e.g. sentences start with uppercase - letters and end with a full stop. -- Be concise. - -Example: - - /** - This function makes tea. - - @param cups number of cups. - @result tea - */ - Tea makeTea( int cups ); - - -Class and File Names --------------------- - -- Put classes in files, which have the same name as the class, but only - lower-case letters. -- Designer-generated files should have a name classname_base.ui and shoul - contain a class called ClassnameBase. -- Classes inheriting from designer-generated classes have the same name as the - generated class, but without the Base suffix. - -Class and Variable Names ------------------------- - -- For class, variable, function names seperate multiple words by upper-casing - the words precedeed by other words. -- Class names start with an upper-case letter. -- Function names start with a lower-case letter. -- Variable names start with a lower-case letter. -- Member variables of a class start with "m" followed by an upper-case letter. diff --git a/kabc/HOWTO b/kabc/HOWTO deleted file mode 100644 index 7b41371b0..000000000 --- a/kabc/HOWTO +++ /dev/null @@ -1,372 +0,0 @@ -The KDE Address Book Framework -=============================== - -The KDE address book framework tries to provide an easy to use and powerful -mechanism to handle contacts in all KDE applications. - -If you want to make use of it, this small introduction to programming -with libkabc may be helpful. - - -General Concepts -================= - -In libkabc the storage and management of contacts is devided in 2 layers. - -****************** -Management Layer * -****************** - - .-------------------. - | KABC::AddressBook | - .--------------------------------. - | KABC::Addressee | => Iterators - | KABC::Addressee | - | KABC::Addressee | => Search functions - | ... | - `--------------------------------' - | - - - - - - - - - - - - | - - - - - - - - - - - - - - | -*************** | -Storage Layer * | -*************** | ....................... - | . . - Network - .---------------. | . .---------------. . - | ResourceFile |----+-----| ResourceLDAP | . - `---------------' | . `---------------' . - .---------------. | . .---------------. . - | ResourceDir |----+-----| ResourceNet | . - `---------------' . `---------------' . - . . - ....................... - - -The Management Layer ---------------------- -The Management Layer consists of the two classes KABC::AddressBook and -KABC::Addressee. KABC::AddressBook is a container for KABC::Addressee objects -and provides 2 kinds of access methods. -1) Iterators - With iterators you can iterate over each of the contacts of the - address book and perform an action on it - -2) Search functions - With search functions you can search for contacts with special attributes - such as "all contacts with the name 'Harald'" - -The class KABC::Addressee represents a single contact and contains all data -a vCard could store (as specified in RFC 2426). - -The Storage Layer ------------------- -The Storage Layer consists of the class KABC::Resource and its derived classes. -These classes are used by KABC::AddressBook to load and store the contacts to -the single backends. -At the moment libkabc provides 4 types of resources: -1) ResourceFile - - stores all contacts in a single file - -2) ResourceDir - - stores each contact in its own file with the unique identifier of the - contact as a filename, will all of the files together in one directory - -3) ResourceLDAP - - stores all of the contacts on a LDAP server - -4) ResourceNet - - stores all contacts in a single file, which can be accessable via HTTP, - FTP, Fish, WebDAV, POP3, IMAP or whatever the KIO frame work supports - -In general the developer does not have to take how to save the single contacts. -He just has to plug one of the above mentioned resources into KABC::AddressBook -and perform a save action. - -Examples -========= -Like a picture, C/C++ code is worth a 1000 words I'd like to give you a -lot of examples now, how to use libkabc for several tasks: - - -Using KABC::StdAddressBook and Iterators ------------------------------------------ -Normally you have to plugin the resources manually into the addressbook object -and call the load() function before you can access the contacts, but there is -a special class KABC::StdAddressBook, which loads all resources of the standard -address book of the user automatically. You can use it the following way: - - - #include <kabc/stdaddressbook.h> - - 1: KABC::AddressBook *ab = KABC::StdAddressBook::self(); - 2: KABC::AddressBook::Iterator it; - 3: for ( it = ab->begin(); it != ab->end(); ++it ) { - 4: KABC::Addressee addr = (*it); - 5: - 6: kdDebug() << "Name = " << addr.formattedName() << endl; - 7: } - -The above example prints out the names of all the contacts in the user's address -book. In line 1 you retrieve a pointer to the user's standard address book -(provided by KABC::StdAddressBook via a singleton design pattern). -In line 2 an iterator is defined, which is used in line 3 to iterate over the -whole address book. The assignment in line 4 is intended only to show more -clearly how iterators function. -You could also use (*it).formattedName() directly. In line 6 the formatted name -of the current contact is printed out to stderr. -As you can see that's all magic, and it's quite easy ;) - - -Using KABC::AddressBook manually ---------------------------------- -In some cases you don't want to load the user's standard address book, but, -for example, just a single vCard. For this purpose you have to use the -class KABC::AddressBook and handle the resource stuff manually. -The following code will create a file resource and save a contact into it: - - - #include <kabc/addressbook.h> - #include <kabc/resourcefile.h> - - 1: KABC::AddressBook ab; - 2: - 3: // create a file resource - 4: KABC::Resource *res = new KABC::ResourceFile( "/home/user/myvcard.vcf", "vcard" ); - 5: - 6: if ( !ab.addResource( res ) ) { - 7: kdDebug() << "Unable to open resource" << endl; - 8: return 1; - 9: } -10: -11: if ( !ab.load() ) { -12: kdDebug() << "Unable to load address book!" << endl; -13: return 2; -14: } -15: -16: KABC::Addressee addr; -17: addr.setNameFromString( "Otto Harald Meyer" ); -18: addr.setBirthday( QDate( 1982, 07, 19 ) ); -19: addr.setNickName( "otto" ); -20: addr.setMailer( "kmail" ); -21: -22: // TZ -23: KABC::TimeZone tz( 60 ); // takes time shift in minutes as argument -24: addr.setTimeZone( tz ); -25: -26: // GEO -27: KABC::Geo geo( 52.5, 13.36 ); // takes latitude and longitude as argument -28: addr.setGeo( geo ); -29: -30: addr.setTitle( "dude, the" ); -31: addr.setRole( "developer" ); -32: addr.setOrganization( "KDE e.V." ); -33: addr.setNote( "Yet another senseless note..." ); -34: addr.setUrl( KURL( "http://kaddressbook.org" ) ); -35: -36: // CLASS -37: KABC::Secrecy secrecy( KABC::Secrecy::Confidential ); -38: addr.setSecrecy( secrecy ); -39: -40: // PHOTO or LOGO -41: KABC::Picture photo; -42: QImage img; -43: if ( img.load( "face.png", "PNG" ) ) { -44: photo.setData( img ); -45: photo.setType( "image/png" ); -46: addr.setPhoto( photo ); -47: } -48: -49: addr.insertEmail( "otto@kde.se", true ); // preferred email -50: addr.insertEmail( "otti@yahoo.com", false ); -51: -52: // TEL -53: KABC::PhoneNumber phoneHome( "0351 5466738", KABC::PhoneNumber::Home ); -54: KABC::PhoneNumber phoneWork( "0351 2335411", KABC::PhoneNumber::Work ); -55: addr.insertPhoneNumber( phoneHome ); -56: addr.insertPhoneNumber( phoneWork ); -57: -58: // ADR -59: KABC::Address homeAddr( KABC::Address::Home ); -60: homeAddr.setStreet( "Milliwaystreet 42" ); -61: homeAddr.setLocality( "London" ); -62: homeAddr.setRegion( "Saxony" ); -63: homeAddr.setPostalCode( "43435" ); -64: homeAddr.setCountry( "Germany" ); -65: addr.insertAddress( homeAddr ); -66: -67: addr.insertCategory( "LUG-Dresden-Members" ); -68: -69: addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", "21.04.2009" ); -70: -71: ab.insertAddressee( addr ); // will be assigned to the standard resource -72: // automatically -73: -74: KABC::Ticket *ticket = ab.requestSaveTicket( res ); -75: if ( !ticket ) { -76: kdError() << "Resource is locked by other application!" << endl; -77: } else { -78: if ( !ab.save( ticket ) ) { -79: kdError() << "Saving failed!" << endl; -80: ab.releaseSaveTicket( ticket ); -81: } -82: -83: } -84: -85: return 0; - -In line 1 the KABC::AddressBook is created. In line 4 you creat the -KABC::ResourceFile (which will handle the loading/saving). -The resource takes 2 arguments, the first is the file name and the -second one the file format. At the moment libkabc supports two file formats: -1) vCard, as specified in RFC 2426 -2) Binary, which increases performance during loading and saving - -In line 6 we try to plug the resource into the addressbook. The addressbook -class tries to open the resource immediately and returns whether opening was -successful. We add here only one resource, but you can add as many resources -as you want. - -In line 11 we try to load all contacts from the backends into the address book. -As before, it returns whether opening was successful. - -In line 16 a KABC::Addressee is created, which we will fill now with data, -before inserting it into the KABC::AddressBook. -The setNameFromString() function in the following line takes a string as -argument and tries to parse it into the single name components such as: given -name, family name, additional names, honoric prefix and honoric suffix. -You can set these values manually as well by calling - addr.setGivenName( "Otto" ); -and - addr.setFamilyName( "Meyer" ); -etc. etc. - -In line 23 we use the class KABC::TimeZone to store the timezone. This class -takes the time shift in minutes. - -In line 27 the KABC::Geo class is used for storing the geographical -information. The arguments are the latitude and longitude as float values. - -KABC::Secrecy in line 37 represents the CLASS entity of a vCard and can take -KABC::Secrecy::Public, KABC::Secrecy::Private or KABC::Secrecy::Confidential -as argument. - -In line 41 we make use of KABC::Picture class to store the photo of the -contact. This class can contain either an URL or the raw image data in form -of a QImage, in this example we use the latter. - -In line 43 we try to load the image "face.png" from the local directory and -assign this QImage to the KABC::Picture class via the setData() function. -Additionally we set the type of the picture to "image/png". - -From 49 - 50 we insert 2 email addresses with the first one as preferred -(second argument is true). - -In 53 and the following 3 lines we add two telephone numbers. For this purpose -libkabc provides the KABC::PhoneNumber class, which takes the phone number in -string representation as first argument and the type as second. The types can -be combined, so 'KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax' would be -the Home Fax. - -In line 59 we create a KABC::Address object and set the single parts in the -following lines. - -In line 67 we assign the contact to a special category. - -A contact can also contain custom entries, which are not specified in the API, -so you can add custom values with insertCustom() as shown in line 69. -The first argument of this function should be the name of the application, so -2 applications which use the same custom entry accidentally, do not overwrite -the data for each other. The second argument contains the name of the -custom entry and the third argument the value in string representation. - -In line 71 we finally insert the KABC::Addressee object into the -KABC::AddressBook. Since we have only one resource loaded, the contact is -automatically assigned to this resource. If you have several writeable -resources loaded, you should ask the user which resource the contact shall -belong to and assign the selected resource to the contact with - KABC::Addressee.setResource( KABC::Resource *resource ); -before inserting it into the address book. - -To prevent multiple access to one resource and possible resulting data loss -we have to lock the resource before saving our changes. -For this purpose KABC::AddressBook provides the function - requestSaveTicket( KABC::Resource* ) -which takes a pointer to the resource which shall be saved as argument and -returns a so called 'Save Ticket' if locking succeeded or a null pointer -if the resource is already locked by another application. - -So when we retrieved a valid ticket in line 74, we try to save our changes in -line 78. -The KABC::AddressBook::save() function takes the save ticket as argument and -returns whether saving succeeded. It also releases the save ticket when successful. - -Important! -If the save() call fails, you have to release the save ticket manually, as is -done in line 80, otherwise possible locks, created by the resources, won't be -removed. - -You can see also, that manual use is quite easy for the KABC::AddressBook class -and for the ResourceFile. For more information about the API of KABC::Addressee -please take a look at the official API documentation or the header files. - - -Distribution Lists -------------------- -libkabc provides so called distribution lists to group contacts. These lists -just store the uid of contacts, so they can be used for every kind of contact -grouping. There are 2 classes which handle the whole distribution list tasks, -KABC::DistributionListManager and KABC::DistributionList. The first one keeps -track of all available distribution lists and the latter one is the -representation of one list. - - - #include <kabc/distributionlist.h> - #include <kabc/stdaddressbook.h> - - 1: KABC::DistributionListManager manager( KABC::StdAddressBook::self() ); - 2: - 3: // load the lists - 4: manager.load(); - 5: - 6: QStringList listNames = manager.listNames(); - 7: QStringList::Iterator it; - 8: for ( it = listNames.begin(); it != listNames.end(); ++it ) { - 9: KABC::DistributionList *list = manager.list( *it ); -10: kdDebug() << list->name() << endl; -11: -12: QStringList emails = list->emails(); -13: QStringList::Iterator eit; -14: for ( eit = emails.begin(); eit != emails.end(); ++eit ) -15: kdDebug() << QString( "\t%1" ).arg( (*eit).latin1() ) << endl; -16: } - -In the first line a KABC::DistributionListManager is created. The manager takes -a pointer to a KABC::AddressBook, because he has to resolve the stored uids to -currently available email addresses. -In line 4 the manager loads all distribution lists from the central config file -$HOME/.trinity/share/apps/kabc/distlists. -The next line queries the names of all available distribution lists, which are -used in line 9 to retrieve a pointer to the specific list. -Now that you have a KABC::DistributionList object, you can performe the -following actions on it: - - set / get the name - - insert an entry - - remove an entry - - get a list of all email addresses - - get a list of all entries (which includes the uids) - -In line 12 we query all email addresses of every resource and print them out. - -<kabc/distributionlist.h> contains also the declaration for the class -KABC::DistributionListWatcher. This class exists only once per application and -its only job is to emit a signal as soon as the distribution list file has -changed. So to make your application aware of changes use the following code: - - - #include <kabc/distributionlist.h> - - 1: connect( KABC::DistributionListWatcher::self(), SIGNAL( changed() ), - 2: this, SLOT( slotDistributionListChanged() ) ); - -You see, as usual, easy ;) - diff --git a/kabc/Makefile.am b/kabc/Makefile.am deleted file mode 100644 index 57e72aec2..000000000 --- a/kabc/Makefile.am +++ /dev/null @@ -1,72 +0,0 @@ -SUBDIRS = vcard vcardparser . formats plugins scripts tests - -# Make sure $(all_includes) remains last! -INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_srcdir)/kab \ - -I$(srcdir)/vcard/include -I$(srcdir)/vcardparser/ \ - -I$(srcdir)/vcard/include/generated \ - -I$(srcdir)/vcardparser $(all_includes) - -field.cpp: addressee.h addressee.cpp -addressee.cpp: addressee.h -addressee.cpp addressee.h field.cpp: \ - $(srcdir)/scripts/makeaddressee \ - $(srcdir)/scripts/addressee.src.cpp \ - $(srcdir)/scripts/addressee.src.h \ - $(srcdir)/scripts/entrylist \ - $(srcdir)/scripts/field.src.cpp - mysrcdir=`cd $(srcdir)/scripts && pwd` ;\ - cd scripts && $(PERL) $$mysrcdir/makeaddressee - -CLEANFILES = addressee.h addressee.cpp field.cpp - -lib_LTLIBRARIES = libkabc.la -libkabc_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 3:0:2 -no-undefined -libkabc_la_LIBADD = vcard/libvcard.la vcardparser/libvcards.la $(LIB_KIO) \ - $(top_builddir)/tderesources/libtderesources.la $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDEUI) $(LIB_TDECORE) -libkabc_la_COMPILE_FIRST = addressee.h - -libkabc_la_SOURCES = \ - address.cpp addressbook.cpp addressee.cpp addresseedialog.cpp agent.cpp \ - distributionlist.cpp distributionlistdialog.cpp distributionlisteditor.cpp \ - errorhandler.cpp field.cpp formatfactory.cpp geo.cpp key.cpp \ - phonenumber.cpp picture.cpp plugin.cpp resource.cpp \ - resourceselectdialog.cpp secrecy.cpp sound.cpp stdaddressbook.cpp \ - timezone.cpp vcard21parser.cpp vcardconverter.cpp vcardformat.cpp \ - vcardformatimpl.cpp vcardformatplugin.cpp ldifconverter.cpp addresslineedit.cpp \ - ldapclient.cpp addresseelist.cpp vcardtool.cpp addresseehelper.cpp \ - addresseehelper.skel lock.cpp locknull.cpp ldif.cpp ldapurl.cpp ldapconfigwidget.cpp \ - sortmode.cpp - - -kabcincludedir = $(includedir)/kabc -kabcinclude_HEADERS = address.h addressbook.h addressee.h addresseedialog.h \ - agent.h distributionlist.h distributionlistdialog.h distributionlisteditor.h \ - errorhandler.h field.h format.h formatfactory.h formatplugin.h geo.h key.h \ - phonenumber.h picture.h plugin.h resource.h \ - resourceselectdialog.h secrecy.h sound.h stdaddressbook.h timezone.h \ - vcardconverter.h vcardformat.h vcardformatplugin.h ldifconverter.h \ - addresslineedit.h ldapclient.h addresseelist.h lock.h locknull.h ldif.h \ - ldapurl.h ldapconfigwidget.h sortmode.h - -METASOURCES = AUTO - -bin_PROGRAMS = tdeab2tdeabc - -tdeab2tdeabc_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -tdeab2tdeabc_LDADD = libkabc.la ../kab/libkab.la -tdeab2tdeabc_SOURCES = tdeab2tdeabc.cpp - -autostart_DATA = tdeab2tdeabc.desktop -autostartdir = $(datadir)/autostart - -manager_DATA = kabc_manager.desktop -managerdir = $(kde_servicesdir)/tderesources - -DOXYGEN_REFERENCES = tdecore tdeui - -map_DATA = countrytransl.map -mapdir = $(kde_datadir)/kabc - -EXTRA_DIST = $(map_DATA) - -include ../admin/Doxyfile.am diff --git a/kabc/README b/kabc/README deleted file mode 100644 index 46d21b9b6..000000000 --- a/kabc/README +++ /dev/null @@ -1,28 +0,0 @@ -LIBKABC - new address book API for KDE - -PURPOSE: - -libkabc provides an API for address book data. This can be used by all KDE -application using data of this type, e.g. KAddressBook, KMail, KOrganizer, -KPilot etc. It is meant as replacement for libkab (in tdebase/kab). - -FEATURES: - -- Value based interface, addressbook entry data is implicitly shared. -- Address book entries are identified by a unique id. -- vCard backend (RFC 2425 / RFC 2426). -- Locking mechanism to support concurrent access to the address book by - multiple processes. -- Notification on change of addressbook by other process. -- Dialog for selecting address book entries, supports mouse and keyboard - selection, supports automatic name completion. -- GUI client for viewing, modifying address book data. This is aimed at - developers not end users. -- Tool for converting data, written with libkab, to libkabc format. -- Multiple backends (resources) for storing entries e.g. LDAP - -AUTHOR: Cornelius Schumacher <schumacher@kde.org> - -LICENCE: LPGL - -DATE: 13 Oct 2001 diff --git a/kabc/README.AddressFormat b/kabc/README.AddressFormat deleted file mode 100644 index 8079e4914..000000000 --- a/kabc/README.AddressFormat +++ /dev/null @@ -1,66 +0,0 @@ -Address formats can be a tricky thing. libkabc tries very hard to perfectly fit -the needs of ~95% of users and to be at least sufficient for the other 5%. - -The formatting of an address depends on the destination country as well as on -the origin country of a letter. Basically, the part indicating the destination -country follows the rules of the country of origin, all the rest follows the -rules of the destination country. So we need to store for every country a) the -country positioning and b) the address formatting. - -Address formats should usually be stored in a country's entry.desktop. There we -store the country position in field "AddressCountryPosition" and the address -format in a field "AddressFormat". Note that for most countries one field -"AddressFormat" is sufficient for personal as well as company addresses -(because personal addresses look just like business addresses without company); -however, in some countries (eg. Hungary) business addresses differ in their -structure. In this case you have the possibility of adding another field -"BusinessAddressFormat" which will be preferred for formatting of business -addresses; if libkabc can't find such a field, it will fall back to -"AddressFormat". (Please use BusinessAddressFormat ONLY if you really need to) - -The format consists mainly of tags that will be replaced by address fields. -The list of tags may grow in the future, the format *might* change in the near -future, but I hope not. - -Any comments very very welcome to kde-pim@kde.org or to jost@schenck.de. - --Jost. - -Fields AddressFormat and BusinessAddressFormat ------------------------------------------------- -%n = real name -%N = REAL NAME -%cm = company -%CM = COMPANY -%s = street -%S = STREET -%z = zip code -%l = location -%L = LOCATION -%r = region -%R = REGION -%p = post office box -%, = conditional comma+whitespace, - will be left out if the value left or right of it is purged -%w = conditional whitespace, - will be left out if the value left or right of it is purged -%0(...) = the text inside the brackets will be completely purged if not - at least one tag inside it evaluates to something. Example: when the - address doesn't have a postbox, the string %0(PO Box %p) will not - evaluate to "PO Box " but to an empty string. -\n = newline - -Field AddressCountryPosition ------------------------------------------------- -below = country name below rest of address -BELOW = country name below in capital letters -above = country name above rest of address -ABOVE = country name above in capital letters - -Some Tips ------------------------------------------------- -- You sometimes have three fields in a line which can all be empty. If you eg. -separate them all with conditional whitespace (same goes for cond. comma) like -in "%z%w%r%w%l" and only the middle value (here: region) is empty, there will -be no whitespace at all between the outer values (here: zipcode and location). -To avoid this, combine two of these values with purge brackets: %0(%z%w%r)%w%l. diff --git a/kabc/TODO b/kabc/TODO deleted file mode 100644 index 13f75b6bb..000000000 --- a/kabc/TODO +++ /dev/null @@ -1 +0,0 @@ -Factor out TDELockFile. diff --git a/kabc/address.cpp b/kabc/address.cpp deleted file mode 100644 index 46b483b43..000000000 --- a/kabc/address.cpp +++ /dev/null @@ -1,592 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 "address.h" - -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <ksimpleconfig.h> -#include <kstandarddirs.h> -#include <kstaticdeleter.h> - -#include <tqfile.h> - -using namespace KABC; - -TQMap<TQString, TQString> *Address::mISOMap = 0; -static KStaticDeleter< TQMap<TQString, TQString> > isoMapDeleter; - -Address::Address() : - mEmpty( true ), mType( 0 ) -{ - mId = TDEApplication::randomString( 10 ); -} - -Address::Address( int type ) : - mEmpty( true ), mType( type ) -{ - mId = TDEApplication::randomString( 10 ); -} - -bool Address::operator==( const Address &a ) const -{ - if ( mPostOfficeBox != a.mPostOfficeBox ) return false; - if ( mExtended != a.mExtended ) return false; - if ( mStreet != a.mStreet ) return false; - if ( mLocality != a.mLocality ) return false; - if ( mRegion != a.mRegion ) return false; - if ( mPostalCode != a.mPostalCode ) return false; - if ( mCountry != a.mCountry ) return false; - if ( mLabel != a.mLabel ) return false; - - return true; -} - -bool Address::operator!=( const Address &a ) const -{ - return !( a == *this ); -} - -bool Address::isEmpty() const -{ - if ( mPostOfficeBox.isEmpty() && - mExtended.isEmpty() && - mStreet.isEmpty() && - mLocality.isEmpty() && - mRegion.isEmpty() && - mPostalCode.isEmpty() && - mCountry.isEmpty() && - mLabel.isEmpty() ) { - return true; - } - return false; -} - -void Address::clear() -{ - *this = Address(); -} - -void Address::setId( const TQString &id ) -{ - mEmpty = false; - - mId = id; -} - -TQString Address::id() const -{ - return mId; -} - -void Address::setType( int type ) -{ - mEmpty = false; - - mType = type; -} - -int Address::type() const -{ - return mType; -} - -TQString Address::typeLabel() const -{ - TQString label; - bool first = true; - - const TypeList list = typeList(); - - TypeList::ConstIterator it; - for ( it = list.begin(); it != list.end(); ++it ) { - if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { - label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); - if ( first ) - first = false; - } - } - - return label; -} - -void Address::setPostOfficeBox( const TQString &s ) -{ - mEmpty = false; - - mPostOfficeBox = s; -} - -TQString Address::postOfficeBox() const -{ - return mPostOfficeBox; -} - -TQString Address::postOfficeBoxLabel() -{ - return i18n("Post Office Box"); -} - - -void Address::setExtended( const TQString &s ) -{ - mEmpty = false; - - mExtended = s; -} - -TQString Address::extended() const -{ - return mExtended; -} - -TQString Address::extendedLabel() -{ - return i18n("Extended Address Information"); -} - - -void Address::setStreet( const TQString &s ) -{ - mEmpty = false; - - mStreet = s; -} - -TQString Address::street() const -{ - return mStreet; -} - -TQString Address::streetLabel() -{ - return i18n("Street"); -} - - -void Address::setLocality( const TQString &s ) -{ - mEmpty = false; - - mLocality = s; -} - -TQString Address::locality() const -{ - return mLocality; -} - -TQString Address::localityLabel() -{ - return i18n("Locality"); -} - - -void Address::setRegion( const TQString &s ) -{ - mEmpty = false; - - mRegion = s; -} - -TQString Address::region() const -{ - return mRegion; -} - -TQString Address::regionLabel() -{ - return i18n("Region"); -} - - -void Address::setPostalCode( const TQString &s ) -{ - mEmpty = false; - - mPostalCode = s; -} - -TQString Address::postalCode() const -{ - return mPostalCode; -} - -TQString Address::postalCodeLabel() -{ - return i18n("Postal Code"); -} - - -void Address::setCountry( const TQString &s ) -{ - mEmpty = false; - - mCountry = s; -} - -TQString Address::country() const -{ - return mCountry; -} - -TQString Address::countryLabel() -{ - return i18n("Country"); -} - - -void Address::setLabel( const TQString &s ) -{ - mEmpty = false; - - mLabel = s; -} - -TQString Address::label() const -{ - return mLabel; -} - -TQString Address::labelLabel() -{ - return i18n("Delivery Label"); -} - -Address::TypeList Address::typeList() -{ - static TypeList list; - - if ( list.isEmpty() ) - list << Dom << Intl << Postal << Parcel << Home << Work << Pref; - - return list; -} - -TQString Address::typeLabel( int type ) -{ - if ( type & Pref ) - return i18n( "Preferred address", "Preferred" ); - - switch ( type ) { - case Dom: - return i18n("Domestic"); - break; - case Intl: - return i18n("International"); - break; - case Postal: - return i18n("Postal"); - break; - case Parcel: - return i18n("Parcel"); - break; - case Home: - return i18n("Home Address", "Home"); - break; - case Work: - return i18n("Work Address", "Work"); - break; - case Pref: - return i18n("Preferred Address"); - break; - default: - return i18n("Other"); - break; - } -} - -void Address::dump() const -{ - kdDebug(5700) << " Address {" << endl; - kdDebug(5700) << " Id: " << id() << endl; - kdDebug(5700) << " Extended: " << extended() << endl; - kdDebug(5700) << " Street: " << street() << endl; - kdDebug(5700) << " Postal Code: " << postalCode() << endl; - kdDebug(5700) << " Locality: " << locality() << endl; - kdDebug(5700) << " }" << endl; -} - - -TQString Address::formattedAddress( const TQString &realName, - const TQString &orgaName ) const -{ - TQString ciso; - TQString addrTemplate; - TQString ret; - - // FIXME: first check for iso-country-field and prefer that one - if ( !country().isEmpty() ) { - ciso = countryToISO( country() ); - } else { - // fall back to our own country - ciso = TDEGlobal::locale()->country(); - } - KSimpleConfig entry( locate( "locale", - TQString( "l10n/" ) + ciso + TQString( "/entry.desktop" ) ) ); - entry.setGroup( "KCM Locale" ); - - // decide whether this needs special business address formatting - if ( orgaName.isEmpty() ) { - addrTemplate = entry.readEntry( "AddressFormat" ); - } else { - addrTemplate = entry.readEntry( "BusinessAddressFormat" ); - if ( addrTemplate.isEmpty() ) - addrTemplate = entry.readEntry( "AddressFormat" ); - } - - // in the case there's no format found at all, default to what we've always - // used: - if ( addrTemplate.isEmpty() ) { - kdWarning(5700) << "address format database incomplete " - << "(no format for locale " << ciso - << " found). Using default address formatting." << endl; - addrTemplate = "%0(%n\\n)%0(%cm\\n)%0(%s\\n)%0(PO BOX %p\\n)%0(%l%w%r)%,%z"; - } - - // scan - parseAddressTemplateSection( addrTemplate, ret, realName, orgaName ); - - // now add the country line if needed (formatting this time according to - // the rules of our own system country ) - if ( !country().isEmpty() ) { - KSimpleConfig entry( locate( "locale", TQString( "l10n/" ) - + TDEGlobal::locale()->country() + TQString( "/entry.desktop" ) ) ); - entry.setGroup( "KCM Locale" ); - TQString cpos = entry.readEntry( "AddressCountryPosition" ); - if ( "BELOW" == cpos || cpos.isEmpty() ) { - ret = ret + "\n\n" + country().upper(); - } else if ( "below" == cpos ) { - ret = ret + "\n\n" + country(); - } else if ( "ABOVE" == cpos ) { - ret = country().upper() + "\n\n" + ret; - } else if ( "above" == cpos ) { - ret = country() + "\n\n" + ret; - } - } - - return ret; -} - -bool Address::parseAddressTemplateSection( const TQString &tsection, - TQString &result, const TQString &realName, const TQString &orgaName ) const -{ - // This method first parses and substitutes any bracketed sections and - // after that replaces any tags with their values. If a bracketed section - // or a tag evaluate to zero, they are not just removed but replaced - // with a placeholder. This is because in the last step conditionals are - // resolved which depend on information about zero-evaluations. - result = tsection; - int stpos = 0; - bool ret = false; - - // first check for brackets that have to be evaluated first - int fpos = result.find( KABC_FMTTAG_purgeempty, stpos ); - while ( -1 != fpos ) { - int bpos1 = fpos + KABC_FMTTAG_purgeempty.length(); - int bpos2; - // expect opening bracket and find next balanced closing bracket. If - // next char is no opening bracket, continue parsing (no valid tag) - if ( '(' == result[bpos1] ) { - bpos2 = findBalancedBracket( result, bpos1 ); - if ( -1 != bpos2 ) { - // we have balanced brackets, recursively parse: - TQString rplstr; - bool purge = !parseAddressTemplateSection( result.mid( bpos1+1, - bpos2-bpos1-1 ), rplstr, - realName, orgaName ); - if ( purge ) { - // purge -> remove all - // replace with !_P_!, so conditional tags work later - result.replace( fpos, bpos2 - fpos + 1, "!_P_!" ); - // leave stpos as it is - } else { - // no purge -> replace with recursively parsed string - result.replace( fpos, bpos2 - fpos + 1, rplstr ); - ret = true; - stpos = fpos + rplstr.length(); - } - } else { - // unbalanced brackets: keep on parsing (should not happen - // and will result in bad formatting) - stpos = bpos1; - } - } - fpos = result.find( KABC_FMTTAG_purgeempty, stpos ); - } - - // after sorting out all purge tags, we just search'n'replace the rest, - // keeping track of whether at least one tag evaluates to something. - // The following macro needs TQString for R_FIELD - // It substitutes !_P_! for empty fields so conditional tags work later -#define REPLTAG(R_TAG,R_FIELD) \ - if ( result.find(R_TAG, false) != -1 ) { \ - TQString rpl = R_FIELD.isEmpty() ? TQString("!_P_!") : R_FIELD; \ - result.replace( R_TAG, rpl ); \ - if ( !R_FIELD.isEmpty() ) { \ - ret = true; \ - } \ - } - REPLTAG( KABC_FMTTAG_realname, realName ); - REPLTAG( KABC_FMTTAG_REALNAME, realName.upper() ); - REPLTAG( KABC_FMTTAG_company, orgaName ); - REPLTAG( KABC_FMTTAG_COMPANY, orgaName.upper() ); - REPLTAG( KABC_FMTTAG_pobox, postOfficeBox() ); - REPLTAG( KABC_FMTTAG_street, street() ); - REPLTAG( KABC_FMTTAG_STREET, street().upper() ); - REPLTAG( KABC_FMTTAG_zipcode, postalCode() ); - REPLTAG( KABC_FMTTAG_location, locality() ); - REPLTAG( KABC_FMTTAG_LOCATION, locality().upper() ); - REPLTAG( KABC_FMTTAG_region, region() ); - REPLTAG( KABC_FMTTAG_REGION, region().upper() ); - result.replace( KABC_FMTTAG_newline, "\n" ); -#undef REPLTAG - - // conditional comma - fpos = result.find( KABC_FMTTAG_condcomma, 0 ); - while ( -1 != fpos ) { - TQString str1 = result.mid( fpos - 5, 5 ); - TQString str2 = result.mid( fpos + 2, 5 ); - if ( str1 != "!_P_!" && str2 != "!_P_!" ) { - result.replace( fpos, 2, ", " ); - } else { - result.remove( fpos, 2 ); - } - fpos = result.find( KABC_FMTTAG_condcomma, fpos ); - } - // conditional whitespace - fpos = result.find( KABC_FMTTAG_condwhite, 0 ); - while ( -1 != fpos ) { - TQString str1 = result.mid( fpos - 5, 5 ); - TQString str2 = result.mid( fpos + 2, 5 ); - if ( str1 != "!_P_!" && str2 != "!_P_!" ) { - result.replace( fpos, 2, " " ); - } else { - result.remove( fpos, 2 ); - } - fpos = result.find( KABC_FMTTAG_condwhite, fpos ); - } - - // remove purged: - result.remove( "!_P_!" ); - - return ret; -} - -int Address::findBalancedBracket( const TQString &tsection, int pos ) const -{ - int balancecounter = 0; - for( unsigned int i = pos + 1; i < tsection.length(); i++ ) { - if ( ')' == tsection[i] && 0 == balancecounter ) { - // found end of brackets - return i; - } else - if ( '(' == tsection[i] ) { - // nested brackets - balancecounter++; - } - } - return -1; -} - -TQString Address::countryToISO( const TQString &cname ) -{ - // we search a map file for translations from country names to - // iso codes, storing caching things in a TQMap for faster future - // access. - if ( !mISOMap ) - isoMapDeleter.setObject( mISOMap, new TQMap<TQString, TQString>() ); - - TQMap<TQString, TQString>::ConstIterator it; - it = mISOMap->find( cname ); - if ( it != mISOMap->end() ) - return it.data(); - - TQString mapfile = TDEGlobal::dirs()->findResource( "data", - TQString::fromLatin1( "kabc/countrytransl.map" ) ); - - TQFile file( mapfile ); - if ( file.open( IO_ReadOnly ) ) { - TQTextStream s( &file ); - TQString strbuf = s.readLine(); - while( !strbuf.isEmpty() ) { - TQStringList countryInfo = TQStringList::split( '\t', strbuf, true ); - if ( countryInfo[ 0 ] == cname ) { - file.close(); - mISOMap->insert( cname, countryInfo[ 1 ] ); - return countryInfo[ 1 ]; - } - strbuf = s.readLine(); - } - file.close(); - } - - // fall back to system country - mISOMap->insert( cname, TDEGlobal::locale()->country() ); - return TDEGlobal::locale()->country(); -} - -TQString Address::ISOtoCountry( const TQString &ISOname ) -{ - // get country name from ISO country code (e.g. "no" -> i18n("Norway")) - if ( ISOname.simplifyWhiteSpace().isEmpty() ) - return TQString::null; - - TQString mapfile = TDEGlobal::dirs()->findResource( "data", - TQString::fromLatin1( "kabc/countrytransl.map" ) ); - - TQFile file( mapfile ); - if ( file.open( IO_ReadOnly ) ) { - TQTextStream s( &file ); - TQString searchStr = "\t" + ISOname.simplifyWhiteSpace().lower(); - TQString strbuf = s.readLine(); - int pos; - while ( !strbuf.isEmpty() ) { - if ( (pos = strbuf.find( searchStr )) != -1 ) { - file.close(); - return i18n( strbuf.left( pos ).utf8() ); - } - strbuf = s.readLine(); - } - file.close(); - } - - return ISOname; -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Address &addr ) -{ - return s << addr.mId << addr.mType << addr.mPostOfficeBox << - addr.mExtended << addr.mStreet << addr.mLocality << - addr.mRegion << addr.mPostalCode << addr.mCountry << - addr.mLabel; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Address &addr ) -{ - s >> addr.mId >> addr.mType >> addr.mPostOfficeBox >> addr.mExtended >> - addr.mStreet >> addr.mLocality >> addr.mRegion >> - addr.mPostalCode >> addr.mCountry >> addr.mLabel; - - addr.mEmpty = false; - - return s; -} diff --git a/kabc/address.h b/kabc/address.h deleted file mode 100644 index b4165a098..000000000 --- a/kabc/address.h +++ /dev/null @@ -1,341 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_ADDRESS_H -#define KABC_ADDRESS_H - -#include <tqmap.h> -#include <tqstring.h> -#include <tqvaluelist.h> - -#include <tdelibs_export.h> - -// template tags for address formatting localization -#define KABC_FMTTAG_realname TQString("%n") -#define KABC_FMTTAG_REALNAME TQString("%N") -#define KABC_FMTTAG_company TQString("%cm") -#define KABC_FMTTAG_COMPANY TQString("%CM") -#define KABC_FMTTAG_pobox TQString("%p") -#define KABC_FMTTAG_street TQString("%s") -#define KABC_FMTTAG_STREET TQString("%S") -#define KABC_FMTTAG_zipcode TQString("%z") -#define KABC_FMTTAG_location TQString("%l") -#define KABC_FMTTAG_LOCATION TQString("%L") -#define KABC_FMTTAG_region TQString("%r") -#define KABC_FMTTAG_REGION TQString("%R") -#define KABC_FMTTAG_newline TQString("\\n") -#define KABC_FMTTAG_condcomma TQString("%,") -#define KABC_FMTTAG_condwhite TQString("%w") -#define KABC_FMTTAG_purgeempty TQString("%0") - -namespace KABC { - -/** - @short Postal address information. - - This class represents information about a postal address. -*/ -class KABC_EXPORT Address -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Address & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Address & ); - - public: - /** - List of addresses. - */ - typedef TQValueList<Address> List; - typedef TQValueList<int> TypeList; - - /** - Address types: - - @li @p Dom - domestic - @li @p Intl - international - @li @p Postal - postal - @li @p Parcel - parcel - @li @p Home - home address - @li @p Work - address at work - @li @p Pref - preferred address - */ - enum Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32, - Pref = 64 }; - - /** - Constructor that creates an empty Address, which is initialized - with a unique id (see id()). - */ - Address(); - - /** - This is like Address() just above, with the difference - that you can specify the type. - */ - Address( int ); - - bool operator==( const Address & ) const; - bool operator!=( const Address & ) const; - - /** - Returns true, if the address is empty. - */ - bool isEmpty() const; - - /** - Clears all entries of the address. - */ - void clear(); - - /** - Sets the unique id. - */ - void setId( const TQString & ); - - /* - Returns the unique id. - */ - TQString id() const; - - /** - Sets the type of address. See enum for definiton of types. - - @param type type, can be a bitwise or of multiple types. - */ - void setType( int type ); - - /** - Returns the type of address. Can be a bitwise or of multiple types. - */ - int type() const; - - /** - Returns a translated string of all types the address has. - */ - TQString typeLabel() const; - - /** - Sets the post office box. - */ - void setPostOfficeBox( const TQString & ); - - /** - Returns the post office box. - */ - TQString postOfficeBox() const; - - /** - Returns the translated label for post office box field. - */ - static TQString postOfficeBoxLabel(); - - /** - Sets the extended address information. - */ - void setExtended( const TQString & ); - - /** - Returns the extended address information. - */ - TQString extended() const; - - /** - Returns the translated label for extended field. - */ - static TQString extendedLabel(); - - /** - Sets the street (including number). - */ - void setStreet( const TQString & ); - - /** - Returns the street. - */ - TQString street() const; - - /** - Returns the translated label for street field. - */ - static TQString streetLabel(); - - /** - Sets the locality, e.g. city. - */ - void setLocality( const TQString & ); - - /** - Returns the locality. - */ - TQString locality() const; - - /** - Returns the translated label for locality field. - */ - static TQString localityLabel(); - - /** - Sets the region, e.g. state. - */ - void setRegion( const TQString & ); - - /** - Returns the region. - */ - TQString region() const; - - /** - Returns the translated label for region field. - */ - static TQString regionLabel(); - - /** - Sets the postal code. - */ - void setPostalCode( const TQString & ); - - /** - Returns the postal code. - */ - TQString postalCode() const; - - /** - Returns the translated label for postal code field. - */ - static TQString postalCodeLabel(); - - /** - Sets the country. - */ - void setCountry( const TQString & ); - - /** - Returns the country. - */ - TQString country() const; - - /** - Returns the translated label for country field. - */ - static TQString countryLabel(); - - /** - Sets the delivery label. This is the literal text to be used as label. - */ - void setLabel( const TQString & ); - - /** - Returns the delivery label. - */ - TQString label() const; - - /** - Returns the translated label for delivery label field. - */ - static TQString labelLabel(); - - /** - Returns the list of available types. - */ - static TypeList typeList(); - - /** - Returns the translated label for a special type. - */ - static TQString typeLabel( int type ); - - /** - Used for debug output. - */ - void dump() const; - - /** - Returns this address formatted according to the country-specific - address formatting rules. The formatting rules applied depend on - either the addresses {@link #country country} field, or (if the - latter is empty) on the system country setting. If companyName is - provided, an available business address format will be preferred. - - @param realName the formatted name of the contact - @param orgaName the name of the organization or company - @return the formatted address (containing newline characters) - */ - TQString formattedAddress( const TQString &realName=TQString::null - , const TQString &orgaName=TQString::null ) const; - - /** - Returns ISO code for a localized country name. Only localized country - names will be understood. This might be replaced by a TDELocale method in - the future. - @param cname name of the country - @return two digit ISO code - */ - static TQString countryToISO( const TQString &cname ); - - /** - Returns a localized country name for a ISO code. - This might be replaced by a TDELocale method in the future. - @param ISOname two digit ISO code - @return localized name of the country - @since 3.2 - */ - static TQString ISOtoCountry( const TQString &ISOname ); - - private: - /** - Parses a snippet of an address template - @param tsection the template string to be parsed - @param result TQString reference in which the result will be stored - @return true if at least one tag evaluated positively, else false - */ - bool parseAddressTemplateSection( const TQString &tsection - , TQString &result - , const TQString &realName - , const TQString &orgaName ) const; - - /** - Finds the balanced closing bracket starting from the opening bracket at - pos in tsection. - @return position of closing bracket, -1 for unbalanced brackets - */ - int findBalancedBracket( const TQString &tsection, int pos ) const; - - bool mEmpty; - - TQString mId; - int mType; - - TQString mPostOfficeBox; - TQString mExtended; - TQString mStreet; - TQString mLocality; - TQString mRegion; - TQString mPostalCode; - TQString mCountry; - TQString mLabel; - - static TQMap<TQString, TQString> *mISOMap; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Address & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Address & ); - -} - -#endif diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp deleted file mode 100644 index 8e1eca333..000000000 --- a/kabc/addressbook.cpp +++ /dev/null @@ -1,842 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> -#include <tqregexp.h> -#include <tqtimer.h> - -#include <tdeapplication.h> -#include <kdebug.h> -#include <kglobal.h> -#include <kinstance.h> -#include <klocale.h> -#include <kstandarddirs.h> - -#include "errorhandler.h" -#include "resource.h" - -#include "addressbook.h" -#include "addressbook.moc" - -using namespace KABC; - -struct AddressBook::AddressBookData -{ - Field::List mAllFields; - ErrorHandler *mErrorHandler; - TDEConfig *mConfig; - KRES::Manager<Resource> *mManager; - TQPtrList<Resource> mPendingLoadResources; - TQPtrList<Resource> mPendingSaveResources; - Iterator end; -}; - -struct AddressBook::Iterator::IteratorData -{ - Resource::Iterator mIt; - TQValueList<Resource*> mResources; - int mCurrRes; -}; - -struct AddressBook::ConstIterator::ConstIteratorData -{ - Resource::ConstIterator mIt; - TQValueList<Resource*> mResources; - int mCurrRes; -}; - -AddressBook::Iterator::Iterator() - : d( new IteratorData ) -{ -} - -AddressBook::Iterator::Iterator( const AddressBook::Iterator &i ) - : d( new IteratorData ) -{ - d->mIt = i.d->mIt; - d->mResources = i.d->mResources; - d->mCurrRes = i.d->mCurrRes; -} - -AddressBook::Iterator &AddressBook::Iterator::operator=( const AddressBook::Iterator &i ) -{ - if ( this == &i ) - return *this; // guard against self assignment - - delete d; // delete the old data the Iterator was completely constructed before - d = new IteratorData; - d->mIt = i.d->mIt; - d->mResources = i.d->mResources; - d->mCurrRes = i.d->mCurrRes; - - return *this; -} - -AddressBook::Iterator::~Iterator() -{ - delete d; - d = 0; -} - -const Addressee &AddressBook::Iterator::operator*() const -{ - return *(d->mIt); -} - -Addressee &AddressBook::Iterator::operator*() -{ - return *(d->mIt); -} - -Addressee *AddressBook::Iterator::operator->() -{ - return &(*(d->mIt)); -} - -AddressBook::Iterator &AddressBook::Iterator::operator++() -{ - do { - bool jumped = false; - while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource - if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { - return *this; - } - - d->mCurrRes++; // jump to next resource - - jumped = true; - d->mIt = (d->mResources[ d->mCurrRes ])->begin(); - } - - if ( !jumped ) - (d->mIt)++; - - } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); - - return *this; -} - -AddressBook::Iterator &AddressBook::Iterator::operator++( int ) -{ - do { - bool jumped = false; - while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource - if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { - return *this; - } - - d->mCurrRes++; // jump to next resource - - jumped = true; - d->mIt = (d->mResources[ d->mCurrRes ])->begin(); - } - - if ( !jumped ) - (d->mIt)++; - - } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); - - return *this; -} - -AddressBook::Iterator &AddressBook::Iterator::operator--() -{ - (d->mIt)--; - - return *this; -} - -AddressBook::Iterator &AddressBook::Iterator::operator--( int ) -{ - (d->mIt)--; - - return *this; -} - -bool AddressBook::Iterator::operator==( const Iterator &it ) -{ - return ( d->mIt == it.d->mIt ); -} - -bool AddressBook::Iterator::operator!=( const Iterator &it ) -{ - return ( d->mIt != it.d->mIt ); -} - - -AddressBook::ConstIterator::ConstIterator() - : d( new ConstIteratorData ) -{ -} - -AddressBook::ConstIterator::ConstIterator( const AddressBook::ConstIterator &i ) - : d( new ConstIteratorData ) -{ - d->mIt = i.d->mIt; - d->mResources = i.d->mResources; - d->mCurrRes = i.d->mCurrRes; -} - -AddressBook::ConstIterator::ConstIterator( const AddressBook::Iterator &i ) -{ - d = new ConstIteratorData; - d->mIt = i.d->mIt; - d->mResources = i.d->mResources; - d->mCurrRes = i.d->mCurrRes; -} - -AddressBook::ConstIterator &AddressBook::ConstIterator::operator=( const AddressBook::ConstIterator &i ) -{ - if ( this == &i ) - return *this; // guard for self assignment - - delete d; // delete the old data because the Iterator was really constructed before - d = new ConstIteratorData; - d->mIt = i.d->mIt; - d->mResources = i.d->mResources; - d->mCurrRes = i.d->mCurrRes; - - return *this; -} - -AddressBook::ConstIterator::~ConstIterator() -{ - delete d; - d = 0; -} - -const Addressee &AddressBook::ConstIterator::operator*() const -{ - return *(d->mIt); -} - -const Addressee* AddressBook::ConstIterator::operator->() const -{ - return &(*(d->mIt)); -} - -AddressBook::ConstIterator &AddressBook::ConstIterator::operator++() -{ - do { - bool jumped = false; - while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource - if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { - return *this; - } - - d->mCurrRes++; // jump to next resource - - jumped = true; - d->mIt = (d->mResources[ d->mCurrRes ])->begin(); - } - - if ( !jumped ) - (d->mIt)++; - - } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); - - return *this; -} - -AddressBook::ConstIterator &AddressBook::ConstIterator::operator++(int) -{ - do { - bool jumped = false; - while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource - if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { - return *this; - } - - d->mCurrRes++; // jump to next resource - - jumped = true; - d->mIt = (d->mResources[ d->mCurrRes ])->begin(); - } - - if ( !jumped ) - (d->mIt)++; - - } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); - - return *this; -} - -AddressBook::ConstIterator &AddressBook::ConstIterator::operator--() -{ - (d->mIt)--; - return *this; -} - -AddressBook::ConstIterator &AddressBook::ConstIterator::operator--(int) -{ - (d->mIt)--; - return *this; -} - -bool AddressBook::ConstIterator::operator==( const ConstIterator &it ) -{ - return ( d->mIt == it.d->mIt ); -} - -bool AddressBook::ConstIterator::operator!=( const ConstIterator &it ) -{ - return ( d->mIt != it.d->mIt ); -} - - -AddressBook::AddressBook() - : d( new AddressBookData ) -{ - d->mErrorHandler = 0; - d->mConfig = 0; - d->mManager = new KRES::Manager<Resource>( "contact" ); - d->end.d->mResources = TQValueList<Resource*>(); - d->end.d->mCurrRes = -1; -} - -AddressBook::AddressBook( const TQString &config ) - : d( new AddressBookData ) -{ - d->mErrorHandler = 0; - if ( config.isEmpty() ) - d->mConfig = 0; - else - d->mConfig = new TDEConfig( config ); - d->mManager = new KRES::Manager<Resource>( "contact" ); - d->mManager->readConfig( d->mConfig ); - d->end.d->mResources = TQValueList<Resource*>(); - d->end.d->mCurrRes = -1; -} - -AddressBook::~AddressBook() -{ - delete d->mManager; d->mManager = 0; - delete d->mConfig; d->mConfig = 0; - delete d->mErrorHandler; d->mErrorHandler = 0; - delete d; d = 0; -} - -bool AddressBook::load() -{ - kdDebug(5700) << "AddressBook::load()" << endl; - - clear(); - - KRES::Manager<Resource>::ActiveIterator it; - bool ok = true; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { - if ( !(*it)->load() ) { - error( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) ); - ok = false; - } - } - - return ok; -} - -bool AddressBook::asyncLoad() -{ - kdDebug(5700) << "AddressBook::asyncLoad()" << endl; - - clear(); - - KRES::Manager<Resource>::ActiveIterator it; - bool ok = true; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { - d->mPendingLoadResources.append( *it ); - if ( !(*it)->asyncLoad() ) { - error( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) ); - ok = false; - } - } - - return ok; -} - -bool AddressBook::save( Ticket *ticket ) -{ - kdDebug(5700) << "AddressBook::save()"<< endl; - - if ( ticket->resource() ) { - deleteRemovedAddressees(); - bool ok = ticket->resource()->save( ticket ); - if ( ok ) ticket->resource()->releaseSaveTicket( ticket ); - return ok; - } - - return false; -} - -bool AddressBook::asyncSave( Ticket *ticket ) -{ - kdDebug(5700) << "AddressBook::asyncSave()"<< endl; - - if ( ticket->resource() ) { - d->mPendingSaveResources.append( ticket->resource() ); - bool ok = ticket->resource()->asyncSave( ticket ); - if ( ok ) ticket->resource()->releaseSaveTicket( ticket ); - return ok; - } - - return false; -} - -AddressBook::Iterator AddressBook::begin() -{ - TQValueList<Resource*> list; - KRES::Manager<Resource>::ActiveIterator resIt; - for ( resIt = d->mManager->activeBegin(); resIt != d->mManager->activeEnd(); ++resIt ) - list.append( *resIt ); - - if ( list.count() == 0 ) - return end(); - - Iterator it = Iterator(); - it.d->mResources = list; - it.d->mCurrRes = 0; - it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); - - while ( it.d->mIt == (it.d->mResources[ it.d->mCurrRes ])->end() ) { - if ( (uint)it.d->mCurrRes == it.d->mResources.count() - 1 ) - return end(); - - it.d->mCurrRes++; - - it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); - } - - return it; -} - -AddressBook::ConstIterator AddressBook::begin() const -{ - TQValueList<Resource*> list; - KRES::Manager<Resource>::ActiveIterator resIt; - for ( resIt = d->mManager->activeBegin(); resIt != d->mManager->activeEnd(); ++resIt ) - list.append( *resIt ); - - if ( list.count() == 0 ) - return end(); - - Iterator it = Iterator(); - it.d->mResources = list; - it.d->mCurrRes = 0; - it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); - - while ( it.d->mIt == (it.d->mResources[ it.d->mCurrRes ])->end() ) { - if ( (uint)it.d->mCurrRes == it.d->mResources.count() - 1 ) - return end(); - - it.d->mCurrRes++; - - it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); - } - - return it; -} - -AddressBook::Iterator AddressBook::end() -{ - KRES::Manager<Resource>::ActiveIterator resIt = d->mManager->activeEnd(); - - if ( resIt == d->mManager->activeBegin() || ! *(--resIt) ) { // no resource available - d->end.d->mIt = Resource::Iterator(); - } else { - d->end.d->mIt = (*resIt)->end(); - } - - return d->end; -} - -AddressBook::ConstIterator AddressBook::end() const -{ - KRES::Manager<Resource>::ActiveIterator resIt = d->mManager->activeEnd(); - - if ( resIt == d->mManager->activeBegin() || ! *(--resIt) ) { // no resource available - d->end.d->mIt = Resource::Iterator(); - } else { - d->end.d->mIt = (*resIt)->end(); - } - - return d->end; -} - -void AddressBook::clear() -{ - KRES::Manager<Resource>::ActiveIterator it; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) - (*it)->clear(); -} - -Ticket *AddressBook::requestSaveTicket( Resource *resource ) -{ - kdDebug(5700) << "AddressBook::requestSaveTicket()" << endl; - - if ( !resource ) - resource = standardResource(); - - KRES::Manager<Resource>::ActiveIterator it; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { - if ( (*it) == resource ) { - if ( (*it)->readOnly() || !(*it)->isOpen() ) - return 0; - else - return (*it)->requestSaveTicket(); - } - } - - return 0; -} - -void AddressBook::releaseSaveTicket( Ticket *ticket ) -{ - if ( !ticket ) - return; - - if ( ticket->resource() ) { - ticket->resource()->releaseSaveTicket( ticket ); - } -} - -void AddressBook::insertAddressee( const Addressee &a ) -{ - Resource *resource = a.resource(); - if ( resource == 0 ) - resource = standardResource(); - - Resource::Iterator it; - Addressee fAddr = resource->findByUid( a.uid() ); - - Addressee addr( a ); - if ( !fAddr.isEmpty() ) { - if ( fAddr != a ) - addr.setRevision( TQDateTime::currentDateTime() ); - else { - if ( fAddr.resource() == 0 ) { - fAddr.setResource( resource ); - //NOTE: Should we have setChanged( true ) here? - resource->insertAddressee( fAddr ); - } - return; - } - } - - addr.setResource( resource ); - addr.setChanged( true ); - resource->insertAddressee( addr ); -} - -void AddressBook::removeAddressee( const Addressee &a ) -{ - if ( a.resource() ) - a.resource()->removeAddressee( a ); -} - -void AddressBook::removeAddressee( const Iterator &it ) -{ - if ( (*it).resource() ) - (*it).resource()->removeAddressee( *it ); -} - -AddressBook::Iterator AddressBook::find( const Addressee &a ) -{ - Iterator it; - for ( it = begin(); it != end(); ++it ) { - if ( a.uid() == (*it).uid() ) - return it; - } - - return end(); -} - -Addressee AddressBook::findByUid( const TQString &uid ) -{ - KRES::Manager<Resource>::ActiveIterator it; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { - Addressee addr = (*it)->findByUid( uid ); - if ( !addr.isEmpty() ) - return addr; - } - - return Addressee(); -} - -Addressee::List AddressBook::allAddressees() -{ - Addressee::List list; - - ConstIterator it; - for ( it = begin(); it != end(); ++it ) - list.append( *it ); - - return list; -} - -Addressee::List AddressBook::findByName( const TQString &name ) -{ - Addressee::List results; - - KRES::Manager<Resource>::ActiveIterator it; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) - results += (*it)->findByName( name ); - - return results; -} - -Addressee::List AddressBook::findByEmail( const TQString &email ) -{ - Addressee::List results; - - KRES::Manager<Resource>::ActiveIterator it; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) - results += (*it)->findByEmail( email ); - - return results; -} - -Addressee::List AddressBook::findByCategory( const TQString &category ) -{ - Addressee::List results; - - KRES::Manager<Resource>::ActiveIterator it; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) - results += (*it)->findByCategory( category ); - - return results; -} - -void AddressBook::dump() const -{ - kdDebug(5700) << "AddressBook::dump() --- begin ---" << endl; - - ConstIterator it; - for( it = begin(); it != end(); ++it ) { - (*it).dump(); - } - - kdDebug(5700) << "AddressBook::dump() --- end ---" << endl; -} - -TQString AddressBook::identifier() -{ - TQStringList identifier; - - - KRES::Manager<Resource>::ActiveIterator it; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { - if ( !(*it)->identifier().isEmpty() ) - identifier.append( (*it)->identifier() ); - } - - return identifier.join( ":" ); -} - -Field::List AddressBook::fields( int category ) -{ - if ( d->mAllFields.isEmpty() ) { - d->mAllFields = Field::allFields(); - } - - if ( category == Field::All ) return d->mAllFields; - - Field::List result; - Field::List::ConstIterator it; - for ( it = d->mAllFields.constBegin(); it != d->mAllFields.constEnd(); ++it ) { - if ( (*it)->category() & category ) - result.append( *it ); - } - - return result; -} - -bool AddressBook::addCustomField( const TQString &label, int category, - const TQString &key, const TQString &app ) -{ - if ( d->mAllFields.isEmpty() ) { - d->mAllFields = Field::allFields(); - } - - TQString a = app.isNull() ? TDEGlobal::instance()->instanceName() : app; - TQString k = key.isNull() ? label : key; - - Field *field = Field::createCustomField( label, category, k, a ); - - if ( !field ) return false; - - d->mAllFields.append( field ); - - return true; -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const AddressBook &ab ) -{ - if (!ab.d) return s; - - return s;// << ab.d->mAddressees; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, AddressBook &ab ) -{ - if (!ab.d) return s; - -// s >> ab.d->mAddressees; - - return s; -} - -bool AddressBook::addResource( Resource *resource ) -{ - if ( !resource->open() ) { - kdDebug(5700) << "AddressBook::addResource(): can't add resource" << endl; - return false; - } - - d->mManager->add( resource ); - resource->setAddressBook( this ); - - connect( resource, TQT_SIGNAL( loadingFinished( Resource* ) ), - this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); - connect( resource, TQT_SIGNAL( savingFinished( Resource* ) ), - this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); - - connect( resource, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), - this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); - connect( resource, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), - this, TQT_SLOT( resourceSavingError( Resource*, const TQString& ) ) ); - - return true; -} - -bool AddressBook::removeResource( Resource *resource ) -{ - resource->close(); - - if ( resource == standardResource() ) - d->mManager->setStandardResource( 0 ); - - resource->setAddressBook( 0 ); - - disconnect( resource, TQT_SIGNAL( loadingFinished( Resource* ) ), - this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); - disconnect( resource, TQT_SIGNAL( savingFinished( Resource* ) ), - this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); - - disconnect( resource, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), - this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); - disconnect( resource, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), - this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); - - d->mManager->remove( resource ); - - return true; -} - -TQPtrList<Resource> AddressBook::resources() -{ - TQPtrList<Resource> list; - - KRES::Manager<Resource>::ActiveIterator it; - for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { - if ( d->mManager->standardResource() == (*it) ) - list.prepend( *it ); - else - list.append( *it ); - } - - return list; -} - -void AddressBook::setErrorHandler( ErrorHandler *handler ) -{ - delete d->mErrorHandler; - d->mErrorHandler = handler; -} - -void AddressBook::error( const TQString& msg ) -{ - if ( !d->mErrorHandler ) // create default error handler - d->mErrorHandler = new ConsoleErrorHandler; - - if ( d->mErrorHandler ) - d->mErrorHandler->error( msg ); - else - kdError(5700) << "no error handler defined" << endl; -} - -void AddressBook::deleteRemovedAddressees() -{ - // no any longer needed -} - -void AddressBook::setStandardResource( Resource *resource ) -{ - d->mManager->setStandardResource( resource ); -} - -Resource *AddressBook::standardResource() -{ - return d->mManager->standardResource(); -} - -KRES::Manager<Resource> *AddressBook::resourceManager() -{ - return d->mManager; -} - -void AddressBook::cleanUp() -{ -} - -bool AddressBook::loadingHasFinished() const -{ - return d->mPendingLoadResources.isEmpty(); -} - -void AddressBook::resourceLoadingFinished( Resource *res ) -{ - d->mPendingLoadResources.remove( res ); - emit loadingFinished( res ); - - if ( d->mPendingLoadResources.count() == 0 ) - emit addressBookChanged( this ); -} - -void AddressBook::resourceSavingFinished( Resource *res ) -{ - d->mPendingSaveResources.remove( res ); - - emit savingFinished( res ); -} - -void AddressBook::resourceLoadingError( Resource *res, const TQString &errMsg ) -{ - error( errMsg ); - - d->mPendingLoadResources.remove( res ); - if ( d->mPendingLoadResources.count() == 0 ) - emit addressBookChanged( this ); -} - -void AddressBook::resourceSavingError( Resource *res, const TQString &errMsg ) -{ - error( errMsg ); - - d->mPendingSaveResources.remove( res ); -} diff --git a/kabc/addressbook.h b/kabc/addressbook.h deleted file mode 100644 index 8b87b6898..000000000 --- a/kabc/addressbook.h +++ /dev/null @@ -1,431 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_ADDRESSBOOK_H -#define KABC_ADDRESSBOOK_H - -#include <tqobject.h> -#include <tqptrlist.h> - -#include <tderesources/manager.h> - -#include "addressee.h" -#include "field.h" - -namespace KABC { - -class ErrorHandler; -class Resource; -class Ticket; - -/** - @short Address Book - - This class provides access to a collection of address book entries. - */ -class KABC_EXPORT AddressBook : public TQObject -{ - Q_OBJECT - - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const AddressBook & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, AddressBook & ); - friend class StdAddressBook; - - public: - /** - @short Address Book Iterator - - This class provides an iterator for address book entries. - */ - class KABC_EXPORT Iterator - { - public: - Iterator(); - Iterator( const Iterator & ); - ~Iterator(); - - Iterator &operator=( const Iterator & ); - const Addressee &operator*() const; - Addressee &operator*(); - Addressee* operator->(); - Iterator &operator++(); - Iterator &operator++(int); - Iterator &operator--(); - Iterator &operator--(int); - bool operator==( const Iterator &it ); - bool operator!=( const Iterator &it ); - - struct IteratorData; - IteratorData *d; - }; - - /** - @short Address Book Const Iterator - - This class provides a const iterator for address book entries. - */ - class KABC_EXPORT ConstIterator - { - public: - ConstIterator(); - ConstIterator( const ConstIterator & ); - ConstIterator( const Iterator & ); - ~ConstIterator(); - - ConstIterator &operator=( const ConstIterator & ); - const Addressee &operator*() const; - const Addressee* operator->() const; - ConstIterator &operator++(); - ConstIterator &operator++(int); - ConstIterator &operator--(); - ConstIterator &operator--(int); - bool operator==( const ConstIterator &it ); - bool operator!=( const ConstIterator &it ); - - struct ConstIteratorData; - ConstIteratorData *d; - }; - - /** - Constructs an address book object. - You have to add the resources manually before calling load(). - */ - AddressBook(); - - /** - Constructs an address book object. - The resources are loaded automatically. - - @param config The config file which contains the resource settings. - */ - AddressBook( const TQString &config ); - - /** - Destructor. - */ - virtual ~AddressBook(); - - /** - Requests a ticket for saving the addressbook. Calling this function locks - the addressbook for all other processes. You need the returned ticket - object for calling the save() function. - - @param resource A pointer to the resource which shall be locked. If 0, - the default resource is locked. - @return 0 if the resource is already locked or a valid save ticket - otherwise. - @see save() - */ - Ticket *requestSaveTicket( Resource *resource = 0 ); - - /** - Releases the ticket requested previously with requestSaveTicket(). - Call this function, if you want to release a ticket without saving. - */ - void releaseSaveTicket( Ticket *ticket ); - - /** - Loads all addressees synchronously. - - @return Whether the loading was successfully. - */ - bool load(); - - /** - Loads all addressees asynchronously. This function returns immediately - and emits the addressBookChanged() signal as soon as the loading has - finished. - - @return Whether the synchronous part of loading was successfully. - */ - bool asyncLoad(); - - /** - Saves all addressees of one resource synchronously. If the save is - successfull the ticket is deleted. - - @param ticket The ticket returned by requestSaveTicket(). - @return Whether the saving was successfully. - */ - bool save( Ticket *ticket ); - - /** - Saves all addressees of one resource asynchronously. If the save is - successfull the ticket is deleted. - - @param ticket The ticket returned by requestSaveTicket(). - @return Whether the synchronous part of saving was successfully. - */ - bool asyncSave( Ticket *ticket ); - - /** - Returns an iterator pointing to the first addressee of address book. - This iterator equals end() if the address book is empty. - */ - ConstIterator begin() const; - - /** - This is an overloaded member function, provided for convenience. It - behaves essentially like the above function. - */ - Iterator begin(); - - /** - Returns an iterator pointing to the last addressee of address book. - This iterator equals begin() if the address book is empty. - */ - ConstIterator end() const; - - /** - This is an overloaded member function, provided for convenience. It - behaves essentially like the above function. - */ - Iterator end(); - - - /** - Removes all addressees from the address book. - */ - void clear(); - - /** - Insert an addressee into the address book. If an addressee with the same - unique id already exists, it is replaced by the new one, otherwise it is - appended. - - @param addr The addressee which shall be insert. - */ - void insertAddressee( const Addressee &addr ); - - /** - Removes an addressee from the address book. - - @param addr The addressee which shall be removed. - */ - void removeAddressee( const Addressee &addr ); - - /** - This is an overloaded member function, provided for convenience. It - behaves essentially like the above function. - - @param it An iterator pointing to the addressee which shall be removed. - */ - void removeAddressee( const Iterator &it ); - - /** - Returns an iterator pointing to the specified addressee. It will return - end() if no addressee matched. - - @param addr The addresee you are looking for. - */ - Iterator find( const Addressee &addr ); // KDE4: const - - /** - Searches an addressee with the specified unique identifier. - - @param uid The unique identifier you are looking for. - @return The addressee with the specified unique identifier or an - empty addressee. - */ - Addressee findByUid( const TQString &uid ); // KDE4: const - - /** - Returns a list of all addressees in the address book. - */ - Addressee::List allAddressees(); // KDE4: const - - /** - Searches all addressees which match the specified name. - - @param name The name you are looking for. - @return A list of all matching addressees. - */ - Addressee::List findByName( const TQString &name ); // KDE4: const - - /** - Searches all addressees which match the specified email address. - - @param email The email address you are looking for. - @return A list of all matching addressees. - */ - Addressee::List findByEmail( const TQString &email ); // KDE4: const - - /** - Searches all addressees which belongs to the specified category. - - @param category The category you are looking for. - @return A list of all matching addressees. - */ - Addressee::List findByCategory( const TQString &category ); // KDE4: const - - /** - Returns a string identifying this addressbook. The identifier is - created by concatenation of the resource identifiers. - */ - virtual TQString identifier(); // KDE4: const - - /** - Returns a list of all Fields known to the address book which are associated - with the given field category. - */ - Field::List fields( int category = Field::All ); // KDE4: const - - /** - Add custom field to address book. - - @param label User visible label of the field. - @param category Ored list of field categories. - @param key Identifier used as key for reading and writing the field. - @param app String used as application key for reading and writing - the field. - */ - bool addCustomField( const TQString &label, int category = Field::All, - const TQString &key = TQString::null, - const TQString &app = TQString::null ); - - /** - Adds a resource to the address book. - - @param resource The resource you want to add. - @return Whether opening the resource was successfully. - */ - bool addResource( Resource *resource ); - - /** - Removes a resource from the address book. - - @param resource The resource you want to remove. - @return Whether closing the resource was successfully. - */ - bool removeResource( Resource *resource ); - - /** - Returns a list of all resources. - */ - TQPtrList<Resource> resources(); // KDE4: const - - /** - Sets the @p ErrorHandler, that is used by error() to - provide GUI independent error messages. - - @param errorHandler The error handler you want to use. - */ - void setErrorHandler( ErrorHandler *errorHandler ); - - /** - Shows GUI independent error messages. - - @param msg The error message that shall be displayed. - */ - void error( const TQString &msg ); - - /** - @deprecated There is no need to call this function anymore. - */ - void cleanUp() KDE_DEPRECATED; - - /** - Used for debug output. This function prints out the list - of all addressees to kdDebug(5700). - */ - void dump() const; - - /** - */ - void emitAddressBookLocked() { emit addressBookLocked( this ); } - void emitAddressBookUnlocked() { emit addressBookUnlocked( this ); } - void emitAddressBookChanged() { emit addressBookChanged( this ); } - - /** - Returns true when the loading of the addressbook has finished, - otherwise false. - - @since 3.5 - */ - bool loadingHasFinished() const; - - signals: - /** - Emitted when one of the resources discovered a change in its backend - or the asynchronous loading of all resources has finished. - You should connect to this signal to update the presentation of - the contact data in your application. - - @param addressBook The address book which emitted this signal. - */ - void addressBookChanged( AddressBook *addressBook ); - - /** - Emitted when one of the resources has been locked for writing. - - @param addressBook The address book which emitted this signal. - */ - void addressBookLocked( AddressBook *addressBook ); - - /** - Emitted when one of the resources has been unlocked. - You should connect to this signal if you want to save your changes - to a resource which is currently locked, and want to get notified when - saving is possible again. - - @param addressBook The address book which emitted this signal. - */ - void addressBookUnlocked( AddressBook *addressBook ); - - /** - Emitted when the asynchronous loading of one resource has finished - after calling asyncLoad(). - - @param resource The resource which emitted this signal. - */ - void loadingFinished( Resource *resource ); - - /** - Emitted when the asynchronous saving of one resource has finished - after calling asyncSave(). - - @param resource The resource which emitted this signal. - */ - void savingFinished( Resource *resource ); - - protected slots: - void resourceLoadingFinished( Resource* ); - void resourceSavingFinished( Resource* ); - void resourceLoadingError( Resource*, const TQString& ); - void resourceSavingError( Resource*, const TQString& ); - - protected: - void deleteRemovedAddressees(); - void setStandardResource( Resource* ); - Resource *standardResource(); - KRES::Manager<Resource> *resourceManager(); - - private: - TQPtrList<Resource> mDummy; // Remove in KDE 4 - struct AddressBookData; - AddressBookData *d; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const AddressBook & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, AddressBook & ); - -} - -#endif diff --git a/kabc/addresseedialog.cpp b/kabc/addresseedialog.cpp deleted file mode 100644 index c8a1bf51e..000000000 --- a/kabc/addresseedialog.cpp +++ /dev/null @@ -1,259 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqlayout.h> -#include <tqpushbutton.h> -#include <tqgroupbox.h> -#include <tqregexp.h> - -#include <klocale.h> -#include <kdebug.h> - -#include "stdaddressbook.h" - -#include "addresseedialog.h" -#include "addresseedialog.moc" - -using namespace KABC; - -AddresseeItem::AddresseeItem( TQListView *parent, const Addressee &addressee ) : - TQListViewItem( parent ), - mAddressee( addressee ) -{ - setText( Name, addressee.realName() ); - setText( Email, addressee.preferredEmail() ); -} - -TQString AddresseeItem::key( int column, bool ) const -{ - if (column == Email) { - TQString value = text(Email); - TQRegExp emailRe("<\\S*>"); - int match = emailRe.search(value); - if (match > -1) - value = value.mid(match + 1, emailRe.matchedLength() - 2); - - return value.lower(); - } - - return text(column).lower(); -} - -AddresseeDialog::AddresseeDialog( TQWidget *parent, bool multiple ) : - KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), - Ok|Cancel, Ok, parent ), mMultiple( multiple ) -{ - TQWidget *topWidget = plainPage(); - - TQBoxLayout *topLayout = new TQHBoxLayout( topWidget ); - TQBoxLayout *listLayout = new TQVBoxLayout; - topLayout->addLayout( listLayout ); - - mAddresseeList = new TDEListView( topWidget ); - mAddresseeList->addColumn( i18n("Name") ); - mAddresseeList->addColumn( i18n("Email") ); - mAddresseeList->setAllColumnsShowFocus( true ); - mAddresseeList->setFullWidth( true ); - listLayout->addWidget( mAddresseeList ); - connect( mAddresseeList, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), - TQT_SLOT( slotOk() ) ); - connect( mAddresseeList, TQT_SIGNAL( selectionChanged( TQListViewItem * ) ), - TQT_SLOT( updateEdit( TQListViewItem * ) ) ); - - mAddresseeEdit = new KLineEdit( topWidget ); - mAddresseeEdit->setCompletionMode( TDEGlobalSettings::CompletionAuto ); - connect( mAddresseeEdit->completionObject(), TQT_SIGNAL( match( const TQString & ) ), - TQT_SLOT( selectItem( const TQString & ) ) ); - mAddresseeEdit->setFocus(); - mAddresseeEdit->completionObject()->setIgnoreCase( true ); - listLayout->addWidget( mAddresseeEdit ); - - setInitialSize( TQSize( 450, 300 ) ); - - if ( mMultiple ) { - TQBoxLayout *selectedLayout = new TQVBoxLayout; - topLayout->addLayout( selectedLayout ); - topLayout->setSpacing( spacingHint() ); - - TQGroupBox *selectedGroup = new TQGroupBox( 1, Qt::Horizontal, i18n("Selected"), - topWidget ); - selectedLayout->addWidget( selectedGroup ); - - mSelectedList = new TDEListView( selectedGroup ); - mSelectedList->addColumn( i18n("Name") ); - mSelectedList->addColumn( i18n("Email") ); - mSelectedList->setAllColumnsShowFocus( true ); - mSelectedList->setFullWidth( true ); - connect( mSelectedList, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), - TQT_SLOT( removeSelected() ) ); - - TQPushButton *unselectButton = new TQPushButton( i18n("Unselect"), selectedGroup ); - connect ( unselectButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeSelected() ) ); - - connect( mAddresseeList, TQT_SIGNAL( clicked( TQListViewItem * ) ), - TQT_SLOT( addSelected( TQListViewItem * ) ) ); - - setInitialSize( TQSize( 650, 350 ) ); - } - - mAddressBook = StdAddressBook::self( true ); - connect( mAddressBook, TQT_SIGNAL( addressBookChanged( AddressBook* ) ), - TQT_SLOT( addressBookChanged() ) ); - connect( mAddressBook, TQT_SIGNAL( loadingFinished( Resource* ) ), - TQT_SLOT( addressBookChanged() ) ); - - loadAddressBook(); -} - -AddresseeDialog::~AddresseeDialog() -{ -} - -void AddresseeDialog::loadAddressBook() -{ - mAddresseeList->clear(); - mItemDict.clear(); - mAddresseeEdit->completionObject()->clear(); - - AddressBook::Iterator it; - for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { - AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); - addCompletionItem( (*it).realName(), item ); - addCompletionItem( (*it).preferredEmail(), item ); - } -} - -void AddresseeDialog::addCompletionItem( const TQString &str, TQListViewItem *item ) -{ - if ( str.isEmpty() ) return; - - mItemDict.insert( str, item ); - mAddresseeEdit->completionObject()->addItem( str ); -} - -void AddresseeDialog::selectItem( const TQString &str ) -{ - if ( str.isEmpty() ) return; - - TQListViewItem *item = mItemDict.find( str ); - if ( item ) { - mAddresseeList->blockSignals( true ); - mAddresseeList->setSelected( item, true ); - mAddresseeList->ensureItemVisible( item ); - mAddresseeList->blockSignals( false ); - } -} - -void AddresseeDialog::updateEdit( TQListViewItem *item ) -{ - mAddresseeEdit->setText( item->text( 0 ) ); - mAddresseeEdit->setSelection( 0, item->text( 0 ).length() ); -} - -void AddresseeDialog::addSelected( TQListViewItem *item ) -{ - AddresseeItem *addrItem = dynamic_cast<AddresseeItem *>( item ); - if ( !addrItem ) return; - - Addressee a = addrItem->addressee(); - - TQListViewItem *selectedItem = mSelectedDict.find( a.uid() ); - if ( !selectedItem ) { - selectedItem = new AddresseeItem( mSelectedList, a ); - mSelectedDict.insert( a.uid(), selectedItem ); - } -} - -void AddresseeDialog::removeSelected() -{ - TQListViewItem *item = mSelectedList->selectedItem(); - AddresseeItem *addrItem = dynamic_cast<AddresseeItem *>( item ); - if ( !addrItem ) return; - - mSelectedDict.remove( addrItem->addressee().uid() ); - delete addrItem; -} - -Addressee AddresseeDialog::addressee() -{ - AddresseeItem *aItem = 0; - - if ( mMultiple ) - aItem = dynamic_cast<AddresseeItem *>( mSelectedList->firstChild() ); - else - aItem = dynamic_cast<AddresseeItem *>( mAddresseeList->selectedItem() ); - - if (aItem) return aItem->addressee(); - return Addressee(); -} - -Addressee::List AddresseeDialog::addressees() -{ - Addressee::List al; - AddresseeItem *aItem = 0; - - if ( mMultiple ) { - TQListViewItem *item = mSelectedList->firstChild(); - while( item ) { - aItem = dynamic_cast<AddresseeItem *>( item ); - if ( aItem ) al.append( aItem->addressee() ); - item = item->nextSibling(); - } - } - else - { - aItem = dynamic_cast<AddresseeItem *>( mAddresseeList->selectedItem() ); - if (aItem) al.append( aItem->addressee() ); - } - - return al; -} - -Addressee AddresseeDialog::getAddressee( TQWidget *parent ) -{ - AddresseeDialog *dlg = new AddresseeDialog( parent ); - Addressee addressee; - int result = dlg->exec(); - - if ( result == TQDialog::Accepted ) { - addressee = dlg->addressee(); - } - - delete dlg; - return addressee; -} - -Addressee::List AddresseeDialog::getAddressees( TQWidget *parent ) -{ - AddresseeDialog *dlg = new AddresseeDialog( parent, true ); - Addressee::List addressees; - int result = dlg->exec(); - if ( result == TQDialog::Accepted ) { - addressees = dlg->addressees(); - } - - delete dlg; - return addressees; -} - -void AddresseeDialog::addressBookChanged() -{ - loadAddressBook(); -} diff --git a/kabc/addresseedialog.h b/kabc/addresseedialog.h deleted file mode 100644 index 74470d1b4..000000000 --- a/kabc/addresseedialog.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_ADDRESSEEDIALOG_H -#define KABC_ADDRESSEEDIALOG_H - -#include <tqdict.h> - -#include <kdialogbase.h> -#include <klineedit.h> -#include <tdelistview.h> - -#include "addressbook.h" - -namespace KABC { - -/** - @short Special ListViewItem, that is used by the AddresseeDialog. -*/ -class KABC_EXPORT AddresseeItem : public TQListViewItem -{ - public: - - /** - Type of column - @li @p Name - Name in Addressee - @li @p Email - Email in Addressee - */ - enum columns { Name = 0, Email = 1 }; - - /** - Constructor. - - @param parent The parent listview. - @param addressee The associated addressee. - */ - AddresseeItem( TQListView *parent, const Addressee &addressee ); - - /** - Returns the addressee. - */ - Addressee addressee() const { return mAddressee; } - - /** - Method used by TQListView to sort the items. - */ - virtual TQString key( int column, bool ascending ) const; - - private: - Addressee mAddressee; -}; - -/** - @short Dialog for selecting address book entries. - - This class provides a dialog for selecting entries from the standard KDE - address book. Use the getAddressee() function to open a modal dialog, - returning an address book entry. - - In the dialog you can select an entry from the list with the mouse or type in - the first letters of the name or email address you are searching for. The - entry matching best is automatically selected. Use double click, pressing - return or pressing the ok button to return the selected addressee to the - application. -*/ -class KABC_EXPORT AddresseeDialog : public KDialogBase -{ - Q_OBJECT - - public: - /** - Construct addressbook entry select dialog. - - @param parent parent widget - @param multiple if true, indicates a multiple selection. - */ - AddresseeDialog( TQWidget *parent=0, bool multiple=false ); - - /** - Destructor. - */ - virtual ~AddresseeDialog(); - - /** - Return the address chosen. - - If it is a multiple select, this will return only the first address chosen - */ - Addressee addressee(); - - /** - Return the list of addresses chosen - */ - Addressee::List addressees(); - - /** - Select a single address book entry. - - Open addressee select dialog and return the entry selected by the user. - If the user doesn't select an entry or presses cancel, the returned - addressee is empty. - */ - static Addressee getAddressee( TQWidget *parent ); - - /** - Select multiple address book entries. - - Open addressee select dialog and return the entries selected by the user. - If the user doesn't select an entry or presses cancel, the returned - addressee list is empty. - */ - static Addressee::List getAddressees( TQWidget *parent ); - - private slots: - void selectItem( const TQString & ); - void updateEdit( TQListViewItem *item ); - void addSelected( TQListViewItem *item ); - void removeSelected(); - - protected slots: - void addressBookChanged(); - - private: - void loadAddressBook(); - void addCompletionItem( const TQString &str, TQListViewItem *item ); - - bool mMultiple; - - TDEListView *mAddresseeList; - KLineEdit *mAddresseeEdit; - - TDEListView *mSelectedList; - - AddressBook *mAddressBook; - - TQDict<TQListViewItem> mItemDict; - TQDict<TQListViewItem> mSelectedDict; - - class AddresseeDialogPrivate; - AddresseeDialogPrivate *d; -}; - -} -#endif diff --git a/kabc/addresseehelper.cpp b/kabc/addresseehelper.cpp deleted file mode 100644 index 5b8998852..000000000 --- a/kabc/addresseehelper.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - This file is part of the KDE libraries - Copyright (C) 2003 Carsten Pfeiffer <pfeiffer@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, version 2. - - 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 <tqapplication.h> - -#include <tdeconfig.h> -#include <klocale.h> - -#include "addresseehelper.h" - -using namespace KABC; - -AddresseeHelper * AddresseeHelper::s_self; - -// static -AddresseeHelper *AddresseeHelper::self() -{ - if ( !s_self ) - s_self = new AddresseeHelper(); - - return s_self; -} - -AddresseeHelper::AddresseeHelper() - : TQObject( tqApp ), - DCOPObject( "KABC::AddresseeHelper" ) -{ - initSettings(); - - connectDCOPSignal( "kaddressbook", "KABC::AddressBookConfig", - "changed()", "initSettings()", false ); -} - -// static -void AddresseeHelper::addToSet( const TQStringList& list, - std::set<TQString>& container ) -{ - TQStringList::ConstIterator it; - for ( it = list.begin(); it != list.end(); ++it ) { - if ( !(*it).isEmpty() ) - container.insert( *it ); - } -} - -void AddresseeHelper::initSettings() -{ - mTitles.clear(); - mSuffixes.clear(); - mPrefixes.clear(); - - mTitles.insert( i18n( "Dr." ) ); - mTitles.insert( i18n( "Miss" ) ); - mTitles.insert( i18n( "Mr." ) ); - mTitles.insert( i18n( "Mrs." ) ); - mTitles.insert( i18n( "Ms." ) ); - mTitles.insert( i18n( "Prof." ) ); - - mSuffixes.insert( i18n( "I" ) ); - mSuffixes.insert( i18n( "II" ) ); - mSuffixes.insert( i18n( "III" ) ); - mSuffixes.insert( i18n( "Jr." ) ); - mSuffixes.insert( i18n( "Sr." ) ); - - mPrefixes.insert( "van" ); - mPrefixes.insert( "von" ); - mPrefixes.insert( "de" ); - - TDEConfig config( "kabcrc", true, false ); // readonly, no kdeglobals - config.setGroup( "General" ); - - addToSet( config.readListEntry( "Prefixes" ), mTitles ); - addToSet( config.readListEntry( "Inclusions" ), mPrefixes ); - addToSet( config.readListEntry( "Suffixes" ), mSuffixes ); - mTradeAsFamilyName = config.readBoolEntry( "TradeAsFamilyName", true ); -} - -bool AddresseeHelper::containsTitle( const TQString& title ) const -{ - return mTitles.find( title ) != mTitles.end(); -} - -bool AddresseeHelper::containsPrefix( const TQString& prefix ) const -{ - return mPrefixes.find( prefix ) != mPrefixes.end(); -} - -bool AddresseeHelper::containsSuffix( const TQString& suffix ) const -{ - return mSuffixes.find( suffix ) != mSuffixes.end(); -} - -bool AddresseeHelper::tradeAsFamilyName() const -{ - return mTradeAsFamilyName; -} diff --git a/kabc/addresseehelper.h b/kabc/addresseehelper.h deleted file mode 100644 index 5280e6b2d..000000000 --- a/kabc/addresseehelper.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - This file is part of the KDE libraries - Copyright (C) 2003 Carsten Pfeiffer <pfeiffer@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, version 2. - - 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 KABC_ADDRESSEEHELPER_H -#define KABC_ADDRESSEEHELPER_H - -#include <tqobject.h> -#include <tqstringlist.h> - -#include <dcopobject.h> - -#include <set> - -/** - static data, shared by ALL addressee objects -*/ - -namespace KABC { - -class KABC_EXPORT AddresseeHelper : public TQObject, public DCOPObject -{ - K_DCOP - - public: - static AddresseeHelper *self(); - - bool containsTitle( const TQString& title ) const; - bool containsPrefix( const TQString& prefix ) const; - bool containsSuffix( const TQString& suffix ) const; - bool tradeAsFamilyName() const; - - k_dcop: - ASYNC initSettings(); - - private: - AddresseeHelper(); - - static void addToSet( const TQStringList& list, - std::set<TQString>& container ); - std::set<TQString> mTitles; - std::set<TQString> mPrefixes; - std::set<TQString> mSuffixes; - bool mTradeAsFamilyName; - - static AddresseeHelper *s_self; -}; - -} - -#endif diff --git a/kabc/addresseelist.cpp b/kabc/addresseelist.cpp deleted file mode 100644 index 47324001c..000000000 --- a/kabc/addresseelist.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Jost Schenck <jost@schenck.de> - 2003 Tobias Koenig <tokoe@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 <kdebug.h> - -#include "addresseelist.h" - -#include "field.h" -#include "sortmode.h" - -using namespace KABC; - -// -// -// Traits -// -// - -bool SortingTraits::Uid::eq( const Addressee &a1, const Addressee &a2 ) -{ - // locale awareness doesn't make sense sorting ids - return ( TQString::compare( a1.uid(), a2.uid() ) == 0 ); -} - -bool SortingTraits::Uid::lt( const Addressee &a1, const Addressee &a2 ) -{ - // locale awareness doesn't make sense sorting ids - return ( TQString::compare( a1.uid(), a2.uid() ) < 0 ); -} - -bool SortingTraits::Name::eq( const Addressee &a1, const Addressee &a2 ) -{ - return ( TQString::localeAwareCompare( a1.name(), a2.name() ) == 0 ); -} - -bool SortingTraits::Name::lt( const Addressee &a1, const Addressee &a2 ) -{ - return ( TQString::localeAwareCompare( a1.name(), a2.name() ) < 0 ); -} - -bool SortingTraits::FormattedName::eq( const Addressee &a1, const Addressee &a2 ) -{ - return ( TQString::localeAwareCompare( a1.formattedName(), a2.formattedName() ) == 0 ); -} - -bool SortingTraits::FormattedName::lt( const Addressee &a1, const Addressee &a2 ) -{ - return ( TQString::localeAwareCompare( a1.formattedName(), a2.formattedName() ) < 0 ); -} - -bool SortingTraits::FamilyName::eq( const Addressee &a1, const Addressee &a2 ) -{ - return ( TQString::localeAwareCompare( a1.familyName(), a2.familyName() ) == 0 - && TQString::localeAwareCompare( a1.givenName(), a2.givenName() ) == 0 ); -} - -bool SortingTraits::FamilyName::lt( const Addressee &a1, const Addressee &a2 ) -{ - int family = TQString::localeAwareCompare( a1.familyName(), a2.familyName() ); - if ( 0 == family ) { - return ( TQString::localeAwareCompare( a1.givenName(), a2.givenName() ) < 0 ); - } else { - return family < 0; - } -} - -bool SortingTraits::GivenName::eq( const Addressee &a1, const Addressee &a2 ) -{ - return ( TQString::localeAwareCompare( a1.givenName(), a2.givenName() ) == 0 - && TQString::localeAwareCompare( a1.familyName(), a2.familyName() ) == 0 ); -} - -bool SortingTraits::GivenName::lt( const Addressee &a1, const Addressee &a2 ) -{ - int given = TQString::localeAwareCompare( a1.givenName(), a2.givenName() ); - if ( 0 == given ) { - return ( TQString::localeAwareCompare( a1.familyName(), a2.familyName() ) < 0 ); - } else { - return given < 0; - } -} - -// -// -// AddresseeList -// -// - -static Field *sActiveField=0; - -AddresseeList::AddresseeList() - : TQValueList<Addressee>() -{ - mReverseSorting = false; - mActiveSortingCriterion = FormattedName; -} - -AddresseeList::~AddresseeList() -{ -} - -AddresseeList::AddresseeList( const AddresseeList &l ) - : TQValueList<Addressee>( l ) -{ - mReverseSorting = l.reverseSorting(); - mActiveSortingCriterion = l.sortingCriterion(); -} - -AddresseeList::AddresseeList( const TQValueList<Addressee> &l ) - : TQValueList<Addressee>( l ) -{ - mReverseSorting = false; -} - -void AddresseeList::dump() const -{ - kdDebug(5700) << "AddresseeList {" << endl; - kdDebug(5700) << "reverse order: " << ( mReverseSorting ? "true" : "false" ) << endl; - - TQString crit; - if ( Uid == mActiveSortingCriterion ) { - crit = "Uid"; - } else if ( Name == mActiveSortingCriterion ) { - crit = "Name"; - } else if ( FormattedName == mActiveSortingCriterion ) { - crit = "FormattedName"; - } else if ( FamilyName == mActiveSortingCriterion ) { - crit = "FamilyName"; - } else if ( GivenName == mActiveSortingCriterion ) { - crit = "GivenName"; - } else { - crit = "unknown -- update dump method"; - } - - kdDebug(5700) << "sorting criterion: " << crit << endl; - - for ( const_iterator it = begin(); it != end(); ++it ) { - (*it).dump(); - } - - kdDebug(5700) << "}" << endl; -} - -void AddresseeList::sortBy( SortingCriterion c ) -{ - mActiveSortingCriterion = c; - if ( Uid == c ) { - sortByTrait<SortingTraits::Uid>(); - } else if ( Name == c ) { - sortByTrait<SortingTraits::Name>(); - } else if ( FormattedName == c ) { - sortByTrait<SortingTraits::FormattedName>(); - } else if ( FamilyName == c ) { - sortByTrait<SortingTraits::FamilyName>(); - } else if ( GivenName==c ) { - sortByTrait<SortingTraits::GivenName>(); - } else { - kdError(5700) << "AddresseeList sorting criterion passed for which a trait is not known. No sorting done." << endl; - } -} - -void AddresseeList::sort() -{ - sortBy( mActiveSortingCriterion ); -} - -template<class Trait> -void AddresseeList::sortByTrait() -{ - // FIXME: better sorting algorithm, bubblesort is not acceptable for larger lists. - // - // for i := 1 to n - 1 - // do for j := 1 to n - i - // do if A[j] > A[j+1] - // then temp := A[j] - // A[j] := A[j + 1] - // A[j + 1 ] := temp - - iterator i1 = begin(); - iterator endIt = end(); - --endIt; - if ( i1 == endIt ) // don't need sorting - return; - - iterator i2 = endIt; - while( i1 != endIt ) { - iterator j1 = begin(); - iterator j2 = j1; - ++j2; - while( j1 != i2 ) { - if ( !mReverseSorting && Trait::lt( *j2, *j1 ) - || mReverseSorting && Trait::lt( *j1, *j2 ) ) { - tqSwap( *j1, *j2 ); - } - ++j1; - ++j2; - } - ++i1; - --i2; - } -} - -void AddresseeList::sortByField( Field *field ) -{ - if ( !field ) { - kdWarning(5700) << "sortByField called with no active sort field" << endl; - return; - } - - sActiveField = field; - - if ( count() == 0 ) - return; - - KABC::FieldSortMode *mode = new KABC::FieldSortMode( sActiveField, !mReverseSorting ); - - KABC::Addressee::setSortMode( mode ); - qHeapSort( *this ); - KABC::Addressee::setSortMode( 0 ); - - delete mode; -} - -void AddresseeList::sortByMode( SortMode *mode ) -{ - if ( count() == 0 ) - return; - - KABC::Addressee::setSortMode( mode ); - qHeapSort( *this ); - KABC::Addressee::setSortMode( 0 ); -} - -Field* -AddresseeList::sortingField() const -{ - return sActiveField; -} diff --git a/kabc/addresseelist.h b/kabc/addresseelist.h deleted file mode 100644 index 7c9df0275..000000000 --- a/kabc/addresseelist.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Jost Schenck <jost@schenck.de> - 2003 Tobias Koenig <tokoe@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 KABC_ADDRESSEELIST_H -#define KABC_ADDRESSEELIST_H - -#include <tqvaluelist.h> - -#include "addressee.h" - -namespace KABC { - -class Field; -class SortField; -class SortMode; - -/** - * Each trait must implement one static function for equality, one for "less - * than". Class name should be the field name. A trait does not necessarily - * have to stick to just one field: a trait sorting by family name can e.g. - * sort addressees with equal family name by given name. - * - * If you want to implement reverse sorting, you do not have to write another - * trait, as AddresseeList takes care of that. - */ -namespace SortingTraits -{ - -class KABC_EXPORT Uid -{ - public: - static bool eq( const Addressee &, const Addressee & ); - static bool lt( const Addressee &, const Addressee & ); -}; - -class KABC_EXPORT Name -{ - public: - static bool eq( const Addressee &, const Addressee & ); - static bool lt( const Addressee &, const Addressee & ); -}; - -class KABC_EXPORT FormattedName -{ - public: - static bool eq( const Addressee &, const Addressee & ); - static bool lt( const Addressee &, const Addressee & ); -}; - -class KABC_EXPORT FamilyName // fallback to given name -{ - public: - static bool eq( const Addressee &, const Addressee & ); - static bool lt( const Addressee &, const Addressee & ); -}; - -class KABC_EXPORT GivenName // fallback to family name -{ - public: - static bool eq( const Addressee &, const Addressee & ); - static bool lt( const Addressee &, const Addressee & ); -}; - -} - -/** - * Addressee attribute used for sorting. - */ -typedef enum { Uid, Name, FormattedName, FamilyName, GivenName } SortingCriterion; - -/** - * @short a TQValueList of Addressee, with sorting functionality - * - * This class extends the functionality of TQValueList with - * sorting methods specific to the Addressee class. It can be used - * just like any other TQValueList but is no template class. - * - * An AddresseeList does not automatically keep sorted when addressees - * are added or removed or the sorting order is changed, as this would - * slow down larger operations by sorting after every step. So after - * such operations you have to call {@link #sort} or {@link #sortBy} to - * create a defined order again. - * - * Iterator usage is inherited by TQValueList and extensively documented - * there. Please remember that the state of an iterator is undefined - * after any sorting operation. - * - * For the enumeration Type SortingCriterion, which specifies the - * field by the collection will be sorted, the following values exist: - * Uid, Name, FormattedName, FamilyName, GivenName. - * - * @author Jost Schenck jost@schenck.de - */ -class KABC_EXPORT AddresseeList : public TQValueList<Addressee> -{ - public: - AddresseeList(); - ~AddresseeList(); - AddresseeList( const AddresseeList & ); - AddresseeList( const TQValueList<Addressee> & ); - - /** - * Debug output. - */ - void dump() const; - - /** - * Determines the direction of sorting. On change, the list - * will <em>not</em> automatically be resorted. - * @param r <tt>true</tt> if sorting should be done reverse, <tt>false</tt> otherwise - */ - void setReverseSorting( bool r = true ) { mReverseSorting = r; } - - /** - * Returns the direction of sorting. - * @return <tt>true</tt> if sorting is done reverse, <tt>false</tt> otherwise - */ - bool reverseSorting() const { return mReverseSorting; } - - /** - * Sorts this list by a specific criterion. - * @param c the criterion by which should be sorted - */ - void sortBy( SortingCriterion c ); - - /** - * Sorts this list by a specific field. If no parameter is given, the - * last used Field object will be used. - * @param field pointer to the Field object to be sorted by - */ - void sortByField( Field *field = 0 ); - - /** - * Sorts this list by a specific sorting mode. - * @param mode pointer to the sorting mode object to be sorted by - * @since 3.4 - */ - void sortByMode( SortMode *mode = 0 ); - - /** - * Sorts this list by its active sorting criterion. This normally is the - * criterion of the last sortBy operation or <tt>FormattedName</tt> if up - * to now there has been no sortBy operation. - * - * Please note that the sorting trait of the last {@link #sortByTrait} - * method call is not remembered and thus the action can not be repeated - * by this method. - */ - void sort(); - - /** - * Templated sort function. You normally will not want to use this but - * {@link #sortBy} and {@link #sort} instead as the existing sorting - * criteria completely suffice for most cases. - * - * However, if you do want to use some special sorting criterion, you can - * write a trait class that will be provided to this templated method. - * This trait class has to have a class declaration like the following: - * \code - * class MySortingTrait { - * public: - * // eq returns true if a1 and a2 are equal - * static bool eq(KABC::Addressee a1, KABC::Addressee a2); - * // lt returns true is a1 is "less than" a2 - * static bool lt(KABC::Addressee a1, KABC::Addressee a2); - * }; - * \endcode - * You can then pass this class to the sortByTrait method like this: - * \code - * myAddresseelist.sortByTrait<MySortingTrait>(); - * \endcode - * Please note that the {@link #sort} method can not be used to repeat the - * sorting of the last <tt>sortByTrait</tt> action. - * - * Right now this method uses the bubble sort algorithm. This should be - * replaced for a better one when I have time. - */ - template<class Trait> void sortByTrait(); - - /** - * Returns the active sorting criterion, ie the sorting criterion that - * will be used by a {@link #sort} call. - */ - SortingCriterion sortingCriterion() const { return mActiveSortingCriterion; } - - /** - * Returns the active sorting field, ie a pointer to the Field object - * which was used for the last {@link #sortByField} operation. - * This function returns the last GLOBAL sorting field, not - * the class specific one. - * You're a lot better off by keeping track of this locally. - */ - Field* sortingField() const; - - private: - bool mReverseSorting; - SortingCriterion mActiveSortingCriterion; - //KDE 4.0 - add a d-pointer here! -}; - -} - -#endif diff --git a/kabc/addresslineedit.cpp b/kabc/addresslineedit.cpp deleted file mode 100644 index a61e7a5c9..000000000 --- a/kabc/addresslineedit.cpp +++ /dev/null @@ -1,610 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Helge Deller <deller@gmx.de> - 2002 Lubos Lunak <llunak@suse.cz> - 2001,2003 Carsten Pfeiffer <pfeiffer@kde.org> - 2001 Waldo Bastian <bastian@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. -*/ - -// $Id$ - -#include "addresslineedit.h" - -#include <tqapplication.h> -#include <tqobject.h> -#include <tqptrlist.h> -#include <tqregexp.h> -#include <tqevent.h> -#include <tqdragobject.h> - -#include <tdecompletionbox.h> -#include <tdeconfig.h> -#include <kcursor.h> -#include <kstandarddirs.h> -#include <kstaticdeleter.h> -#include <tdestdaccel.h> -#include <kurldrag.h> - -#include <kabc/stdaddressbook.h> -#include <kabc/distributionlist.h> -#include "ldapclient.h" - -#include <kdebug.h> - -//============================================================================= -// -// Class AddressLineEdit -// -//============================================================================= - - -using namespace KABC; - -TDECompletion * AddressLineEdit::s_completion = 0L; -bool AddressLineEdit::s_addressesDirty = false; -TQTimer* AddressLineEdit::s_LDAPTimer = 0L; -LdapSearch* AddressLineEdit::s_LDAPSearch = 0L; -TQString* AddressLineEdit::s_LDAPText = 0L; -AddressLineEdit* AddressLineEdit::s_LDAPLineEdit = 0L; -TDEConfig *AddressLineEdit::s_config = 0L; - -static KStaticDeleter<TDECompletion> completionDeleter; -static KStaticDeleter<TQTimer> ldapTimerDeleter; -static KStaticDeleter<LdapSearch> ldapSearchDeleter; -static KStaticDeleter<TQString> ldapTextDeleter; -static KStaticDeleter<TDEConfig> configDeleter; - -AddressLineEdit::AddressLineEdit(TQWidget* parent, - bool useCompletion, - const char *name) - : KLineEdit(parent,name) -{ - m_useCompletion = useCompletion; - m_completionInitialized = false; - m_smartPaste = false; - - init(); - - // Whenever a new AddressLineEdit is created (== a new composer is created), - // we set a dirty flag to reload the addresses upon the first completion. - // The address completions are shared between all AddressLineEdits. - // Is there a signal that tells us about addressbook updates? - if (m_useCompletion) - s_addressesDirty = true; -} - - -//----------------------------------------------------------------------------- -void AddressLineEdit::init() -{ - if ( !s_completion ) { - completionDeleter.setObject( s_completion, new TDECompletion() ); - s_completion->setOrder( TDECompletion::Sorted ); - s_completion->setIgnoreCase( true ); - } - - if( m_useCompletion ) { - if( !s_LDAPTimer ) { - ldapTimerDeleter.setObject( s_LDAPTimer, new TQTimer ); - ldapSearchDeleter.setObject( s_LDAPSearch, new LdapSearch ); - ldapTextDeleter.setObject( s_LDAPText, new TQString ); - } - connect( s_LDAPTimer, TQT_SIGNAL( timeout()), TQT_SLOT( slotStartLDAPLookup())); - connect( s_LDAPSearch, TQT_SIGNAL( searchData( const TQStringList& )), - TQT_SLOT( slotLDAPSearchData( const TQStringList& ))); - } - - if ( m_useCompletion && !m_completionInitialized ) - { - setCompletionObject( s_completion, false ); // we handle it ourself - connect( this, TQT_SIGNAL( completion(const TQString&)), - this, TQT_SLOT(slotCompletion() )); - - TDECompletionBox *box = completionBox(); - connect( box, TQT_SIGNAL( highlighted( const TQString& )), - this, TQT_SLOT( slotPopupCompletion( const TQString& ) )); - connect( box, TQT_SIGNAL( userCancelled( const TQString& )), - TQT_SLOT( userCancelled( const TQString& ))); - - m_completionInitialized = true; // don't connect muliple times. That's - // ugly, tho, better have completionBox() - // virtual in KDE 4 - // Why? This is only called once. Why should this be called more - // than once? And why was this protected? - } -} - -//----------------------------------------------------------------------------- -AddressLineEdit::~AddressLineEdit() -{ -} - -//----------------------------------------------------------------------------- - -TDEConfig* AddressLineEdit::config() -{ - if ( !s_config ) - configDeleter.setObject( s_config, new TDEConfig( "kabldaprc", false, false ) ); // Open read-write, no kdeglobals - - return s_config; -} - -void AddressLineEdit::setFont( const TQFont& font ) -{ - KLineEdit::setFont( font ); - if ( m_useCompletion ) - completionBox()->setFont( font ); -} - -//----------------------------------------------------------------------------- -void AddressLineEdit::keyPressEvent(TQKeyEvent *e) -{ - bool accept = false; - - if (TDEStdAccel::shortcut(TDEStdAccel::SubstringCompletion).contains(KKey(e))) - { - doCompletion(true); - accept = true; - } - else if (TDEStdAccel::shortcut(TDEStdAccel::TextCompletion).contains(KKey(e))) - { - int len = text().length(); - - if (len == cursorPosition()) // at End? - { - doCompletion(true); - accept = true; - } - } - - if( !accept ) - KLineEdit::keyPressEvent( e ); - - if( e->isAccepted()) - { - if( m_useCompletion && s_LDAPTimer != NULL ) - { - if( *s_LDAPText != text()) - stopLDAPLookup(); - *s_LDAPText = text(); - s_LDAPLineEdit = this; - s_LDAPTimer->start( 500, true ); - } - } -} - -void AddressLineEdit::mouseReleaseEvent( TQMouseEvent * e ) -{ - if (m_useCompletion && (e->button() == Qt::MidButton)) - { - m_smartPaste = true; - KLineEdit::mouseReleaseEvent(e); - m_smartPaste = false; - return; - } - KLineEdit::mouseReleaseEvent(e); -} - -void AddressLineEdit::insert(const TQString &t) -{ - if (!m_smartPaste) - { - KLineEdit::insert(t); - return; - } - TQString newText = t.stripWhiteSpace(); - if (newText.isEmpty()) - return; - - // remove newlines in the to-be-pasted string as well as an eventual - // mailto: protocol - newText.replace( TQRegExp("\r?\n"), ", " ); - if ( newText.startsWith( "mailto:" ) ) - { - KURL u(newText); - newText = u.path(); - } - else if (newText.find(" at ") != -1) - { - // Anti-spam stuff - newText.replace( " at ", "@" ); - newText.replace( " dot ", "." ); - } - else if (newText.find("(at)") != -1) - { - newText.replace( TQRegExp("\\s*\\(at\\)\\s*"), "@" ); - } - - TQString contents = text(); - int start_sel = 0; - int end_sel = 0; - int pos = cursorPosition(); - if (getSelection(&start_sel, &end_sel)) - { - // Cut away the selection. - if (pos > end_sel) - pos -= (end_sel - start_sel); - else if (pos > start_sel) - pos = start_sel; - contents = contents.left(start_sel) + contents.right(end_sel+1); - } - - int eot = contents.length(); - while ((eot > 0) && contents[eot-1].isSpace()) eot--; - if (eot == 0) - { - contents = TQString::null; - } - else if (pos >= eot) - { - if (contents[eot-1] == ',') - eot--; - contents.truncate(eot); - contents += ", "; - pos = eot+2; - } - - contents = contents.left(pos)+newText+contents.mid(pos); - setText(contents); - setCursorPosition(pos+newText.length()); -} - -void AddressLineEdit::paste() -{ - if (m_useCompletion) - m_smartPaste = true; - KLineEdit::paste(); - m_smartPaste = false; -} - -//----------------------------------------------------------------------------- -void AddressLineEdit::cursorAtEnd() -{ - setCursorPosition( text().length() ); -} - -//----------------------------------------------------------------------------- -void AddressLineEdit::enableCompletion(bool enable) -{ - m_useCompletion = enable; -} - -//----------------------------------------------------------------------------- -void AddressLineEdit::doCompletion(bool ctrlT) -{ - if ( !m_useCompletion ) - return; - - TQString prevAddr; - - TQString s(text()); - int n = s.findRev(','); - - if (n >= 0) - { - n++; // Go past the "," - - int len = s.length(); - - // Increment past any whitespace... - while( n < len && s[n].isSpace() ) - n++; - - prevAddr = s.left(n); - s = s.mid(n,255).stripWhiteSpace(); - } - - if ( s_addressesDirty ) - loadAddresses(); - - if ( ctrlT ) - { - TQStringList completions = s_completion->substringCompletion( s ); - if (completions.count() > 1) { - m_previousAddresses = prevAddr; - setCompletedItems( completions ); - } - else if (completions.count() == 1) - setText(prevAddr + completions.first()); - - cursorAtEnd(); - return; - } - - TDEGlobalSettings::Completion mode = completionMode(); - - switch ( mode ) - { - case TDEGlobalSettings::CompletionPopupAuto: - { - if (s.isEmpty()) - break; - } - case TDEGlobalSettings::CompletionPopup: - { - m_previousAddresses = prevAddr; - TQStringList items = s_completion->allMatches( s ); - items += s_completion->allMatches( "\"" + s ); - items += s_completion->substringCompletion( '<' + s ); - uint beforeDollarCompletionCount = items.count(); - - if( s.find( ' ' ) == -1 ) // one word, possibly given name - items += s_completion->allMatches( "$$" + s ); - - if ( !items.isEmpty() ) - { - if ( items.count() > beforeDollarCompletionCount ) - { - // remove the '$$whatever$' part - for( TQStringList::Iterator it = items.begin(); - it != items.end(); - ++it ) - { - int pos = (*it).find( '$', 2 ); - if( pos < 0 ) // ??? - continue; - (*it)=(*it).mid( pos + 1 ); - } - } - - items = removeMailDupes( items ); - - // We do not want KLineEdit::setCompletedItems to perform text - // completion (suggestion) since it does not know how to deal - // with providing proper completions for different items on the - // same line, e.g. comma-separated list of email addresses. - bool autoSuggest = (mode != TDEGlobalSettings::CompletionPopupAuto); - setCompletedItems( items, autoSuggest ); - - if (!autoSuggest) - { - int index = items.first().find( s ); - TQString newText = prevAddr + items.first().mid( index ); - //kdDebug() << "OLD TEXT: " << text() << endl; - //kdDebug() << "NEW TEXT: " << newText << endl; - setUserSelection(false); - setCompletedText(newText,true); - } - } - - break; - } - - case TDEGlobalSettings::CompletionShell: - { - TQString match = s_completion->makeCompletion( s ); - if ( !match.isNull() && match != s ) - { - setText( prevAddr + match ); - cursorAtEnd(); - } - break; - } - - case TDEGlobalSettings::CompletionMan: // Short-Auto in fact - case TDEGlobalSettings::CompletionAuto: - { - if (!s.isEmpty()) - { - TQString match = s_completion->makeCompletion( s ); - if ( !match.isNull() && match != s ) - { - TQString adds = prevAddr + match; - setCompletedText( adds ); - } - break; - } - } - case TDEGlobalSettings::CompletionNone: - default: // fall through - break; - } -} - -//----------------------------------------------------------------------------- -void AddressLineEdit::slotPopupCompletion( const TQString& completion ) -{ - setText( m_previousAddresses + completion ); - cursorAtEnd(); -} - -//----------------------------------------------------------------------------- -void AddressLineEdit::loadAddresses() -{ - s_completion->clear(); - s_addressesDirty = false; - - TQStringList adrs = addresses(); - for( TQStringList::ConstIterator it = adrs.begin(); it != adrs.end(); ++it) - addAddress( *it ); -} - -void AddressLineEdit::addAddress( const TQString& adr ) -{ - s_completion->addItem( adr ); - int pos = adr.find( '<' ); - if( pos >= 0 ) - { - ++pos; - int pos2 = adr.find( pos, '>' ); - if( pos2 >= 0 ) - s_completion->addItem( adr.mid( pos, pos2 - pos )); - } -} - -void AddressLineEdit::slotStartLDAPLookup() -{ - if( !s_LDAPSearch->isAvailable() || s_LDAPLineEdit != this ) - return; - startLoadingLDAPEntries(); -} - -void AddressLineEdit::stopLDAPLookup() -{ - s_LDAPSearch->cancelSearch(); - s_LDAPLineEdit = NULL; -} - -void AddressLineEdit::startLoadingLDAPEntries() -{ - TQString s( *s_LDAPText ); - // TODO cache last? - TQString prevAddr; - int n = s.findRev(','); - if (n>= 0) - { - prevAddr = s.left(n+1) + ' '; - s = s.mid(n+1,255).stripWhiteSpace(); - } - if( s.length() == 0 ) - return; - - loadAddresses(); // TODO reuse these? - s_LDAPSearch->startSearch( s ); -} - -void AddressLineEdit::slotLDAPSearchData( const TQStringList& adrs ) -{ - if( s_LDAPLineEdit != this ) - return; - for( TQStringList::ConstIterator it = adrs.begin(); it != adrs.end(); ++it ) { - TQString name(*it); - int pos = name.find( " <" ); - int pos_comma = name.find( ',' ); - // put name in quotes, if we have a comma in the name - if (pos>0 && pos_comma>0 && pos_comma<pos) { - name.insert(pos, '\"'); - name.prepend('\"'); - } - addAddress( name ); - } - - if( hasFocus() || completionBox()->hasFocus()) - { - if( completionMode() != TDEGlobalSettings::CompletionNone ) - { - doCompletion( false ); - } - } -} - -TQStringList AddressLineEdit::removeMailDupes( const TQStringList& adrs ) -{ - TQStringList src = adrs; - qHeapSort( src ); - TQString last; - for( TQStringList::Iterator it = src.begin(); it != src.end(); ) { - if( *it == last ) - { - it = src.remove( it ); - continue; // dupe - } - last = *it; - ++it; - } - return src; -} - -//----------------------------------------------------------------------------- -void AddressLineEdit::dropEvent(TQDropEvent *e) -{ - KURL::List uriList; - if(KURLDrag::canDecode(e) && KURLDrag::decode( e, uriList )) - { - TQString ct = text(); - KURL::List::Iterator it = uriList.begin(); - for (; it != uriList.end(); ++it) - { - if (!ct.isEmpty()) ct.append(", "); - KURL u(*it); - if ((*it).protocol() == "mailto") - ct.append( (*it).path() ); - else - ct.append( (*it).url() ); - } - setText(ct); - setEdited( true ); - } - else { - if (m_useCompletion) - m_smartPaste = true; - TQLineEdit::dropEvent(e); - m_smartPaste = false; - } -} - - -TQStringList AddressLineEdit::addresses() -{ - TQApplication::setOverrideCursor( KCursor::waitCursor() ); // loading might take a while - - TQStringList result; - TQString space(" "); - TQRegExp needQuotes("[^ 0-9A-Za-z\\x0080-\\xFFFF]"); - TQString endQuote("\" "); - TQString addr, email; - - KABC::AddressBook *addressBook = KABC::StdAddressBook::self(); - KABC::AddressBook::Iterator it; - for( it = addressBook->begin(); it != addressBook->end(); ++it ) { - TQStringList emails = (*it).emails(); - - TQString n = (*it).prefix() + space + - (*it).givenName() + space + - (*it).additionalName() + space + - (*it).familyName() + space + - (*it).suffix(); - - n = n.simplifyWhiteSpace(); - - TQStringList::ConstIterator mit; - - for ( mit = emails.begin(); mit != emails.end(); ++mit ) { - email = *mit; - if (!email.isEmpty()) { - if (n.isEmpty() || (email.find( '<' ) != -1)) - addr = TQString::null; - else { /* do we really need quotes around this name ? */ - if (n.find(needQuotes) != -1) - addr = '"' + n + endQuote; - else - addr = n + space; - } - - if (!addr.isEmpty() && (email.find( '<' ) == -1) - && (email.find( '>' ) == -1) - && (email.find( ',' ) == -1)) - addr += '<' + email + '>'; - else - addr += email; - addr = addr.stripWhiteSpace(); - result.append( addr ); - } - } - } - - KABC::DistributionListManager manager( addressBook ); - manager.load(); - result += manager.listNames(); - - TQApplication::restoreOverrideCursor(); - - return result; -} - -#include "addresslineedit.moc" diff --git a/kabc/addresslineedit.h b/kabc/addresslineedit.h deleted file mode 100644 index f81ffbfe4..000000000 --- a/kabc/addresslineedit.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Helge Deller <deller@gmx.de> - 2002 Lubos Lunak <llunak@suse.cz> - - 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 KABC_ADDRESSLINEEDIT_H -#define KABC_ADDRESSLINEEDIT_H -// $Id$ - -#include <tqobject.h> -#include <tqptrlist.h> -#include <tqtimer.h> - -#include "klineedit.h" -#include "kcompletion.h" - -class TDEConfig; - -namespace KABC { - -class LdapSearch; - -/** - * A lineedit with LDAP and kabc completion - * - * This lineedit is supposed to be used wherever the user types email addresses - * and might want a completion. You can simply use it as a replacement for - * KLineEdit or TQLineEdit. - * - * You can enable or disable the lineedit at any time. - * - * @see AddressLineEdit::enableCompletion() - */ -class KABC_EXPORT AddressLineEdit : public KLineEdit -{ - Q_OBJECT -public: - AddressLineEdit(TQWidget* parent, bool useCompletion = true, - const char *name = 0L); - virtual ~AddressLineEdit(); - - /** - * Reimplented for internal reasons. - * @ see KLineEdit::setFont() - */ - virtual void setFont( const TQFont& ); - - static TDEConfig *config(); - -public slots: - /** - * Set cursor to end of line. - */ - void cursorAtEnd(); - /** - * Toggle completion. - */ - void enableCompletion( bool enable ); - -protected: - /** - * Always call AddressLineEdit::loadAddresses() as the first thing. - * Use addAddress() to add addresses. - */ - virtual void loadAddresses(); - void addAddress( const TQString& ); - virtual void keyPressEvent(TQKeyEvent*); - virtual void dropEvent(TQDropEvent *e); - virtual void paste(); - virtual void insert(const TQString &t); - virtual void mouseReleaseEvent( TQMouseEvent * e ); - void doCompletion(bool ctrlT); - -private slots: - void slotCompletion() { doCompletion(false); } - void slotPopupCompletion( const TQString& ); - void slotStartLDAPLookup(); - void slotLDAPSearchData( const TQStringList& ); - -private: - void init(); - void startLoadingLDAPEntries(); - void stopLDAPLookup(); - TQStringList addresses(); - TQStringList removeMailDupes( const TQStringList& adrs ); - - TQString m_previousAddresses; - bool m_useCompletion; - bool m_completionInitialized; - bool m_smartPaste; - TQString m_typedText; // unused - - static bool s_addressesDirty; - static TDECompletion *s_completion; - static TQTimer *s_LDAPTimer; - static LdapSearch *s_LDAPSearch; - static TQString *s_LDAPText; - static AddressLineEdit *s_LDAPLineEdit; - static TDEConfig *s_config; - -private: - class AddressLineEditPrivate* d; -}; - -} - -#endif /* KABC_ADDRESSLINEEDIT_H */ diff --git a/kabc/agent.cpp b/kabc/agent.cpp deleted file mode 100644 index 571b7803e..000000000 --- a/kabc/agent.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 "addressee.h" - -#include "agent.h" - -using namespace KABC; - -Agent::Agent() - : mAddressee( 0 ), mIntern( false ) -{ -} - -Agent::Agent( const TQString &url ) - : mAddressee( 0 ),mUrl( url ), mIntern( false ) -{ -} - -Agent::Agent( Addressee *addressee ) - : mAddressee( addressee ), mIntern( true ) -{ -} - -Agent::~Agent() -{ - delete mAddressee; - mAddressee = 0; -} - -bool Agent::operator==( const Agent &a ) const -{ - if ( mIntern != a.mIntern ) - return false; - - if ( !mIntern ) { - if ( mUrl != a.mUrl ) - return false; - } else { - if ( mAddressee && !a.mAddressee ) return false; - if ( !mAddressee && a.mAddressee ) return false; - if ( !mAddressee && !a.mAddressee ) return false; - if ( (*mAddressee) != (*a.mAddressee) ) return false; - } - - return true; -} - -bool Agent::operator!=( const Agent &a ) const -{ - return !( a == *this ); -} - -Agent &Agent::operator=( const Agent &addr ) -{ - if ( this == &addr ) - return *this; - - if ( addr.mIntern && addr.mAddressee ) { - if ( mAddressee ) - delete mAddressee; - - mAddressee = new Addressee; - *mAddressee = *(addr.mAddressee); - } - - mUrl = addr.mUrl; - mIntern = addr.mIntern; - - return *this; -} - -void Agent::setUrl( const TQString &url ) -{ - mUrl = url; - mIntern = false; -} - -void Agent::setAddressee( Addressee *addressee ) -{ - mAddressee = addressee; - mIntern = true; -} - -bool Agent::isIntern() const -{ - return mIntern; -} - -TQString Agent::url() const -{ - return mUrl; -} - -Addressee *Agent::addressee() const -{ - return mAddressee; -} - -TQString Agent::asString() const -{ - if ( mIntern ) - return "intern agent"; - else - return mUrl; -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Agent &agent ) -{ - TQ_UINT32 hasAddressee = ( agent.mAddressee != 0 ); - - s << agent.mIntern << agent.mUrl << hasAddressee; - if ( hasAddressee ) - s << (*agent.mAddressee); - - return s; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Agent &agent ) -{ - TQ_UINT32 hasAddressee; - - s >> agent.mIntern >> agent.mUrl >> hasAddressee; - - if ( hasAddressee ) { - agent.mAddressee = new Addressee; - s >> (*agent.mAddressee); - } - - return s; -} diff --git a/kabc/agent.h b/kabc/agent.h deleted file mode 100644 index dbe048f08..000000000 --- a/kabc/agent.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_AGENT_H -#define KABC_AGENT_H - -class TQDataStream; - -#include <tqstring.h> - -#include <tdelibs_export.h> - -namespace KABC { - -class Addressee; - -/** - * Important!!! - * - * At the moment the vcard format does not support saving and loading - * this entity. - */ -class KABC_EXPORT Agent -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Agent & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Agent & ); - -public: - - /** - * Consturctor. Creates an empty object. - */ - Agent(); - - /** - * Consturctor. - * - * @param url A URL that describes the position of the agent file. - */ - Agent( const TQString &url ); - - /** - * Consturctor. - * - * @param addressee The addressee object of the agent. - */ - Agent( Addressee *addressee ); - - /** - * Destructor. - */ - ~Agent(); - - - bool operator==( const Agent & ) const; - bool operator!=( const Agent & ) const; - Agent &operator=( const Agent & ); - - /** - * Sets a URL for the location of the agent file. When using this - * function, isIntern() will return 'false' until you use - * setAddressee(). - * - * @param url The location URL of the agent file. - */ - void setUrl( const TQString &url ); - - /** - * Sets the addressee of the agent. When using this function, - * isIntern() will return 'true' until you use setUrl(). - * - * @param addressee The addressee object of the agent. - */ - void setAddressee( Addressee *addressee ); - - /** - * Returns whether the agent is described by a URL (extern) or - * by a addressee (intern). - * When this method returns 'true' you can use addressee() to - * get a Addressee object. Otherwise you can request the URL - * of this agent by url() and load the data from that location. - */ - bool isIntern() const; - - /** - * Returns the location URL of this agent. - */ - TQString url() const; - - /** - * Returns the addressee object of this agent. - */ - Addressee* addressee() const; - - /** - * Returns string representation of the agent. - */ - TQString asString() const; - -private: - Addressee *mAddressee; - TQString mUrl; - - int mIntern; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Agent & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Agent & ); - -} -#endif diff --git a/kabc/countrytransl.map b/kabc/countrytransl.map deleted file mode 100644 index 1459f0942..000000000 --- a/kabc/countrytransl.map +++ /dev/null @@ -1,12381 +0,0 @@ -Andorra ad -Andorra ad -أندورا ad -Ðндора ad -Ðндора ad -অà§à¦¯à¦¾à¦¨à¦¡à§‹à¦°à¦¾ ad -Andora ad -Andora ad -ΑνδόÏα ad -Andoro ad -آندورا ad -Andorre ad -Andóra ad -×נדורה ad -अंडोरा ad -アンドラ ad -អង់ដូរ៉ា ad -안ë„ë¼ ad -ອີນເດີຠad -Andora ad -Ðндора ad -Ðндорра ad -à¨à¨‚ਡੋਰਾ ad -Andora ad -Ðндорра ad -Andora ad -Ðндора ad -Andora ad -அனà¯à®Ÿà¯‹à®°à®¾ ad -Ðндора ad -à¹à¸­à¸™à¹‚ดรา ad -Ðндорра ad -Ðндорра ad -Andore ad -安é“å°” ad -安é“爾 ad -United Arab Emirates ae -Vereenigde Arabiese Emirate ae -الإمارات العربية المتحدة ae -Ð—Ð»ÑƒÑ‡Ð°Ð½Ñ‹Ñ ÐрабÑÐºÑ–Ñ Ð­Ð¼Ñ–Ñ€Ð°Ñ‚Ñ‹ ae -ОÐЕ ae -সংযà§à¦•à§à¦¤ আরব আমিরশাহি ae -Stadoù-Unanet Arabeg ae -Ujedinjeni arapski emirati ae -Emirats Àrabs Units ae -Spojené arabské emiráty ae -Emiraethau Arabaidd Unedig ae -Forenende Arabiske Emirater ae -Vereinigte Arabische Emirate ae -Ενωμένα ΑÏαβικά ΕμιÏάτα ae -UniÄintaj Arabaj Emirlandoj ae -Emiratos árabes unidos ae -Araabia Ühendemiraadid ae -Arabiar Emirato Batuak ae -امارات متحده عربی ae -Yhdistyneet Arabiemiraatit ae -Émirats Arabes Unis ae -Ferienigde Arabyske Emiraten ae -Aontas na nÉimíríochtaí Arabacha ae -Emiratos Ãrabes Unidos ae -×יחוד ×”×מירויות הערביות ae -संयà¥à¤•à¥à¤¤ अरब अमीरात ae -Ujedinjeni arapski emirati ae -Egyesült Arab Emirátusok ae -Sameinuðu arabísku furstadæmin ae -Emirati Arabi Uniti ae -アラブ首長国連邦 ae -អារ៉ាប់​រួម ae -ì•„ëž ì—미레ì´íЏ ì—°í•© ae -ສະຫະລັດ ae -Jungtiniai Arabų Emiratai ae -Apvienotie ArÄbu EmerÄti ae -Обединети ÐрапÑки Емирати ae -ÐÑгдÑÑн арабын имрат ae -Emirati Għarab Magħquda ae -De forente arabiske emirater ae -Vereenigte Araabsche Emiraten ae -Verenigde Arabische Emiraten ae -Dei sameinte arabiske emirata ae -Di-Emirate tseo di Kopanego tsa Arab ae -ਸੰਯà©à¨•ਤ ਅਰਬ ਅਮੀਰਾਤ ae -Zjednoczone Emiraty Arabskie ae -Emiratos Ãrabes Unidos ae -Emirados Ãrabes Unidos ae -Emiratele Arabe Unite ae -Объединенные ÐрабÑкие Эмираты ae -Leta Zunze Ubumwe z'Abarabu ae -Ovttastuvvon arábalaÅ¡ emiráhtat ae -Spojené arabské emiráty ae -Združeni arabski Emirati ae -Уједињени арапÑки емирати ae -Ujedinjeni arapski emirati ae -Förenade arabemiraten ae -யà¯à®©à¯ˆà®Ÿà¯†à®Ÿà¯ அரபி எமிரேடà¯à®¸à¯ ae -Ðморати муттаҳидаи Ðраб ae -สหรัà¸à¸­à¸²à¸«à¸£à¸±à¸šà¸­à¸µà¸¡à¸´à¹€à¸£à¸•ส์ ae -BirleÅŸik Arap Emirlikleri ae -Berläşkän Ğäräp Ämirlekläre ae -Об'єднані ÐрабÑькі Емірати ae -Бирлашган Ðраб Ðмирликлари ae -Mashango o tangananaho a Emirates ae -Emirat Arabes Unis ae -阿è”é…‹ ae -阿拉伯è¯åˆå¤§å…¬åœ‹ ae -Izindawo zezinduna zase-United Arab ae -Afghanistan af -Ø£ÙØºØ§Ù†Ø³ØªØ§Ù† af -ÐфганіÑтан af -ÐфганиÑтан af -আফগানিসà§à¦¤à¦¾à¦¨ af -Afganistan af -Afganistan af -Afganistan af -Afghanistán af -Affganistan af -Αφγανιστάν af -Afganio af -Afghanistán af -Afganistan af -Ø§ÙØºØ§Ù†Ø³ØªØ§Ù† af -Afganistan af -An Afganastáin af -Afganistan af -×פגניסטן af -अफगानिसà¥à¤¤à¤¾à¤¨ af -Afganistan af -Afganisztán af -Afganistan af -Afganistan af -アフガニスタン af -អាហ្វកានីស្ážáž¶áž“ af -아프가니스탄 af -ລີທົ່ວເນີຠaf -AfganistÄna af -ÐвганиÑтан af -ÐфганÑтан af -Afganistan af -ਅਫਗਾਨਿਸਤਾਨ af -Afganistan af -Afeganistão af -Afeganistão af -Afganistan af -ÐфганиÑтан af -Afuganisitani af -Afganistan af -Afganistan af -ÐвганиÑтан af -Avganistan af -Afganistan af -ஆபà¯à®•ானிஸà¯à®¤à®¾à®©à¯ af -ÐфғониÑтон af -อาฟà¸à¸²à¸™à¸´à¸ªà¸–าน af -Afganistan af -Äfğänstan af -ÐфганіÑтан af -ÐфғониÑтон af -Afganistan af -阿富汗 af -阿富汗 af -Antigua and Barbuda ag -Antigue en Barbuda ag -أنتيغوا Ùˆ باربودا ag -Antigua vÉ™ Barbuda ag -Ðнтыгуа Ñ– Барбуда ag -Ðнтигуа и Барбуда ag -অà§à¦¯à¦¾à¦¨à§à¦Ÿà¦¿à¦—à§à§Ÿà¦¾ à¦à¦¬à¦‚ বারà§à¦¬à§à¦¡à¦¾ ag -Antigua ha Barbuda ag -Antigua i Barbuda ag -Antigua i Barbuda ag -Antigua a Barbuda ag -Antigwa a Barbwda ag -Antigua og Barbuda ag -Antigua und Barbuda ag -Αντίγκουα και ΜπαÏμποÏντα ag -Antigvo-Barbudo ag -Antigua y Barbuda ag -Antigua ja Barbuda ag -Antigua eta Barbuda ag -آنتیگوا Ùˆ باربودا ag -Antigua ja Barbados ag -Antigua og Barbuda ag -Antigua et Barbuda ag -Antigua en Barbuda ag -Antigua agus Barbúda ag -Antiga e Barbuda ag -×נטיגו××” ובריבודה ag -à¤à¤¨à¥à¤Ÿà¤¿à¤—à¥à¤† और बारबूडा ag -Antigua i Barbuda ag -Antigua és Barbuda ag -Antigua dan Barbuda ag -Antígva og Barbúda ag -Antigua e Barbuda ag -アンティグアãƒãƒ¼ãƒ–ーダ ag -Antigua និង Barbuda ag -앤티가 바부다 ag -Antikva ir Barbuda ag -Antigva un Barbuda ag -Ðнтигва и Барбуда ag -Ðнтигуа ба Барбуда ag -Antigwa u Barbuda ag -Antigua og Barbuda ag -Antigua un Barbuda ag -Antigua en Barbuda ag -Antigua og Barbuda ag -Antigua le Barbuda ag -Antigua e Barbuda ag -à¨à¨‚ਟੀਗà©à¨† ਤੇ ਬਾਰਬà©à¨¡à¨¾ ag -Antigua i Barbuda ag -Antígua e Barbuda ag -Antigua e Barbuda ag -Antigua ÅŸi Barbuda ag -Ðнтигуа и Барбуда ag -Antigwa na Barubida ag -Antigua ja Barbuda ag -Antigua a Barbuda ag -Antigva in Barbuda ag -Ðнтигва и Барбуда ag -Antigva i Barbuda ag -I-Antigua kanye ne Barbuda ag -Antigua och Barbuda ag -ஆனà¯à®Ÿà®¿à®•ா மறà¯à®±à¯à®®à¯ பெரà¯à®®à¯à®Ÿà®¾ ag -Ðнтигуо ва Барбудо ag -อันทิà¸à¸±à¸§ à¹à¸¥à¸° บาร์บูดา ag -Antigua ve Barbuda ag -Antigua wä Barbuda ag -Трінідад Ñ– Тобаго ag -Ðнтигуа ва Барбуда ag -Antigua và Barbuda ag -Antigua eyet Barbuda ag -Antigua ne Barbuda ag -安æç“œå’Œå·´å¸ƒè¾¾ ag -安地瓜島和巴布é”å³¶ ag -Antigua kanye ne-Barbuda ag -Anguilla ai -أنغويلا ai -ÐÐ½Ð³Ñ–Ð»ÑŒÑ ai -Ðнгила ai -অà§à¦¯à¦¾à¦™à§à¦—à§à¦‡à¦²à¦¾ ai -Angilla ai -Angwila ai -Ανγκουίλα ai -Angvilo ai -آنگوییلا ai -×נגווילה ai -à¤à¤‚गà¥à¤à¤²à¤¾ ai -Angvilla ai -イギリス属領アンギラ ai -អង់ហ្ស៊ីឡា ai -ì•™ê¸¸ë¼ ai -à»àºžàº™àº§àº´àº™ ai -Ðнгилја ai -Ðнгуаилла ai -Angwilla ai -à¨à¨‚ਨਗà©à¨ˆà¨²à¨¾ ai -Anghila ai -Ðнгилла ai -Angwiya ai -Angvila ai -Ðнгвила ai -Angvila ai -ஆனà¯à®•ிலà¯à®²à®¾ ai -Ðнгуилло ai -à¹à¸­à¸‡à¸à¸µà¸¥à¸² ai -ÐÐ½Ð³Ñ–Ð»ÑŒÑ ai -Ðнгвилла ai -Anguila ai -安圭拉 ai -阿爾åŠåˆ©äºž ai -Albania al -Albanië al -ألبانيا al -ÐÐ»ÑŒÐ±Ð°Ð½Ñ–Ñ al -ÐÐ»Ð±Ð°Ð½Ð¸Ñ al -অলবেনিয়া al -Albani al -Albanija al -Albània al -Albánie al -Albanien al -Albanien al -Αλβανία al -Albanio al -Albaania al -آلبانی al -Albanie al -Albanië al -An Albáin al -Albánia al -×לבניה al -अलà¥à¤¬à¤¾à¤¨à¤¿à¤¯à¤¾ al -Albánia al -Albanía al -アルãƒãƒ‹ã‚¢ al -អាល់បានី al -알바니아 al -à»àº­àº”à»àº¥àº™àº•ິຠal -Albanija al -AlbÄnija al -Ðлбанија al -Ðлбани al -Albanija al -Albanien al -Albanië al -ਅਲਬਾਨੀਆ al -Albânia al -Albânia al -ÐÐ»Ð±Ð°Ð½Ð¸Ñ al -Alubaniya al -Albánia al -Albánsko al -Albanija al -Ðлбанија al -Albanija al -Albanien al -ஆலà¯à®ªà®©à®¿à®¯à®¾ al -Олбанӣ al -อัลเบเนีย al -Arnavutluk al -ÐÐ»Ð±Ð°Ð½Ñ–Ñ al -ÐÐ»Ð±Ð°Ð½Ð¸Ñ al -Albaneye al -阿尔巴尼亚 al -阿亞巴尼亞 al -Armenia am -Armenië am -أرمينيا am -ÐрмÑÐ½Ñ–Ñ am -ÐÑ€Ð¼ÐµÐ½Ð¸Ñ am -আরà§à¦®à§‡à¦¨à¦¿à§Ÿà¦¾ am -Armeni am -Armenija am -Armènia am -Arménie am -Armenien am -Armenien am -ΑÏμενία am -Armenio am -Armeenia am -ارمنستان am -Arménie am -Armenië am -An Airméin am -Arménia am -×רמניה am -आरà¥à¤®à¥‡à¤¨à¤¿à¤¯à¤¾ am -Örményország am -Armenía am -アルメニア am -អារមáŸáž“ី am -아르메니아 am -ອາເຈນຕິນາ am -ArmÄ—nija am -ArmÄ“nija am -Ерменија am -Ðрмен am -Armenien am -Armenië am -ਅਰਮੀਨੀਆ am -Arménia am -Armênia am -ÐÑ€Ð¼ÐµÐ½Ð¸Ñ am -Arumeniya am -Arménsko am -Armenija am -Јерменија am -Jermenija am -Armenien am -ஆரà¯à®®à¯‡à®©à®¿à®¯à®¾ am -ÐрманиÑтон am -อาร์เมเนีย am -Ermenistan am -Ärmänstan am -Ð’Ñ–Ñ€Ð¼ÐµÐ½Ñ–Ñ am -ÐрманиÑтон am -Ã…rmeneye am -亚美尼亚 am -亞美尼亞 am -Netherlands Antilles an -Nederlandse Antilles an -أنتيل هولندا an -ÐідÑрлÑндÑÐºÑ–Ñ Ðнтылы an -ХоландÑки Ðнтили an -নেদারলà§à¦¯à¦¾à¦£à§à¦¡à¦¸ অà§à¦¯à¦¾à¦¨à§à¦Ÿà¦¿à¦²à§‡à¦¸ an -Antilh an Izelvroioù an -Nizozemski Antili an -Antilles del Països Baixos an -Nizozemské Antily an -Ynysoedd Iseldiraidd Y Carib? an -Nederlandske antiller an -Niederländische Antillen an -Ολλανδικές Αντίλλες an -Nederlandaj Antiloj an -Antillas holandesas an -Hollandi Antillid an -Antilla Holandarrak an -آنتیلس هلند an -Alankomaiden Antillit an -Antilles néerlandaises an -Nederlânske Antillen an -Aintillí na hÃsiltíre an -Antillas Holandesas an -नीदरलैंड à¤à¤¨à¥à¤Ÿà¥€à¤²à¥€à¤¸ an -Nizozemski Antili an -Holland-Antillák an -Hollensku Antillur an -Antille Olandesi an -オランダ領アンãƒãƒ« an -អង់ទីយáŸâ€‹áž áž¼áž›áŸ’លង់ an -네ëœëž€ë“œë ¹ 안틸레스 an -ເນເທີà»àº¥àº™ an -Nyderlandų Antilai an -NÄ«derlandes Antiļas an -ХоландÑки Ðнтили an -Ðедерландын ÐнтиллÑÑ an -De nederlandske Antillene an -Nedderlandsche Antillen an -Nederlandse Antillen an -Dei nederlandske Antillane an -ਨੀਂਦਰਲੈਂਡ à¨à¨‚ਟੀਲੀਸ an -Antyle Holenderskie an -Antilhas Holandês an -Antilhas Holandesas an -Antilele Olandeze an -ÐидерландÑкие ÐнтильÑкие оÑтрова an -Antiye z'Ubuholande an -HollándalaÅ¡ Antillat an -Holandské Antily an -Nizozemski Antili an -ХоландÑки антили an -Holandski antili an -Nederländska Antillerna an -நெதரà¯à®²à®¾à®¨à¯à®¤à¯ அனà¯à®Ÿà®¿à®²à¯à®¸à¯ an -ÐнтилиÑи Ҳолланд an -เนเธอร์à¹à¸¥à¸™à¸”์ à¹à¸­à¸™à¸—ิลีส an -Hollanda Antilleri an -Niderland Antilläre an -ÐнтільÑькі оÑтрови (Ðідерланди) an -Ðидерландлар Ðнтил Ороллари an -Hà Lan Antilles an -Antiyes Neyerlandesses an -è·å±žå®‰çš„列斯群岛 an -è·å±¬å®‰åœ°åˆ—斯群島 an -Angola ao -أنغولا ao -Ðнгола ao -Ðнгола ao -অà§à¦¯à¦¾à¦™à§à¦—োলা ao -Ανγκόλα ao -Angolo ao -آنگولا ao -Angóla ao -×נגולה ao -अंगोला ao -Angóla ao -アンゴラ ao -អង់ហ្គោឡា ao -ì•™ê³¨ë¼ ao -ບັນà»àºà»€àº¥àºµàº ao -Ðнгола ao -Ðнгол ao -ਅੰਗੋਲਾ ao -Ðнгола ao -Ðнгола ao -ஆஙà¯à®•ோலா ao -Ðнгуло ao -à¹à¸­à¸‡à¹‚à¸à¸¥à¸² ao -Ðнгола ao -Ðнгола ao -安哥拉 ao -安哥拉 ao -Argentina ar -Argentinië ar -الأرجنتين ar -Ðргентына ar -Ðржентина ar -আরà§à¦œà§‡à¦¨à§à¦Ÿà¦¿à¦¨à¦¾ ar -Arc'hantina ar -Ariannin ar -Argentinien ar -ΑÏγεντινή ar -Argentino ar -آرژانتین ar -Agentiina ar -Argentine ar -Argentinië ar -An Airgintín ar -Arxentina ar -×רגנטינה ar -अरà¥à¤œà¥‡à¤‚टीना ar -Argentína ar -Argentína ar -アルゼンãƒãƒ³ ar -អាហ្សង់ទីន ar -아르헨티나 ar -ອາເຈນຕິນາ ar -ArgentÄ«na ar -Ðргентина ar -Ðргентин ar -ArÄ¡entina ar -Argentinien ar -Argentinië ar -ਅਰਜ਼ਨਟੀਨਾ ar -Argentyna ar -Ðргентина ar -Arijantina ar -Argentína ar -Ðргентина ar -I-Argentina ar -ஆரà¯à®šà¯†à®©à¯à®Ÿà®¿à®©à®¾ ar -Оржонтина ar -อาร์เจนตินา ar -Arjantin ar -Ðргентина ar -Ðргентина ar -Agenthina ar -Ã…rdjintene ar -阿根廷 ar -阿根廷 ar -American Samoa as -Amerikanse Samoa as -ساموا الأمريكية as -ÐмÑрыканÑкае Самоа as -ÐмериканÑки Самоа as -মারà§à¦•িন সামোয়া as -Samoa amerikanek as -AmeriÄka Samoa as -Samoa Americana as -Americká Samoa as -Samoa Americanaidd as -Samoa (USA) as -Amerikanisches Samoa as -ΑμεÏικανική Σαμόα as -Amerika Samoo as -Samoa americana as -Ameerika Samoa as -Amerikar Samoa as -ساموای آمریکا as -Amerikan Samoa as -Samoa américaines as -Amerikaansk Samoa as -Samó Meiriceánach as -Samoa Americana as -סמו××” ×”×מריקנית as -अमेरिकी सामोआ as -AmeriÄka Samoa as -Amerikai Szamoa as -Bandaríska Samóa as -Samoa Americane as -アメリカンサモア as -សាមូអា អាមáŸážšáž·áž€ as -미국령 사모아 as -ອາເມລິàºàº²à»€àº«àº™àº·àº­ as -Amerikos Samoa as -Amerikas Samoa as -ÐмериканÑка Самоа as -Ðмерик, Самоа as -Samoa Amerikana as -Amerikansk Samoa as -Amerikaansch Samoa as -Amerikaans Samoa as -Amerikansk Samoa as -ਅਮਰੀਕੀ ਸਾਮੋਆ as -Samoa AmerykaÅ„skie as -Samoa Americana as -Samoa Americana as -Samoa americană as -ÐмериканÑкое Самоа as -Samowa Nyamerika as -AmerihkálaÅ¡ Samoa as -Americká Samoa as -AmeriÅ¡ka Samoa as -Ðмеричка Самоа as -AmeriÄka Samoa as -Amerikanska Samoa as -அமெரிகà¯à®•ா சமோயா as -Самоаи Ðмрикоӣ as -อเมริà¸à¸±à¸™ ซามัว as -Amerika Samoası as -Amerikalı Samoa as -ÐмериканÑьке Самоа as -Ðмерика СамоаÑи as -Samowa Amerikinne as -ç¾Žå±žè¨æ‘©äºš as -美屬薩摩亞 as -Austria at -Oostenryk at -النمسا at -Avstriya at -ÐÑžÑÑ‚Ñ€Ñ‹Ñ at -ÐвÑÑ‚Ñ€Ð¸Ñ at -অসà§à¦Ÿà§à¦°à¦¿à§Ÿà¦¾ at -Aostria at -Austrija at -Àustria at -Rakousko at -Awstria at -Østrig at -Österreich at -ΑυστÏία at -AÅ­strio at -اتریش at -Itävalta at -Eysturríki at -Autriche at -Eastenryk at -An Ostair at -×וסטריה at -आसà¥à¤Ÿà¥à¤°à¤¿à¤¯à¤¾ at -Austrija at -Ausztria at -Austurríki at -オーストリア at -អូទ្រីស at -오스트리아 at -ອອດສະເຕເລີຠat -Austrija at -Austrija at -ÐвÑтрија at -ÐвÑтри at -Awtrija at -Østerrike at -Österriek at -Oostenrijk at -Austerrike at -ਆਸਟਰੀਆ at -Ãustria at -Ãustria at -ÐвÑÑ‚Ñ€Ð¸Ñ at -Ositiriya at -Nuortariika at -Rakúsko at -Avstrija at -ÐуÑтрија at -Austrija at -I-Austria at -Österrike at -ஆஸà¯à®¤à¯à®¤à®¿à®°à®¿à®¯à®¾ at -ÐвÑÑ‚Ñ€Ð¸Ñ at -ออสเตรีย at -Avusturya at -ÐвÑÑ‚Ñ€Ñ–Ñ at -ÐвÑÑ‚Ñ€Ð¸Ñ at -Ositiria at -Ão at -Otriche at -奥地利 at -奧地利 at -Australia au -Australië au -أستراليا au -Avustralya au -ÐÑžÑÑ‚Ñ€Ð°Ð»Ñ–Ñ au -ÐвÑÑ‚Ñ€Ð°Ð»Ð¸Ñ au -অসà§à¦Ÿà§à¦°à§‡à¦²à¦¿à§Ÿà¦¾ au -Aostralia au -Australija au -Austràlia au -Austrálie au -Awstralia au -Australien au -Australien au -ΑυστÏαλία au -AÅ­stralio au -Austraalia au -استرالیا au -Australie au -Australië au -An Astráil au -Austrália au -×וסטרליה au -आसà¥à¤Ÿà¥à¤°à¥‡à¤²à¤¿à¤¯à¤¾ au -Australija au -Ausztrália au -Ãstralía au -オーストラリア au -អូស្ážáŸ’រាលី au -오스트레ì¼ë¦¬ì•„ au -ອອດສະເຕເລີຠau -Australija au -AustrÄlija au -ÐвÑтралија au -ÐвÑтрали au -Awstralja au -Australien au -Australië au -ਅਸਟਰੇਲੀਆ au -Austrália au -Austrália au -ÐвÑÑ‚Ñ€Ð°Ð»Ð¸Ñ au -Ositaraliya au -Austrália au -Austrália au -Avstralija au -ÐуÑтралија au -Australija au -I-Australia au -Australien au -ஆஸà¯à®¤à¯à®¤à®¿à®°à¯‡à®²à®¿à®¯à®¾ au -ОÑтролиё au -ออสเตรเลีย au -Avusturalya au -ÐвÑÑ‚Ñ€Ð°Ð»Ñ–Ñ au -ÐвÑÑ‚Ñ€Ð°Ð»Ð¸Ñ au -Ositiralia au -Úc au -Ostraleye au -澳大利亚 au -澳大利亞 au -Aruba aw -أروبا aw -Ðруба aw -আরà§à¦¬à¦¾ aw -Arwba aw -ΑÏοÏμπα aw -Arubo aw -آروبا aw -×רובה aw -अरूबा aw -Arúba aw -オランダ自治領アルムaw -អារូបា aw -아루바 aw -ເàºàº¡à»„ັພ່ aw -Ðруба aw -Ðрува aw -ਅਰੂਬੀ aw -Ðруба aw -Ãruba aw -Ðруба aw -à®…à®°à¯à®ªà®¾ aw -Ðрубо aw -อรูบา aw -Ðруба aw -Ðруба aw -Arouba aw -阿é²å·´ aw -阿魯巴 aw -Ã…land Islands ax -Ã…land Eilande ax -ОÑтрови Ðланд ax -Illes Ã…land ax -Ã…landské ostrovy ax -Ã…land-øerne ax -Aland ax -Îησιά Ã…land ax -Islas Aland ax -Ahvenamaa ax -Ã…land irlak ax -Ahvenanmaan saaret ax -ÃŽles Ã…land ax -Ã…land-eilannen ax -Na hOileáin Ã…land ax -Illas Ã…land ax -Ã…land-szigetek ax -Ãlandseyjar ax -Isole Ã…land ax -オーランド諸島 ax -កោះ Ã…land ax -Ã…land salos ax -ОÑтрови Оланд ax -Ã…land-øyene ax -Ã…land-Inseln ax -Ã…land-eilanden ax -Ã…land-øyane ax -ਅਮਾਨ ਟਾਪੂ ax -Wyspy Ã…land ax -Ilhas Ã…land ax -Ilhas Ã…land ax -ÐландÑкие оÑтрова ax -Ibirwa by'Ã…land ax -Ã…land sullot ax -Ã…landski otoki ax -ÐландÑка оÑтрва ax -Alandska ostrva ax -Ã…land ax -หมู่เà¸à¸²à¸°à¸­à¸²à¸¥à¸±à¸™à¸”์ ax -Cayman Adaları ax -Aland Utrawları ax -ÐландÑькі оÑтрови ax -Ðланд Ороллари ax -阿兰群岛 ax -奧蘭群島 ax -Azerbaijan az -أذربيجان az -AzÉ™rbaycan az -ÐзÑрбайджан az -Ðзербайджан az -আজেরবাইজান az -Azerbeidjan az -Azerbejdžan az -Azerbaitjan az -Ãzerbajdžánský az -Aserbaijan az -Azerbajdjan az -Aserbaidschan az -ΑζεÏμπαϊτζάν az -AzerbajÄano az -Azerbaiján az -Aserbaidžaan az -آذربایجان az -Azerbaidäani az -Aserbadsjan az -Azerbeidjan az -An Asarbaiseáin az -×זרביג'ן az -अजरबैजान az -Azerbejdžan az -Azerbajdzsán az -Aserbaídsjan az -Azerbaigian az -アゼルãƒã‚¤ã‚¸ãƒ£ãƒ³ az -អាហ្ស៊ែរបែហ្សង់ az -아제르바ì´ìž” az -ອາເຊີໄບຈັນ az -Azerbaidžanas az -AzerbaidžÄna az -Ðзербејџан az -Ðзарбайжан az -AżerbajÄ¡an az -Aserbajdsjan az -Aserbaidschan az -Azerbeidjan az -Aserbajdsjan az -ਅਜ਼ਰਬਾਈਜਾਨ az -Azerbejdżan az -Azerbaijão az -Azerbaijão az -Ðзербайджан az -Azeribayijani az -Aserbaižan az -Ãzerbajdžánsky az -Azerbajdžan az -Ðзербејџан az -Azerbejdžan az -I-Azerbaijan az -அசரà¯à®ªà¯ˆà®šà®¾à®©à¯ az -Озарбойҷон az -อาร์เซอร์ไบจัน az -Azerice az -Äzärbaycan az -Ðзербайджан az -Озарбайжон az -Azerbaydjan az -阿塞拜疆 az -亞塞拜然 az -Bosnia and Herzegovina ba -Bosnië en Herzegovina ba -البوسنا Ùˆ الهرسك ba -БоÑÑŒÐ½Ñ–Ñ Ñ– Герцагавіна ba -БоÑна и Херцеговина ba -বসনিয়া à¦à¦¬à¦‚ হারজিগোভিনা ba -Bosni hag Herzigovi ba -Bosna i Hercegovina ba -Bòsnia i Hercegovina ba -Bosna a Herzegovina ba -Bosnia a Hertsegofina ba -Bosnien-Herzegovina ba -Bosnien und Herzegowina ba -Βοσνία και ΕÏζεγοβίνη ba -Bosnio kaj Hercegovino ba -Bosnia y Herzegovina ba -Bosnia ja Hertsegovina ba -Bosnia eta Herzegovina ba -بوسنی Ùˆ هرزگوین ba -Bosnia ja Herzegovina ba -Bosnia-Herzegovina ba -Bosnie herzégovine ba -Bosnië en Herzegovina ba -An Bhoisnia agus Heirseagóivéin ba -Bosnia e Herzegovina ba -בוסניה הרצגובינה ba -बोसà¥à¤¨à¤¿à¤¯à¤¾ और हरà¥à¤œà¥‡à¤—ोविना ba -Bosna i Hercegovina ba -Bosznia-Hercegovina ba -Bosnía og Hersegóvína ba -Bosnia e Erzegovina ba -ボスニアヘルツェゴビナ ba -បូស្ន៊ី និង​ហឺហ្ស៊áŸáž áŸ’គោវីណា ba -보스니아어와 헤르체고비나 ba -ບອສເນີຠà»àº¥àº° ເຫີເຊີໂàºàº§àº´àº™àº² ba -Bosnija ir Hercegovina ba -Bosnija un Hercogovina ba -БоÑна и Херцеговина ba -БоÑни ба Херцеговина ba -Bożnia u Ħerżegovina ba -Bosnia-Hercegovina ba -Bosnien-Herzegowina ba -Bosnië en Herzegovina ba -Bosnia-Hercegovina ba -Bosnia le Herzegovina ba -ਬੋਸਨੀਆ ਤੇ ਹਰਜ਼ੀਗੋਵਿਨਾ ba -BoÅ›nia i Hercegowina ba -Bósnia e Herzegovina ba -Bósnia Herzegovina ba -Bosnia ÅŸi HerÅ£egovina ba -БоÑÐ½Ð¸Ñ Ð¸ Герцеговина ba -Bosiniya na Herizegovina ba -Bosnia ja Hercegovina ba -Bosna a Hercegovina ba -Bosna in Hercegovina ba -БоÑна и Херцеговина ba -Bosna i Hercegovina ba -I-Bosnia kanye ne Herzegovina ba -Bosnien och Herzegovina ba -பொசà¯à®©à®¿à®¯à®¾ மறà¯à®±à¯à®®à¯ ஹரà¯à®œà®¿à®•ோவினா ba -БоÑÐ½Ð¸Ñ Ð²Ð° ГерÑогавина ba -บอสเนียà¹à¸¥à¸°à¹€à¸®à¸­à¸£à¹Œà¹€à¸‹à¹‚à¸à¸§à¸´à¸™à¸² ba -Bosna Hersek ba -Bosnia wä Herzegovina ba -БоÑÐ½Ñ–Ñ Ñ– Герцеговина ba -БоÑÐ½Ð¸Ñ Ð²Ð° Герцоговина ba -Mubosinia na Muhezegovina ba -Bosnia và Herzegovina ba -Bosneye ba -Bosnia ne Herzegovina ba -波斯尼亚和黑塞哥维那 ba -æ³¢å£«å°¼äºžèˆ‡èµ«å¡žå“¥ç¶­ç´ ba -Bosnia kanye ne-Herzegovina ba -Barbados bb -بربادوس bb -Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb -Ð‘Ð°Ñ€Ð±ÐµÐ¹Ð´Ð¾Ñ bb -বারবাডোস bb -ΜπαÏμπάντος bb -Barbado bb -باربادوس bb -Barbade bb -Barbadós bb -ברבדוס bb -बारबाडोस bb -ãƒãƒ«ãƒãƒ‰ã‚¹ bb -បារបាដូស bb -바르바ë„스 bb -ບາລບາດອດສ bb -Barbadosas bb -Barbadosa bb -Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb -Ð‘Ð°Ñ€Ð±Ð¾Ð´Ð°Ñ bb -ਬਾਰਬਾਡੋਸ bb -Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb -Barubadosi bb -Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb -I-Barbados bb -பாரà¯à®ªà¯‡à®Ÿà®¾à®šà¯ bb -Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb -บาร์บาดอส bb -Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb -Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb -BÃ¥rbades bb -巴巴多斯 bb -å·´è²å¤š bb -Bangladesh bd -بنغلاديش bd -BanqladeÅŸ bd -БанглÑдÑш bd -Бангладеш bd -বাংলাদেশ bd -Bangladaech bd -BangladeÅ¡ bd -Bangladéš bd -Bangladesch bd -Μπαγκλαντές bd -BangladeÅo bd -بنگلادش bd -An Bhanglaidéis bd -בנגלדש bd -बांगà¥à¤²à¤¾à¤¦à¥‡à¤¶ bd -BangladeÅ¡ bd -Banglades bd -Bangladess bd -ãƒãƒ³ã‚°ãƒ©ãƒ‡ã‚·ãƒ¥ bd -បង់ក្លាដáŸážŸáŸ’áž  bd -방글ë¼ë°ì‹œ bd -ບັງຄະລາເທດ bd -BangladeÅ¡as bd -BangladeÅ¡a bd -Бангладеш bd -Бангладеш bd -Bangladexx bd -Bangladesch bd -ਬੰਗਲਾਦੇਸ਼ bd -Bangladesz bd -BangladeÅŸ bd -Бангладеш bd -Bangaladeshi bd -Bangladéš bd -BangladeÅ¡ bd -Бангладеш bd -BangladeÅ¡ bd -I-Bangladesh bd -பஙà¯à®•ளாதேச௠bd -Банглодеш bd -บังคลาเทศ bd -BangladeÅŸ bd -BangladeÅŸ bd -Бангладеш bd -Бангладеш bd -孟加拉国 bd -孟加拉 bd -Belgium be -België be -بلجيكا be -Belçika be -БÑÐ»ÑŒÐ³Ñ–Ñ be -Ð‘ÐµÐ»Ð³Ð¸Ñ be -বেলজিয়াম be -Belgia be -Belgija be -Bèlgica be -Belgie be -Gwlad Belg be -Belgien be -Belgien be -Βέλγιο be -Belgio be -Bélgica be -Belgia be -Belgika be -بلژیک be -Belgia be -Belgia be -Belgique be -België be -An Bheilg be -Bélxica be -בלגיה be -बेलà¥à¤œà¤¿à¤¯à¤® be -Belgija be -Belgia be -Belgía be -Belgio be -ベルギー be -បែលហ្ស៊ិក be -ë²¨ê¸°ì— be -ເບລຢ່ງມ be -Belgija be -Beļģija be -Белгија be -Белги be -BelÄ¡ju be -Belgia be -Belgien be -België be -Belgia be -Bèlgica be -ਬੈਲਜੀਅਮ be -Belgia be -Bélgica be -Bélgica be -Belgia be -Ð‘ÐµÐ»ÑŒÐ³Ð¸Ñ be -Ububiligi be -Belgia be -Belgicko be -Belgija be -Белгија be -Belgija be -I-Belgium be -Belgien be -பெலà¯à®šà®¿à®¯à®®à¯ be -Ð‘ÐµÐ»Ð³Ð¸Ñ be -เบลเยียม be -Belçika be -Belgia be -Ð‘ÐµÐ»ÑŒÐ³Ñ–Ñ be -Ð‘ÐµÐ»Ð³Ð¸Ñ be -Bỉ be -Beldjike be -比利时 be -比利時 be -Burkina Faso bf -بوركينا ÙØ§Ø³Ùˆ bf -Буркіна ФаÑо bf -Буркина ФаÑо bf -বারকিনা ফাসো bf -Bwrcina Ffaso bf -ΜπουÏκίνα Φάσο bf -Burkino bf -Ø¨ÙˆØ±Ú©ÛŒÙ†Ø§ÙØ§Ø³Ùˆ bf -Buircíne Fasó bf -בורניקה פ×סו bf -बà¥à¤°à¥à¤•िना फासो bf -Burkina faso bf -Búrkína Fasó bf -ブルキナファソ bf -ប៊ូរគីណាហ្វាសូ bf -부르키나 파소 bf -ຕຸລະàºàºµ bf -Буркина ФаÑо bf -Буркина ФаÑо bf -ਬà©à¨°à¨•ਿਨਾ ਫਾਸੋ bf -Буркина-ФаÑо bf -Burukina Faso bf -Буркина ФаÑо bf -பரà¯à®•ினா ஃபசோ bf -Буркина ФаÑу bf -เบอร์à¸à¸´à¸™à¸²à¸Ÿà¸²à¹‚ซ bf -Буркіна-ФаÑо bf -Буркина-ФаÑÑо bf -Bourkina Fasso bf -布基纳法索 bf -布å‰ç´æ³•ç´¢ bf -Bulgaria bg -Bulgarye bg -بلغاريا bg -Bolgarıstan bg -Ð‘Ð°ÑžÐ³Ð°Ñ€Ñ‹Ñ bg -Ð‘ÑŠÐ»Ð³Ð°Ñ€Ð¸Ñ bg -বà§à¦²à¦—েরিয়া bg -Bulgari bg -Bugarska bg -Bulgària bg -Bulharsko bg -Bwlgaria bg -Bulgarien bg -Bulgarien bg -ΒουλγαÏία bg -Bulgario bg -Bulgaaria bg -بلغارستان bg -Bulgarie bg -Bulgarije bg -An Bhulgáir bg -Bulgária bg -בולגריה bg -बà¥à¤²à¥à¤—ारिया bg -Bugarska bg -Bulgária bg -Búlgaría bg -ブルガリア bg -ប៊ុលហ្ការី bg -불가리아 bg -ບັນà»àºà»€àº¥àºµàº bg -Bulgarija bg -BulgÄrija bg -Бугарија bg -Болгари bg -Bulgarija bg -Bulgarien bg -Bulgarije bg -ਬà©à¨²à¨—ਾਰੀਆ bg -BuÅ‚garia bg -Bulgária bg -Bulgária bg -Ð‘Ð¾Ð»Ð³Ð°Ñ€Ð¸Ñ bg -Buligariya bg -Bulgária bg -Bulharsko bg -Bolgarija bg -БугарÑка bg -Bugarska bg -I-Bulgaria bg -Bulgarien bg -பலà¯à®•ேரியா bg -БулғориÑтон bg -บัลà¹à¸à¹€à¸£à¸µà¸¢ bg -Bulgaristan bg -Ð‘Ð¾Ð»Ð³Ð°Ñ€Ñ–Ñ bg -Ð‘Ð¾Ð»Ð³Ð°Ñ€Ð¸Ñ bg -Baligaria bg -BulgÃ¥reye bg -ä¿åŠ åˆ©äºš bg -ä¿åŠ åˆ©äºž bg -Bahrain bh -البحرين bh -БахрÑйн bh -Бахрейн bh -বাহরেন bh -Barein bh -Bahrein bh -Bahrajn bh -ΜπαχÏέιν bh -Barejno bh -Bahrein bh -Bahrein bh -بحرین bh -Baghrein bh -Bairéin bh -Barein bh -בחריין bh -बहारीन bh -Barein bh -ãƒãƒ¼ãƒ¬ãƒ¼ãƒ³ bh -បារ៉ែន bh -ë°”ë ˆì¸ bh -ຖັàºàºà»ˆàº‡àº§ bh -Bahreinas bh -Bahreina bh -Бахреин bh -Бахрайн bh -Baħrain bh -Baghrein bh -ਬਹਿਰੀਨ bh -Bahrajn bh -Bahrein bh -Бахрейн bh -Bahirayini bh -Bahrajn bh -Bahrajn bh -Бахреин bh -Bahrein bh -I-Bahrain bh -Bahrein bh -பஹà¯à®°à¯ˆà®©à¯ bh -Баҳрайн bh -บาห์เรียน bh -Bahreyn bh -Bahreyn bh -Бахрейн bh -Баҳрайн bh -Bareyn bh -å·´æž— bh -å·´æž— bh -Burundi bi -بوروندي bi -Бурундзі bi -Бурунди bi -বà§à¦°à§à¦¨à§à¦¡à¦¿ bi -Bwrwndi bi -ΜπουÏουντί bi -Burundo bi -بروندی bi -An Bhurúin bi -בורונדי bi -बà¥à¤°à¥‚ंडी bi -Búrúndí bi -ブルンジ bi -ប៊ូរុនឌី bi -부룬디 bi -ເຄອຣດ bi -Burundija bi -Бурунди bi -Бурунди bi -ਬà©à¨°à©à¨¨à¨¡à©€ bi -Бурунди bi -Бурунди bi -பà¯à®°à¯à®©à¯à®Ÿà®¿ bi -Бурундӣ bi -บูรันดิ bi -Бурунді bi -Бурунди bi -Bouroundi bi -布隆迪 bi -浦隆地 bi -Benin bj -Denin bj -بينين bj -БÑнін bj -Бенин bj -বেনিন bj -Μπενίν bj -Benino bj -بنین bj -Bénin bj -Beinin bj -בנין bj -बेनिन bj -Benín bj -ベナン bj -áž”áŸážŽáž¶áŸ†áž„ bj -베냉 bj -ບອສເນີຠbj -Benina bj -Бенин bj -Бенин bj -ਬੀਨਿਨ bj -Benim bj -Бенин bj -Bene bj -Бенин bj -பெனின௠bj -Бенини bj -เบนิน bj -Бенін bj -Бенин bj -è´å® bj -è²å— bj -Bermuda bm -برمودا bm -БÑрмуды bm -Бермуда bm -বারà§à¦®à§à¦¡à¦¾ bm -Bermud bm -Bermudy bm -Bermwda bm -Bermudas bm -ΒεÏμοÏδες bm -Bermudoj bm -برمودا bm -Bermudes bm -Beirmiúda bm -ברמודה bm -बरमूडा bm -Bermúdaeyjar bm -英領ãƒãƒ¼ãƒŸãƒ¥ãƒ¼ãƒ€ bm -ប៊áŸážšáž˜áž¼ážŠáž¶ bm -버뮤다 bm -ເàºàº¥àº¥àº°àº¡àº±àº™ bm -Bermudų bm -Bermudas bm -Бермуди bm -Бермуда bm -ਬੀਰਮà©à¨¡à¨¾ bm -Bermudy bm -Bermude bm -БермудÑкие ОÑтрова bm -Berimuda bm -Bermudy bm -Bermudi bm -Бермуда bm -பெரà¯à®®à¯à®Ÿà®¾ bm -Бермудо bm -เบอร์มิวดา bm -Бермуди bm -Бермуда Ороллари bm -Bermudes bm -百慕大 bm -ç™¾æ…•é” bm -Brunei Darussalam bn -بروناي دار السلام bn -БрунÑй bn -Бруней bn -বà§à¦°à§à¦¨à§‡à¦‡ দারà¦à¦¸à¦¸à¦²à¦¾à¦® bn -Darussalam Brunei bn -Brunej bn -Brwnei Darwsalam bn -Brunei bn -ΜπÏουνέι ÎταÏουσαλάμ bn -Brunejo bn -Brunei bn -برونویی بیت‌المقدس bn -Brunei bn -Brúiné bn -בורניי ×“×¨×•×¡×œ× bn -बà¥à¤°à¥‚नेई दारेसà¥à¤¸à¤²à¤¾à¤® bn -Brunei Szultánság bn -Brúnei Darussalam bn -Brunei bn -ブルãƒã‚¤ bn -ប្រ៊ុយណ០bn -ë¸Œë£¨ë‚˜ì´ bn -ເບລາລັສເຊີຠbn -Bruneja Darusalama bn -Брунеи Дар ÐµÑ Ð¡Ð°Ð»Ð°Ð¼ bn -Бруней ДаруÑÑалам bn -Brunei bn -Brunei bn -Brunei bn -ਬਰੂਨੀ ਡਾਰੂਸਲਾਮ bn -Brunei Dar-es-Salam bn -Brunei bn -Бруней bn -Buruneyi Darusalamu bn -Brunei bn -Brunei Darusalam bn -Брунеј ДаруÑалам bn -Brunej Darusalam bn -பà¯à®°à¯‚னை டரà¯à®šà®²à®¾à®®à¯ bn -Брунеи Ð‘Ð°Ð¹Ñ‚ÑƒÐ»Ð¼ÑƒÒ›Ð°Ð´Ð´Ð°Ñ bn -บรูไนดูรัสซาลาม bn -Brunei bn -Бруней ДаруÑÑалам bn -Бруней ДоруÑÑалом bn -Bruney Darussalam bn -文莱达é²è¨å…° bn -æ–‡èŠé”魯薩蘭 bn -Bolivia bo -Bolivië bo -بوليÙيا bo -Boliviya bo -Ð‘Ð°Ð»Ñ–Ð²Ñ–Ñ bo -Ð‘Ð¾Ð»Ð¸Ð²Ð¸Ñ bo -বলিভিয়া bo -Bolivija bo -Bolívia bo -Bolívie bo -Bolifia bo -Bolivien bo -Βολιβία bo -Bolivio bo -Boliivia bo -بولیوی bo -Bolivie bo -An Bholaiv bo -Bolívia bo -בוליביה bo -बोलिविया bo -Bolivija bo -Bolívia bo -Bólivía bo -ボリビア bo -បូលីវី bo -볼리비아 bo -ໂບລີເວີຠbo -Bolivija bo -BolÄ«vija bo -Боливија bo -Боливи bo -Bolivja bo -Bolivien bo -ਬੋਲਵੀਆ bo -Boliwia bo -Bolívia bo -Bolívia bo -Ð‘Ð¾Ð»Ð¸Ð²Ð¸Ñ bo -Boliviya bo -Bolívia bo -Bolivija bo -Боливија bo -Bolivija bo -I-Bolivia bo -பொலிவியா bo -Ð‘Ð¾Ð»Ð¸Ð²Ð¸Ñ bo -โบลิเวีย bo -Bolivya bo -Ð‘Ð¾Ð»Ñ–Ð²Ñ–Ñ bo -Ð‘Ð¾Ð»Ð¸Ð²Ð¸Ñ bo -Boliveye bo -玻利维亚 bo -玻利維亞 bo -Brazil br -Brazilië br -البرازيل br -Braziliya br -Ð‘Ñ€Ð°Ð·Ñ‹Ð»Ñ–Ñ br -Ð‘Ñ€Ð°Ð·Ð¸Ð»Ð¸Ñ br -বà§à¦°à¦¾à¦œà¦¿à¦² br -Brasil br -Brazílie br -Brasil br -Brasilien br -Brasilien br -Î’Ïαζιλία br -Brazilo br -Brasil br -Brasiilia br -Brasil br -برزیل br -Brasilia br -Brésil br -Brazilië br -An Bhrasaíl br -Brasil br -ברזיל br -बà¥à¤°à¤¾à¤œà¥€à¤² br -Brazília br -Brasilía br -Brasile br -ブラジル br -ប្រáŸáž áŸ’ស៊ីល br -브ë¼ì§ˆ br -ບາຊີລ br -Brazilija br -BrazÄ«lija br -Бразил br -Бразил br -Brażil br -Brasil br -Brasilien br -Brazilië br -Brasil br -Brasil br -ਬਰਾਜ਼ੀਲ br -Brazylia br -Brasil br -Brasil br -Brazilia br -Ð‘Ñ€Ð°Ð·Ð¸Ð»Ð¸Ñ br -Burezile br -Brasil br -Brazília br -Brazilija br -Бразил br -I-Brazil br -Brasilien br -பிரேசில௠br -Бразил br -บราซิล br -Brezilya br -Ð‘Ñ€Ð°Ð·Ð¸Ð»Ñ–Ñ br -Ð‘Ñ€Ð°Ð·Ð¸Ð»Ð¸Ñ br -Burazili br -Braezi br -巴西 br -巴西 br -Bahamas bs -جزر الباهاما bs -Багамы bs -БахамÑки оÑтрови bs -বাহামাস bs -Bahami bs -Bahames bs -Bahamy bs -Ynysoedd Bahama bs -Μπαχάμες bs -Bahamoj bs -Bahama bs -باهاماس bs -Bahaman saaret bs -Na Bahámaí bs -Baamas bs -בהמס bs -बहामा bs -Bahamák bs -Bahamaeyjar bs -ãƒãƒãƒž bs -បាហាម៉ា bs -바하마 bs -ປານາມາ bs -Bahamų bs -Бахами bs -Ð‘Ð°Ñ…Ð°Ð¼Ð°Ñ bs -Baħamas bs -ਬਾਹਾਮਾਸ bs -Bahamy bs -БагамÑкие оÑтрова bs -Bahamasi bs -Bahamy bs -Bahami bs -Бахами bs -Bahami bs -பனாமா bs -Ð‘Ð¾Ò³Ð¾Ð¼Ð¾Ñ bs -บาฮามา bs -Bahamalar bs -Багами bs -Багама Ороллари bs -巴哈马 bs -巴拿馬 bs -Bhutan bt -بوتان bt -Бутан bt -Бутан bt -ভূটান bt -Butañ bt -Butan bt -Bhútán bt -Bhwtan bt -Μπουτάν bt -Butano bt -Bhután bt -بوتان bt -Bhoutan bt -An Bhútáin bt -Bután bt -בהוטן bt -भूटान bt -Bhután bt -Bútan bt -ブータン bt -ប៊ូážáž¶áž“ bt -부탄 bt -ຖັàºàºà»ˆàº‡àº§ bt -Bhutano bt -ButÄna bt -Бутан bt -Бутан bt -Butan bt -ਭà©à¨Ÿà¨¾à¨¨ bt -Butão bt -Butão bt -Butan bt -Бутан bt -Butani bt -Butan bt -Бутан bt -Butan bt -பூடான௠bt -Бутон bt -ภูà¸à¸²à¸™ bt -Butan bt -Бутан bt -Бутан bt -Boutan bt -ä¸ä¸¹ bt -ä¸ä¸¹ bt -Botswana bw -بوتسوانا bw -БатÑвана bw -БотÑуана bw -বটসওয়ানা bw -Bocvana bw -Μποτσουάνα bw -Bocvano bw -بوتسووانا bw -An Bhotsuáin bw -Botsuana bw -בוצ×ונה bw -बोतà¥à¤¸à¤µà¤¾à¤¨à¤¾ bw -Botsvana bw -Botsvana bw -ボツワナ bw -បុážážŸáŸ’វាណា bw -보츠와나 bw -ບອດສເນີຠbw -Botsvanos bw -BotsvÄna bw -Боцвана bw -БотÑвана bw -ਬੋਟਸਵਾਨਾ bw -Botsuana bw -БотÑвана bw -Botsvana bw -Боцвана bw -Bocvana bw -பாடà¯à®¸à¯à®µà®©à®¾ bw -БотÑвана bw -บอทสวานา bw -Botsvana bw -БотÑвана bw -Боцвана bw -Boswana bw -åšèŒ¨ç“¦çº³ bw -波札那 bw -Belarus by -روسيا البيضاء by -БеларуÑÑŒ by -Ð‘ÐµÐ»Ð°Ñ€ÑƒÑ by -বেলারà§à¦¸ by -Belarusi by -Bjelorusija by -Bielorússia by -BÄ›lorusko by -Belarws by -Hviderusland by -Weißrussland by -ΛευκοÏωσία by -Belorusio by -Valgevene by -بلاروس by -Valkovenäjä by -Hvítarusland by -Bélarus by -Wyt-Rusland by -An Bhealarúis by -Bielorúsia by -בלרוס by -बेलारूस by -Bjelorusija by -Fehéroroszország by -Hvíta-Rússland by -Bielorussia by -ベラルーシ by -áž”áŸáž¡áž¶ážšáž»ážŸáŸ’ស by -벨ë¼ë£¨ìФ by -ເບລາລັສ by -Baltarusija by -Baltkrievija by -БелоруÑија by -Цагаан Ð¾Ñ€Ð¾Ñ by -Hviterussland by -Wittrussland by -Wit-Rusland by -Kviterussland by -ਬੇਲਾਰੂਸ by -BiaÅ‚oruÅ› by -Bielorrússia by -БеларуÑÑŒ by -Belarusi by -Vilges-Ruošša by -Bielorusko by -Belorusija by -БелоруÑија by -Belorusija by -I-Belarus by -Vitryssland by -பெலாரூச௠by -БелоруÑиё by -เบลารุส by -БілоруÑÑ–Ñ by -Ð‘ÐµÐ»Ð¾Ñ€ÑƒÑ by -Belaruss by -白俄罗斯 by -白俄羅斯 by -Belize bz -بيليز bz -БÑлізе bz -Белийз bz -বেলিজ bz -Beliz bz -Bel?s bz -Μπελίζε bz -Belizo bz -بلیز bz -An Bheilís bz -בליז bz -बेलिज bz -Belís bz -ベリーズ bz -áž”áŸáž›áž¸áž áŸ’ស bz -벨리즈 bz -ເບລàºà»ˆàº‡àº¡ bz -Belizo bz -Beliza bz -Белизе bz -Ð‘ÐµÐ»Ð¸Ð·Ñ bz -Beliż bz -ਬੀਲੀਜ਼ਿ bz -Белиз bz -Белиз bz -Beliz bz -பெலà¯à®šà®¿à®¯à®®à¯ bz -Белиз bz -เบลไลซ์ bz -Beliz bz -Беліз bz -Белиз bz -伯利兹 bz -比利時 bz -Default C -Standaard C -Ø§ÙØªØ±Ø§Ø¶ÙŠ C -Ön QurÄŸulu C -Па ўмаўчаньні C -По подразбиране C -ডিফলà§à¦Ÿ C -Dre ziouer C -Omissió C -Výchozí C -Rhagosodedig C -Standard C -Standard C -ΠÏοκαθοÏισμένο C -Apriora C -Predeterminado C -Vaikimisi C -Lehenetsia C -Ù¾ÛŒØ´â€ŒÙØ±Ø¶ C -Oletus C -Forsettur C -Par défaut C -Standert C -Réamhshocrú C -Por Omisión C -ברירת מחדל C -डिफ़ॉलà¥à¤Ÿ C -UobiÄajeno C -Standard C -Alapértelmezett C -Standar C -Sjálfgefið C -Predefinito C -標準 C -លំនាំដើម C -기본 C -ຄ່າປະລິàºàº²àº C -Numatyta C -NoklusÄ“tais C -Почетно C -Стандарт C -Normali C -Standard C -Standard C -Standaard C -Standard C -Thuso ya Tshoganetso C -Omission C -ਮੂਲ C -DomyÅ›lnie C -Por Omissão C -Padrão C -Implicit C -По умолчанию C -Mburabuzi C -Standárda C -Å tandardný C -Privzeto C -Подразумевано C -Podrazumevano C -Förval C -à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯ C -Пешфарзӣ C -ค่าปริยาย C -Öntanımlı C -Ğädäti C -Типовий C -Ðндоза C -Mặc định C -Prémetou C -Okwendalo C -默认 C -é è¨­ C -Okwendalo C -Canada ca -Kanada ca -كندا ca -Kanada ca -Канада ca -Канада ca -কানাডা ca -Kanada ca -Kanada ca -Canadà ca -Kanada ca -Kanada ca -Καναδάς ca -Kanado ca -Canadá ca -Kanada ca -Kanada ca -کانادا ca -Kanada ca -Kanada ca -Kanada ca -Ceanada ca -Canadá ca -קנדה ca -कनाडा ca -Kanada ca -Kanada ca -Kanada ca -Kanada ca -カナダ ca -កាណាដា ca -ìºë‚˜ë‹¤ ca -à»àº„ນາດາ ca -Kanada ca -KanÄda ca -Канада ca -Канад ca -Kanada ca -Kanada ca -ਕੈਨੇਡਾ ca -Kanada ca -Canadá ca -Canadá ca -Канада ca -Kanada ca -Kanada ca -Kanada ca -Канада ca -Kanada ca -I-Canada ca -Kanada ca -கனடா ca -Канада ca -à¹à¸„นาดา ca -Kanada ca -Kanada ca -Канада ca -Канада ca -加拿大 ca -加拿大 ca -Cocos (Keeling) Islands cc -Kokos Eilande cc -جزر كوكوس (كيلينغ) cc -КокоÑови оÑтрови cc -কোকোস (কীলিং) দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ cc -Inizi Koko (Keeling) cc -Kokosovo (Keeling) ostrvo cc -Illes Cocos (Keeling) cc -Kokosové ostrovy (Keeling) cc -Ynysoedd y Cocos (Keeling) cc -Cocos/Keeling-Inseln cc -Îήσοι Κόκος (Κήλινγκ) cc -Kokosinsuloj cc -Islas Cocos (Keeling) cc -Kookossaared cc -Cocos Irlak cc -جزایر کوکوس کیلینگ cc -Cookinsaaret cc -ÃŽles Cocos cc -Oileán na gCócónna (Keeling) cc -Illas Cocos (Keeling) cc -××™×™ קוקוס cc -कोकोस (कीलिंग) आइलैंडà¥à¤¸ cc -Cocos (Keeling) Otoci cc -Kókusz-szigetek (Keeling) cc -Kókoseyjar cc -Isole Cocos (Keeling) cc -オーストラリア領ココス島 cc -កោះ Cocos (Keeling) cc -코코스 ì œë„ cc -Kokosu salas cc -ОÑтрови ÐšÐ¾ÐºÐ¾Ñ (Килинг) cc -Cocos (Keeling) арлууд cc -Gżejjer Cocos (Keeling) cc -Kokosøyene cc -Cocos- (Keeling-) Inseln cc -Kokosøyane cc -ਕੋਕੋਸ(ਕਿਨਿੰਗ) ਟਾਪੂ cc -Wyspy Kokosowe (Keelinga) cc -Ilhas Cocos (Keeling) cc -Ilhas Cocos cc -Insulele Cocos (Keeling) cc -КокоÑовые (Килинг) оÑтрова cc -Ibirwa Kokosi cc -Kokosullut cc -Kokosove Ostrovy cc -Kokosovi (Keelingovi) otoki cc -КокоÑова (Килингова) оÑтрва cc -Kokosova (Kilingova) ostrva cc -Kokosöarna cc -கோகோஸ௠(கீலிஙà¯) தீவà¯à®•ள௠cc -Ҷазираи ÐšÐ¾ÐºÐ¾Ñ (Килинг) cc -หมู่เà¸à¸²à¸°à¹‚คคอส (Keeling) cc -Keeling Adaları cc -Kokos (Keeling) Utrawları cc -КокоÑові оÑтрови cc -ÐšÐ¾ÐºÐ¾Ñ (Килинг) Ороллари cc -Iyes Cocos cc -科科斯群岛 cc -å¯å¯æ–¯ç¾¤å³¶ cc -Congo, The Democratic Republic of the cd -Kongo, Demokratiese republiek van die cd -ДÑÐ¼Ð°ÐºÑ€Ð°Ñ‚Ñ‹Ñ‡Ð½Ð°Ñ Ð ÑÑпубліка Конга cd -ДР Конго cd -কঙà§à¦—োর গণতানà§à¦¤à§à¦°à¦¿à¦• পà§à¦°à¦œà¦¾à¦¤à¦¨à§à¦¤à§à¦° cd -Kongo, Demokratska republika cd -Congo, República Democràtica del cd -Kongo cd -Congo, Gweriniaeth Democrataidd y cd -Congo, den demokratiske republik cd -Kongo, Republik cd -Κονγκό, ΔημοκÏατία του cd -Kongo, la Demokratia Respubliko de la cd -Congo, República democrática del cd -Kongo (DV) cd -Kongoko Errepublika Demokratikoa cd -Kongon demokraattinen tasavalta cd -République Démocratique du Congo cd -Kongo, de democratische republyk van de cd -Poblacht Dhaonlathach an Chongó cd -Congo, República Democrática do cd -קונגו, הרפובליקה הדמוקרטית של cd -डेमोकà¥à¤°à¥‡à¤Ÿà¤¿à¤• रिपबà¥à¤²à¤¿à¤• ऑफ कॉगो cd -Kongói Demokratikus Köztársaság cd -Kongó, Austur cd -Congo, Repubblica Democratica del cd -コンゴ,民主共和国 cd -សាធារណរដ្ឋ​ប្រជាធិបážáŸáž™áŸ’យ​កុងហ្គោ cd -Kongo demokratinÄ— respublika cd -Kongo demokrÄtiskÄ republika cd -Конго, ДемократÑка Република на cd -Kongo (RD) cd -Kongo cd -Kongo (De demokraatsche Republiek) cd -Congo, Democratische republiek cd -Kongo cd -ਕਾਂਗੋ, ਲੋਕਤੰਤਰੀ ਗਣਰਾਜ cd -Republika Demokratyczna Kongo cd -Congo, República Democrática do cd -República Democrática do Congo cd -Congo, Republica Democrată cd -ДемократичеÑÐºÐ°Ñ Ð ÐµÑпублика Конго cd -Kongo, Repubulika Iharanira Demokarasi ya cd -Kongo cd -Demokratická Republika Kongo cd -Kongo, demokratiÄna republika cd -Конго, ДемократÑка Република cd -Kongo, Demokratska Republika cd -Demokratiska republiken Kongo cd -கானà¯à®•ோ, கà¯à®Ÿà®¿à®¯à®°à®šà¯ cd -Ҷумҳурии демократии Ҳонконг cd -สาธารณรัà¸à¸›à¸£à¸°à¸Šà¸²à¸˜à¸´à¸›à¹„ตยคองโภcd -Demokratik Kongo Cumhuriyeti cd -Kongo, Demokrat Cömhüriäte cd -Конго, демократична реÑпубліка cd -Конго Демократик РеÑпубликаÑи cd -Congo, republike democratike cd -刚果民主共和国 cd -剛果民主共和國 cd -Central African Republic cf -Sentrale Afrika Republiek cf -جمهورية Ø£ÙØ±ÙŠÙ‚يا الوسطى cf -ЦÑнтральнаафрыканÑÐºÐ°Ñ Ð ÑÑпубліка cf -ЦÐР cf -মধà§à¦¯ আফà§à¦°à¦¿à¦•ান রিপাবলিক cf -Republik centrafricaine cf -CentralnoafriÄka Republika cf -República Centro Africana cf -StÅ™edoafrická republika cf -Gweriniaeth Canolig Affrica cf -Central-afrikanske Republik cf -Zentralafrikanische Republik cf -ΔημοκÏατία ΚεντÏικής ΑφÏικής cf -Mezafrika Respubliko cf -República Centroafricana cf -Kesk-Aafrika Vabariik cf -Afrika Erdiko Errepublika cf -جمهوری Ø§ÙØ±ÛŒÙ‚ای مرکزی cf -Keski-Afrikan tasavalta cf -République centrafricaine cf -Sintraal Afrikaanse Republyk cf -Poblacht na hAfraice Láir cf -República Centro Africana cf -הרפובליקה ×”×פריקנית התיכונה cf -सेंटà¥à¤°à¤² अफà¥à¤°à¥€à¤•न रिपबà¥à¤²à¤¿à¤• cf -Centralna AfriÄka Republika cf -Közép-Afrikai Köztársaság cf -Mið-Afríkulýðveldið cf -Repubblica Centrafricana cf -中央アフリカ共和国 cf -សាធារណរដ្ឋ​អាហ្វ្រិក​កណ្ដាល cf -중앙 아프리카 공화국 cf -ໂດມິນິàºàº±àº™ cf -CentrinÄ—s Afrikos Respublika cf -CentrÄlÄfrikas republika cf -ЦентралноафриканÑка Република cf -Төв африкын ард ÑƒÐ»Ñ cf -Repubblika ÄŠentrali Afrikana cf -Den sentralafrikanske republikk cf -Zentraalafrikaansche Republiek cf -Centraal Afrikaanse Republiek cf -Den sentralafrikanske republikken cf -ਕੇਂਦਰੀ ਅਫਰੀਕੀ ਗਣਰਾਜ cf -Republika Åšrodkowej Afryki cf -República Central Africana cf -República da Ãfrica Central cf -Republica Centrafricană cf -Центрально-ÐфриканÑÐºÐ°Ñ Ð ÐµÑпублика cf -Repubulika ya Santara Afurika cf -GuovddášafrihkálaÅ¡ republihkka cf -Stredoafrická Republika cf -CentralnoafriÅ¡ka republika cf -Централноафричка Република cf -CentralnoafriÄka Republika cf -Centralafrikanska Republiken cf -மைய ஆபà¯à®ªà®¿à®°à®¿à®•à¯à®• கà¯à®Ÿà®¿à®¯à®°à®šà¯ cf -Ҷумҳурии Ðфриқои Марказӣ cf -สาธารณรัà¸à¸­à¸±à¸Ÿà¸£à¸´à¸à¸²à¸à¸¥à¸²à¸‡ cf -Orta Afrika Cumhuriyeti cf -Üzäk Afrika Cömhüriäte cf -Центральна африканÑька реÑпубліка cf -Марказий Ðфрика РеÑпубликаÑи cf -Cá»™ng hoà Trung Phi cf -Cintrafrike cf -中éžå…±å’Œå›½ cf -多明尼加共和國 cf -Congo cg -Konsole cg -الكونغو cg -Конга cg -Конго cg -কঙà§à¦—à§‹ cg -Kongo cg -Kongo cg -Kongo cg -Kongo cg -Κονγκό cg -Kongo (Brazavila) cg -Kongo cg -Kongo cg -Ú©Ù†Ú¯Ùˆ cg -Kongo cg -Kongo cg -Congó cg -קונגו cg -कोंगो cg -Kongo cg -Kongó cg -Kongó, Vestur cg -コンゴ cg -កុងហ្គោ cg -콩고 cg -ຄອນໂà»àºŠàº¥ cg -Kongo cg -Kongo cg -Конго cg -Конго cg -Kongo cg -Kongo-Brazaville cg -Kongo cg -Kongo-Brazaville cg -ਕਾਂਗੋ cg -Kongo cg -Конго cg -Kongo cg -Kongo cg -Kongo cg -Kongo cg -Конго cg -Kongo cg -Kongo cg -கானà¯à®•ோ cg -Конго cg -คองโภcg -Kongo cg -Kongo cg -Конго cg -Конго cg -刚果 cg -剛果 cg -Switzerland ch -Switserland ch -سويسرا ch -İsveçrÉ™ ch -ШвÑÐ¹Ñ†Ð°Ñ€Ñ‹Ñ ch -Ð¨Ð²ÐµÐ¹Ñ†Ð°Ñ€Ð¸Ñ ch -সà§à¦‡à¦œà¦¾à¦°à¦²à§à¦¯à¦¾à¦£à§à¦¡ ch -Suis ch -Å vicarska ch -Suïssa ch -Å výcarsko ch -Y Swistir ch -Schweiz ch -Schweiz ch -Ελβετία ch -Svislando ch -Suiza ch -Å veits ch -Suitza ch -سوییس ch -Sveitsi ch -Suisse ch -Switserlân ch -An Eilvéis ch -Suíza ch -שוייץ ch -सà¥à¤µà¤¿à¤Ÿà¥à¤œà¤°à¤²à¥ˆà¤‚ड ch -Å vicarska ch -Svájc ch -Swiss ch -Sviss ch -Svizzera ch -スイス ch -ស្វ៊ីស ch -스위스 ch -ສະວິສເຊີà»àº¥àº™ ch -Å veicarija ch -Å veice ch -Швајцарија ch -Швецарь ch -Svizzera ch -Sveits ch -Swiez ch -Zwitserland ch -Sveits ch -Suissa ch -ਸਵਿਟਜ਼ਰਲੈਂਡ ch -Szwajcaria ch -Suíça ch -Suíça ch -ElveÅ£ia ch -Ð¨Ð²ÐµÐ¹Ñ†Ð°Ñ€Ð¸Ñ ch -Swazilande ch -Å veica ch -Å vajÄiarsko ch -Å vica ch -ШвајцарÑка ch -Å vajcarska ch -I-Switzerland ch -Schweiz ch -சà¯à®µà®¿à®Ÿà¯à®šà®°à¯à®²à®¾à®¨à¯à®¤à¯ ch -Свитзерланд ch -สวิสเซอร์à¹à¸¥à¸™à¸”์ ch -İsviçre ch -İswiçrä ch -Ð¨Ð²ÐµÐ¹Ñ†Ð°Ñ€Ñ–Ñ ch -Ð¨Ð²ÐµÐ¹Ñ†Ð°Ñ€Ð¸Ñ ch -Thuỵ SÄ© ch -Swisse ch -瑞士 ch -瑞士 ch -Cote d'ivoire ci -ساحل العاج ci -Бераг Слановай КоÑьці ci -Кот Дивоар ci -Aod an Olifant ci -Obala SlonovaÄe ci -Costa d'ivori ci -PobÅ™eží slonoviny ci -Y Traeth Ifori ci -Elfenbenskysten ci -Ακτή Î•Î»ÎµÏ†Î±Î½Ï„Î¿ÏƒÏ„Î¿Ï ci -Eburio ci -Costa de Marfil ci -Cote d'Ivoire ci -Boli kosta ci -Ú©ÙØªÙ دیوÙیر ci -Côte d'Ivoire ci -Ivoorkust ci -An Cósta Eabhair ci -कोट डि'वॉरे ci -Baci kocke ci -Elefántcsontpart ci -Fílabeinsströndin ci -Costa d'Avorio ci -コートジボアール ci -កូដឌីវáŸážš ci -코트디부아르 ci -ປ່ອàºàº«àº¡àº²àºàºàº°àº¥àº­àº ci -KotdivuÄra ci -Брегот на Слоновата КоÑка ci -Kosta tal-Avorju ci -Elfenbenskysten ci -Elfenbeenküst ci -Ivoorkust ci -Elfenbeinskysten ci -ਕਾਂਟੋ ਡੀਵੋਇਰੀ ci -Wybrzeże KoÅ›ci SÅ‚oniowej ci -Costa do Marfim ci -Coasta de Azur ci -Кот Д'Ивуар ci -Kote divuware ci -ElfenÄalánriddu ci -SlonokoÅ¡Äena obala ci -Обала Ñлоноваче ci -Obala slonovaÄe ci -Elfenbenskusten ci -Соҳили Оҷ ci -อ่าวไอวอรี ci -Кот Д'Івуар ci -Кот д'Ивуар ci -Bá» biển ngà ci -Coisse d' Ivwere ci -科特迪瓦 ci -象牙海岸 ci -Cook islands ck -Cook Eilande ck -جزر كوك ck -ÐÑтравы Кука ck -ОÑтрови Кук ck -কà§à¦• দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ ck -Inizi Kook ck -Kukova ostrva ck -Illes Cook ck -Cookovy ostrovy ck -Ynysoedd Cook ck -Cook-øerne ck -Cook-Inseln ck -Îησιά Κουκ ck -Kukinsuloj ck -Islas Cook ck -Cooki saared ck -Cook Irlak ck -جزایر Ú©ÙˆÚ© ck -Cooksaaret ck -ÃŽles Cook ck -Oileáin Chook ck -Illas Cook ck -××™×™ קוק ck -कà¥à¤• आइलैंड ck -Cook otoci ck -Cook-szigetek ck -Cooks-eyjar ck -Isole Cook ck -ニュージーランド自治領クック諸島 ck -កោះ Cook ck -ì¿¡ ì œë„ ck -ຄຸàºàºàºµà»‰ ck -Kuko salų ck -Kuka salas ck -Кукови оÑтрови ck -Cook арлууд ck -Gżejjer Cook ck -Cookøyene ck -Cookinseln ck -Cook Eilanden ck -Cookøyane ck -ਕà©à©±à¨• ਟਾਪੂ ck -Wyspy Cooka ck -Ilhas Cook ck -Ilhas Cook ck -Insulele Cook ck -ОÑтрова Кука ck -Ibirwa bya Kuke ck -Cooksullut ck -Cookove ostrovy ck -Cookovi otoki ck -Кукова оÑтрва ck -Kukova ostrva ck -Cooköarna ck -கà¯à®•௠தீவ௠ck -Ҷазираи Кук ck -หมู่เà¸à¸²à¸°à¸„ุภck -Cook Adaları ck -Kok Utrawları ck -ОÑтрови Кука ck -Кук Ороллари ck -Iyes Cook ck -库克群岛 ck -庫克群島 ck -Chile cl -Chilië cl -تشيلي cl -Åžili cl -Чылі cl -Чили cl -চিলি cl -ÄŒile cl -Xile cl -Tsile cl -Χιλή cl -Ĉilio cl -TÅ¡iili cl -Txile cl -شیلی cl -Chili cl -Chili cl -An tSile cl -צ'ילה cl -चिली cl -ÄŒile cl -Chili cl -Cile cl -ãƒãƒª cl -ឈីលី cl -ì¹ ë ˆ cl -ຊີລີ cl -ÄŒilÄ— cl -Čīle cl -Чиле cl -Чили cl -ÄŠile cl -Chili cl -ਚਿੱਲੀ cl -Cile cl -Чили cl -Shili cl -ÄŒile cl -ÄŒile cl -Чиле cl -ÄŒile cl -I-Chile cl -சிலி cl -Чилли cl -ชิลี cl -Åžili cl -Çili cl -Чилі cl -Чили cl -Chi lê cl -Tchili cl -智利 cl -智利 cl -Cameroon cm -Kameroon cm -الكاميرون cm -КамÑрун cm -Камерун cm -কà§à¦¯à¦¾à¦®à§‡à¦°à§à¦¨ cm -Kameroun cm -Kamerun cm -Camerun cm -Kamerun cm -Y Camer?n cm -Cameroun cm -Kamerun cm -ΚαμεÏοÏν cm -Kameruno cm -Camerún cm -Kamerun cm -Kamerun cm -کامرون cm -Kamerun cm -Cameroun cm -Kameroen cm -Camarún cm -Camerún cm -קמרון cm -कैमरून cm -Kamerun cm -Kamerun cm -Kamerún cm -Camerun cm -カメルーン cm -កាមáŸážšáž¼áž“ cm -카메룬 cm -ຕາລາງງານ - K cm -KamerÅ«no cm -KamerÅ«na cm -Камерун cm -Камерун cm -Kamerun cm -Kamerun cm -Kamerun cm -Cameroen cm -Kamerun cm -ਕੈਮਰੂਨ cm -Kamerun cm -Camarões cm -Camarões cm -Camerun cm -Камерун cm -Kameruni cm -Kamerun cm -Komerun cm -Kamerun cm -Камерун cm -Kamerun cm -Kamerun cm -கமீரூன௠cm -Камерун cm -คาเมรูน cm -Kamerun cm -Kameroon cm -Камерун cm -Камерун cm -Camrone cm -喀麦隆 cm -喀麥隆 cm -China cn -الصين cn -Çin cn -Кітай cn -Китай cn -চীন cn -Sina cn -Kina cn -Xina cn -Čína cn -Tseina cn -Kina cn -Κίνα cn -Ĉinujo cn -Hiina cn -Txina cn -چین cn -Kiina cn -Kina cn -Chine cn -An tSín cn -סין cn -चीन cn -Kina cn -Kína cn -Cina cn -Kína cn -Cina cn -中国 cn -áž…áž·áž“ cn -중국 cn -ຈີນ cn -Kinija cn -Ķīna cn -Кина cn -Ð¥Ñтад cn -ÄŠina cn -Kina cn -Kina cn -Xina cn -ਚੀਨ cn -Chiny cn -Китай cn -Ubushinwa cn -Kiinná cn -Čína cn -Kitajska cn -Кина cn -Kina cn -I-China cn -Kina cn -சீனா cn -Хитой cn -จีน cn -Çin cn -Çin cn -Китай cn -Хитой cn -Trung Quốc cn -Chine cn -中国 cn -中國 cn -Colombia co -Colombië co -كولمبيا co -ÐšÐ°Ð»ÑŽÐ¼Ð±Ñ–Ñ co -ÐšÐ¾Ð»ÑƒÐ¼Ð±Ð¸Ñ co -কলোমà§à¦¬à¦¿à§Ÿà¦¾ co -Kolumbi co -Kolumbija co -Colòmbia co -Kolumbie co -Kolumbien co -Κολομβία co -Kolumbio co -Kolumbia co -Kolonbia co -کلمبیا co -Kolumbia co -Colombie co -Columbia co -An Cholóim co -Colómbia co -קולומביה co -कोलमà¥à¤¬à¤¿à¤¯à¤¾ co -Kolumbija co -Kolumbia co -Kólumbía co -コロンビア co -កូឡុំប៊ី co -콜롬비아 co -ໂຄລຳເບີຠco -Kolumbija co -Kolumbija co -Колумбија co -Колумб co -Kolumbja co -Kolumbien co -Columbia co -ਕੋਲੰਬੀਆ co -Kolumbia co -Colômbia co -Colômbia co -Columbia co -ÐšÐ¾Ð»ÑƒÐ¼Ð±Ð¸Ñ co -Kolombiya co -Kolombia co -Kolumbia co -Kolumbija co -Колумбија co -Kolumbija co -I-Colombia co -கொலமà¯à®ªà®¿à®¯à®¾ co -ÐšÐ¾Ð»ÑƒÐ¼Ð±Ð¸Ñ co -โคลัมเบีย co -Kolombiya co -Kolombia co -ÐšÐ¾Ð»ÑƒÐ¼Ð±Ñ–Ñ co -ÐšÐ¾Ð»ÑƒÐ¼Ð±Ð¸Ñ co -Colombeye co -Columbia co -哥伦比亚 co -哥倫比亞 co -Costa Rica cr -كوستاريكا cr -КоÑта Рыка cr -КоÑта Рика cr -কোসà§à¦Ÿà¦¾ রিকা cr -Kosta Rika cr -Kostarika cr -Kostarika cr -Κόστα Ρίκα cr -Kostariko cr -کاستاریکا cr -Kosta Rika cr -Cósta Ríce cr -קוסטה ריקה cr -कोसà¥à¤Ÿà¤¾ रिका cr -Kosta rika cr -Kostaríka cr -コスタリカ cr -កូស្ážáž¶ážšáž¸áž€áž¶ cr -코스타 리카 cr -ໂຄເອເທີຠcr -Kosta Rika cr -Kostarika cr -КоÑта Рика cr -КоÑта Рика cr -ਕੋਸਟਾ ਰੀਕਾ cr -Kostaryka cr -КоÑта-Рика cr -Kosita Rika cr -Kostarika cr -Kostarika cr -КоÑтарика cr -Kostarika cr -I-Costa Rica cr -கோஸà¯à®Ÿà®¾ ரிகா cr -КоÑта Рика cr -คอสตาริà¸à¸² cr -Kosta Rika cr -Kosta Rika cr -КоÑта-Ріка cr -КоÑта Рика cr -哥斯达黎加 cr -哥斯大黎加 cr -Cuba cu -Kuba cu -كوبا cu -Куба cu -Куба cu -কিউবা cu -Kuba cu -Kuba cu -Kuba cu -Ciwba cu -Kuba cu -ΚοÏβα cu -Kubo cu -Kuuba cu -Kuba cu -کوبا cu -Kuuba cu -Kuba cu -Cúba cu -קובה cu -कà¥à¤¯à¥‚बा cu -Kuba cu -Kuba cu -Kúba cu -キュームcu -គុយបា cu -ì¿ ë°” cu -ເàºàº¡à»„ພ່ cu -Kuba cu -Kuba cu -Куба cu -Куба cu -Kuba cu -Kuba cu -ਕਿਊਬਾ cu -Kuba cu -Куба cu -Kuba cu -Kuba cu -Kuba cu -Куба cu -Kuba cu -I-Cuba cu -Kuba cu -கியà¯à®ªà®¾ cu -Куба cu -คิวบา cu -Küba cu -Kuba cu -Куба cu -Куба cu -å¤å·´ cu -å¤å·´ cu -Cape Verde cv -Kaap Verde cv -كاب Ùيردي cv -Кабо Верде cv -কেপ ভারডি cv -Penn Verde cv -Zelenortska ostrva cv -Cap Verd cv -Kapverdy cv -Cape Ferde cv -Kapverdiske øer cv -Cap Verdische Inseln cv -ΠÏάσινο ΑκÏωτήÏιο cv -Kapo-Verdo cv -Cabo Verde cv -Roheneeme saared cv -Cabo Verde cv -کیپ‌ورده cv -Kap Verde cv -Cap vert cv -Kaap Verdië cv -Rinn Verde cv -Cabo Verde cv -×›×£ וורדה cv -कैप वरà¥à¤¡à¥‡ cv -Zöldfoki-szigetek cv -Grænhöfðaeyjar cv -Capo Verde cv -カーãƒãƒ™ãƒ«ãƒ‡ cv -កាបវែរ cv -ì¹´ë³´ë² ë¥´ë° cv -ເàºàº¡à»„ພ່ cv -Kabaverde cv -Кејп Верде cv -Капе Ð’ÑÑ€Ð´Ñ cv -Kapp Verde cv -Kap Verde cv -Kaap Verdië cv -Kapp Verde cv -ਕੇਪ ਵੀਰਡੀ cv -Cabo Verde cv -Cabo Verde cv -Capul Verde cv -Кабо-Верде cv -Kapu Veri cv -Кејп Верд cv -Kejp Verd cv -Kap Verde cv -கேப௠வெரà¯à®Ÿà¯ cv -Димоғи Верде cv -à¹à¸«à¸¥à¸¡à¹€à¸§à¸­à¸£à¹Œà¸”ี cv -Kape Verde cv -Кабо-Верде cv -Кейп Верде cv -Cap Vert cv -佛得角 cv -ç¶­å¾·è§’ cv -Christmas Island cx -Kersfees Eiland cx -جزر الكريسماس cx -ОÑтров РождеÑтво cx -কà§à¦°à¦¿à¦¸à§à¦Ÿà¦®à¦¾à¦¸ দà§à¦¬à§€à¦ª cx -Inizi Nedeleg cx -BožiÄno ostrvo cx -Illa de Pascua cx -VánoÄní ostrovy cx -Ynys y Nadolig cx -Juleøen cx -Weihnachtsinsel cx -Îήσος των ΧÏιστουγέννων cx -Kristnaskinsulo cx -Islas Christmas cx -Jõulusaar cx -Eguberri Irla cx -جزایر کریسمس cx -Joulusaari cx -ÃŽle de Noël cx -Christmas Eilân cx -Oileán na Nollag cx -Illas Christmas cx -××™×™ כריסטמס cx -कà¥à¤°à¤¿à¤¸à¤®à¤¸ आइलैंड cx -UskrÅ¡nji otoci cx -Karácsony-szigetek cx -Jólaey cx -Isola Christmas cx -クリスマス諸島 cx -កោះ Christmas cx -í¬ë¦¬ìŠ¤ë§ˆìŠ¤ 섬 cx -ຄິດສະຕອລ cx -KalÄ—dų salos cx -ZiemassvÄ“tku salas cx -ВелигденÑки ОÑтрови cx -КриÑÑ‚Ð¼Ð°Ñ Ð°Ñ€Ð»ÑƒÑƒÐ´ cx -Christmasøya cx -Wiehnachtsinsel cx -Christmasøya cx -ਕà©à¨°à¨¿à¨¸à¨®à¨¿à¨¸ ਟਾਪੂ cx -Wyspy Bożego Narodzenia cx -Ilhas Natal cx -Ilhas do Natal cx -Insulele Christmas cx -ОÑтров РождеÑтва cx -Ikirwa cya Noheli cx -Christmassuollu cx -VianoÄné Ostrovy cx -BožiÄni otok cx -Божићно оÑтрво cx -Božićno ostrvo cx -Julön cx -கிரà¯à®¸à¯à®¤à¯à®®à®¸à¯ தீவ௠cx -Ҷазираи КриÑÑ‚Ð¼Ð°Ñ cx -เà¸à¸²à¸°à¸„ริสต์มาส cx -Yılbaşı Adaları cx -Christmas Utrawları cx -ОÑтрів Різдва cx -КриÑÐ¼Ð°Ñ ÐžÑ€Ð¾Ð»Ð¸ cx -Äảo giáng sinh cx -圣诞岛 cx -è–誕島 cx -Cyprus cy -Siprus cy -قبرص cy -Кіпр cy -Кипър cy -সাইপà§à¦°à¦¾à¦¸ cy -Chipr cy -Kipar cy -Xipre cy -Kypr cy -Cypern cy -Zypern cy -ΚÏÏ€Ïος cy -Cipro cy -Chipre cy -Küpros cy -Txipre cy -قبرس cy -Kypros cy -Chypre cy -An Chipir cy -Chipre cy -קפריסין cy -साइपà¥à¤°à¤¸ cy -Cipar cy -Ciprus cy -Kýpur cy -Cipro cy -キプロス cy -ស៊ីពរ០cy -키프로스 cy -ບີບອັດ cy -Kipro cy -Kipra cy -Кипар cy -Ð¡Ð¸Ð¿Ñ€ÑƒÑ cy -ÄŠipru cy -Kypros cy -Zypern cy -Kypros cy -ਕਿਉਪਰਸ cy -Cypr cy -Chipre cy -Chipre cy -Cipru cy -Кипр cy -Shipure cy -Kypros cy -Ciper cy -Кипар cy -Kipar cy -Cypern cy -சிபà¯à®°à®¸à¯ cy -Кипр cy -ไซปรัส cy -Kıbrıs cy -Kiper cy -Кіпр cy -Кипр cy -Síp cy -Chîpe cy -塞浦路斯 cy -賽普勒斯 cy -Czechia cz -Czechië cz -التشيك cz -Çex Respublikası cz -ЧÑÑ…Ñ–Ñ cz -Чешка република cz -চেকিয়া cz -Tchekia cz -ÄŒeÅ¡ka cz -Txèquia cz -ÄŒesko cz -Y Weriniaeth Siec cz -Tjekkiet cz -Tschechien cz -Τσεχία cz -ĈeÄ¥io cz -República Checa cz -TÅ¡ehhi cz -Txekia cz -Ú†Ú© cz -Tsekki cz -République tchèque cz -Tsjechië cz -Poblacht na Seice cz -Chéquia cz -צ'×›×™×” cz -चेक cz -ÄŒeÅ¡ka cz -Csehország cz -Tékkland cz -Repubblica Ceca cz -ãƒã‚§ã‚³ cz -ឆáŸáž€ cz -ì²´ì½” cz -ÄŒekija cz -ÄŒehija cz -Чешка cz -Чехиа cz -Cżekia cz -Tsjekkia cz -Tschechien cz -Tsjechië cz -Tsjekkia cz -Chèquia cz -ਚੈੱਚੀਆ cz -Czechy cz -República Checa cz -República Tcheca cz -Cehia cz -Ð§ÐµÑ…Ð¸Ñ cz -Ceke cz -ÄŒeahkka cz -ÄŒesko cz -ÄŒeÅ¡ka cz -Чешка cz -ÄŒeÅ¡ka cz -I-Czechia cz -Tjeckien cz -செகà¯à®¯à®¾ cz -Ð§ÐµÑ…Ð¸Ñ cz -เชค cz -Çek Cumhuriyeti cz -Çexiä cz -Ð§ÐµÑ…Ñ–Ñ cz -Ð§ÐµÑ…Ð¸Ñ cz -Séc cz -Tchekeye cz -æ·å…‹ cz -æ·å…‹ cz -Germany de -Duitsland de -ألمانيا de -Almaniya de -ÐÑмеччына de -Ð“ÐµÑ€Ð¼Ð°Ð½Ð¸Ñ de -জারà§à¦®à¦¾à¦¨à¦¿ de -Alamagn de -NjemaÄka de -Alemanya de -NÄ›mecko de -Yr Almaen de -Tyskland de -Deutschland de -ΓεÏμανία de -Germanio de -Alemania de -Saksamaa de -Alemania de -آلمان de -Saksa de -Týskland de -Allemagne de -Dûtslân de -An Ghearmáin de -Alemaña de -גרמניה de -जरà¥à¤®à¤¨à¥€ de -NjemaÄka de -Németország de -Jerman de -Þýskaland de -Germania de -ドイツ de -អាល្លឺម៉ង់ de -ë…ì¼ de -ເàºàº¥àº¥àº°àº¡àº±àº™àº™àºµ de -Vokietija de -VÄcija de -Германија de -Герман de -Jerman de -Ä ermanja de -Tyskland de -Düütschland de -Duitsland de -Tyskland de -Alemanya de -ਜਰਮਨੀ de -Niemcy de -Alemanha de -Alemanha de -Germania de -Ð“ÐµÑ€Ð¼Ð°Ð½Ð¸Ñ de -Ubudage de -Duiska de -Nemecko de -NemÄija de -Ðемачка de -NemaÄka de -I-Germany de -Tyskland de -ஜெரà¯à®®à®©à®¿ de -Олмон de -เยอรมันนี de -Almanya de -Almania de -Ðімеччина de -ÐžÐ»Ð¼Ð¾Ð½Ð¸Ñ de -Äức de -Almagne de -德国 de -德國 de -IJalimani de -Djibouti dj -جيبوتي dj -Джыбуці dj -Джибути dj -জিবৌতি dj -Äibuti dj -Džibuti dj -Jib?ti dj -Dschibuti dj -Τζιμπουτί dj -Äœibutio dj -جیبوتی dj -Xibuti dj -×’'יבוטי dj -डिबौती dj -Džibuti dj -Dzsibuti dj -Djíbútí dj -Gibuti dj -ジブムdj -ហ្ស៊ីបូទី dj -지부티 dj -ພັດພາ dj -Džibutis dj -Džibutija dj -Ðибути dj -Жибут dj -DÄ¡ibuti dj -Dschibouti dj -ਡਜੀਬà©à¨‰à¨Ÿà©€ dj -Dżibuti dj -Djibuti dj -Djibuti dj -Джибути dj -Jibuti dj -Djibuhti dj -Džibuty dj -Džibuti dj -Ðибути dj -Džibuti dj -I-Djibouti dj -டிஜிபொடி dj -Ҷибойти dj -จิบูติ dj -Cibuti dj -Djibuti dj -Джібуті dj -Жибути dj -å‰å¸ƒæ dj -å‰å¸ƒåœ° dj -Denmark dk -Denemarke dk -الدنمارك dk -Danimarka dk -Ð”Ð°Ð½Ñ–Ñ dk -Ð”Ð°Ð½Ð¸Ñ dk -ডেনমারà§à¦• dk -Danmark dk -Danska dk -Dinamarca dk -Dánsko dk -Denmarc dk -Danmark dk -Dänemark dk -Δανία dk -Danlando dk -Dinamarca dk -Taani dk -Danimarka dk -دانمارک dk -Tanska dk -Danmark dk -Danemark dk -Denemarken dk -An Danmhairg dk -Dinamarca dk -דנמרק dk -डेनमारà¥à¤• dk -Danska dk -Dánia dk -Danmörk dk -Danimarca dk -デンマーク dk -ដាណឺម៉ាក dk -ë´ë§ˆí¬ dk -ເດນມາຠdk -Danija dk -DÄnija dk -ДанÑка dk -Дани dk -Danimarka dk -Danmark dk -Dänmark dk -Denemarken dk -Danmark dk -Dinamarca dk -ਡੈੱਨਮਾਰਕ dk -Dania dk -Dinamarca dk -Dinamarca dk -Danemarca dk -Ð”Ð°Ð½Ð¸Ñ dk -Danimarike dk -Dánmárku dk -Dánsko dk -Danska dk -ДанÑка dk -Danska dk -I-Denmark dk -Danmark dk -டெனà¯à®®à®¾à®°à¯à®•௠dk -Денмарк dk -เดนมาร์ภdk -Danimarka dk -Dania dk -Ð”Ð°Ð½Ñ–Ñ dk -Ð”Ð°Ð½Ð¸Ñ dk -Äan Mạch dk -DaenmÃ¥tche dk -丹麦 dk -丹麥 dk -Dominica dm -Dominisië dm -دومينيكا dm -Дамініка dm -Доминика dm -ডমিনিকা dm -Dominik dm -Dominika dm -Dominika dm -Dominikanische Republik dm -Îτομίνικα dm -Dominiko dm -دومینیکا dm -Dominique dm -Doiminice dm -דומינקה dm -डोमिनिका dm -Dominika dm -Dóminíka dm -ドミニカ dm -ដូមីនីកា dm -ë„미니카 dm -ໂລມາເນີຠdm -Dominika dm -Dominika dm -Доминика dm -Доминика dm -Dominika dm -ਡੋਮਾਨੀਕਾ dm -Dominika dm -Dominicana dm -Доминика dm -Dominikani dm -Dominikánsko dm -Dominikanska republika dm -Доминика dm -Dominika dm -டொமினிகா dm -Доминика dm -โดมินาà¸à¸±à¸™ dm -Dominik dm -Dominika dm -Домініка dm -Доминика dm -Dominike dm -多米尼加 dm -多明尼加 dm -Dominican Republic do -Dominikaanse Republiek do -جمهورية الدومينيكان do -Dominik Respublikası do -ДамініканÑÐºÐ°Ñ Ð ÑÑпубліка do -ДоминиканÑка република do -ডমিনিকান রিপাবলিক do -Republik Dominikan do -Dominikanska Republika do -República Dominicana do -Dominikánská republika do -Gweriniaeth Dominica do -Dominikanske Republik do -Dominikanische Republik do -Δομινικανή ΔημοκÏατία do -Dominika Respubliko do -República Dominicana do -Dominikaani Vabariik do -Dominikar Errepublika do -جمهوری دامینیکن do -Dominikaaninen tasavalta do -République dominicaine do -Dominicaanse Republyk do -An Phoblacht Dhoiminiceach do -República Dominicana do -הרפובליקה הדומיניקנית do -डोमिनिकन रिपबà¥à¤²à¤¿à¤• do -Dominikanska Republika do -Dominikai Köztársaság do -Republik Dominika do -Dóminíska lýðveldið do -Repubblica Dominicana do -ドミニカ共和国 do -សាធារណរដ្ឋ​ដូមីនីកែន do -ë„미니카 공화국 do -ໂດມິນີàºàº±àº™ do -Dominikos Respublika do -Dominikas Republika do -ДоминиканÑка Република do -Домникан ард ÑƒÐ»Ñ do -Repubblika Dominikana do -Den dominikanske republikk do -Dominikaansche Republiek do -Dominicaanse Republiek do -Den dominikanske republikken do -Republica Dominicana do -ਡੋਮਾਨੀਕਾ ਗਣਰਾਜ do -Dominikana do -República Dominicana do -República Dominicana do -Republica Dominicană do -ДоминиканÑÐºÐ°Ñ Ñ€ÐµÑпублика do -Repubulika Dominikani do -DominihkalaÅ¡ republihkka do -Dominikánska republika do -Dominikanska republika do -ДоминиканÑка Република do -Dominikanska Republika do -I-Dominican Republic do -Dominikanska republiken do -டொமினிகà¯à®•ன௠கà¯à®Ÿà®¿à®¯à®°à®šà¯ do -Ҷумҳурии Доминика do -สาธารณรัà¸à¹‚ดมินิà¸à¸±à¸™ do -Dominik Cumhuriyeti do -Dominika Cömhüriäte do -ДомініканÑька реÑпубліка do -Доминикана РеÑпубликаÑи do -Muvhuso wa Dominican do -Cá»™ng hoà Dominican do -Republike Dominikinne do -IRepublic yeDominican do -多米尼加共和国 do -多明尼加共和國 do -Algeria dz -Algerië dz -الجزائر dz -Ðльжыр dz -Ðлжир dz -অà§à¦¯à¦¾à¦²à¦œà§‡à¦°à¦¿à§Ÿà¦¾ dz -Aljeri dz -Alžir dz -Algèria dz -Alžírsko dz -Algeriet dz -Algerien dz -ΑλγεÏία dz -Algerio dz -Argelia dz -Alžeeria dz -الجزیره dz -Algérie dz -Algerije dz -An Ailgéir dz -Alxéria dz -×לג'יריה dz -अलà¥à¤œà¥€à¤°à¤¿à¤¯à¤¾ dz -Alžir dz -Algéria dz -Alsír dz -アルジェリア dz -អាល់ហ្សáŸážšáž¸ dz -알제리 dz -ບັນàºàº²à»€àº¥àºµàº dz -Alžyras dz -Alžīrija dz -Ðлжир dz -Ðлжер dz -AlÄ¡erija dz -Algerie dz -Algerien dz -Algerije dz -Algerie dz -ਅਲਜੀਰੀਆ dz -Algieria dz -Argélia dz -Argélia dz -Ðлжир dz -Aligeriya dz -Alžírsko dz -Alžirija dz -Ðлжир dz -Alžir dz -I-Algeria dz -Algeriet dz -அலà¯à®œà®¿à®°à®¿à®¯à®¾ dz -Ðлҷазоир dz -อัลจีเรีย dz -Aljır dz -Ðлжир dz -Жазоир dz -Aldjereye dz -阿尔åŠåˆ©äºš dz -阿爾åŠåˆ©äºž dz -Equador ec -Ewenaar ec -الإكوادور ec -Ekvator ec -Эквадор ec -Еквадор ec -ইকà§à§Ÿà§‡à¦¡à¦° ec -Ecuador ec -Ekvador ec -Ekvádor ec -Ecwador ec -Ecuador ec -ΙσημεÏινός ec -Ekvadoro ec -Ecuador ec -Ekuador ec -اکوادور ec -Équateur ec -Eacuadór ec -Ecuador ec -×קוודור ec -इकà¥à¤µà¥‡à¤¡à¥‰à¤° ec -Ekvador ec -Ecuador ec -Ekvador ec -Ecuador ec -エクアドル ec -អáŸáž€áŸ’វាឌáŸážš ec -ì—ì½°ë„르 ec -ເອàºà»àº”à» ec -Ekvadoras ec -Ekvadora ec -Еквадор ec -Эквадор ec -Ekwador ec -Ecuador ec -Ecuador ec -Ecuador ec -à¨à¨•ਾਵੇਡਰ ec -Ekwador ec -Ecuador ec -Эквадор ec -Ekwateri ec -Ekvador ec -Ekvádor ec -Ekvador ec -Еквадор ec -Ekvador ec -I-Equador ec -ஈகà¯à®µà¯†à®Ÿà®¾à®°à¯ ec -Эквадор ec -เอà¸à¸§à¸²à¸”อร์ ec -Ekvator ec -Еквадор ec -Эквадор ec -EcwÃ¥teur ec -厄瓜多尔 ec -厄瓜多 ec -Estonia ee -Estlandies ee -استونيا ee -Estoniya ee -ЭÑÑ‚Ð¾Ð½Ñ–Ñ ee -ЕÑÑ‚Ð¾Ð½Ð¸Ñ ee -à¦à¦¸à§à¦Ÿà§‹à¦¨à¦¿à§Ÿà¦¾ ee -Estonija ee -Estònia ee -Estonsko ee -Estland ee -Estland ee -Εσθονία ee -Estlando ee -Eesti ee -استونی ee -Eesti ee -Estonie ee -Estland ee -An Eastóin ee -×סטוניה ee -à¤à¤¸à¥à¤¤à¥‹à¤¨à¤¿à¤¯à¤¾ ee -Estonija ee -Észtország ee -Eistland ee -エストニア ee -អáŸážŸáŸ’ážáž¼áž“ី ee -ì—스토니아 ee -ເອໂທເນີຠee -Estija ee -Igaunija ee -ЕÑтонија ee -ЭÑтони ee -Estonja ee -Estland ee -Estland ee -Estland ee -Estland ee -Estònia ee -ਈਸਟੋਨੀਆ ee -Estónia ee -Estônia ee -ЭÑÑ‚Ð¾Ð½Ð¸Ñ ee -Esitoniya ee -Estteeana ee -Estónsko ee -Estonija ee -ЕÑтонија ee -Estonija ee -I-Estonia ee -Estland ee -எசà¯à®Ÿà¯‹à®©à®¿à®¯à®¾ ee -ЭÑÑ‚Ð¾Ð½Ð¸Ñ ee -เอสโทเนีย ee -Estonya ee -ЕÑÑ‚Ð¾Ð½Ñ–Ñ ee -ЭÑÑ‚Ð¾Ð½Ð¸Ñ ee -Estoneye ee -爱沙尼亚 ee -愛沙尼亞 ee -Egypt eg -Egipte eg -مصر eg -Misir eg -ЭгіпÑÑ‚ eg -Египет eg -মিশর eg -Ejipt eg -Egipat eg -Egipte eg -Yr Aifft eg -Egypten eg -Ägypten eg -Αίγυπτος eg -Egiptujo eg -Egipto eg -Egiptus eg -Egipto eg -مصر eg -Egypti eg -Egyptaland eg -Égypte eg -Egypte eg -An Éigipt eg -Exipto eg -×ž×¦×¨×™× eg -इजिपà¥à¤¤ eg -Egipat eg -Egyiptom eg -Egyptaland eg -Egitto eg -エジプト eg -អáŸáž áŸ’ស៊ីប eg -ì´ì§‘트 eg -ອີຢີບ eg -Egiptas eg -Ä’Ä£ipte eg -Египет eg -Египт eg -Mesir eg -EÄ¡ittu eg -Ägypten eg -Egypte eg -Egepeta eg -ਮਿਸਰ eg -Egipt eg -Egipto eg -Egito eg -Egipt eg -Египет eg -Misiri eg -Egypta eg -Egipt eg -Египат eg -Egipat eg -I-Egypt eg -Egypten eg -எகிபà¯à®¤à¯ eg -МиÑÑ€ eg -อียิปต์ eg -Mısır eg -Mısır eg -Єгипет eg -МиÑÑ€ eg -Ai Cập eg -Edjipe eg -åŸƒåŠ eg -åŸƒåŠ eg -Igibhithe eg -Western Sahara eh -Westelike Sahara eh -الصحراء الغربية eh -ЗаходнÑÑ Ð¡Ð°Ñ…Ð°Ñ€Ð° eh -Западна Сахара eh -পশà§à¦šà¦¿à¦® সাহারা eh -Sahara occidental eh -Zapadna Sahara eh -Sàhara Occidental eh -Západní Sahara eh -Gorllewin Sahara eh -Vestsahara eh -Westsahara eh -Δυτική ΣαχάÏα eh -Okcidenta Saharo eh -Sahara occidental eh -Lääne-Sahara eh -Mendebaldeko Sahara eh -صحرای غربی eh -Länsi-Sahara eh -Sahara occidental eh -West Sahara eh -An Sahára Thiar eh -Saara Ocidental eh -מערב סהרה eh -पशà¥à¤šà¤¿à¤®à¥€ सहारा eh -Westerm Sahara eh -Nyugat-Szahara eh -Vestur-Sahara eh -Sahara Occidentale eh -西サãƒãƒ© eh -សាហារ៉ា​ážáž¶áž„​លិច eh -ì„œì‚¬í•˜ë¼ eh -ພື້ນທີ່ທຳງານ eh -Vakarų Sahara eh -RietumsahÄra eh -Западна Сахара eh -Барууг Ñахар eh -Saħara tal-Punent eh -Vest-Sahara eh -Westsahara eh -West Sahara eh -Vest-Sahara eh -ਦੱਖਣੀ ਸਹਾਰਾ eh -Zachodnia Sahara eh -Sara Ocidental eh -Sahara Ocidental eh -Sahara de Vest eh -Ð—Ð°Ð¿Ð°Ð´Ð½Ð°Ñ Ð¡Ð°Ñ…Ð°Ñ€Ð° eh -Sahara y'Iburengerazuba eh -Oarje-Sahara eh -Západna Sahara eh -Zahodna Sahara eh -Западна Сахара eh -Zapadna Sahara eh -Västsahara eh -மேறà¯à®•தà¯à®¤à®¿à®¯ சஹாரா eh -Саҳрои Ғарбӣ eh -ซาฮาร่าตะวันตภeh -Batı Sahara eh -Batış Sahara eh -Західна Сахара eh -Ғарбий Сахара eh -Tây Sahara eh -Sara Coûtchantrece eh -西撒哈拉 eh -西盛哈拉 eh -Eritrea er -اريتريا er -ЭрытрÑÑ er -Ð•Ñ€Ð¸Ñ‚Ñ€ÐµÑ er -à¦à¦°à¦¿à¦Ÿà§à¦°à¦¿à§Ÿà¦¾ er -Eritre er -Eritreja er -ΕÏυθÏαία er -Eritreo er -اریتره er -Érythrée er -Eiritré er -×ריתרי××” er -à¤à¤°à¤¿à¤Ÿà¥à¤°à¥€à¤¯à¤¾ er -Eritreja er -Erítrea er -エリトリア er -អáŸážšáž¸áž‘្រា er -ì—리트레아 er -à»àºà»‰à»„ຂà»àºŸà»‰àº¡àº—ຳງານ er -EritrÄ—ja er -Eritreja er -Еритреја er -Эритреа er -ਈਰੀਟਰੀਆ er -Erytrea er -Eritreia er -Eritréia er -Ð­Ñ€Ð¸Ñ‚Ñ€ÐµÑ er -Eritereya er -Eritreja er -Еритреја er -Eritreja er -ரிடà¯à®°à®¿à®¯à®¾ er -Ð­Ñ€Ð¸Ñ‚Ñ€Ð¸Ñ er -เอริเทรีย er -Eritre er -Ð•Ñ€Ñ–Ñ‚Ñ€ÐµÑ er -Ð­Ñ€Ð¸Ñ‚Ñ€Ð¸Ñ er -Eritrêye er -厄立特里亚 er -厄利垂亞 er -Spain es -Spanje es -أسبانيا es -İspaniya es -Ð“Ñ–ÑˆÐ¿Ð°Ð½Ñ–Ñ es -ИÑÐ¿Ð°Ð½Ð¸Ñ es -সà§à¦ªà§‡à¦¨ es -Spagn es -Å panija es -Espanya es -Å panÄ›lsko es -Sbaen es -Spanien es -Spanien es -Ισπανία es -Hispanio es -España es -Hispaania es -Espainia es -اسپانیا es -Espanja es -Spania es -Espagne es -Spanje es -An Spáinn es -España es -ספרד es -सà¥à¤ªà¥‡à¤¨ es -Å panjolska es -Spanyolország es -Spanyol es -Spánn es -Spagna es -スペイン es -អáŸážŸáŸ’ប៉ាញ es -ìŠ¤íŽ˜ì¸ es -ສະເປັນ es -Ispanija es -SpÄnija es -Шпанија es -ИÑпани es -Sepanyol es -Spanja es -Spania es -Spanien es -Spanje es -Spania es -Espanha es -ਸਪੇਨ es -Hiszpania es -Espanha es -Espanha es -Spania es -ИÑÐ¿Ð°Ð½Ð¸Ñ es -Esipanye es -Spánia es -Å panielsko es -Å panija es -Шпанија es -Å panija es -I-Spain es -Spanien es -சà¯à®ªà¯†à®¯à®¿à®©à¯ es -ИÑпаниё es -สเปน es -İspanya es -İspania es -ІÑÐ¿Ð°Ð½Ñ–Ñ es -ИÑÐ¿Ð°Ð½Ð¸Ñ es -Tây Ban Nha es -Sipagne es -西ç­ç‰™ es -西ç­ç‰™ es -Ethiopia et -Ethiopië et -اثيوبيا et -Ð­Ñ‚Ñ‹Ñ‘Ð¿Ñ–Ñ et -Ð•Ñ‚Ð¸Ð¾Ð¿Ð¸Ñ et -ইথিওপিয়া et -Etiopi et -Etiopija et -Etiòpia et -Etiopie et -Ethiopien et -Äthiopien et -Αιθιοπία et -Etiopio et -Etiopía et -Etioopia et -Etiopia et -اتیوپی et -Etiopia et -Éthiopie et -Ethiopië et -An Aetóip et -Etiopia et -×תיופיה et -इथियोपिया et -Etiopija et -Etiópia et -Eþíópía et -Etiopia et -エãƒã‚ªãƒ”ã‚¢ et -អáŸážáŸ’យូពី et -ì—티오피아 et -ເອໂທເນີຠet -Etiopija et -Etiopija et -Етиопија et -Этопи et -Etjopia et -Etiopia et -Äthiopien et -Ethiopië et -Etiopia et -ਈਥੋਪੀਆ et -Etiopia et -Etiópia et -Etiópia et -Etiopia et -Ð­Ñ„Ð¸Ð¾Ð¿Ð¸Ñ et -Etiyopiya et -Etiopia et -Etiópia et -Etiopija et -Етиопија et -Etiopija et -Etiopien et -எதியோபியா et -ҲабашиÑтон et -เอธิโอเปีย et -Etiyopya et -Efiopia et -Ð•Ñ„Ñ–Ð¾Ð¿Ñ–Ñ et -Ð­Ñ„Ð¸Ð¾Ð¿Ð¸Ñ et -Etiopeye et -埃塞俄比亚 et -衣索比亞 et -Finland fi -Ùنلندا fi -Finlandiya fi -ФінлÑÐ½Ð´Ñ‹Ñ fi -Ð¤Ð¸Ð½Ð»Ð°Ð½Ð´Ð¸Ñ fi -ফিনলà§à¦¯à¦¾à¦£à§à¦¡ fi -Finska fi -Finlàndia fi -Finsko fi -Y Ffindir fi -Finnland fi -Φινλανδία fi -Finnlando fi -Finlandia fi -Soome fi -Finlandia fi -Ùنلاند fi -Suomi fi -Finnland fi -Finlande fi -Finlân fi -An Fhionlainn fi -Finlándia fi -פינלנד fi -फिनलैंड fi -Finska fi -Finnország fi -Finlandia fi -Finnland fi -Finlandia fi -フィンランド fi -ហ្វាំងឡង់ fi -핀란드 fi -ຟີນà»àº¥àº™ fi -Suomija fi -Somija fi -ФинÑка fi -Финнланд fi -Finlandja fi -Finnland fi -Finlandia fi -ਫਿਨਲੈਂਡ fi -Finlandia fi -Finlândia fi -Finlândia fi -Finlanda fi -ФинлÑÐ½Ð´Ð¸Ñ fi -Finilande fi -Suopma fi -Fínsko fi -Finska fi -ФинÑка fi -Finska fi -I-Finland fi -பினà¯à®²à®¾à®¨à¯à®¤à¯ fi -Финлонд fi -ฟินà¹à¸¥à¸™à¸”์ fi -Finlandiya fi -Finland (Suomi) fi -ФінлÑÐ½Ð´Ñ–Ñ fi -ФинлÑÐ½Ð´Ð¸Ñ fi -Phần Lan fi -Finlande fi -芬兰 fi -芬蘭 fi -Fiji fj -Ùيجي fj -Фіджы fj -ОÑтрови Фиджи fj -ফিজি fj -Fidji fj -Fidži fj -Fidži fj -Ffiji fj -Fidschi fj -Φίτζι fj -FiÄioj fj -Fidži fj -Ùیجی fj -Fidji fj -Fidsí fj -פיג'×™ fj -फिजी fj -Fidzsi fj -Fídjieyjar fj -Figi fj -フィジー fj -ហ្វ៊ីហ្ស៊ី fj -피지 fj -ມີດີ fj -Fidži fj -Фиџи fj -Фижи fj -FiÄ¡i fj -Fidschi fj -ਫਿੱਜੀ fj -Fidżi fj -Ilhas Fiji fj -Фиджи fj -Fidži fj -Fidži fj -Фиџи fj -Fidži fj -பிஜி fj -Фиҷи fj -ฟิจิ fj -Фіджі fj -Фижи fj -Fidji fj -æ–æµŽ fj -è²æ¿Ÿ fj -Falkland Islands (Malvinas) fk -Falkland Eilande (Malvinas) fk -جزر الÙوكلاند (المالÙيناس) fk -ФалклендÑÐºÑ–Ñ Ð°Ñтравы (Мальвіны) fk -ФолклендÑки оÑтрови fk -ফকলà§à¦¯à¦¾à¦£à§à¦¡ দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ (মলভিনাস) fk -Inizi Falklandi (Malvinas) fk -Foklandska ostrva (Malvini) fk -Illes Falkland (Malvines) fk -Falklandy (Malvíny) fk -Ynysoedd Y Ffalcland (Malfinas) fk -Falkland-øerne fk -Falkland-Inseln (Malvinen) fk -Îησιά Φώκλαντ (Malvinas) fk -Falklandoj fk -Islas Falkland (Malvinas) fk -Falklandi saared (Malviinid) fk -Falkland Irlak (Malvinak) fk -جزایر ÙØ§Ù„کلند مالویناس fk -Falklandin saaret (Malvinassaaret) fk -ÃŽles Falkland (Malvinas) fk -Falkland Eilannen (Malvinas) fk -Na hOileáin Fháclainne (Malvinas) fk -Illas Falkland (Malvinas) fk -××™×™ פולקלנד fk -फाकलैंड आइलैंड (मालविनास) fk -Folklandska otoÄja (Malvini) fk -Falkland-szigetek fk -Falklandseyjar fk -Isole Falkland (Malvine) fk -フォークランド諸島 fk -កោះ Falkland (Malvinas) fk -í¬í´ëžœë“œ êµ°ë„ (ë§ë¹„나스) fk -Folklendu salas fk -ФокландÑки ОÑтрови (Малвини) fk -Фалкланд арлууд (МалвинаÑ) fk -Gżejjer Falkland (Malvinas) fk -Falklandsøyene fk -Falklandinseln (Malvinas) fk -Falkland Eilanden (Malvinas) fk -Falklandsøyane fk -ਫਾਕਲੈਂਡ ਟਾਪੂ fk -Wyspy Falklandzkie (Malwiny) fk -Ilhas Falkland (Malvinas) fk -Ilhas Malvinas fk -Insulele Falkland (Malvine) fk -ФолклендÑкие (МальвинÑкие) оÑтрова fk -Ibirwa bya Falikilande (Maluvinasi) fk -Falklánddasullot fk -Falklandské Ostrovy (Malviny) fk -Falklandski otoki (Malvini) fk -ФолкландÑка оÑтрва (Малвини) fk -Folklandska ostrva (Malvini) fk -Falklandsöarna fk -ஃபாலà¯à®•௠தீவà¯(மாலà¯à®µà®¿à®©à®¾à®¸à¯) fk -Ҷазираи фолкланд (Малвина) fk -หมู่เà¸à¸²à¸°à¸Ÿà¸­à¸¥à¹Œà¸„à¹à¸¥à¸™à¸”์ (Malvinas) fk -Falkland Adaları fk -Falkland Utrawları (Malvinnar) fk -ФолклендÑькі оÑтрови (БританіÑ) fk -Фолкленд (Малвин) Ороллари fk -Iyes Malouwines fk -ç¦å…‹å…°ç¾¤å²›(马尔维纳斯) fk -ç¦å…‹è˜­ç¾¤å³¶ (é¦¬çˆ¾ç¶­ç´æ–¯) fk -Micronesia, Federated States of fm -Micronesië, Vereenigde State van fm -ФедÑÑ€Ð°Ñ†Ñ‹Ñ ÐœiкранÑзіі fm -ÐœÐ¸ÐºÑ€Ð¾Ð½ÐµÐ·Ð¸Ñ fm -মাইকà§à¦°à§‹à¦¨à§‡à¦¶à¦¿à§Ÿà¦¾, ফেডারেটেড সà§à¦Ÿà§‡à¦Ÿà¦¸ অব fm -Mikronezija, Federalne države fm -Micronesia, Estats Federats de fm -Mikronésie fm -Micronesia, Taleithau Cyfunol fm -Mikronesien, de forenede stater af fm -Mikronesien, Föderation von fm -ΜικÏονησίας, Ομόσπονδες πολιτείες της fm -Mikronezio, Respubliko de fm -Micronesia, Estados federados de fm -Mikroneesia fm -Mikronesiako Estatu Federatuak fm -Mikronesian liittovaltio fm -Etats Fédérés de Micronésie fm -Micronesië, Federale staten Fan fm -Stáit Cónascacha na Micrinéise fm -Micronésia, Estados Federados de fm -מיקרונזיה, מדינות הפדרציה של fm -फेडरेटेड सà¥à¤Ÿà¥‡à¤Ÿ ऑफ माइकà¥à¤°à¥‹à¤¨à¥‡à¤¸à¤¿à¤¯à¤¾ fm -Mikronézia fm -Míkrónesía, Sambandsríki fm -Micronesia, stati federati di fm -ミクロãƒã‚·ã‚¢,米自由連邦 fm -រដ្ឋ​សហពáŸáž“្ធ​មិក្រូនáŸážŸáŸŠáž¸ fm -Mikronezija fm -MikronÄ“zija fm -Микронезија, Федеративни Држави на fm -Mikronesja (Stati Federati ta') fm -Mikronesiaføderasjonen fm -Mikronesien, Vereenigte Staten vun fm -Micronesië, Federale staten van fm -Mikronesiaføderasjonen fm -ਮਾਇਕਰੋਨੀਸੀਆ, ਸੰਘੀ ਪà©à¨°à¨¾à¨‚ਤ fm -Federacja Stanów Mikronezji fm -Micronésia, Estados Federados da fm -Estados Federados da Micronésia fm -Micronezia, Statele Federative fm -ÐœÐ¸ÐºÑ€Ð¾Ð½ÐµÐ·Ð¸Ñ fm -Mikoronesiya, Leta Zishyizwehamwe fm -MikronesiafederaÅ¡uvdna fm -Spojené Å¡táty Mikronézie fm -Mikronezija, Združene države fm -Микронезија, Федерација држава fm -Mikronezija, Federacija država fm -Mikronesiska federationen fm -மைகà¯à®°à¯‹à®©à®¿à®šà®¾, à®’à®°à¯à®™à¯à®•ிணைநà¯à®¤ மாநிலம௠fm -สหพันธรัà¸à¸¡à¸´à¹‚ครนีเซีย fm -Mikronezya Federasyonu fm -Mikronesia, Berläşkän İlläre fm -МікронезіÑ, федеративні штати fm -ÐœÐ¸ÐºÑ€Ð¾Ð½ÐµÐ·Ð¸Ñ fm -Micronezeye fm -密克罗尼西亚è”邦 fm -密克羅尼西亞è¯é‚¦ fm -Faroe Islands fo -Faroe Eilande fo -جزر الÙيرو fo -ОÑтрови Фаро fo -ফারো দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ fo -Enez Faroe fo -Farska ostrva fo -Illes Faroe fo -Faerské ostrovy fo -Ynysoedd Ffar?e fo -Færøerne fo -Färöer-Inseln fo -Îήσοι ΦεÏόε fo -Ferooj fo -islas Faroe fo -Fääri saared fo -Faroe Irlak fo -جزایر ÙØ§Ø±Ùˆ fo -Färsaaret fo -ÃŽles Féroé fo -Faroe Eilannen fo -Na Scigirí (Oileáin Fharó) fo -Illas Feroe fo -××™×™ פ×רו fo -फारोठआइलैंड fo -Faroe Otoci fo -Faroe-szigetek fo -Færeyjar fo -Isole Fær Øer fo -フェロー諸島 fo -កោះ​ហ្វ៉ារ៉ូ fo -페로 ì œë„ fo -ໄອà»àº¥àº™ fo -Faroe salos fo -FÄ“ru salas fo -ФарÑки ОÑтрови fo -Фарое арлууд fo -Gżejjer Faroe fo -Færøyene fo -Färöerinseln fo -Faroe Eilanden fo -Færøyane fo -ਫਾਰੋਈ ਟਾਪੂ fo -Wyspy Faroe fo -Ilhas Faroe fo -Ilhas Faroe fo -Insulele Feroe fo -ФарерÑкие оÑтрова fo -Ibirwa bya Farowe fo -Fearsuolu fo -Ostrovy Faroe fo -Otoki Faroe fo -ФарÑка оÑтрва fo -Farska ostrva fo -Färöarna fo -ஃபரோ தீவà¯à®•ள௠fo -Ҷазираи Фару fo -หมู่เà¸à¸²à¸°à¸Ÿà¸²à¹‚ร fo -Faroe Adaları fo -Faroe Utrawları fo -ФарерÑькі оÑтрови fo -Фарер Ороллари fo -Äảo Faroe fo -Iye Faeroyé fo -法罗群岛 fo -法羅群島 fo -France fr -Frankryk fr -ÙØ±Ù†Ø³Ø§ fr -Fransa fr -Ð¤Ñ€Ð°Ð½Ñ†Ñ‹Ñ fr -Ð¤Ñ€Ð°Ð½Ñ†Ð¸Ñ fr -ফà§à¦°à¦¾à¦¨à§à¦¸ fr -Frañs fr -Francuska fr -França fr -Francie fr -Ffrainc fr -Frankrig fr -Frankreich fr -Γαλλία fr -Francio fr -Francia fr -Prantsusmaa fr -Frantzia fr -ÙØ±Ø§Ù†Ø³Ù‡ fr -Ranska fr -Frakland fr -Frankryk fr -An Fhrainc fr -Franza fr -צרפת fr -फà¥à¤°à¤¾à¤‚स fr -Francuska fr -Franciaország fr -Prancis fr -Frakkland fr -Francia fr -フランス fr -បារាំង fr -프랑스 fr -àºàº£àº±à»ˆàº‡ fr -PrancÅ«zija fr -Francija fr -Франција fr -Франц fr -Perancis fr -Franza fr -Frankrike fr -Frankriek fr -Frankrijk fr -Frankrike fr -Fora fr -França fr -ਫਰਾਂਸ fr -Francja fr -França fr -França fr -FranÅ£a fr -Ð¤Ñ€Ð°Ð½Ñ†Ð¸Ñ fr -Ubufaransa fr -Fránkriika fr -Francúzsko fr -Francija fr -ФранцуÑка fr -Francuska fr -I-France fr -Frankrike fr -பிரானà¯à®šà¯ fr -ФаронÑа fr -à¸à¸£à¸±à¹ˆà¸‡à¹€à¸¨à¸ª fr -Fransa fr -Fransia fr -Ð¤Ñ€Ð°Ð½Ñ†Ñ–Ñ fr -Ð¤Ñ€Ð°Ð½Ñ†Ð¸Ñ fr -Fura fr -Pháp fr -Fransi fr -法国 fr -法國 fr -Gabon ga -الغابون ga -Габон ga -Габон ga -গà§à¦¯à¦¾à¦¬à¦¨ ga -Gabun ga -Γκαμπόν ga -Gabono ga -Gabón ga -گابون ga -An Ghabúin ga -Gabón ga -גבון ga -गेबॉन ga -ガボン ga -ហ្គាបុង ga -가봉 ga -à»àºàº¥à»ˆàº‡àº™ ga -Gabonas ga -Gabona ga -Габон ga -Габон ga -Gabun ga -ਗਾਬੋਨ ga -Gabão ga -Gabão ga -Габон ga -Gabo ga -Габон ga -காபான௠ga -Габон ga -à¸à¸²à¸šà¸­à¸™ ga -Габон ga -Габон ga -加蓬 ga -加彭 ga -United Kingdom gb -Vereenigde Koninkryk gb -المملكة المتحدة gb -BirləşmiÅŸ Krallıq gb -Злучанае КаралеўÑтва gb -Ð’ÐµÐ»Ð¸ÐºÐ¾Ð±Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ gb -ইউনাইটেড কিংডম gb -Rouantelezh Unanet gb -Velika Britanija gb -Regne Unit gb -Spojené království gb -Y Deyrnas Unedig gb -Storbritannien gb -Großbritannien gb -Ηνωμένο Βασίλειο gb -Britio gb -Reino Unido gb -Suurbritannia gb -Erresuma Batua gb -بریتانیا gb -Iso-Britannia gb -Stórabretland gb -Royaume Uni gb -Ferienigd Keninkryk gb -An Ríocht Aontaithe gb -Reino Unido gb -בריטניה gb -यूनाइटेड किंगडम gb -Ujedinjeno Kraljevstvo gb -Egyesült Királyság gb -Inggris gb -Bretland gb -Regno Unito gb -イギリス gb -ចក្រភព​អង់គ្លáŸážŸ gb -ì˜êµ­ gb -ສະຫະລາດສະອານາຈັຠgb -JungtinÄ— KaralystÄ— gb -ApvienotÄ Karaliste gb -Обединето КралÑтво gb -Их британ gb -Renju Unit gb -Storbritannia gb -Grootbritannien gb -Verenigd Koninkrijk gb -Storbritannia gb -Regne Unit gb -ਬਰਤਾਨੀਆ gb -Wielka Brytania gb -Reino Unido gb -Reino Unido gb -Anglia gb -Ð’ÐµÐ»Ð¸ÐºÐ¾Ð±Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ gb -Ubwongereza gb -Stuorrabrittania gb -Anglicko gb -Združeno kraljestvo gb -Уједињено КраљевÑтво gb -Ujedinjeno Kraljevstvo gb -I-United Kingdom gb -Storbritannien gb -à®à®•à¯à®•ிய ராஜà¯à®œà®¿à®¯à®®à¯ gb -Подшоҳии Муттаҳида gb -สหราชอาณาจัà¸à¸£ gb -BirleÅŸik Krallık gb -Berläşkän PadÅŸahlıq gb -Ð’ÐµÐ»Ð¸ÐºÐ¾Ð±Ñ€Ð¸Ñ‚Ð°Ð½Ñ–Ñ gb -Буюк Ð‘Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ gb -Anh gb -RweyÃ¥me Uni gb -United Kingdom gb -英国 gb -è¯åˆçŽ‹åœ‹ gb -United Kingdom gb -Grenada gd -غرينادا gd -Qrenada gd -ГрÑнада gd -Гренада gd -গà§à¦°à§‡à¦¨à¦¾à¦¡à¦¾ gd -Granada gd -ΓÏενάδα gd -Grenado gd -Granada gd -گرانادا gd -Grenade gd -Granada gd -גרנדה gd -गà¥à¤°à¥‡à¤¨à¤¾à¤¡à¤¾ gd -Granada gd -グレナダ gd -ហ្គ្រីណាដា gd -그러네ì´ë‹¤ gd -ເàºàº™àº²àº”າ gd -GrenÄda gd -Гренада gd -Гренада gd -Granada gd -ਗਰੀਨਾਡਾ gd -Granada gd -Granada gd -Гренада gd -Gerenada gd -I-Grenada gd -கிரெனடா gd -Гронодо gd -เà¸à¸£à¸™à¸²à¸”า gd -Гренада gd -Гренада gd -GrenÃ¥de gd -格林纳达 gd -æ ¼ç‘žé‚£é” gd -Georgia ge -Georgië ge -جورجيا ge -Ð“Ñ€ÑƒÐ·Ñ–Ñ ge -Ð“Ñ€ÑƒÐ·Ð¸Ñ ge -জরà§à¦œà¦¿à§Ÿà¦¾ ge -Jeorji ge -Gruzija ge -Geòrgia ge -Gruzie ge -Georgien ge -Georgien ge -ΓεωÏγία ge -Georgino ge -Gruusia ge -گرجستان ge -Géorgie ge -Georgië ge -An tSeoirsia ge -Xeórxia ge -×’'ורג'×™×” ge -जà¥à¤¯à¤¾à¤°à¥à¤œà¤¿à¤¯à¤¾ ge -Grúzia ge -Georgía ge -ジョージア島 ge -ហ្សកហ្ស៊ី ge -그루지아 ge -ເຊີເບີຠge -Gruzija ge -Gruzija ge -Грузија ge -Георги ge -Ä orÄ¡ia ge -Georgien ge -Georgië ge -ਜਾਰਜੀਆ ge -Gruzja ge -Geórgia ge -Geórgia ge -Ð“Ñ€ÑƒÐ·Ð¸Ñ ge -Jeworugiya ge -Gruzija ge -Грузија ge -Gruzija ge -Georgien ge -ஜியோரà¯à®œà®¿à®¯à®¾ ge -ГурҷиÑтон ge -จอร์เจีย ge -Gürcistan ge -Görcestan ge -Ð“Ñ€ÑƒÐ·Ñ–Ñ ge -ГуржиÑтон ge -Djeyordjeye ge -æ ¼é²å‰äºš ge -喬治亞 ge -Ghana gh -غانا gh -Гана gh -Гана gh -ঘানা gh -Gwana gh -Gana gh -Γκάνα gh -Ganao gh -غنا gh -Gána gh -Gana gh -×’×× ×” gh -घाना gh -Gana gh -ガーナ gh -ហ្កាណា gh -가나 gh -ຈີນ gh -Gana gh -Gana gh -Гана gh -Гана gh -Gana gh -ਘਾਨਾ gh -Gana gh -Gana gh -Gana gh -Гана gh -Gana gh -Gana gh -Гана gh -Gana gh -I-Ghana gh -கானா gh -Ғано gh -à¸à¸²à¸™à¸² gh -Гана gh -Гана gh -Gana gh -加纳 gh -è¿¦ç´ gh -Gibraltar gi -جبل طارق gi -Гібралтар gi -Гибралтар gi -জিবà§à¦°à¦²à§à¦Ÿà¦¾à¦° gi -Jibraltar gi -ΓιβÏÎ±Î»Ï„Î¬Ï gi -Gibraltaro gi -گیبرالتار gi -Giobráltar gi -Xibraltar gi -גיברלטר gi -जिबà¥à¤°à¤¾à¤²à¥à¤Ÿà¤° gi -Gibraltár gi -Gíbraltar gi -Gibilterra gi -ジブラルタル gi -지브롤터 gi -ມອລຕາ gi -Gibraltaras gi -GibraltÄrs gi -Гибралтар gi -Гибралтар gi -Ä ibiltar gi -ਗੀਬਰਾਲਟਾਰ gi -Гибралтар gi -Jiburalitari gi -Гибралтар gi -ஜிபà¯à®°à®²à¯à®Ÿà®¾à®°à¯ gi -Ҷабалуттариқ gi -ยิบรอลตา gi -Cebelitarık gi -Гібралтар gi -Гибралтар gi -Djibraltar gi -直布罗陀 gi -直布羅陀 gi -Greenland gl -Groenland gl -Ð“Ñ€ÐµÐ½Ð»Ð°Ð½Ð´Ð¸Ñ gl -গà§à¦°à§€à¦¨à¦²à§à¦¯à¦¾à¦£à§à¦¡ gl -Griñland gl -Groenlàndia gl -Grónsko gl -Y Lasynys gl -Grønland gl -Grönland gl -Ισλανδία gl -Groenlandia gl -Gröönimaa gl -Gröönlanti gl -Groenland gl -Grienlân gl -An Ghraonlainn gl -Groenlándia gl -Grönland gl -Grænland gl -Groenlandia gl -グリーンランド gl -Grenlandija gl -Гренланд gl -Grønland gl -Gröönland gl -Groenland gl -Grønland gl -ਗਰੀਨਲੈਂਡ gl -Grenlandia gl -Gronelândia gl -Ð“Ñ€ÐµÐ½Ð»Ð°Ð½Ð´Ð¸Ñ gl -Goronilande gl -Ruonáeatnan gl -Grenlandija gl -Гренланд gl -Grenland gl -Grönland gl -Ð“Ñ€Ð¸Ð½Ð»Ð°Ð½Ð´Ð¸Ñ gl -à¸à¸£à¸µà¸™à¹à¸¥à¸™à¸”์ gl -Grönland gl -Ð“Ñ€ÐµÐ½Ð»Ð°Ð½Ð´Ñ–Ñ gl -Ð“Ñ€ÐµÐ½Ð»Ð°Ð½Ð´Ð¸Ñ gl -格陵兰 gl -格陵蘭 gl -Gambia gm -Gambië gm -غامبيا gm -Ð“Ð°Ð¼Ð±Ñ–Ñ gm -Ð“Ð°Ð¼Ð±Ð¸Ñ gm -গামবিয়া gm -Gambi gm -Gambija gm -Gàmbia gm -Gambie gm -Γκάμπια gm -Gambio gm -گامبیا gm -Gambie gm -An Ghaimbia gm -Gámbia gm -גמביה gm -जामà¥à¤¬à¤¿à¤¯à¤¾ gm -Gambija gm -Gambía gm -ガンビア gm -ហ្កាំប៊ី gm -ê°ë¹„ì•„ gm -à»àºàº¡àº¡àº² gm -Gambija gm -Gambija gm -Гамбија gm -Гамби gm -Gambja gm -ਗੈਂਬੀਆ gm -Gâmbia gm -Gâmbia gm -Ð“Ð°Ð¼Ð±Ð¸Ñ gm -Gambiya gm -Gambija gm -Гамбија gm -Gambija gm -காமà¯à®ªà®¿à®¯à®¾ gm -Гомбиё gm -à¹à¸à¸¡à¹€à¸šà¸µà¸¢ gm -Ð“Ð°Ð¼Ð±Ñ–Ñ gm -Ð“Ð°Ð¼Ð±Ð¸Ñ gm -Gambeye gm -冈比亚 gm -甘比亞 gm -Guinea gn -غينيا gn -ГвінÑÑ gn -Ð“Ð²Ð¸Ð½ÐµÑ gn -গিনি gn -Gine gn -Gvineja gn -Gini gn -Γουινέα gn -Gvineo gn -Ginea gn -گینه gn -Guinée gn -An Ghuine gn -Guiné gn -×’×™× ××” gn -गà¥à¤ˆà¤¨à¤¾ gn -Gvineja gn -Gínea gn -ギニア gn -ហ្គីណ០gn -기니 gn -ເຖາວັນ gn -GvinÄ—ja gn -Gvineja gn -Гвинеја gn -Гуйнеа gn -Ginea gn -ਗà©à¨‡à¨¨à©€à¨† gn -Gwinea gn -Guiné gn -Guiné gn -Ð“Ð²Ð¸Ð½ÐµÑ gn -Gineya gn -Gvineja gn -Гвинеја gn -Gvineja gn -கà¯à®¯à¯à®©à®¿à®¯à®¾ gn -Гине gn -à¸à¸´à¸™à¸µ gn -Gine gn -Ð“Ð²Ñ–Ð½ÐµÑ gn -Ð“Ð²Ð¸Ð½ÐµÑ gn -Guinêye gn -几内亚 gn -幾內亞 gn -Guadeloupe gp -غواديلوب gp -ГвадÑлупа gp -Гваделупа gp -গাডেলà§à¦ª gp -Gwadeloup gp -Gvadalupe gp -Guadalupe gp -Gwadel?p gp -ΓουαδελοÏπη gp -Gvadelupo gp -Guadalupe gp -Guadalupe gp -گوادلوپ gp -Guadalúip gp -Guadalupe gp -×’×ודלופה gp -गà¥à¤µà¤¾à¤¡à¥‡à¤²à¥‹à¤ª gp -Gvadelúpeyjar gp -Guadalupa gp -ä»é ˜ã‚°ã‚¢ãƒ‰ãƒ«ãƒ¼ãƒ— gp -ហ្គាដឺលុប gp -과들루프 gp -ເດີລຸຠgp -Gvandelupa gp -Гваделупе gp -Gwadelup gp -ਗà©à¨†à¨¡à©€à¨“ਪੀ gp -Gwadelupa gp -Guadalupe gp -Guadalupe gp -Guadelupa gp -Гваделупа gp -Gwaderupe gp -Гвадалупе gp -Gvadalupe gp -கà¯à®µà®¾à®Ÿà¯†à®²à¯à®ªà¯‹à®ªà¯ gp -Гвадалуппо gp -เà¸à¸²à¸°à¸à¸±à¸§à¹€à¸”อลูป gp -Guadelupa gp -Гваделупа gp -Гваделупа gp -瓜德罗普 gp -瓜德魯普 gp -Equatorial Guinea gq -Ekwatoriaal Guinea gq -غينيا الاستوائية gq -ЭкватарыÑÐ»ÑŒÐ½Ð°Ñ Ð“Ð²Ñ–Ð½ÑÑ gq -Екваториална Ð“Ð²Ð¸Ð½ÐµÑ gq -ইকà§à§Ÿà§‡à¦Ÿà§‹à¦°à¦¿à§Ÿà¦¾à¦² গিনি gq -Guine équatoriale gq -Ekvatorijalna Gvineja gq -Guinea Equatorial gq -Rovníková Guinea gq -Gini Gyhydeddol gq -Ækvatorial Guinea gq -Äquatorial-Guinea gq -ΙσημεÏινή Γουινέα gq -Ekvatora Gvineo gq -Guinea equatorial gq -Ekvatoriaal-Guinea gq -Ginea Ekuatoriala gq -گینه اکوادور gq -Päiväntasaajan Guinea gq -Guinée équatoriale gq -Guine Mheánchiorclach gq -Guinea Ecuatorial gq -×’×™× ××” המשוונית gq -इकà¥à¤µà¥‡à¤Ÿà¥‹à¤°à¤¿à¤¯à¤² गà¥à¤à¤¨à¤¾ gq -Ekvatorijalna Gvineja gq -EgyenlítÅ‘i Guinea gq -Miðbaugs-Gínea gq -Guinea Equatoriale gq -赤é“ギニア gq -ហ្គីណáŸâ€‹áž¢áŸáž€áŸ’វាទáŸážš gq -ì ë„ 기니 gq -àºàº²àº™àºªàº­àº™ gq -Ekvatoriaus GvinÄ—ja gq -EkvatoriÄlÄ Gvineja gq -Екваторијална Гвинеја gq -Equatorial Гуйнеа gq -Ginea Ekwatorjali gq -Ekvatorial-Guinea gq -Äquatoriaal-Guinea gq -Equatoriaal Guinea gq -Ekvatorial-Guinea gq -à¨à¨•ੂਲੇਟਰਲ ਗà©à¨ˆà¨¨à¨¿à¨† gq -Gwinea Równikowa gq -Guiné Equatorial gq -Guiné Equatorial gq -Guinea Ecuatorială gq -Ð­ÐºÐ²Ð°Ñ‚Ð¾Ñ€Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ð“Ð²Ð¸Ð½ÐµÑ gq -Gineya Ekwatoriyale gq -EkvatorialalaÅ¡-Guinea gq -Rovníkova Guinea gq -Ekvatorialna Gvineja gq -Екваторијална Гвинеја gq -Ekvatorijalna Gvineja gq -Ekvatorialguinea gq -ஈகோடோரியல௠கà¯à®¯à¯à®©à®¿à®¯à®¾ gq -Гинеи Экваторӣ gq -à¸à¸´à¸™à¸µ ตรงเส้นศูนย์สูตร gq -Ekvatoral Gine gq -Equatorlı Guinea gq -Екваторіальна Ð“Ð²Ñ–Ð½ÐµÑ gq -Экваториал Ð“Ð²Ð¸Ð½ÐµÑ gq -Guinêye EcwÃ¥toriÃ¥le gq -赤é“几内亚 gq -赤é“幾內亞 gq -Greece gr -Griekeland gr -اليونان gr -Yunanıstan gr -ГрÑÑ†Ñ‹Ñ gr -Ð“ÑŠÑ€Ñ†Ð¸Ñ gr -গà§à¦°à§€à¦¸ gr -Gres gr -GrÄka gr -Grècia gr -Řecko gr -Gwlad Groeg gr -Grækenland gr -Griechenland gr -Ελλάδα gr -Grekujo gr -Grecia gr -Kreeka gr -Grezia gr -یونان gr -Kreikka gr -Grikkaland gr -Grèce gr -Grikelân gr -An Ghréig gr -Grécia gr -יוון gr -गà¥à¤°à¥€à¤¸ gr -GrÄka gr -Görögország gr -Grikkland gr -Grecia gr -ギリシャ gr -ក្រិក gr -그리스 gr -àºàºµàºŠ gr -Graikija gr -GrieÄ·ija gr -Грција gr -Грек gr -GreÄ‹ja gr -Hellas gr -Grekenland gr -Griekenland gr -Hellas gr -Grèça gr -ਗਰੀਸ gr -Grecja gr -Grécia gr -Grécia gr -Grecia gr -Ð“Ñ€ÐµÑ†Ð¸Ñ gr -Ubugereki gr -Greika gr -Grécko gr -GrÄija gr -Грчка gr -GrÄka gr -I-Greece gr -Grekland gr -கிரீச௠gr -Юнон gr -à¸à¸£à¸µà¸‹ gr -Yunanistan gr -Yunanstan gr -Ð“Ñ€ÐµÑ†Ñ–Ñ gr -ЮнониÑтон gr -Hy Lạp gr -Grece gr -希腊 gr -希臘 gr -Guatemala gt -Gautemala gt -غواتيمالا gt -Quatemala gt -ГватÑмала gt -Гватемала gt -গà§à§Ÿà¦¾à¦¤à§‡à¦®à¦¾à¦²à¦¾ gt -Gvatemala gt -Gwatemala gt -Γουατεμάλα gt -Gvatemalo gt -گواتمالا gt -Guatamala gt -גו×טמלה gt -गà¥à¤µà¤¾à¤Ÿà¥‡à¤®à¤¾à¤²à¤¾ gt -Gvatemala gt -Gvatemala gt -グァテマラ gt -ហ្គាážáŸáž˜áŸ‰áž¶áž¡áž¶ gt -과테ë§ë¼ gt -àºàº±àº§à»€àº•ມາລາ gt -Gvatemala gt -Gvatemala gt -Гватемала gt -ГуÑтемала gt -Gwatemala gt -ਗà©à¨†à¨Ÿà©‡à¨®à¨¾à¨²à¨¾ gt -Gwatemala gt -Гватемала gt -Gwatemala gt -Gvatemala gt -Гватемала gt -Gvatemala gt -I-Guatemala gt -கà¯à®µà®¾à®¤à¯à®¤à®®à®¾à®²à®¾ gt -Гватемоло gt -à¸à¸±à¸§à¹€à¸•มาลา gt -Гватемала gt -Гватемала gt -Gwatemala gt -å±åœ°é©¬æ‹‰ gt -瓜地馬拉 gt -Guam gu -غوام gu -Гуам gu -Гуам gu -গà§à§Ÿà¦¾à¦® gu -Gwam gu -Gw?m gu -Γκουάμ gu -Gvamo gu -گوام gu -גו×× gu -गà¥à¤µà¤¾à¤® gu -Gvam gu -グァム gu -ហ្គាំម gu -ê´Œ gu -à»àºàº¡àº¡àº² gu -Guama gu -Гвам gu -Гуам gu -Gwam gu -ਗà©à¨†à¨® gu -Гуам gu -Gwamu gu -Гуам gu -காம௠gu -Гуамма gu -à¸à¸§à¸¡ gu -Гуам gu -Гуам gu -Gwam gu -关岛 gu -關島 gu -Guinea-Bissau gw -غينيا-بيساو gw -ГвінÑÑ-БіÑаў gw -Ð“Ð²Ð¸Ð½ÐµÑ Ð‘Ð¸Ñау gw -গিনি-বিসো gw -Gine-Biso gw -Gvineja-Bisau gw -Gini-Bisaw gw -Γουινέα-Μπισσάου gw -Gvineo BisaÅ­a gw -Ginea-Bissau gw -گینه بیسائو gw -Guinée-Bissau gw -Guine-Bhissau gw -×’×™× ××” ביס×ו gw -गà¥à¤à¤¨à¤¾-बिसाऊ gw -Bissau-Guinea gw -Gínea-Bissá gw -ギニアビサオ gw -ហ្គីណáŸáž”៊ីសៅ gw -기니비사 gw -ລັດເຊີຠgw -Gvineja-Bisava gw -Гвинеја БиÑао gw -Гуйнеа-БиÑÑау gw -Ginea-Bissaw gw -ਗà©à¨‡à¨¨à¨¿à¨†-ਬਿਸ਼ਾਉ gw -Gwinea-Bissau gw -Guiné Bissau gw -Guiné-Bissau gw -ГвинеÑ-БиÑау gw -Gineya-Bisawu gw -Гвинеја БиÑао gw -Gvineja Bisao gw -கà¯à®¯à¯à®©à®¿à®¯à®¾-பிஸà¯à®¸à®¾ gw -Гвинеи БиÑÑои gw -à¸à¸´à¸™à¸µ - บิสซอ gw -Gine-Bissau gw -ГвінеÑ-БіÑау gw -ГвинеÑ-БиÑÑау gw -Guinêye-Bissaw gw -å‡ å†…äºšæ¯”ç» gw -幾內亞比紹 gw -Guyana gy -غيانا gy -ГвіÑна gy -Гуайана gy -গায়ানা gy -Gwiana gy -Gvajana gy -Giana gy -Γουιάνα gy -Gujano gy -گویان gy -Guyane gy -An Ghuáin gy -Guiana gy -גוי×× ×” gy -गà¥à¤¯à¤¾à¤¨à¤¾ gy -Gvæjana gy -ガイアナ gy -ហ្គីយ៉ាណា gy -ê°€ì´ì•„나 gy -ຈີນ gy -Gviana gy -Gajana gy -Гвајана gy -ГуÑна gy -Gujana gy -ਗà©à¨†à¨¨à¨¾ gy -Gujana gy -Guiana gy -Guiana gy -Guiana gy -Гайана gy -Giyana gy -Gvajana gy -Гвајана gy -Gvajana gy -கானா gy -Гуана gy -à¸à¸¹à¸¢à¸²à¸™à¹ˆà¸² gy -Guana gy -ГайÑна gy -Гвиана gy -圭亚那 gy -è“‹äºžç´ gy -Hong Kong SAR(China) hk -Hong Kong SAR (China) hk -Хонг Конг (Китай) hk -হং কং SAR(চীন) hk -Hong Kong SAR(Sina) hk -Hong Kong SAR(Xina) hk -Hong Kong SAR (Čína) hk -Hongkong SAR(Kina) hk -Χονγκ Κονγκ SAR (Κίνα) hk -Hongkong hk -Hong Kong SAR(Txina) hk -Hong Kong SAR (Kiina) hk -Hong Kong SAR (Chine) hk -Hong Cong SAR(An tSín) hk -Hong Kong hk -הונג קונג SAR (סין) hk -Hongkong (Kína) hk -Hong Kong (sjálfstjórnarhérað í Kína) hk -Hong Kong SAR(Cina) hk -香港(中国) hk -ហុងចិន (áž…áž·áž“) hk -Hong Kongas SAR(Kinija) hk -Хонг Конг СÐР(Кина) hk -Hongkong SAR(Kina) hk -Hong Kong hk -Hongkong SAR(Kina) hk -ਹਾਂਗ-ਕਾਂਗ SAR(ਚੀਨ) hk -Hong Kong SAR (Chiny) hk -Hong Kong SAR (China) hk -Гонконг hk -Hong Kong SAR (Ubushinwa) hk -Hongkong SAR(Kiinná) hk -Hong Kong SAR (Kitajska) hk -SAR Hong Kong (Кина) hk -SAR Hong Kong (Kina) hk -Hong Kong (Kina) hk -ஹாஙà¯à®•ாங௠SAR(சீனா) hk -ฮ่องà¸à¸‡ hk -Hong Kong (Çin) hk -Гонконг SAR (Китай) hk -Гонконг (Хитой) hk -中国香港特别行政区 hk -香港 SAR(中國) hk -Honduras hn -هندوراس hn -Ð“Ð°Ð½Ð´ÑƒÑ€Ð°Ñ hn -Ð¥Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn -হণà§à¦¡à§à¦°à¦¾à¦¸ hn -Hondures hn -Hondwras hn -ΟνδοÏÏα hn -Honduro hn -هندوراس hn -Hondúras hn -הונדורס hn -होंडà¥à¤°à¤¾à¤¸ hn -Hondúras hn -ホンジュラス hn -ហុងឌូរ៉ាស់ hn -온ë‘ë¼ìФ hn -ຫອນດູລັດ hn -HondÅ«ras hn -Hondurasa hn -Ð¥Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn -Ð¥Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn -Ħonduras hn -Hondures hn -ਹੰਨਡੂਰਸ hn -Ð“Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn -Hondirasi hn -Ð¥Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn -I-Honduras hn -ஆணà¯à®Ÿà¯à®°à®¾à®¸à¯ hn -Ò²Ð¸Ð½Ð´ÑƒÑ€Ð¾Ñ hn -ฮอนดูรัส hn -Ð“Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn -Ð“Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn -洪都拉斯 hn -å®éƒ½æ‹‰æ–¯ hn -Croatia hr -Kroasië hr -كرواتيا hr -Xırvatıstan hr -Ð¥Ð°Ñ€Ð²Ð°Ñ‚Ñ‹Ñ hr -ХърватÑка hr -কà§à¦°à§‹à§Ÿà¦¾à¦¶à¦¿à§Ÿà¦¾ hr -Kroatia hr -Hrvatska hr -Croàcia hr -Chorvatsko hr -Kroatien hr -Kroatien hr -ΚÏοατία hr -Kroatio hr -Croacia hr -Horvaatia hr -Kroazia hr -کرواسی hr -Kroatia hr -Kroatia hr -Croatie hr -Kroatië hr -An Chróit hr -Croácia hr -קרו×טיה hr -कà¥à¤°à¥‹à¤à¤¶à¤¿à¤¯à¤¾ hr -Hrvatska hr -Horvátország hr -Kroasia hr -Króatía hr -Croazia hr -クロアãƒã‚¢ hr -ក្រូអាហhr -í¬ë¡œì•„í‹°ì•„ hr -ໂຄເອເທີຠhr -Kroatija hr -HorvÄtija hr -ХрватÑка hr -Кроати hr -Kroazja hr -Kroatia hr -Kroatien hr -Kroatië hr -Kroatia hr -Croacia hr -ਕਰੋਆਟਿਆ hr -Chorwacja hr -Croácia hr -Croácia hr -CroaÅ£ia hr -Ð¥Ð¾Ñ€Ð²Ð°Ñ‚Ð¸Ñ hr -Korowasiya hr -Kroátia hr -Chorvátsko hr -HrvaÅ¡ka hr -ХрватÑка hr -Hrvatska hr -I-Croatia hr -Kroatien hr -கà¯à®°à¯‹à®Ÿà®¿à®¯à®¾ hr -Хорватӣ hr -โครเอเธีย hr -Hırvatistan hr -Kroatia hr -Ð¥Ð¾Ñ€Ð²Ð°Ñ‚Ñ–Ñ hr -Ð¥Ð¾Ñ€Ð²Ð°Ñ‚Ð¸Ñ hr -CrowÃ¥ceye hr -克罗地亚 hr -克羅埃西亞 hr -Haiti ht -Haïti ht -هايتي ht -Гаіці ht -Хаити ht -হাইতি ht -Haití ht -Αϊτή ht -Haitio ht -Haití ht -هاییتی ht -Haïti ht -Háítí ht -×”×יטי ht -हैती ht -Haítí ht -ãƒã‚¤ãƒ ht -ហែទី ht -ì•„ì´í‹° ht -ວາດຮູບ - K ht -Haitis ht -Хаити ht -Хайти ht -Ħaiti ht -ਹਾਇਟੀ ht -Гаити ht -Hayiti ht -Хаити ht -ஹைதி ht -Ҳаити ht -ไฮติ ht -Гаїті ht -Гаити ht -Hayiti ht -海地 ht -海地 ht -Hungary hu -Hongarye hu -هنغاريا hu -Macarıstan hu -Вугоршчына hu -Ð£Ð½Ð³Ð°Ñ€Ð¸Ñ hu -হাঙà§à¦—েরী hu -Hungaria hu -MaÄ‘arska hu -Hongria hu -MaÄarsko hu -Hwngari hu -Ungarn hu -Ungarn hu -ΟυγγαÏία hu -Hungario hu -Hungría hu -Ungari hu -Hungaria hu -مجارستان hu -Unkari hu -Ungarn hu -Hongrie hu -Hongarije hu -An Ungáir hu -Hungria hu -הונגריה hu -हंगरी hu -MaÄ‘jarska hu -Magyarország hu -Hungaria hu -Ungverjaland hu -Ungheria hu -ãƒãƒ³ã‚¬ãƒªãƒ¼ hu -ហុងគ្រី hu -í—가리 hu -ຫັງàºàº²àº¥àºµ hu -Vengrija hu -UngÄrija hu -Унгарија hu -Унгар hu -Ungerija hu -Ungarn hu -Ungarn hu -Hongarije hu -Ungarn hu -Hongria hu -ਹੰਗਰੀ hu -WÄ™gry hu -Hungria hu -Hungria hu -Ungaria hu -Ð’ÐµÐ½Ð³Ñ€Ð¸Ñ hu -Hongiriya hu -Ungár hu -MaÄarsko hu -Madžarska hu -МађарÑка hu -MaÄ‘arska hu -I-Hungary hu -Ungern hu -ஹஙà¯à®•ேரி hu -МаҷориÑтон hu -ฮังà¸à¸²à¸£à¸µ hu -Macaristan hu -Macarstan hu -Угорщина hu -Ð’ÐµÐ½Ð³Ñ€Ð¸Ñ hu -Hongreye hu -匈牙利 hu -匈牙利 hu -Indonesia id -Indonesië id -إندونيسيا id -İndoneziya id -ІнданÑÐ·Ñ–Ñ id -Ð˜Ð½Ð´Ð¾Ð½ÐµÐ·Ð¸Ñ id -ইনà§à¦¦à§‹à¦¨à§‡à¦¶à¦¿à§Ÿà¦¾ id -Indonezi id -Indonezija id -Indonèsia id -Indonésie id -Indonesien id -Indonesien id -Ινδονησία id -Indonezio id -Indoneesia id -اندونزی id -Indonésie id -Indonesië id -An Indinéis id -Indonésia id -×ינדונזיה id -इंडोनेशिया id -Indonezija id -Indonézia id -Indónesía id -インドãƒã‚·ã‚¢ id -ឥណ្ឌូនáŸážŸáŸŠáž¸ id -ì¸ë„네시아 id -ອີàºà»‚ດນີເຊີຠid -Indonezija id -IndonÄ“zija id -Индонезија id -Индонез id -Indoneżja id -Indonesien id -Indonesië id -ਇੰਡੋਨੇਸ਼ੀਆ id -Indonezja id -Indonésia id -Indonésia id -Indonezia id -Ð˜Ð½Ð´Ð¾Ð½ÐµÐ·Ð¸Ñ id -Indonesiya id -Indonézia id -Indonezija id -Индонезија id -Indonezija id -I-Indonesia id -Indonesien id -இநà¯à®¤à¯‹à®©à¯€à®šà®¿à®¯à®¾ id -Индонезӣ id -อินโดนีเซีย id -İndonezya id -İndonesia id -Ð†Ð½Ð´Ð¾Ð½ÐµÐ·Ñ–Ñ id -Ð˜Ð½Ð´Ð¾Ð½ÐµÐ·Ð¸Ñ id -Indonezeye id -å°åº¦å°¼è¥¿äºš id -å°å°¼ id -Ireland ie -Ierland ie -أيرلندا ie -İrlandiya ie -ІрлÑÐ½Ð´Ñ‹Ñ ie -Ð˜Ñ€Ð»Ð°Ð½Ð´Ð¸Ñ ie -আয়ারলà§à¦¯à¦¾à¦£à§à¦¡ ie -Iwerzhon ie -Irska ie -Irlanda ie -Irsko ie -Iwerddon ie -Irland ie -Irland ie -ΙÏλανδία ie -Islando ie -Irlanda ie -Iirimaa ie -Irlanda ie -ایرلند ie -Irlanti ie -Ãrland ie -Irlande ie -Ierlân ie -Éire ie -Irlanda ie -×ירלנד ie -आयरलैंड ie -Irska ie -Ãrország ie -Irlandia ie -Ãrland ie -Irlanda ie -アイルランド ie -អៀរឡង់ ie -ì•„ì¼ëžœë“œ ie -ໄອà»àº¥àº™ ie -Airija ie -Īrija ie -ИрÑка ie -Ирланд ie -Irlanda ie -Irland ie -Irland ie -Ierland ie -Irland ie -Irlanda ie -ਆਇਰਲੈਂਡ ie -Irlandia ie -Irlanda ie -Irlanda ie -Irlanda ie -Ð˜Ñ€Ð»Ð°Ð½Ð´Ð¸Ñ ie -Irilande ie -Irlánda ie -Ãrsko ie -Irska ie -ИрÑка ie -Irska ie -I-Ireland ie -Irland ie -அயரà¯à®²à®¾à®¨à¯à®¤à¯ ie -Ирлонд ie -ไอร์à¹à¸¥à¸™à¸”์ ie -İrlanda ie -İreland, İrlandia ie -Ð†Ñ€Ð»Ð°Ð½Ð´Ñ–Ñ ie -Ð˜Ñ€Ð»Ð°Ð½Ð´Ð¸Ñ ie -Irlande ie -伊朗 ie -愛爾蘭 ie -Israel il -اسرائيل il -İzrail il -Ізраіль il -Израел il -ইসরাইল il -Izrael il -Izrael il -ΙσÏαήλ il -Israelo il -Iisrael il -اسراییل il -Ãsrael il -Israël il -Iosrael il -ישר×ל il -इज़राइल il -Izrael il -Izrael il -Ãsrael il -Israele il -イスラエル il -អ៊ីស្រាអែល il -ì´ìФë¼ì—˜ il -ອິດສະລະເອລ il -Izraelis il -IzraÄ“la il -Израел il -Изриал il -Iżrael il -ਇਜ਼ਰਾਈਲ il -Izrael il -Израиль il -Isirayeli il -Izrael il -Izrael il -Израел il -Izrael il -I-Israel il -இசà¯à®°à¯‡à®²à¯ il -ИÑроил il -อิสราเอล il -İsrail il -İsrael il -Ізраїль il -ИÑроил il -Israyel il -USirayeli il -以色列 il -以色列 il -India in -Indië in -الهند in -Hindistan in -Ð†Ð½Ð´Ñ‹Ñ in -Ð˜Ð½Ð´Ð¸Ñ in -ভারত in -Indez in -Indija in -Ãndia in -Indie in -Indien in -Indien in -Ινδία in -Hindujo in -هندوستان in -Intia in -Inde in -An India in -Ãndia in -הודו in -भारत in -Indija in -Indland in -インド in -ឥណ្ឌា in -ì¸ë„ in -ອິນເດີຠin -Indija in -Indija in -Индија in -ЭнÑтхÑг in -Indja in -Indien in -ਭਾਰਤ in -Indie in -Ãndia in -Ãndia in -Ð˜Ð½Ð´Ð¸Ñ in -Ubuhinde in -Indija in -Индија in -Indija in -I-India in -Indien in -இநà¯à®¤à®¿à®¯à®¾ in -ҲиндуÑтон in -อินเดีย in -Hindistan in -Hindstan in -Ð†Ð½Ð´Ñ–Ñ in -ҲиндиÑтон in -Ấn Äá»™ in -Inde in -å°åº¦ in -å°åº¦ in -Endiya in -Iraq iq -Irak iq -العراق iq -İraq iq -Ірак iq -Ирак iq -ইরাক iq -Irak iq -Irak iq -Irák iq -Irac iq -Irak iq -Irak iq -ΙÏάκ iq -Irako iq -Irak iq -Iraak iq -Irak iq -عراق iq -Irak iq -Irak iq -Irak iq -Irak iq -An Iaráic iq -עיר××§ iq -इराक iq -Irak iq -Irak iq -Ãrak iq -イラク iq -អ៊ីរ៉ាក់ iq -ì´ë¼í¬ iq -ອີລັຠiq -Irakas iq -IrÄka iq -Ирак iq -Ирак iq -Irak iq -Irak iq -Irak iq -Irak iq -ਇਰਾਕ iq -Irak iq -Iraque iq -Iraque iq -Irak iq -Ирак iq -Iraki iq -Iráka iq -Irák iq -Irak iq -Ирак iq -Irak iq -I-Iraq iq -Irak iq -ஈராக௠iq -Ироқ iq -อิรัภiq -Irak iq -Ğíraq iq -Ірак iq -Ироқ iq -Irak iq -伊拉克 iq -伊拉克 iq -Iran ir -أيران ir -Іран ir -Иран ir -ইরান ir -Ãrán ir -ΙÏάν ir -Irano ir -Iraan ir -ایران ir -An Iaráin ir -Irán ir -×יר×ן ir -इरान ir -Irán ir -Ãran ir -イラン ir -អ៊ីរ៉ង់ ir -ì´ëž€ ir -ອີລັຠir -Iranas ir -IrÄna ir -Иран ir -Иран ir -ਈਰਾਨ ir -Irão ir -Irã ir -Иран ir -Irani ir -Irána ir -Irán ir -Иран ir -I-Iran ir -ஈரான௠ir -Эрон ir -อิหร่าน ir -İran ir -İran ir -Іран ir -Эрон ir -伊朗 ir -伊朗 ir -Iceland is -Ysland is -أيسلندا is -İslandiya is -ІÑьлÑÐ½Ð´Ñ‹Ñ is -ИÑÐ»Ð°Ð½Ð´Ð¸Ñ is -আইসলà§à¦¯à¦¾à¦£à§à¦¡ is -Island is -Island is -Islàndia is -Island is -Ynys yr I? is -Island is -Island is -Ισλανδία is -Islando is -Islandia is -Island is -Islandia is -ایسلند is -Islanti is -Ãsland is -Islande is -Yslân is -An Ãoslainn is -Islándia is -×יסלנד is -आयरलैंड is -Island is -Izland is -Islandia is -Ãsland is -Islanda is -アイスランド is -អ៊ីស្លង់ is -ì•„ì´ìŠ¬ëž€ë“œ is -ໄອຊà»àº¥àº™ is -Islandija is -Islande is -ИÑланд is -ИÑланд is -Islandja is -Island is -Island is -IJsland is -Island is -Islandia is -ਆਈਸਲੈਂਡ is -Islandia is -Islândia is -Islândia is -Islanda is -ИÑÐ»Ð°Ð½Ð´Ð¸Ñ is -Isilande is -Islánda is -Island is -Islandija is -ИÑланд is -Island is -I-Iceland is -Island is -தீவ௠is -ИÑлонд is -ไอซ์à¹à¸¥à¸™à¸”์ is -İzlanda is -İsland is -ІÑÐ»Ð°Ð½Ð´Ñ–Ñ is -ИÑÐ»Ð°Ð½Ð´Ð¸Ñ is -Izlande is -冰岛 is -冰島 is -Icelandi is -Italy it -Italië it -ايطاليا it -İtalyia it -Ð†Ñ‚Ð°Ð»Ñ–Ñ it -Ð˜Ñ‚Ð°Ð»Ð¸Ñ it -ইতালী it -Italia it -Italija it -Itàlia it -Itálie it -Yr Eidal it -Italien it -Italien it -Ιταλία it -Italio it -Italia it -Itaalia it -Italia it -ایتالیا it -Italia it -Italia it -Italie it -Italië it -An Iodáil it -Itália it -×יטליה it -इटली it -Italija it -Olaszország it -Italia it -Ãtalía it -Italia it -イタリア it -អ៊ីážáž¶áž›áž¸ it -ì´íƒˆë¦¬ì•„ it -ອີຕາລີ it -Italija it -ItÄlija it -Италија it -Итали it -Itali it -Italja it -Italia it -Italien it -Italië it -Italia it -Italia it -ਇਟਲੀ it -WÅ‚ochy it -Itália it -Itália it -Italia it -Ð˜Ñ‚Ð°Ð»Ð¸Ñ it -Ubutaliyani it -Itália it -Taliansko it -Italija it -Италија it -Italija it -I-Italy it -Italien it -இதà¯à®¤à®¾à®²à®¿ it -Итолиё it -อิตาลี it -İtalya it -İtalia it -Ð†Ñ‚Ð°Ð»Ñ–Ñ it -Ð˜Ñ‚Ð°Ð»Ð¸Ñ it -à it -ItÃ¥leye it -Ithali it -æ„大利 it -義大利 it -Jamaica jm -Jamaika jm -جامايكا jm -Yamayka jm -Ямайка jm -Ямайка jm -জামাইকা jm -Jamaika jm -Jamajka jm -Jamajka jm -Jamaika jm -Τζαμάικα jm -Jamajko jm -Jamaika jm -جاماییکا jm -Jamaika jm -Jamaïque jm -An Iamáice jm -Xamaica jm -×’'מייקה jm -जमैका jm -Jamajka jm -Jamaika jm -Jamaika jm -Jamaíka jm -Giamaica jm -ジャマイカ jm -ហ្សាម៉ាអ៊ិគ jm -ìžë©”ì´ì¹´ jm -ຈາໄມàºàº² jm -Jamaika jm -Jamaika jm -Јамајка jm -Ямайк jm -Ä amajka jm -Jamaika jm -ਜੈਮੇਕਾ jm -Jamajka jm -Ямайка jm -Jamayika jm -Jamajka jm -Jamajka jm -Јамајка jm -Jamajka jm -I-Jamaica jm -சமெயà¯à®•à¯à®•ா jm -Ҷомойко jm -จาไมà¸à¹‰à¸² jm -Jamaika jm -Jamayka jm -Ямайка jm -Ямайка jm -Djamayike jm -牙买加 jm -牙買加 jm -Jordan jo -Jordaan jo -الأردن jo -İordaniya jo -Ð¯Ñ€Ð´Ð°Ð½Ñ–Ñ jo -Ð™Ð¾Ñ€Ð´Ð°Ð½Ð¸Ñ jo -জরà§à¦¡à¦¾à¦¨ jo -Jordani jo -Jordània jo -Jordán jo -Gwlad Iorddonen jo -Jordanien jo -ΙοÏδανία jo -Jordanio jo -Jordania jo -Jordaania jo -Jordania jo -اردن jo -Jordania jo -Jordanie jo -Jordanië jo -An Iordáin jo -Xordánia jo -ירדן jo -जॉरà¥à¤¡à¤¨ jo -Jordánia jo -Jórdanía jo -Giordania jo -ヨルダン jo -ហ្ស៊កដានី jo -요르단 jo -ຈà»à»àº”ນ jo -Jordanija jo -JordÄnija jo -Јордан jo -Ðрдан jo -Ä ordan jo -Jordanien jo -Jordanië jo -ਜਾਰਡਨ jo -Jordania jo -Jordânia jo -Jordânia jo -Iordania jo -Ð˜Ð¾Ñ€Ð´Ð°Ð½Ð¸Ñ jo -Yorudani jo -Jordánia jo -Jordánsko jo -Jordanija jo -Јордан jo -I-Jordan jo -Jordanien jo -ஜோரà¯à®Ÿà®¾à®©à¯ jo -Урдон jo -จอร์à¹à¸”น jo -Ürdün jo -Ð™Ð¾Ñ€Ð´Ð°Ð½Ñ–Ñ jo -Иордан jo -Djordaneye jo -约旦 jo -ç´„æ—¦ jo -Ijolidani jo -Japan jp -اليابان jp -Yaponiya jp -Ð¯Ð¿Ð¾Ð½Ñ–Ñ jp -Ð¯Ð¿Ð¾Ð½Ð¸Ñ jp -জাপান jp -Japon jp -Japó jp -Japonsko jp -Siapan jp -Ιαπωνία jp -Japanio jp -Japón jp -Jaapan jp -Japonia jp -ژاپن jp -Japani jp -Japon jp -An tSeapáin jp -Xapón jp -יפן jp -जापान jp -Japán jp -Jepang jp -Giappone jp -日本 jp -ជប៉ុន jp -ì¼ë³¸ jp -àºàºµà»ˆàº›àº¸à»ˆàº™ jp -Japonija jp -JapÄna jp -Јапонија jp -Япон jp -Jepun jp -Ä appun jp -Japon jp -ਜਾਪਾਨ jp -Japonia jp -Japão jp -Japão jp -Japonia jp -Ð¯Ð¿Ð¾Ð½Ð¸Ñ jp -Ubuyapani jp -Japána jp -Japonsko jp -Japonska jp -Јапан jp -I-Japan jp -சபà¯à®ªà®¾à®©à¯ jp -Ҷопон jp -à¸à¸µà¹ˆà¸›à¹ˆà¸¸à¸™ jp -Japonya jp -Japan, Yaponia jp -Ð¯Ð¿Ð¾Ð½Ñ–Ñ jp -Ð¯Ð¿Ð¾Ð½Ð¸Ñ jp -Nhật bản jp -Djapon jp -日本 jp -日本 jp -Kenya ke -Kenië ke -كينيا ke -ÐšÐµÐ½Ñ–Ñ ke -ÐšÐµÐ½Ð¸Ñ ke -কেনিয়া ke -Kenija ke -Keňa ke -Cenia ke -Kenia ke -Κένυα ke -Kenjo ke -Kenia ke -کنیا ke -Kenia ke -An Chéinia ke -Kenia ke -×§× ×™×” ke -केनà¥à¤¯à¤¾ ke -Kenija ke -Kenía ke -ケニア ke -កáŸáž“យ៉ា ke -ì¼€ëƒ ke -ເວນດາ ke -Kenija ke -Kenija ke -Кенија ke -ÐšÐµÐ½Ð¸Ñ ke -Kenja ke -Kenia ke -ਕੀਨੀਆ ke -Kenia ke -Quénia ke -Quênia ke -Kenia ke -ÐšÐµÐ½Ð¸Ñ ke -Keňa ke -Kenija ke -Кенија ke -Kenija ke -கெனà¯à®¯à®¾ ke -Куниё ke -เคนยา ke -Kenia ke -ÐšÐµÐ½Ñ–Ñ ke -ÐšÐµÐ½Ð¸Ñ ke -Kenia ke -肯尼亚 ke -肯亞 ke -Kyrgyzstan kg -قيرغيزستان kg -КыргызÑтан kg -КиргизÑтан kg -কিরà§à¦—িজসà§à¦¤à¦¾à¦¨ kg -Kirgistan kg -Kirgistan kg -Kyrgigstan kg -Kyrgyzstán kg -Cyrgystan kg -Kirgizistan kg -Kirgisien kg -ΚιÏγιζιστάν kg -Kirgizujo kg -Kyrgyzstán kg -Kõrgõzstan kg -قرقیزستان kg -Kirghizstan kg -An Chirgeastáin kg -Kirguizistán kg -קירגיסטן kg -किरà¥à¤—िजिसà¥à¤¤à¤¾à¤¨ kg -Kirgizisztán kg -Kirgisistan kg -Kirghizistan kg -キルギスタン kg -គៀរហ្គីស្ážáž„់ kg -키르기스스탄 kg -ຄສິຕັລ kg -Kirgistanas kg -KirgizstÄna kg -КиргиÑтан kg -КиргизÑтан kg -Kirgiżstan kg -Kirgisistan kg -Kirgisien kg -Kirgizië kg -Kirgisistan kg -ਕਿਰਗਸਤਾਨ kg -Kigistan kg -Quirguistão kg -Quirguistão kg -Kirgiztan kg -КиргизÑтан kg -Kirigizisitani kg -Kirgisistan kg -Kirgizstan kg -КиргиÑтан kg -Kirgistan kg -Kirgizistan kg -கிரà¯à®•ிஸà¯à®¤à®¾à®©à¯ kg -ҚирғизиÑтон kg -คีจิสถาน kg -Kırgızistan kg -Qırğızstan kg -КиргизÑтан kg -ҚирғизиÑтон kg -Kirguiztan kg -å‰å°”剿–¯æ–¯å¦ kg -å‰çˆ¾å‰æ–¯ kg -Cambodia kh -Kambodië kh -كمبوديا kh -Камбоджа kh -Камбоджа kh -কামবোডিয়া kh -Kambodj kh -KamboÄ‘a kh -Cambodja kh -Kambodža kh -Kambodscha kh -Καμπότζη kh -KamboÄo kh -Kambodža kh -Canbodia kh -کامبوج kh -Kambodza kh -Cambodge kh -Cambodja kh -An Chambóid kh -Camboia kh -קמבודיה kh -कमà¥à¤¬à¥‹à¤¡à¤¿à¤¯à¤¾ kh -KamboÄ‘a kh -Kambodzsa kh -Kambódía kh -Cambogia kh -カンボジア kh -កម្ពុជា kh -캄보디아 kh -ໂຄລຳເບີຠkh -Kambodža kh -Kambodža kh -Камбоџа kh -Камбодиа kh -Kemboja kh -Kambodja kh -Kambodsja kh -Kambodscha kh -Cambodja kh -Kambodsja kh -ਕੰਬੋਡੀਆ kh -Kambodża kh -Cambodja kh -Cambodja kh -Cambogia kh -Камбоджа kh -Kamboji kh -Kamboža kh -Kambodža kh -Kambodža kh -Камбоџа kh -Kambodža kh -Kambodja kh -கமà¯à®ªà¯‹à®Ÿà®¿à®¯à®¾ kh -Камбуҷа kh -à¸à¸±à¸¡à¸žà¸¹à¸Šà¸² kh -Kamboçya kh -Kambodia kh -Камбоджа kh -Камбоджа kh -Cam pu chia kh -Cambodje kh -柬埔寨 kh -柬埔寨 kh -Kiribati ki -كيريباتي ki -Кiрыбацi ki -Кирибати ki -কিরিবাটি ki -Ciribati ki -ΚιÏιμπάτι ki -Kiribato ki -کیریباتی ki -Ciribeas ki -קיריב×טי ki -किरीबाती ki -Kíribatí ki -キリãƒã‚¹ ki -គិរិបាទី ki -키리바시 ki -à»àºŸàº„ທັລ - K ki -Кирибати ki -Крибати ki -ਕਿਰਿਬਟੀ ki -Кирибати ki -Кирибати ki -கிரிபடி ki -Карибот ki -คิริบาติ ki -Кірібаті ki -Кирибати ki -基里巴斯 ki -å‰é‡Œå·´æ–¯ ki -Comoros km -جزر القمر km -Каморы km -КоморÑки оÑтрови km -কমোরস km -Komoros km -Komori km -Komory km -Ynysoedd Y Comoros km -Comorerne km -Komoren km -ΚομόÏες km -Komoroj km -Komoorid km -کوموروس km -Komorit km -Comores km -Na Comóir km -קומורוס km -कोमोरो km -Kómoreyjar km -Comore km -コモロ km -កុំម៉ូរ៉ូស km -코모로 km -ສີ km -Komoru salas km -КоморÑки оÑтрови km -Ð¡Ð¾Ð¼Ð¾Ñ€Ð¾Ñ km -Komoros km -Komorene km -Komoren km -Komorane km -ਕੋਮੋਰੋਸ km -Komory km -КоморÑкие оÑтрова km -Komore km -Komorot km -Komori km -Комора km -Komora km -Komorerna km -காமாரோஸ௠km -ÐšÐ¾Ð¼Ð¾Ñ€Ð¾Ñ km -โคโมรอส km -Komoros km -Komorlar km -КоморÑькі оÑтрови km -ÐšÐ¾Ð¼Ð¾Ñ€Ð¾Ñ km -Comores km -ç§‘æ‘©ç½— km -葛摩 km -St. Kitts and Nevis kn -St. Kitts en Nevis kn -سانت كيتس Ùˆ نيÙيس kn -St. Kitts vÉ™ Nevis kn -СÑнт-КрыÑтофер Ñ– ÐÑÐ²Ñ–Ñ kn -Св. ÐšÐ¸Ñ‚Ñ Ð¸ ÐÐµÐ²Ð¸Ñ kn -সেনà§à¦Ÿ কিটস à¦à¦¬à¦‚ নেভিস kn -S. Kitts ha Nevis kn -St. Kitts i Nevis kn -Sv. Kitts a Nevis kn -Ynysoedd St. Kitts a Nevis kn -St. Kitts-Nevis kn -St. Kitts und Nevis kn -Άγιος ΧÏιστόφοÏος (Σαιντ Κιτς) και Îέβις kn -Sent-Kristofo kaj Neviso kn -St. Kitts y Nevis kn -St. Kitts ja Nevis kn -St. Kitts eta Nevis kn -سن کیتس Ùˆ نویس kn -St. Kitts ja Nevis kn -St Kitts et Nevis kn -St. Kitts en Nevis kn -San Críostóir Nimheas kn -Saint Kitts e Nevis kn -סנט קיטס ונביס kn -सेंट किटà¥à¤¸ तथा नेविस kn -St. Kitts és Nevis kn -St. Kitts dan Nevis kn -Sankti Kristófer og Nevis kn -Saint Kitts e Nevis kn -セントクリストファーãƒã‚¤ãƒ“ス kn -សង់ឃីហនិង áž“áŸážœáž¸ážŸ kn -세ì¸íЏ 키츠 네비스 kn -Å v. Kitts ir Nevis kn -Senkitsa un Nevisa kn -Св. ÐšÐ¸Ñ‚Ñ Ð¸ ÐÐµÐ²Ð¸Ñ kn -St. ÐšÐ¸Ñ‚Ñ‚Ñ Ð±Ð° ÐÐµÐ²Ð¸Ñ kn -St. Kitts u Nevis kn -St. Kitts og Nevis kn -St. Kitts un Nevis kn -St. Kitts en Nevis kn -St. Kitts og Nevis kn -St. Kitts le Nevis kn -St. Kitts e Nevis kn -ਸੇਂਟ ਕਿਟਸ ਤੇ ਨਿਵੀਸ kn -St. Kitts e Nevis kn -St Kitts e Nevis kn -Sf. Kitts ÅŸi Nevis kn -Сент-ÐšÐ¸Ñ‚Ñ Ð¸ ÐÐµÐ²Ð¸Ñ kn -Mutagatifu Kitsi na Nevisi kn -St. Kitts ja Nevis kn -St. Kitts a Nevis kn -St. Kitts in Nevis kn -Св. ÐšÐ¸Ñ‚Ñ Ð¸ ÐÐµÐ²Ð¸Ñ kn -Sv. Kits i Nevis kn -I-St. Kitts and Nevis kn -St. Kitts och Nevis kn -செயினà¯à®Ÿà¯ கிடà¯à®šà¯ & நெவிச௠kn -Синт ÐšÐ¸Ñ‚Ñ‚Ñ Ð²Ð° ÐÐµÐ²Ð¸Ñ kn -เซนต์à¸à¸´à¸•ส์à¹à¸¥à¸°à¹€à¸™à¸§à¸´à¸ª kn -St. Kitts ve Nevis kn -Santa Kitts wä Nevis kn -Ð¤ÐµÐ´ÐµÑ€Ð°Ñ†Ñ–Ñ Ð¡ÐµÐ½Ñ‚-ÐšÑ–Ñ‚Ñ Ñ– ÐÐµÐ²Ñ–Ñ kn -Сент-КриÑтофер ва ÐÐµÐ²Ð¸Ñ kn -St. Kitts na Nevis kn -St. Kitts và Nevis kn -St. Kitts neNevis kn -圣基茨和尼维斯 kn -è–å…‹ç†æ–¯å¤šç¦åŠå°¼ç¶­æ–¯ kn -St. Kitts kanye no-Nevis kn -North Korea kp -Noord Korea kp -كوريا الشمالية kp -Åžimali Koreya kp -ÐŸÐ°ÑžÐ½Ð¾Ñ‡Ð½Ð°Ñ ÐšÐ°Ñ€ÑÑ kp -Северна ÐšÐ¾Ñ€ÐµÑ kp -উতà§à¦¤à¦° কোরিয়া kp -Norzh-Korea kp -Sjeverna Koreja kp -Corea del Nord kp -Severní Korea kp -Gogledd Corea kp -Nordkorea kp -Nord-Korea kp -Î’ÏŒÏεια ΚοÏέα kp -Nordkoreo kp -Corea del Norte kp -Põhja-Korea kp -Ipar Korea kp -کره شمالی kp -Pohjois-Korea kp -Norðurkorea kp -Corée du nord kp -Noard-Korea kp -An Chóiré Thuaidh kp -Corea do Norte kp -צפון קורי××” kp -उतà¥à¤¤à¤°à¥€ कोरिया kp -Sjeverna Koreja kp -Észak-Korea kp -Korea Utara kp -Norður-Kórea kp -Corea del Nord kp -æœé®®æ°‘主主義人民共和国 kp -កូរ៉áŸâ€‹ážáž¶áž„​ជើង kp -ì¡°ì„ ë¯¼ì£¼ì£¼ì˜ ì¸ë¯¼ê³µí™”êµ­ kp -ເàºàº»àº²àº¥àºµà»€àº«àº™àº·àº­ kp -Å iaurÄ—s KorÄ—ja kp -ZiemeļKoreja kp -Северна Кореја kp -Хойд ÑÐ¾Ð»Ð¾Ð½Ð³Ð¾Ñ kp -Korea ta' Fuq kp -Nord-Korea kp -Noordkorea kp -Noord-Korea kp -Nord-Korea kp -Lebowa la Korea kp -Corea dèu Nord kp -ਉੱਤਰੀ ਕੋਰੀਆ kp -Korea Północna kp -Coreia do Norte kp -Coréia do Norte kp -Coreea de Nord kp -Ð¡ÐµÐ²ÐµÑ€Ð½Ð°Ñ ÐšÐ¾Ñ€ÐµÑ kp -Koreya y'Amajyaruguru kp -Davvi-Korea kp -severná Kórea kp -Severna Koreja kp -Северна Кореја kp -Severna Koreja kp -I-North Korea kp -Nordkorea kp -வட கொரியா kp -КореÑи Шимолӣ kp -เà¸à¸²à¸«à¸¥à¸µà¹€à¸«à¸™à¸·à¸­ kp -Kuzey Kore kp -Tönyaq Korea kp -Північна ÐšÐ¾Ñ€ÐµÑ kp -Шимолий ÐšÐ¾Ñ€ÐµÑ kp -Devhula ha Korea kp -Bắc Triá»u Tiên kp -Bijhe Corêye kp -Umntla Korea kp -æœé²œ kp -北韓 kp -Enyakatho ne-Korea kp -South Korea kr -Suid Korea kr -كوريا الجنوبية kr -CÉ™nubi Koreya kr -ÐŸÐ°ÑžÐ´Ð½Ñ‘Ð²Ð°Ñ ÐšÐ°Ñ€ÑÑ kr -Южна ÐšÐ¾Ñ€ÐµÑ kr -দকà§à¦·à¦¿à¦£ কোরিয়া kr -Su-Korea kr -Južna Koreja kr -Corea del Sud kr -Jižní Korea kr -De Corea kr -Sydkorea kr -Süd-Korea kr -Îότια ΚοÏέα kr -Sudkoreo kr -Corea del Sur kr -Lõuna-Korea kr -Hego Korea kr -کره جنوبی kr -Etelä-Korea kr -Suðurkorea kr -Corée du sud kr -Sûd-Korea kr -An Chóiré Theas kr -Corea do Sur kr -×“×¨×•× ×§×•×¨×™××” kr -दकà¥à¤·à¤¿à¤£à¥€ कोरिया kr -Južna Koreja kr -Dél-Korea kr -Korea Selatan kr -Suður-Kórea kr -Corea del Sud kr -大韓民国 kr -កូរ៉áŸâ€‹ážáž¶áž„​ážáŸ’បូង kr -대한민국 kr -ເàºàº»àº²àº¥àºµà»ƒàº•້ kr -Pietų KorÄ—ja kr -DievidKoreja kr -Јужна Кореја kr -Өмнөд ÑÐ¾Ð»Ð¾Ð½Ð³Ð¾Ñ kr -Korea t'Isfel kr -Sør-Korea kr -Söödkorea kr -Zuid-Korea kr -Sør-Korea kr -Borwa bja Korea kr -Corea dèu Sud kr -ਦੱਖਣੀ ਕੋਰੀਆ kr -Korea PoÅ‚udniowa kr -Coreia do Sul kr -Coréia do Sul kr -Coreea de Sud kr -Ð®Ð¶Ð½Ð°Ñ ÐšÐ¾Ñ€ÐµÑ kr -Koreya y'Amajyepfo kr -Lulli-Korea kr -Južná Kórea kr -Južna Koreja kr -Јужна Кореја kr -Južna Koreja kr -I-South Korea kr -Sydkorea kr -தென௠கொரியா kr -КореÑи Ҷанубӣ kr -เà¸à¸²à¸«à¸¥à¸µà¹ƒà¸•้ kr -Güney Kore kr -Könyaq Korea kr -Південна ÐšÐ¾Ñ€ÐµÑ kr -Жанубий ÐšÐ¾Ñ€ÐµÑ kr -Korea tshipembe kr -Hàn Quốc kr -Nonne Corêye kr -Umzantsi Korea kr -韩国 kr -å—韓 kr -Emzansi Korea kr -Kuwait kw -Kuwaït kw -الكويت kw -КувÑйт kw -Кувейт kw -কà§à§Ÿà§‡à¦¤ kw -Kowaet kw -Kuvajt kw -Kuvajt kw -Coweit kw -Κουβέιτ kw -Kuvajto kw -Kuveit kw -کویت kw -Kuvait kw -Kowait kw -Koeweit kw -Cuáit kw -כווית kw -कà¥à¤µà¥ˆà¤¤ kw -Kuvajt kw -Kuvait kw -Kúveit kw -クェート kw -គុយវ៉ែហkw -쿠웨ì´íЏ kw -à»àº•້ມຮູບ- K kw -Kuveitas kw -Kuveita kw -Кувајт kw -Кувейт kw -Koeweit kw -ਕà©à¨µà©ˆà¨¤ kw -Koweit kw -Kuveit kw -Кувейт kw -Koweti kw -Kuvajt kw -Kuvajt kw -Кувајт kw -Kuvajt kw -I-Kuwait kw -கà¯à®µà¯ˆà®¤à¯ kw -Қувейт kw -คูเวต kw -Küwäyt kw -KКувейт kw -Кувайт kw -Kuweyt kw -ç§‘å¨ç‰¹ kw -ç§‘å¨ç‰¹ kw -Cayman Islands ky -Cayman Eilande ky -جزر الكايمان ky -Кайманови оÑтрови ky -কেমà§à¦¯à¦¾à¦¨ দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ ky -Inizi Kaeman ky -Kajmanska ostrva ky -Illes Caimà ky -Kajmanské ostrovy ky -Ynysoedd Caiman ky -Cayman-øerne ky -Kaiman-Inseln ky -Îησιά Κάυμαν ky -Kejmanoj ky -Islas Caimán ky -Kaimanisaared ky -Kaiman Irlak ky -جزایر Ú©Ùیمن ky -Cayman-saaret ky -ÃŽles Caïman ky -Kaaiman Eilannen ky -Oileáin na gCadhman ky -Illas Caimán ky -××™×™ קיימן ky -केमन आइलैंड ky -Kajmanski Otoci ky -Kajmán-szigetek ky -Cayman-eyjar ky -Isole Cayman ky -英領ケイマン諸島 ky -កោះ​កៃម៉ាន ky -ì¼€ì´ë§¨ ì œë„ ky -ຄາຕາລັນ ky -Kaimanų salos ky -Kaimanu salas ky -КајманÑки ОÑтрови ky -Cayman арлууд ky -Gżejjer Cayman ky -Caymanøyene ky -Kayman-Inseln ky -Kaaiman Eilanden ky -Caymanøyane ky -ਕਾਅਮਾਨ ਟਾਪੂ ky -Kajmany ky -Ilhas Caimão ky -Ilhas Cayman ky -Insulele Cayman ky -Каймановы оÑтрова ky -Ibirwa bya Kayimani ky -Caymansullot ky -Kajmanske Ostrovy ky -Kajmanski otoki ky -КајманÑка оÑтрва ky -Kajmanska ostrva ky -Caymanöarna ky -கேமான௠தீவà¯à®•ள௠ky -Ҷазираи Кайман ky -หมู่เà¸à¸²à¸°à¹€à¸„ย์à¹à¸¡à¸™ ky -Cayman Adaları ky -Kayman Utrawları ky -Кайман оÑтрів ky -Кайман Ороллари ky -Iyes Cayman ky -开曼群岛 ky -開曼群島 ky -Kazakhstan kz -كازاخستان kz -КазахÑтан kz -КазахÑтан kz -কাজাকসà§à¦¤à¦¾à¦¨ kz -Kazakstan kz -Kazahstan kz -Kazachstán kz -Casacstan kz -Kasachstan kz -Καζακστάν kz -KazaÄ¥ujo kz -Kazakhstán kz -Kasahstan kz -قزاقستان kz -Kazakstan kz -Kazachstan kz -An Chasacstáin kz -Kazaxistán kz -קזחסט×ן kz -कज़ाखिसà¥à¤¤à¤¾à¤¨ kz -Kazahstan kz -Kazahsztán kz -Kasakstan kz -Kazakistan kz -カザフスタン kz -កាហ្សាក់ស្ážáž„់ kz -ì¹´ìží스탄 kz -à»àºà»àº¥àºàº•ິຠ- K kz -Kazachstanas kz -KazahstÄna kz -КазакÑтан kz -Казак kz -Każakstan kz -Kasakhstan kz -Kasachstan kz -Kazachstan kz -Kasakhstan kz -ਕਾਜ਼ਾਕਸਤਾਨ kz -Kazachstan kz -Cazaquistão kz -Cazaquistão kz -Cazahstan kz -КазахÑтан kz -Kazakisitani kz -Kasakhstan kz -Kazachstan kz -Kazahstan kz -КазахÑтан kz -Kazahstan kz -Kazakstan kz -கஜஸà¯à®¤à®¾à®©à¯` kz -ҚазоқиÑтон kz -คาซัคสถาน kz -Kazakistan kz -Qazaqstan kz -КазахÑтан kz -ҚозоғиÑтон kz -Kazaxhtan kz -哈è¨å…‹æ–¯å¦ kz -哈薩克 kz -Laos la -لاوس la -Ð›Ð°Ð¾Ñ la -Ð›Ð°Ð¾Ñ la -লাওস la -Λάος la -Laoso la -لائوس la -Láós la -ל×וס la -लाओस la -Laosz la -ラオス la -ឡាវ la -ë¼ì˜¤ìФ la -ລາວ la -Laosas la -Laosa la -Ð›Ð°Ð¾Ñ la -Ð›Ð°Ð¾Ñ la -ਲਿਉਸ la -Ð›Ð°Ð¾Ñ la -Lawosi la -Ð›Ð°Ð¾Ñ la -லாஸ௠la -Ð›Ð°Ð¾Ñ la -ลาว la -Ð›Ð°Ð¾Ñ la -Ð›Ð°Ð¾Ñ la -Lào la -Lawosse la -è€æŒ la -寮國 la -Lebanon lb -Libanon lb -لبنان lb -Ліван lb -Ливан lb -লেবানন lb -Liban lb -Liban lb -Líban lb -Libanon lb -Libanus lb -Libanon lb -Libanon lb -Λίβανος lb -Libano lb -Líbano lb -Liibanon lb -Libano lb -لبنان lb -Libanon lb -Libanon lb -Liban lb -Libanon lb -An Liobáin lb -Líbano lb -לבנון lb -लेबनान lb -Libanon lb -Libanon lb -Líbanon lb -Libano lb -レãƒãƒŽãƒ³ lb -លីបង់ lb -레바논 lb -ເດນ່ງນ lb -Libanas lb -LibÄna lb -Либан lb -Либанон lb -Lubnan lb -Libanu lb -Libanon lb -Libanon lb -Libanon lb -Libanon lb -ਲਿਬਨਾਨ lb -Liban lb -Líbano lb -Líbano lb -Liban lb -Ливан lb -Libani lb -Libanon lb -Libanon lb -Libanon lb -Либан lb -Liban lb -I-Lebanon lb -Libanon lb -லெபனான௠lb -Лубнон lb -เลบานอน lb -Ліван lb -Лебанон lb -Li Băng lb -Liban lb -黎巴嫩 lb -黎巴嫩 lb -St. Lucia lc -سانت لوسيا lc -СÑнт-ЛюÑÑ–Ñ lc -Св. Ð›ÑƒÑ‡Ð¸Ñ lc -সেনà§à¦Ÿ লà§à¦¸à¦¿à§Ÿà¦¾ lc -S. Lucia lc -Svatá Lucie lc -St. Lwsia lc -Σάντα Λουτσία lc -Sent-Lucio lc -Santa Lucía lc -سن لوسیا lc -Sankta Lusia lc -Sainte Lucie lc -San Lúisia lc -Santa Lucia lc -סנטה לוסיה lc -सेंट लूसिया lc -Sankti Lúsía lc -Santa Lucia lc -セントルシア lc -សង់លូស៊ីយ៉ា lc -세ì¸íЏ 루시아 lc -ເຊັນລູເຊີຠlc -Å v Liucija lc -Sv. LÅ«cija lc -Св. Луција lc -St. ЛуÑиа lc -St. LuÄ‹ija lc -ਸੇਂਟ ਲੂਉਸ lc -Santa Lúcia lc -Santa Lúcia lc -Sf. Lucia lc -Сент-ЛюÑÐ¸Ñ lc -Mutagatifu Lusiya lc -Sv. Júlia lc -Sv. Lucija lc -Св. Луција lc -Sv. Lucija lc -I-St. Lucia lc -செனà¯à®Ÿà¯ லூசியா lc -Синт ЛуÑиё lc -เซนต์ลูเซีย lc -Santa Lüçiä lc -Сент-ЛюÑÑ–Ñ lc -Сент-ЛюÑÐ¸Ñ lc -Ste Luceye lc -圣å¢è¥¿äºš lc -è–露西亞 lc -Liechtenstein li -ليشتنشتاين li -ЛіхтÑнштÑйн li -Лихтенщайн li -লিখটেনসà§à¦Ÿà¦¾à¦‡à¦¨ li -LihtenÅ¡tajn li -LichtenÅ¡tejnsko li -Λίχτενσταϊν li -LiÄ¥tenÅtejno li -Liechtestein li -لیختن اشتاین li -An Lichtinstéin li -ליכטנשטין li -लिचटेनसà¥à¤Ÿà¥€à¤¨ li -LihtenÅ¡tajn li -リヒテンシュタイン li -លិចទáŸáž“ស្ážáŸ‚áž“ li -리히í…ìŠˆíƒ€ì¸ li -ຟ້າà»àº¡àºš li -LichtenÅ¡teinas li -LihtenÅ¡teina li -Лихтенштајн li -ЛихтÑнштайн li -Liechtensteen li -ਲੀਚਟੀਨਸਟੀਨ li -Lichtensztajn li -Лихтенштейн li -Liyeshitensiteyini li -Лихтенштајн li -LihtenÅ¡tajn li -லசà¯à®šà¯†à®©à¯à®¸à¯à®Ÿà¯†à®©à¯ li -Лихтанштоин li -ลิชเทนสไตน์ li -LihtenÅŸtayn li -Lihtenstein li -Ліхтенштейн li -Лихтенштейн li -Lîchtensteyn li -列支敦士登 li -列支敦斯登 li -Sri Lanka lk -سريلانكا lk -Шры-Ланка lk -Шри Ланка lk -শà§à¦°à§€à¦²à¦™à§à¦•া lk -Å ri Lanka lk -Srí Lanka lk -Sri Lanca lk -ΣÏι Λάνκα lk -Sri-Lanko lk -سریلانکا lk -Srí Lanca lk -סרי לנקה lk -शà¥à¤°à¥€ लंका lk -Å ri Lanka lk -Srí Lanka lk -スリランカ lk -ស្រីលង្កា lk -스리랑카 lk -ເຊີເບີຠlk -Å ri Lanka lk -Å rilanka lk -Шри Ланка lk -Шириланк lk -ਸà©à¨°à©€à¨²à©°à¨•ਾ lk -Шри-Ланка lk -Siri Lanka lk -Å ri Lanka lk -Шри Ланка lk -Å ri Lanka lk -இலஙà¯à®•ை lk -Сри Лонко lk -ศรีลังà¸à¸² lk -Åžri Lanka lk -Шрі-Ланка lk -Шри Ланка lk -æ–¯é‡Œå…°å¡ lk -æ–¯é‡Œè˜­å¡ lk -Liberia lr -Liberië lr -ليبيريا lr -ЛібÑÑ€Ñ‹Ñ lr -Ð›Ð¸Ð±ÐµÑ€Ð¸Ñ lr -লাইবেরিয়া lr -Liberija lr -Libèria lr -Libérie lr -ΛιβεÏία lr -Liberio lr -Libeeria lr -لیبریا lr -Libéria lr -An Libéir lr -Libéria lr -לוב lr -लाइबेरिया lr -Liberija lr -Libéria lr -Líbería lr -リベリア lr -លីបáŸážšáž¸áž™áŸ‰áž¶ lr -ë¼ì´ë² ë¦¬ì•„ lr -ລິຊາ lr -LibÄ“rija lr -Либерија lr -Либери lr -Liberja lr -ਲੀਬਿਰੀਆ lr -Libéria lr -Libéria lr -Ð›Ð¸Ð±ÐµÑ€Ð¸Ñ lr -Liberiya lr -Lýbia lr -Liberija lr -Либерија lr -Liberija lr -லிபிரியா lr -Либериё lr -ไลบีเรีย lr -Liberya lr -Ð›Ñ–Ð±ÐµÑ€Ñ–Ñ lr -Ð›Ð¸Ð±ÐµÑ€Ð¸Ñ lr -利比里亚 lr -賴比瑞亞 lr -Lesotho ls -ليسوتو ls -ЛеÑота ls -ЛеÑото ls -লেসোথো ls -Lesoto ls -Lesoto ls -Λεσόθο ls -Lesoto ls -Lesoto ls -لسوتو ls -Leosóta ls -Lesoto ls -לסוטו ls -लेसोथो ls -Lesótó ls -レソト ls -áž¡áŸážŸáž¼ážáž¼ ls -레소토 ls -ທົດສອບ ls -Lesoto ls -ЛеÑото ls -ЛиÑото ls -Leżoto ls -ਲਿਉਥੂ ls -Lesoto ls -Lesoto ls -Lesoto ls -ЛеÑото ls -Lesoto ls -Lesoto ls -ЛеÑото ls -Lesoto ls -லஸொதோ ls -ЛиÑуту ls -เลโซโต ls -Lesoto ls -Lesoto ls -ЛеÑото ls -ЛеÑото ls -Lessoto ls -莱索托 ls -賴索扥 ls -Lithuania lt -Lithuanië lt -ليتوانيا lt -Litvaniya lt -Літва lt -Литва lt -লিথà§à§Ÿà§‡à¦¨à¦¿à§Ÿà¦¾ lt -Lituani lt -Litvanija lt -Lituània lt -Litva lt -Lithwania lt -Litauen lt -Litauen lt -Λιθουανία lt -Litovio lt -Lituania lt -Leedu lt -Lituania lt -لیتوانی lt -Liettua lt -Lituanie lt -Litouwen lt -An Liotuáin lt -Lituánia lt -×œ×™×˜× lt -लिथà¥à¤†à¤¨à¤¿à¤¯à¤¾ lt -Litva lt -Litvánia lt -Litháen lt -Lituania lt -リトアニア lt -លីទុយអានី lt -리투아니아 lt -ລິທົ່ວເນີຠlt -Lietuva lt -Lietuva lt -Литванија lt -Литва lt -Litwanja lt -Litauen lt -Litauen lt -Litouwen lt -Litauen lt -ਲੀਥੂਨੀਆ lt -Litwa lt -Lituânia lt -Lituânia lt -Lituania lt -Литва lt -Litwaniya lt -Lietuva lt -Litva lt -Litva lt -Литванија lt -Litvanija lt -I-Lithuania lt -Litauen lt -லிதà¯à®¤à¯à®µà¯‡à®©à®¿à®¯à®¾ lt -Литвониё lt -ลิธัวเนีย lt -Litvanya lt -Lituania lt -Литва lt -Литва lt -Litwaneye lt -ç«‹é™¶å®› lt -ç«‹é™¶å®› lt -Luxembourg lu -Luxenburg lu -لوكسمبورغ lu -Lüksemburq lu -ЛюкÑÑмбург lu -ЛюкÑембург lu -লাকà§à¦¸à§‡à¦®à¦¬à§à¦°à§à¦— lu -Luksembourg lu -Luksemburg lu -Luxemburg lu -Lucembursko lu -Lwcsembwrg lu -Luxemburg lu -ΛουξεμβοÏÏγο lu -Luksemburgo lu -Luxemburgo lu -Luksemburg lu -Luxenburgo lu -لوگزامبورگ lu -Luxemburg lu -Luksemborg lu -Luxemburg lu -Lucsamburg lu -Luxemburgo lu -לוקסמבורג lu -लकà¥à¤¸à¤®à¤¬à¤°à¥à¤— lu -Luksemburg lu -Luxemburg lu -Lúxemborg lu -Lussemburgo lu -ルクセンブルグ lu -លុចហ្សំបួរ lu -ë£©ì…ˆë¶€ë¥´í¬ lu -ລັàºà»àºŠàº¡à»€àºšàºµàº lu -Liuksemburgas lu -Luksemburga lu -ЛукÑембург lu -ЛюкÑембүрг lu -Lussemburgu lu -Luxemborg lu -Luxemburg lu -ਲਕਸ਼ਮਬਰਗ lu -Luksemburg lu -Luxemburgo lu -Luxemburgo lu -Luxemburg lu -ЛюкÑембург lu -Lugizamburu lu -Luxemburg lu -Luxemburg lu -Luksemburg lu -ЛукÑембург lu -Luksemburg lu -I-Luxembourg lu -Luxemburg lu -லகà¯à®šà®®à¯à®ªà¯‹à®°à¯à®•௠lu -Лукзамбург lu -ลัà¸à¹€à¸‹à¸¡à¹€à¸šà¸­à¸£à¹Œà¸ lu -Lüksemburg lu -Lüksemburg lu -ЛюкÑембург lu -ЛюкÑембург lu -Lussimbork lu -墿£®å ¡ lu -盧森堡 lu -Latvia lv -لاتÙيا lv -Latviya lv -Ð›Ð°Ñ‚Ð²Ñ–Ñ lv -Ð›Ð°Ñ‚Ð²Ð¸Ñ lv -লাতভিয়া lv -Latvija lv -Letònia lv -LotyÅ¡sko lv -Latfia lv -Letland lv -Lettland lv -Λεττονία lv -Latvio lv -Letonia lv -Läti lv -لاتویا lv -Lettonie lv -Letland lv -An Laitvia lv -Letónia lv -לטביה lv -लाटविया lv -Latvija lv -Lettország lv -Lettland lv -Lettonia lv -ラトビア lv -ឡាážážœáž¸áž™áŸ‰áž¶ lv -ë¼íŠ¸ë¹„ì•„ lv -ລັດເວີຠlv -Latvija lv -Latvija lv -Латвија lv -Латви lv -Latvja lv -Lettland lv -Letland lv -ਲਾਟਵੀਆ lv -Åotwa lv -Letónia lv -Ð›Ð°Ñ‚Ð²Ð¸Ñ lv -Lativiya lv -Látvia lv -LotyÅ¡sko lv -Latvija lv -Латвија lv -Latvija lv -I-Latvia lv -Lettland lv -லடà¯à®µà®¿à®¯à®¾ lv -Латвонӣ lv -ลัธเวีย lv -Litvanya lv -Ð›Ð°Ñ‚Ð²Ñ–Ñ lv -Ð›Ð°Ñ‚Ð²Ð¸Ñ lv -Lativia lv -Letoneye lv -拉脱维亚 lv -拉脫維亞 lv -Libya ly -Libië ly -ليبيا ly -Ð›Ñ–Ð²Ñ–Ñ ly -Ð›Ð¸Ð±Ð¸Ñ ly -লিবিয়া ly -Julia ly -Libija ly -Líbia ly -Lýbie ly -Libia ly -Libyen ly -Libyen ly -ΛιβÏη ly -Libio ly -Libia ly -Liibüa ly -Libia ly -لیبی ly -Lybie ly -Libië ly -An Libia ly -Líbia ly -לוב ly -लीबिया ly -Libija ly -Líbia ly -Líbía ly -Libia ly -リビア ly -លីប៊ី ly -리비아 ly -ລິຊາ ly -Libija ly -LÄ«bija ly -Либија ly -Ð›Ð¸Ð±Ñ ly -Libja ly -Libyen ly -Libië ly -ਲੀਬੀਆ ly -Libia ly -Líbia ly -Líbia ly -Libia ly -Ð›Ð¸Ð²Ð¸Ñ ly -Libiya ly -Lýbia ly -Libija ly -Либија ly -Libija ly -I-Libya ly -Libyen ly -லிபியா ly -Ð›Ð¸Ð±Ð¸Ñ ly -ลิเบีย ly -Libia ly -Ð›Ñ–Ð²Ñ–Ñ ly -Ð›Ð¸Ð±Ð¸Ñ ly -Libeye ly -利比亚 ly -利比亞 ly -Morocco ma -Morokko ma -المغرب ma -Марока ma -Мароко ma -মরকà§à¦•à§‹ ma -Marok ma -Maroko ma -Marroc ma -Maroko ma -Moroco ma -Marokko ma -Marokko ma -ΜαÏόκο ma -Maroko ma -Marruecos ma -Maroko ma -Maroko ma -مراکش ma -Marokko ma -Marokko ma -Maroc ma -Marokko ma -Maracó ma -Marrocos ma -מרוקו ma -मोरकà¥à¤•ो ma -Maroko ma -Marokkó ma -Marokkó ma -Marocco ma -モロッコ ma -ម៉ារ៉ុក ma -모로코 ma -ເມົາລິ ma -Marokas ma -Maroka ma -Мароко ma -Морокко ma -Marokk ma -Marokko ma -Marokko ma -Marokko ma -Marokko ma -ਮੋਰਕੋ ma -Maroko ma -Marrocos ma -Marrocos ma -Maroc ma -Марокко ma -Maroke ma -Marokko ma -Maroko ma -Maroko ma -Мароко ma -Maroko ma -I-Morocco ma -Marocko ma -மோராகோ ma -Марокко ma -โมร็อคโค ma -Morokko ma -Марокко ma -Марокаш ma -Ma rốc ma -Marok ma -摩洛哥 ma -摩洛哥 ma -Monaco mc -Monako mc -موناكو mc -Манака mc -Монако mc -মোনাকো mc -Monako mc -Monako mc -Mònaco mc -Monako mc -Μονακό mc -Monako mc -Mónaco mc -موناکو mc -Monacó mc -Mónaco mc -מונקו mc -मोनेको mc -Monako mc -Mónakó mc -モナコ mc -ម៉ូណាកូ mc -모나코 mc -ເມົາລິ mc -Monakas mc -Monako mc -Монако mc -Монако mc -Monako mc -ਮੋਨਕੋ mc -Monako mc -Mónaco mc -Mônaco mc -Монако mc -Monako mc -Monako mc -Monako mc -Монако mc -Monako mc -மனாகோ mc -Монако mc -โมนาโค mc -Monako mc -Manako mc -Монако mc -Монако mc -摩纳哥 mc -æ‘©ç´å“¥ mc -Moldova md -Ù…ÙˆÙ„Ø¯ÙˆÙØ§ md -Малдова md -ÐœÐ¾Ð»Ð´Ð°Ð²Ð¸Ñ md -মলডোভা md -Moldavi md -Moldàvia md -Moldávie md -Moldofa md -Moldawien md -Μολδαβία md -Moldavujo md -Moldavia md -Moldavia md -مولداوی md -Moldavie md -An Mholdóiv md -Moldávia md -מולדובה md -मॉलà¥à¤¦à¥‹à¤µà¤¾ md -Moldóva md -Moldavia md -モルドムmd -ម៉ុលដូវ៉ា md -몰ë„ë°” md -ສະໂລວັຠmd -MoldÄvija md -Молдавија md -Молдав md -Moldavja md -Moldawien md -Moldavië md -ਮੋਡੋਵਾ md -MoÅ‚dawia md -Moldávia md -Молдова md -Molidova md -Moldávsko md -Молдавија md -Moldavija md -Moldavien md -மாலà¯à®Ÿà¯‹à®µà®¾ md -Молдавӣ md -มอลโดวา md -Молдова md -Молдова md -摩尔多瓦 md -摩爾多瓦 md -Madagascar mg -Madagaskar mg -مدغشقر mg -МадагаÑкар mg -МадагаÑкар mg -মাদাগাসà§à¦•ার mg -Madagaskar mg -Madagaskar mg -Madagaskar mg -Madagaskar mg -ΜαδαγασκάÏη mg -Madagaskaro mg -Madagaskar mg -ماداگاسکار mg -Madagaskar mg -מדגסקר mg -मेडागासà¥à¤•र mg -Madagaskar mg -Madagaszkár mg -Madagaskar mg -マダガスカル mg -ម៉ាដាហ្កាស្ការ mg -마다카스카르 mg -ຄາສະບາລ - K mg -Madagaskaras mg -Madagaskara mg -МадаÑкар mg -МадагаÑкар mg -Madagaskar mg -Madagaskar mg -Madagaskar mg -Madagaskar mg -ਮੈਡਾਗਾਸਕਰ mg -Madagaskar mg -Madagáscar mg -МадагаÑкар mg -Madagasikari mg -Madagaskar mg -Madagaskar mg -Madagaskar mg -МадагаÑкар mg -Madagaskar mg -Madagaskar mg -மடகஸà¯à®•ார௠mg -МадогоÑкор mg -มาดาà¸à¸±à¸ªà¸à¸² mg -Madagaskar mg -Madagaskar mg -МадагаÑкар mg -МадагаÑкар mg -马达加斯加 mg -馬é”加斯加 mg -Marshall Islands mh -Marshall EIlande mh -جزر مارشال mh -Маршалавы аÑтравы mh -МаршалÑки оÑтрови mh -মারশাল দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ mh -Inizi Marshall mh -MarÅ¡alova ostrva mh -Illes Marshall mh -Marshallovy ostrovy mh -Ynysoedd Marshall mh -Marshall-øerne mh -Marshall-Inseln mh -Îησιά ΜάÏσαλ mh -MarÅaloj mh -Islas Marshall mh -Marshalli saared mh -Marshall Irlak mh -جزایر مارشال mh -Marshallinsaaret mh -ÃŽles Marshall mh -Marshall Eilânen mh -Oileáin Mharshall mh -Illas Marshall mh -××™×™ מרשל mh -मारà¥à¤¶à¤² आइलैंड mh -Marshall Otoci mh -Marshall-szigetek mh -Marshall-eyjar mh -Isole Marshall mh -米自由連åˆãƒžãƒ¼ã‚·ãƒ£ãƒ«è«¸å³¶ mh -កោះ Marshall mh -마샬 ì œë„ mh -ລາດສະອານາຈັàºà»„ທຠmh -Marshalo salos mh -MÄrÅ¡alu salas mh -Маршалови ОÑтрови mh -Маршаллын арлууд mh -Gżejjer Marshall mh -Marshalløyene mh -Marshallinseln mh -Marshall Eilanden mh -Marshalløyane mh -ਮਾਰਸ਼ਲ ਟਾਪੂ mh -Wyspy Marshalla mh -Ilhas Marshall mh -Ilhas Marshall mh -Insulele Marshall mh -Маршалловы оÑтрова mh -Ibirwa bya Marishali mh -Marshallsullot mh -Maršálove ostrovy mh -Marshallovi otoki mh -Маршалова оÑтрва mh -MarÅ¡alova ostrva mh -Marshallöarna mh -மாரà¯à®·à®²à¯ தீவà¯à®•ள௠mh -Ҷазираи Маршал mh -หมู่เà¸à¸²à¸°à¸¡à¸²à¹à¸Šà¸¥ mh -MarÅŸal Adaları mh -MarÅŸal Utrawları mh -МаршальÑькі оÑтрови mh -Маршалл Ороллари mh -Iyes Marshall mh -马ç»ç¾¤å²› mh -馬紹爾群島 mh -Macedonia mk -Makedoniese mk -مقدونيا mk -Makedonya mk -ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ñ–Ñ mk -ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ð¸Ñ mk -মà§à¦¯à¦¾à¦¸à¦¿à¦¡à§‹à¦¨à¦¿à§Ÿà¦¾ mk -Makedonia mk -Makedonija mk -Macedònia mk -Makedonie mk -Makedonien mk -Makedonien mk -Σλαβομακεδονία mk -Makedonujo mk -Makedoonia mk -Mazedonia mk -مقدونیه mk -Makedonia mk -Macédoine mk -Macedonië mk -An Mhacadóin (IPIM) mk -Macedónia mk -מקדוניה mk -मकदूनिया mk -Makedonija mk -Macedónia mk -Masedonia mk -Makedónía mk -マケドニア mk -ម៉ាសáŸážŠáž“ mk -마케ë„니아 mk -ມາເຊໂດເນີຠmk -Makedonija mk -MaÄ·edonija mk -Македонија mk -Макидон mk -MaÄ‹edonja mk -Makedonia mk -Makedonien mk -Macedonië mk -Makedonia mk -Macedònian mk -ਮੈਕਡੋਨੀਆ mk -Macedónia mk -Macedônia mk -ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ð¸Ñ mk -Masedoniya mk -Makedonia mk -Macedónsky mk -Makedonija mk -Македонија mk -Makedonija mk -I-Macedonia mk -Makedonien mk -மாசிடோ னியா mk -Мақдуниё mk -มาเซโดเนีย mk -Makedonya mk -Makedonia mk -ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ñ–Ñ mk -ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ð¸Ñ mk -Masedonia mk -Macedoneye mk -马其顿 mk -馬其頓 mk -Mali ml -مالي ml -Малі ml -Мали ml -মালি ml -Μαλί ml -Malio ml -مالی ml -Mailí ml -מ×לי ml -माली ml -Malí ml -マリ ml -ម៉ាលី ml -ë§ë¦¬ ml -ຈົດຫມາຠml -Мали ml -Мали ml -ਮਾਲੀ ml -Мали ml -Мали ml -மாலி ml -Молӣ ml -มาลี ml -Малі ml -Мали ml -马里 ml -馬利 ml -Myanmar mm -ميانمار mm -М'Ñнма mm -Мианмар mm -মিয়ানমার mm -Mjanmar mm -Mianmar mm -Burma mm -Burma (Myanmar) mm -ÎœÎ¹Î±Î½Î¼Î¬Ï mm -Mjanmao mm -Birmania mm -میانمار mm -Maenmar mm -מינמר mm -मà¥à¤¯à¤¨à¤®à¤¾à¤° mm -Mianmar mm -Mjanmar mm -ミャンマー mm -មីយ៉ាន់ម៉ា mm -미얀마 mm -ຕົວຮງàºàºžàºµàº·à»‰àº™àº—ີ່ທຳງານ - K mm -Mjanma mm -Мијанмар mm -МÑнмар mm -Mjanmar mm -Myanmar (Birma) mm -ਮਿਆਂਮਾਰ mm -Mianmar mm -МьÑнма (Бирма) mm -Mjanmar mm -Мијанмар mm -Mijanmar mm -மயனà¯à®®à®¾à®°à¯ mm -Миёнмор mm -เมียนมาร์ mm -Mianmar mm -М'Ñнма mm -МÑнмар mm -Miến Äiện mm -Birmaneye mm -缅甸 mm -緬甸 mm -Mongolia mn -Mongolië mn -منغوليا mn -ÐœÐ°Ð½Ð³Ð¾Ð»Ñ–Ñ mn -ÐœÐ¾Ð½Ð³Ð¾Ð»Ð¸Ñ mn -মোঙà§à¦—োলিয়া mn -Mongoli mn -Mongolija mn -Mongòlia mn -Mongolsko mn -Mongoliet mn -Mongolei mn -Μογγολία mn -Mongolio mn -Mongoolia mn -مغولستان mn -Mongolie mn -Mongolië mn -An Mhongóil mn -Mongólia mn -מונגוליה mn -मंगोलिया mn -Mongolija mn -Mongólia mn -Mongólía mn -モンゴル mn -ម៉ុងហ្គោលី mn -몽골 mn -ລອàºàº­àº´àº™ mn -Mongolija mn -Mongolija mn -Монголија mn -МОÐГОЛ mn -Mongolja mn -Mongolei mn -Mongolië mn -ਮੰਗੋਲੀਆ mn -Mongólia mn -Mongólia mn -ÐœÐ¾Ð½Ð³Ð¾Ð»Ð¸Ñ mn -Mongoliya mn -Mongolsko mn -Mongolija mn -Монголија mn -Mongolija mn -Mongoliet mn -மாஙà¯à®•ோலியா mn -МуғулиÑтон mn -มองโà¸à¹€à¸¥à¸µà¸¢ mn -MoÄŸolistan mn -MoÄŸolstan mn -ÐœÐ¾Ð½Ð³Ð¾Ð»Ñ–Ñ mn -МуғилиÑтон mn -Mông cổ mn -Mongoleye mn -è’™å¤ mn -è’™å¤ mn -Macau SAR(China) mo -Macau SAR (China) mo -Макао (Китай) mo -মাকাউ SAR(চীন) mo -Makav SAR(Sina) mo -Macau SAR(Xina) mo -Macau SAR (Čína) mo -Macau SAR(Kina) mo -Macao SAR (China) mo -Μακάο SAR (Κίνα) mo -Macau mo -Macau SAR(Txina) mo -Makao SAR(Kiina) mo -Macao SAR (Chine) mo -Macao SAR(An tSín) mo -מק×ו SAR (סין) mo -Makaó (Kína) mo -Makaó (sjálfstjórnarhérað í Kína) mo -Macau SAR(Cina) mo -マカオ(中国) mo -ម៉ាកាវ (áž…áž·áž“) mo -Macau SAR(Kinija) mo -Макао СÐР(Кина) mo -Macao SAR (Kina) mo -Macao mo -Macao SAR (Kina) mo -ਮੈਕਿਉ SAR(ਚੀਨ) mo -Makao SAR (Chiny) mo -Macau (China) mo -Macao SAR(China) mo -Макао mo -Makawu SAR (Ubushinwa) mo -Macau SAR (Kiinná) mo -Macau SAR (Kitajska) mo -SAR Macau (Кина) mo -SAR Macau (Kina) mo -Macao (Kina) mo -Macau SAR(சீனா) mo -มาเà¸à¹Šà¸² mo -Makau (Çin) mo -Macau SAR(Китай) mo -Макау (Хитой) mo -中国澳门特别行政区 mo -澳門 SAR(中國) mo -Martinique mq -مارتينيك mq -Мартыніка mq -Мартиника mq -মারà§à¦Ÿà¦¿à¦¨à¦¿à¦•à§ mq -Martinik mq -Martinik mq -Martinica mq -Martinik mq -Martin?c mq -ΜαÏτινίκα mq -Martiniko mq -Martinica mq -Martinika mq -مارتینیک mq -Martainíc mq -Martinica mq -מרטיניק mq -मारà¥à¤Ÿà¥€à¤¨à¥€à¤• mq -Martiník mq -Martinica mq -フランス海外県マルãƒãƒ‹ãƒ¼ã‚¯ mq -ម៉ារទីនីគ mq -ë§ˆë¥´í‹°ë‹ˆí¬ mq -ເມົາລິ mq -Martinika mq -Martinika mq -Мартиник mq -Мартиники mq -Martinik mq -ਮਾਰਟੀਨਿਕਿਉ mq -Martynika mq -Martinica mq -Martinica mq -Martinica mq -Мартиника mq -Maritinike mq -Martinik mq -Мартиник mq -Martinik mq -மாரà¯à®¤à®¿à®©à®¿à®•à¯à®¯à¯ mq -Мартиник mq -มาทินิค mq -Martinik mq -Martinik mq -Мартініка mq -Мартиника mq -Martinike mq -马æå°¼å…‹ mq -馬æå°¼å…‹ mq -Mauritania mr -Mauritanië mr -موريتانيا mr -ÐœÐ°ÑžÑ€Ñ‹Ñ‚Ð°Ð½Ñ–Ñ mr -ÐœÐ°Ð²Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ mr -মরিটানিয়া mr -Maouritani mr -Mauritanija mr -Mauritània mr -Mauretánie mr -Mawritania mr -Mauretanien mr -Mauretanien mr -ΜαυÏιτανία mr -MaÅ­ritanujo mr -Mauritaania mr -موراتانی mr -Mauritanie mr -Mauritanië mr -An Mháratáin mr -Mauritánia mr -מ×וריטניה mr -मारीतानिया mr -Mauritanija mr -Mauritánia mr -Máritanía mr -モーリタニア mr -ម៉ូរីážáž¶áž“ី mr -모리타니 mr -ລິທົວເນີຠmr -Mauritanija mr -MauritÄnija mr -Мавританија mr -Мауритани mr -Mawritanja mr -Mauretanien mr -Mauritanië mr -ਮਾਉਰੀਟਨਿਆ mr -Mauretania mr -Mauritânia mr -Mauritânia mr -ÐœÐ°Ð²Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ mr -Moritaniya mr -Mavretanija mr -Мауританија mr -Mauritanija mr -Mauretanien mr -மௌரிடானியா mr -Мавритонӣ mr -มอริทาเนีย mr -Mauritanya mr -ÐœÐ°Ð²Ñ€Ð¸Ñ‚Ð°Ð½Ñ–Ñ mr -ÐœÐ°Ð²Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ mr -Moritanreye mr -毛里塔尼亚 mr -茅利塔尼亞 mr -Montserrat ms -مونتسيرات ms -МонÑерат ms -মনà§à¦Ÿà¦¸à§‡à¦°à¦¾à¦Ÿ ms -Monsera ms -ΜοντσεÏάτ ms -Moncerato ms -مون‌سرات ms -Montsarat ms -מונטסרט ms -मॉटसेरट ms -Monserrat ms -英領モントセラト ms -ម៉ុងសáŸážšáŸ‰áž¶ ms -몬트세ë¼íЏ ms -ຈà»àºžàº²àºš ms -Monserata ms -МонÑерат ms -МонтÑеррат ms -ਮੋਨਟਸੀਰਾਟ ms -МонтÑеррат ms -Monserati ms -МонÑерат ms -Monserat ms -மானà¯à®Ÿà¯à®šà¯†à®°à¯à®°à®Ÿà¯ ms -МунтеÑирот ms -มอนต์เซอร์รัท ms -МонтÑеррат ms -Монцеррат ms -蒙特塞拉特 ms -蒙的塞拉特 ms -Malta mt -مالطة mt -Мальта mt -Малта mt -মলটা mt -Malt mt -Μάλτα mt -Malto mt -مالت mt -Malte mt -Málta mt -מלטה mt -मालà¥à¤Ÿà¤¾ mt -Málta mt -マルタ mt -ម៉ាល់ážáž¶ mt -몰타 mt -ມອລຕາ mt -Малта mt -Малта mt -ਮਾਲਟਾ mt -Мальта mt -Malita mt -Малта mt -I-Malta mt -மாலà¯à®Ÿà®¾ mt -Молет mt -มอลตา mt -Мальта mt -Малта mt -Male mt -马耳他 mt -馬爾他 mt -Mauritius mu -موريشيوس mu -Маўрыцы mu -ОÑтров Мавриций mu -মরিশাস mu -Mauris mu -Mauricijus mu -Maurici mu -Mauricius mu -Mawrisiws mu -ΜαυÏίκιος mu -MaÅ­ricio mu -Mauricio mu -Maurizio mu -موریتیس mu -ÃŽle Maurice mu -Oileán Mhuirís mu -Maurício mu -מ×וריציוס mu -मॉरीशस mu -Mauricijus mu -Máritíus mu -モーリシャス mu -ម៉ូរីទុស mu -모리셔스 mu -ພາທິຊັ້ນ mu -MaurÄ«cija mu -ÐœÐ°Ð²Ñ€Ð¸Ñ†Ð¸ÑƒÑ mu -ÐœÐ°Ð²Ñ€Ð¸Ñ‚ÑƒÑ mu -Mawriju mu -ਮਾਉਰੀਟਿਸ mu -Mauritânia mu -Ilhas Maurício mu -MauriÅ£ius mu -Маврикий mu -Ibirwa bya Morise mu -Maurícius mu -Mavricij mu -ÐœÐ°ÑƒÑ€Ð¸Ñ†Ð¸Ñ˜ÑƒÑ mu -Mauricijus mu -மௌரிடியஸ௠mu -Мавритӣ mu -มอริเชียส mu -Mauritus mu -Маврікій mu -Маврикий mu -Iye Môrice mu -毛里求斯 mu -毛里求斯 mu -Maldives mv -جزر المالدي٠mv -Мальдывы mv -МалдивÑки оÑтрови mv -মালদà§à¦¬à§€à¦ª mv -Inizi Maldiv mv -Maldivi mv -Maledivy mv -Ynysoedd y Mald?f mv -Maldiverne mv -Malediven mv -Μαλδίβες mv -Maldivoj mv -Maldivas mv -Maldiivid mv -Maldibak mv -مالدیو mv -Malediivit mv -Malediven mv -Na Maildiví mv -Maldivas mv -מולדבה mv -मालदीव mv -Maldivi mv -Maldív-szigetek mv -Maldíveyjar mv -Maldive mv -モルジブ mv -ម៉ាល់ឌីវ mv -몰디브 mv -ມັລດິສ mv -Maldyvai mv -Maldivu salas mv -Малдиви mv -Малдив mv -Maldivene mv -Malediven mv -Malediven mv -Maldivane mv -ਮਾਲਦੀਵ mv -Malediwy mv -Maldivas mv -Maldivas mv -Maldive mv -МальдивÑкие оÑтрова mv -Malidive mv -Maldiivat mv -Maldiv mv -Малдиви mv -Maldivi mv -Maldiverna mv -மாலà¯à®¤à¯€à®µà¯à®•ள௠mv -Молдивӣ mv -มัลดิฟ mv -Maldivler mv -Maldivlar mv -Мальдіви mv -Малдив Ороллари mv -马尔代夫 mv -馬爾地夫 mv -Malawi mw -مالاوي mw -Малаві mw -Малави mw -মালাওয়ি mw -Malavi mw -Μαλάουι mw -Malavio mw -مالاوی mw -An Mhaláiv mw -Malavi mw -מל×ווי mw -मलावी mw -Malavi mw -Malaví mw -マラウイ mw -ម៉ាឡាវី mw -ë§ë¼ìœ„ mw -ມອລຕາ mw -Malavi mw -Малави mw -Малави mw -ਮਾਲਾਵੀ mw -Малави mw -Малави mw -Malavi mw -மலவி mw -Моловӣ mw -มาลาวี mw -Malavi mw -Малаві mw -Малави mw -马拉维 mw -é¦¬æ‹‰å¨ mw -Mexico mx -Meksiko mx -المكسيك mx -Meksika mx -МÑкÑыка mx -МекÑико mx -মেকà§à¦¸à¦¿à¦•à§‹ mx -Mec'hiko mx -Meksiko mx -Mèxic mx -Mexiko mx -Mecsico mx -Mexiko mx -Μεξικό mx -Meksiko mx -México mx -Mehhiko mx -Mexiko mx -مکزیک mx -Meksiko mx -Meksiko mx -Mexique mx -Meicsiceo mx -México mx -מקסיקו mx -मेकà¥à¤¸à¤¿à¤•ो mx -Meksiko mx -Mexikó mx -Meksiko mx -Mexíkó mx -Messico mx -メキシコ mx -ម៉ិចស៊ិក mx -멕시코 mx -ເມັàºàºŠàºµà»‚ຠmx -Meksika mx -Meksika mx -МекÑико mx -МекÑико mx -Messiku mx -Mexiko mx -Mèxic mx -ਮੈਕਸਿਕੋ mx -Meksyk mx -México mx -México mx -Mexic mx -МекÑика mx -Megizike mx -Mexiko mx -Mehika mx -МекÑико mx -Meksiko mx -I-Mexico mx -மெகà¯à®šà®¿à®•ோ mx -МекÑико mx -เม็à¸à¸‹à¸´à¹‚ภmx -Meksika mx -Meksiko mx -МекÑика mx -МекÑика mx -Mê hi cô mx -Mecsike mx -墨西哥 mx -墨西哥 mx -Malaysia my -Malysië my -ماليزيا my -ÐœÐ°Ð»Ð°Ð¹Ð·Ñ‹Ñ my -ÐœÐ°Ð»Ð°Ð¹Ð·Ð¸Ñ my -মালয়েশিয়া my -Malezia my -Malezija my -Malàsia my -Malajsie my -Maleisia my -Μαλαισία my -Malajzio my -Malasia my -Malaisia my -Malasia my -مالزی my -Malesia my -Malaisie my -Maleisië my -An Mhalaeisia my -Malásia my -מלזיה my -मलेशिया my -Malezija my -Malajzia my -Malasía my -マレーシア my -ម៉ាឡáŸážŸáŸŠáž¸ my -ë§ë ˆì´ì‹œì•„ my -ມອລຕາ my -Malaizija my -Malaizija my -Малезија my -Малайз my -Malażja my -Maleisië my -ਮਲੇਸ਼ੀਆ my -Malezja my -Malásia my -Malásia my -Malaezia my -ÐœÐ°Ð»Ð°Ð¹Ð·Ð¸Ñ my -Maleziya my -Malajzia my -Malezija my -Малезија my -Malezija my -மலேசியா my -Малайзӣ my -มาเลเซีย my -Malezya my -ÐœÐ°Ð»Ð°Ð¹Ð·Ñ–Ñ my -ÐœÐ°Ð»Ð°Ð¹Ð·Ð¸Ñ my -Malaizeye my -马æ¥è¥¿äºš my -馬來西亞 my -Mozambique mz -Mosambiek mz -موزمبيق mz -Мазамбік mz -Мозамбик mz -মোজামবিক mz -Mozambik mz -Mozambik mz -Moçambic mz -Mozambik mz -Mosamb?c mz -Μοζαμβίκη mz -Mozambiko mz -Mosambiik mz -Mozanbike mz -موزامبیک mz -Mosambik mz -Mósaimbíc mz -מוזמביק mz -मोज़ामà¥à¤¬à¥€à¤• mz -Mozambik mz -Mozambik mz -Mósambík mz -Mozambico mz -モザンビーク mz -ម៉ូហ្សាំប៊ិក mz -ëª¨ìž ë¹„í¬ mz -ຫນ່ວàºàº„ວາມຈຳ mz -Mozambikas mz -Mozambika mz -Мозамбик mz -Мозамбайк mz -Możambik mz -Mosambik mz -Mosambik mz -Mosambik mz -ਮੋਜ਼ਾਨਬਿਕਿਉ mz -Mozambik mz -Moçambique mz -Moçambique mz -Mozambic mz -Мозамбик mz -Mosambik mz -Mozambik mz -Mozambik mz -Мозамбик mz -Mozambik mz -Moçambique mz -மோசாமà¯à®ªà®¿à®•௠mz -Мозамбик mz -โมà¹à¸‹à¸¡à¸šà¸´à¸ mz -Mozambik mz -Mozambik mz -Мозамбік mz -Мозамбик mz -Mozambike mz -莫桑比克 mz -莫三比克 mz -Namibia na -Namibië na -ناميبيا na -ÐÐ°Ð¼Ñ–Ð±Ñ–Ñ na -ÐÐ°Ð¼Ð¸Ð±Ð¸Ñ na -নামিবিয়া na -Namibi na -Namibija na -Namíbia na -Namíbie na -Îαμίμπια na -Namibio na -Namiibia na -نامیبیا na -Namibie na -Namibië na -An Namaib na -Namíbia na -נמיביה na -नामीबिया na -Namibija na -Namíbia na -Namibía na -ナミビア na -ណាមីប៊ី na -나미비아 na -ຈາໄມàºàº² na -Namibija na -NamÄ«bija na -Ðамибија na -Ðамиби na -Namibja na -Namibië na -ਨਾਮੀਬੀਆ na -Namíbia na -Namíbia na -ÐÐ°Ð¼Ð¸Ð±Ð¸Ñ na -Namibiya na -Namíbia na -Namibija na -Ðамибија na -Namibija na -நாமிபியா na -Ðамибиё na -นามิเบีย na -Namibya na -ÐÐ°Ð¼Ñ–Ð±Ñ–Ñ na -ÐÐ°Ð¼Ð¸Ð±Ð¸Ñ na -Namibeye na -纳米比亚 na -那米比亞 na -New Caledonia nc -Nuwe Caledonië nc -كاليدونيا الجديدة nc -ÐÐ¾Ð²Ð°Ñ ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ñ–Ñ nc -Ðова ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ð¸Ñ nc -নিউ কà§à¦¯à¦¾à¦²à¦¿à¦¡à§‹à¦¨à¦¿à§Ÿà¦¾ nc -Kaledoni-nevez nc -Nova Kaledonija nc -Nova Caledònia nc -Nová Kaledonie nc -Caledonia Newydd nc -Ny Caledonien nc -Neukaledonien nc -Îέα Καληδονία nc -Nov-Kaledonio nc -Nueva Caledonia nc -Uus-Kaledoonia nc -Kaledonia Berria nc -کالدونیا نو nc -Uusi-Kaledonia nc -Nouvelle Calédonie nc -Nij Caledonië nc -An Nua-Chaladóin nc -Nova Caledónia nc -קלדוניה החדשה nc -नà¥à¤¯à¥‚ केलेदूनिया nc -Nova Kaledonija nc -Új-Kaledónia nc -Nýja-Kaledónía nc -Nuova Caledonia nc -ニューカレドニア nc -នូវែលកាលáŸážŠáž¼áž“ី nc -뉴 칼레ë„니아 nc -ມາເຊໂດເນີຠnc -Naujoji Kaledonija nc -Jaunkaledonija nc -Ðова Каледонија nc -Ð¨Ð¸Ð½Ñ ÐºÐ°Ð»ÐµÐ´Ð¾Ð½Ð¸ nc -Kaledonja Ä dida nc -Ny-Caledonia nc -Nieg Kaledonien nc -Nieuw Caledonië nc -Ny-Caledonia nc -ਨਵਾਂ ਕਾਲੀਡੋਨਾ nc -Nowa Kaledonia nc -Nova Caledónia nc -Nova Caledônia nc -Noua Caledonie nc -ÐÐ¾Ð²Ð°Ñ ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ð¸Ñ nc -Kaledoniya nc -Ođđa Kaledonia nc -Nová Kaledónia nc -Nova Kaledonija nc -Ðова Каледонија nc -Nova Kaledonija nc -Nya Caledonien nc -நியூ கலடோனியா nc -КаледониÑи Ðав nc -นิวคาเลโดเนีย nc -Yeni Kaledonya nc -Yaña Kaledonia nc -Ðова ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ñ–Ñ nc -Янги ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ð¸Ñ nc -Nouve Caledonreye nc -新喀里多尼亚 nc -新喀里多尼亞 nc -Niger ne -النيجر ne -Ðігер ne -Ðигер ne -নাইজের ne -Nijer ne -Níger ne -ÎίγηÏας ne -NiÄero ne -نیجر ne -Nigeria ne -An Nígir ne -Níxer ne -× ×™×’'ר ne -निगर ne -Níger ne -ニジェール ne -នីហ្សáŸážš ne -니제르 ne -ຕົວຮງàºàºžàº·à»‰àº™àº—ີ່ທຳງານ ne -NigÄ“ra ne -Ðигер ne -Ðигер ne -NiÄ¡er ne -ਨਿਜੀਰ ne -Nigéria ne -Nigéria ne -Ðигер ne -Nijeri ne -Nigéria ne -Ðигер ne -நிஜர௠ne -Ðигерӣ ne -ไนเจอร์ ne -Nijerya ne -Ðігер ne -Ðигер ne -Nidjer ne -尼日尔 ne -尼日 ne -Norfolk Island nf -Norfolk Eiland nf -جزيرة نورÙولك nf -Ðорфалк nf -ОÑтров Ðорфолк nf -নরফোক দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ nf -Enez Norfolk nf -Norfolk ostrvo nf -Illa Norfolk nf -Ynys Norffolc nf -Norfolk-øerne (Australien) nf -Norfolk-Insel nf -Îήσος ÎÏŒÏφοκ nf -Norfolkinsulo nf -Isla Norfolk nf -Norfolki saar nf -Norfok Irla nf -جزایر نورÙولک nf -Norfolkinsaari nf -ÃŽle Norfolk nf -Norfolk Eilân nf -Oileán Norfolc nf -Illa Norfolk nf -××™×™ נורפולק nf -नॉरफाक आइलैंड nf -Otok Norfolk nf -Norfolk-szigetek nf -Norfolkeyja nf -Isola Norfolk nf -オーストラリア領ノーフォーク諸島 nf -កោះ Norfolk nf -ë…¸í¬í¬ ì œë„ nf -ໂປà»àº¥àº™ nf -Norfolko sala nf -Norfolka nf -Ðорфолшки ОÑтров nf -Norfolk арлууд nf -Gżira ta' Norfolk nf -Norfolkøya nf -Norfolkinsel nf -Norfolk Eiland nf -Norfolkøya nf -ਨੋਰਫੋਲਕ ਟਾਪੂ nf -Wyspy Norfolk nf -Ilha Norfolk nf -Ilhas Norfolk nf -Insulele Norfolk nf -ОÑтров Ðорфолк nf -Ikirwa cya Norufolika nf -Norfolksuolu nf -Ostrov Norfolk nf -Otok Norfolk nf -Ðорфолкшко оÑтрво nf -NorfolkÅ¡ko ostrvo nf -Norfolkön nf -நாரà¯à®ªà¯‹à®•௠தீவ௠nf -Ҷазираи Ðурфолк nf -เà¸à¸²à¸°à¸™à¸­à¸£à¹Œà¸Ÿà¸­à¸¥à¹Œà¸„ nf -Norfolk Adaları nf -Norfolk Utrawları nf -ОÑтрів Ðорфолк nf -Ðорфолк Ороли nf -Iye di Norfolk nf -诺ç¦å…‹å²› nf -諾ç¦å…‹å³¶ nf -Nigeria ng -Nigerië ng -نيجيريا ng -ÐÑ–Ð³ÐµÑ€Ñ‹Ñ ng -ÐÐ¸Ð³ÐµÑ€Ð¸Ñ ng -নাইজেরিয়া ng -Nijeria ng -Nigerija ng -Nigèria ng -Nigérie ng -ÎιγηÏία ng -NiÄerio ng -Nigeeria ng -نیجریه ng -Nigéria ng -An Nigéir ng -Nixéria ng -ניגריה ng -नाइजीरिया ng -Nigerija ng -Nigéria ng -Nígería ng -ナイジェリア ng -នីហ្សáŸážšáž¸áž™áŸ‰áž¶ ng -나ì´ì§€ë¦¬ì•„ ng -ບັນà»àºà»€àº¥àºµàº ng -Nigerija ng -NigÄ“rija ng -Ðигерија ng -Ðигери ng -NiÄ¡erja ng -ਨੀਜੀਰਿਆ ng -Nigéria ng -Nigéria ng -ÐÐ¸Ð³ÐµÑ€Ð¸Ñ ng -Nigeriya ng -Nigéria ng -Nigerija ng -Ðигерија ng -Nigerija ng -நிஜேரியா ng -Ðигерӣ ng -ไนจีเรีย ng -Nijerya ng -ÐÑ–Ð³ÐµÑ€Ñ–Ñ ng -ÐÐ¸Ð³ÐµÑ€Ð¸Ñ ng -Nidjeria ng -尼日利亚 ng -奈åŠåˆ©äºž ng -Nicaragua ni -Nikaragua ni -نيكاراغوا ni -Ðікарагуа ni -Ðикарагуа ni -নিকারাগà§à§Ÿà¦¾ ni -Nikwaraga ni -Nikaragva ni -Nikaragua ni -Nicaragwa ni -ÎικαÏάγουα ni -Nikaragvo ni -Nikaraagua ni -Nikaragua ni -نیکاراگویه ni -Nikaragua ni -Nikaragua ni -Nicearagua ni -ניקרגווה ni -निकारागà¥à¤† ni -Nikaragva ni -Níkaragva ni -ニカラグア ni -នីការ៉ាហ្គáŸážš ni -니카ë¼ê³¼ ni -ປາລາàºàºàº§àº ni -Nikaragva ni -Nikaragva ni -Ðикарагва ni -Ðикрагуа ni -Nikaragwa ni -ਨਿਕਾਰਗà©à¨† ni -Nikaragua ni -Nicarágua ni -Nicarágua ni -Ðикарагуа ni -Nikaragwa ni -Nikaragua ni -Nikaragva ni -Ðикарагва ni -Nikaragva ni -I-Nicaragua ni -நிகராகà¯à®µà¯‡ ni -Ðикарагуа ni -นิคาราà¸à¸±à¸§ ni -Nikaragua ni -Nikaragua ni -Ðікарагуа ni -Ðикарагуа ni -Nicaragwa ni -尼加拉瓜 ni -尼加拉瓜 ni -Netherlands nl -Nederland nl -هولندا nl -Hollandiya nl -ГалÑÐ½Ð´Ñ‹Ñ nl -Ð¥Ð¾Ð»Ð°Ð½Ð´Ð¸Ñ nl -হলà§à¦¯à¦¾à¦£à§à¦¡ nl -Izelvroioù nl -Nizozemska nl -Holanda nl -Nizozemí nl -Yr Iseldiroedd nl -Holland nl -Niederlande nl -Κάτω ΧώÏες nl -Nederlando nl -Países Bajos nl -Holland nl -Holanda nl -هلند nl -Alankomaat nl -Háland nl -Pays bas nl -Nederlân nl -An Ãsiltír nl -Países Baixos nl -הולנד nl -नीदरलैंडà¥à¤¸ nl -Nizozemska nl -Hollandia nl -Belanda nl -Holland nl -Paesi Bassi nl -オランダ nl -ហុល្លង់ nl -네ëœëž€ë“œ nl -ເນເທີà»àº¥àº™à¹Œ nl -Olandija nl -NÄ«derlande nl -Холандија nl -Ðедерланд nl -Nederland nl -Nedderlanne nl -Nederland nl -Nederland nl -Holanda nl -ਨੀਂਦਰਲੈਂਡ nl -Holandia nl -Holanda nl -Holanda nl -Olanda nl -Ðидерланды nl -Ubuholandi nl -Hollánda nl -Holandsko nl -Nizozemska nl -Холандија nl -Holandija nl -I-Netherlands nl -Nederländerna nl -நெதரà¯à®²à®¾à®¨à¯à®¤à¯ nl -Ҳуланд nl -เนเธอร์à¹à¸¥à¸™à¸”์ nl -Hollanda nl -Niderlandlar nl -Ð“Ð¾Ð»Ð»Ð°Ð½Ð´Ñ–Ñ nl -Ðидерландлар nl -Hà Lan nl -Bas Payis nl -è·å…° nl -è·è˜­ nl -Norway no -Noorweë no -النرويج no -Norveç no -ÐарвÑÐ³Ñ–Ñ no -ÐÐ¾Ñ€Ð²ÐµÐ³Ð¸Ñ no -নরওয়ে no -Norvegia no -NorveÅ¡ka no -Noruega no -Norsko no -Norwy no -Norge no -Norwegen no -ÎοÏβηγία no -Norvegio no -Noruega no -Norra no -Norvegia no -نروژ no -Norja no -Norra no -Norvège no -Noorwegen no -An Iorua no -Noruega no -נורבגיה no -नारà¥à¤µà¥‡ no -NorveÅ¡ka no -Norvégia no -Norwegia no -Noregur no -Norvegia no -ノルウェー no -áž“áŸážšážœáŸ‚ស no -ë…¸ë¥´ì›¨ì´ no -ນà»à»€àº§ no -Norvegija no -Norvēģija no -Ðорвешка no -Ðорвеги no -NorveÄ¡ja no -Norge no -Norwegen no -Noorwegen no -Noreg no -Noruega no -ਨਾਰਵੇ no -Norwegia no -Noruega no -Noruega no -Norvegia no -ÐÐ¾Ñ€Ð²ÐµÐ³Ð¸Ñ no -Noruveje no -Norga no -Nórsko no -NorveÅ¡ka no -Ðорвешка no -NorveÅ¡ka no -I-Norway no -Norge no -நாரà¯à®µà¯‡ no -Ðорвегӣ no -นอร์เวย์ no -Norveç no -ÐÐ¾Ñ€Ð²ÐµÐ³Ñ–Ñ no -ÐÐ¾Ñ€Ð²ÐµÐ³Ð¸Ñ no -Na uy no -Norvedje no -æŒªå¨ no -æŒªå¨ no -Nepal np -نيبال np -ÐÑпал np -Ðепал np -নেপাল np -Nepál np -Îεπάλ np -Nepalo np -نپال np -Népal np -Neipeal np -נפ×ל np -नेपाल np -Nepál np -ãƒãƒ‘ール np -áž“áŸáž”៉ាល់ np -네팔 np -ເວນດາ np -Nepalas np -NepÄla np -Ðепал np -Ðепал np -ਨੇਪਾਲ np -Ðепал np -Nepali np -Ðепал np -நேபாளம௠np -Ðипол np -เนปาล np -Ðепал np -Ðепал np -尼泊尔 np -尼泊爾 np -Nauru nr -ناورو nr -Ðауру nr -Ðауру nr -নাউরৠnr -Naurueg nr -Nawrw nr -ÎαουÏÎ¿Ï nr -NaÅ­ro nr -Naurú nr -نائورو nr -Naurusaaret nr -Nárúis nr -× ×ורו nr -नौरू nr -Naurski nr -Nárú nr -ナウル nr -ណូរូ nr -나우루 nr -ປາລາàºàºàº§àº nr -Ðауру nr -Ðауру nr -Nawru nr -ਨਾਉਰੂ nr -Ðауру nr -Ikinawuru nr -Ðауру nr -நௌர௠nr -Ðауру nr -นาวรู nr -Ðауру nr -Ðауру nr -Nawouro nr -ç‘™é² nr -諾魯 nr -Niue nu -Nieu nu -نيوي nu -ÐÑ–ÑžÑ nu -Ðиуе nu -নিউই nu -Niwe nu -ÎιοÏε nu -Niuo nu -نیئو nu -ניווה nu -नियू nu -ニュージーランド自治領ニウエ nu -នីវ nu -ë‹ˆìš°ì— nu -ເນ໊ຕ nu -Ðије nu -Ðиуе nu -Niwe nu -ਨੀਉਈ nu -Ðиуе nu -Ðиуе nu -நீய௠nu -Ðиу nu -นิอุเอ nu -Nive nu -Niu nu -Ðіуе nu -Ðиуе nu -Niuwé nu -纽埃 nu -ç´é„‚å³¶ nu -New Zealand nz -Nuwe Seeland nz -نيوزيلاندا nz -Yeni Zellandiya nz -ÐÐ¾Ð²Ð°Ñ Ð—ÑлÑÐ½Ð´Ñ‹Ñ nz -Ðова Ð—ÐµÐ»Ð°Ð½Ð´Ð¸Ñ nz -নিউজিলà§à¦¯à¦¾à¦£à§à¦¡ nz -Zeland nevez nz -Novi Zeland nz -Nova Zelanda nz -Nový Zéland nz -Seland Newydd nz -Neuseeland nz -Îέα Ζηλανδία nz -Nov-Zelando nz -Nueva Zelanda nz -Uus-Meremaa nz -Zelanda Berria nz -زلاندنو nz -Uusi-Seelanti nz -Nýsæland nz -Nouvelle Zélande nz -Nij Seelân nz -An Nua-Shéalainn nz -Nova Celándia nz -ניו זילנד nz -नà¥à¤¯à¥‚जीलैंड nz -Novi Zeland nz -Új-Zéland nz -Selandia Baru nz -Nýja-Sjáland nz -Nuova Zelanda nz -ニュージーランド nz -នូវែលហ្សáŸáž¡áž„់ nz -뉴질랜드 nz -ນີວຊີà»àº¥àº™ nz -Naujoji Zelandija nz -JaunZÄ“lande nz -Ðов Зеланд nz -Ð¨Ð¸Ð½Ñ Ð·ÐµÐ°Ð»Ð°Ð½Ð´ nz -Nieg Seeland nz -Nieuw Zeeland nz -Navera Zelanda nz -ਨਿਊਜ਼ੀਲੈਂਡ nz -Nowa Zelandia nz -Nova Zelândia nz -Nova Zelândia nz -Noua Zeelandă nz -ÐÐ¾Ð²Ð°Ñ Ð—ÐµÐ»Ð°Ð½Ð´Ð¸Ñ nz -Nuveli Zelande nz -Ođđa Zealánda nz -Nový Zéland nz -Nova Zelandija nz -Ðови Зеланд nz -Novi Zeland nz -I-New Zealand nz -Nya Zeeland nz -நியூசிலாநà¯à®¤à¯ nz -Зилонди Ðав nz -นิวซีà¹à¸¥à¸™à¸”์ nz -Yeni Zelanda nz -Yaña Zealand nz -Ðова Ð—ÐµÐ»Ð°Ð½Ð´Ñ–Ñ nz -Янги Ð—ÐµÐ»Ð°Ð½Ð´Ð¸Ñ nz -Nouve Zelande nz -新西兰 nz -ç´è¥¿è˜­ nz -Oman om -عÙمان om -Ðман om -Оман om -ওমান om -Omán om -Ομάν om -Omano om -Omán om -Omaan om -عمان om -Omán om -עומן om -ओमन om -Omán om -Óman om -オマーン om -អូម៉ង់ om -오만 om -ເàºàºµàºàº¥àº°àº¡àº±àº™ om -Omanas om -OmÄna om -Оман om -Оман om -ਓਮਾਨ om -Omã om -Omã om -Оман om -Omani om -Omán om -Оман om -I-Oman om -ஓமன௠om -Оман om -โอมาน om -Umman om -Оман om -Уммон om - Oman om -阿曼 om -阿曼 om -Panama pa -بنما pa -Панама pa -Панама pa -পানামা pa -Panamà pa -Παναμάς pa -Panamo pa -Panamá pa -پاناما pa -Panamá pa -פנמה pa -पनामा pa -パナマ pa -ប៉ាណាម៉ា pa -파나마 pa -ປານາມາ pa -Панама pa -Панама pa -ਪੈਨਾਮਾ pa -Panamá pa -Panamá pa -Панама pa -Панама pa -I-Panama pa -பனாமா pa -Панама pa -ปานามา pa -Панама pa -Панама pa -巴拿马 pa -巴拿馬 pa -Peru pe -البيرو pe -ПÑру pe -Перу pe -পেরৠpe -Perou pe -Perú pe -Periw pe -ΠεÏÎ¿Ï pe -Peruo pe -Perú pe -Peruu pe -پرو pe -Pérou pe -Peiriú pe -Perú pe -פרו pe -पेरू pe -Perú pe -Perù pe -ペルー pe -ប៉áŸážšáž¼ pe -페루 pe -ເປລູ pe -Перу pe -Перу pe -Pero pe -ਪੇਰੂ pe -Перу pe -Перу pe -I-Peru pe -பெர௠pe -Перу pe -เปรู pe -Перу pe -Перу pe -Perou pe -ç§˜é² pe -秘魯 pe -French Polynesia pf -Fraans Polynesië pf -بولينيزيا Ø§Ù„ÙØ±Ù†Ø³ÙŠØ© pf -ФранцуÑÐºÐ°Ñ ÐŸÐ°Ð»Ñ–Ð½ÑÐ·Ñ–Ñ pf -ÐŸÐ¾Ð»Ð¸Ð½ÐµÐ·Ð¸Ñ pf -ফরাসী পলিনেশিয়া pf -Polinezi galleg pf -Francuska Polinezija pf -Polinèsia francessa pf -Francouzská Polynésie pf -Polynesia Ffrengig pf -Fransk Polynesien pf -Französisch Polynesien pf -Γαλλική Πολυνησία pf -Franca Polinezio pf -Polinesia francesa pf -Prantsuse Polüneesia pf -Polinesia Frantziarra pf -پولونزی ÙØ±Ø§Ù†Ø³Ù‡ pf -Ranskan Polynesia pf -Polynésie française pf -Frânsk Polinesië pf -Polainéis na Fraince pf -Polinésia Francesa pf -פולינזיה הצרפתית pf -फà¥à¤°à¥‡à¤‚च पॉलीनेसिया pf -Francuska Polinezija pf -Francia-Polinézia pf -Franska Pólýnesía pf -Polinesia Francese pf -フランス領ãƒãƒªãƒã‚·ã‚¢ pf -ប៉ូលីនáŸážŸáŸŠáž¸â€‹áž”ារាំង pf -프랑스령 í´ë¦¬ë„¤ì‹œì•„ pf -àºàº£àº±à»ˆàº‡à»€àºªàº” pf -PrancÅ«zų Polinezija pf -FranÄu PolinÄ“zija pf -ФранцуÑка Полинезија pf -Франц полинеÑи pf -Polineżja FranÄ‹iża pf -Fransk Polynesia pf -Franzöösch Polynesien pf -Frans Polinesië pf -Fransk Polynesia pf -ਫਰੈਂਚ ਪੋਲੀਂਸੀਆ pf -Polinezja Francuska pf -Polinésia Francesa pf -Polinésia Francesa pf -Polinezia Franceză pf -ФранцузÑÐºÐ°Ñ ÐŸÐ¾Ð»Ð¸Ð½ÐµÐ·Ð¸Ñ pf -Polinesiya Mfaransa pf -FránskkalaÅ¡ Polynesia pf -Francúzska Polynézia pf -Francoska Polinezija pf -ФранцуÑка Полинезија pf -Francuska Polinezija pf -Franska Polynesien pf -பிரனà¯à®šà¯ போலினேசியா pf -ПулинезиÑи ФаронÑа pf -à¸à¸£à¸±à¹ˆà¸‡à¹€à¸¨à¸ªà¹‚พลีนีเซีย pf -Fransız Polinezyası pf -Frans Polinesia pf -Французька ÐŸÐ¾Ð»Ñ–Ð½ÐµÐ·Ñ–Ñ pf -Француз ÐŸÐ¾Ð»Ð¸Ð½ÐµÐ·Ð¸Ñ pf -Polynesia thuá»™c Pháp pf -Polinezeye francesse pf -法属波利尼西亚 pf -法屬波利尼西亞 pf -Papua New Guinea pg -بابوا غينيا الجديدة pg -Papua Yeni Gvineya pg -Папуа–ÐÐ¾Ð²Ð°Ñ Ð“Ð²Ñ–Ð½ÑÑ pg -Папуа Ðова Ð“Ð²Ð¸Ð½ÐµÑ pg -পাপà§à§Ÿà¦¾ নিউ গিনি pg -Papouazi Gine Nevez pg -Papua Nova Gvineja pg -Papua Nova Guinea pg -Papua - Nová Guinea pg -Papwa Gini Newydd pg -Papua Neu-Guinea pg -ΠαποÏα Îέα Γουινέα pg -Papuo-Nov-Gvineo pg -Papua Nueva Guinea pg -Paapua Uus-Guinea pg -Papua Ginea Berria pg -پاپوا گینه نو pg -Papua-Uusi-Guinea pg -Papouasie-Nouvelle-Guinée pg -Papua Nij Guinea pg -Nua-Ghuine Phapua pg -Papúa Nova Guiné pg -פפו××” ניו ×’×™× ×™ pg -पापà¥à¤† नà¥à¤¯à¥‚ गियाना pg -Papua Nova Gvineja pg -Pápua Új-Guinea pg -Papúa Nýja-Gínea pg -Papua Nuova Guinea pg -パプアニューギニア pg -ប៉ាពូញូវហ្គីណ០pg -파푸아뉴기니 pg -ເທົາອ່ອນ pg -Papua Naujoji GvinÄ—ja pg -Papua Jaungvineja pg -Папуа Ðова Гвинеја pg -Папуа ÑˆÐ¸Ð½Ñ Ð“ÑƒÐ¹Ð½ÐµÐ° pg -Papwa Ginea pg -Papua Ny-Guinea pg -Papua-Niegguinea pg -Papua Ny-Guinea pg -ਪਾਪੂਆ ਨਵਾਂ ਗੂਈਆ pg -Papua Nowa Gwinea pg -Papua Nova Guiné pg -Papua Nova Guiné pg -Papua Noua Guinee pg -Папуа-ÐÐ¾Ð²Ð°Ñ Ð“Ð²Ð¸Ð½ÐµÑ pg -Papuwa Gineya Nshya pg -Papua Ođđa-Guinea pg -Papua Nová Guinea pg -Papua Nova Gvineja pg -Папуа Ðова Гвинеја pg -Papua Nova Gvineja pg -Papua Nya Guinea pg -பாபà¯à®ªà®¾ நியூ ஜினியா pg -Папуа ГвинеиÑи Ðав pg -ปาปัวนิวà¸à¸´à¸™à¸µ pg -Papua Yeni Gine pg -Papua Yaña Guinea pg -Папуа Ðова Ð“Ð²Ñ–Ð½ÐµÑ pg -Папуа Янги Ð“Ð²Ð¸Ð½ÐµÑ pg -Papouwazeye Nouve Guinêye pg -巴布亚新几内亚 pg -巴布ç´å¹¾å…§äºž pg -Philippines ph -Fillipyne ph -الÙلبين ph -FillipinlÉ™r ph -Філіпіны ph -Филипини ph -ফিলিপিনস ph -Filipin ph -Filipini ph -Filipines ph -Filipíny ph -Ynysoedd Y Philipinau ph -Filippinerne ph -Philippinen ph -Φιλιππίνες ph -Filipinoj ph -Filipinas ph -Filipiinid ph -Filipinak ph -Ùیلیپین ph -Filippiinit ph -Filippijnen ph -Na hOileáin Fhilipíneacha ph -Filipinas ph -×¤×™×œ×™×¤×™× ×™× ph -फिलिपà¥à¤ªà¥€à¤¨à¥à¤¸ ph -Filipini ph -Fülöp-szigetek ph -Filippseyjar ph -Filippine ph -フィリピン ph -ហ្វ៊ីលីពីន ph -필리핀 ph -ອາລະປະໂຫàºàº” ph -Filipinai ph -FilipÄ«nas ph -Филипини ph -Плиппин ph -Filippini ph -Filippinene ph -Philippinen ph -Filippijnen ph -Filippinane ph -ਫਿਲੀਪੀਨਜ਼ ph -Filipiny ph -Filipinas ph -Filipinas ph -Filipine ph -Филиппины ph -Filipine ph -Filippiinat ph -Filipíny ph -Filipini ph -Филипини ph -Filipini ph -Filippinerna ph -பிலிபà¯à®ªà¯ˆà®©à¯à®¸à¯ ph -Филипин ph -ฟิลิปปินส์ ph -Filipinler ph -Filippinnär ph -Філіппіни ph -Филиппин ph -Filipenes ph -è²å¾‹å®¾ ph -è²å¾‹è³“ ph -Pakistan pk -باكستان pk -ПакіÑтан pk -ПакиÑтан pk -পাকিসà§à¦¤à¦¾à¦¨ pk -Paquistà pk -Pákistán pk -Pacistan pk -Πακιστάν pk -Pakistano pk -پاکستان pk -An Phacastáin pk -Paquistán pk -פ×קיסטן pk -पाकिसà¥à¤¤à¤¾à¤¨ pk -Pakisztán pk -パキスタン pk -ប៉ាគីស្ážáž¶áž“ pk -파키스탄 pk -ລງບ pk -Pakistanas pk -PakistÄna pk -ПакиÑтан pk -ПакиÑтан pk -ਪਾਕਿਸਤਾਨ pk -Paquistão pk -Paquistão pk -ПакиÑтан pk -Pakisitani pk -ПакиÑтан pk -பாகிஸà¯à®¤à®¾à®©à¯ pk -ПокиÑтон pk -ปาà¸à¸µà¸ªà¸–าน pk -Päqstan pk -ПакиÑтан pk -ПокиÑтон pk -å·´åŸºæ–¯å¦ pk -å·´åŸºæ–¯å¦ pk -Poland pl -بولندا pl -PolÅŸa pl -Польшча pl -Полша pl -পোলà§à¦¯à¦¾à¦£à§à¦¡ pl -Polonia pl -Poljska pl -Polònia pl -Polsko pl -Gwlad Pwyl pl -Polen pl -Polen pl -Πολωνία pl -Pollando pl -Polonia pl -Poola pl -Polonia pl -لهستان pl -Puola pl -Pólland pl -Pologne pl -Polen pl -An Pholainn pl -Polónia pl -פולין pl -पोलैंड pl -Poljska pl -Lengyelország pl -Polandia pl -Pólland pl -Polonia pl -ãƒãƒ¼ãƒ©ãƒ³ãƒ‰ pl -ប៉ូឡូញ pl -í´ëž€ë“œ pl -ໂປà»àº¥àº™ pl -Lenkija pl -Polija pl -ПолÑка pl -Польш pl -Polonja pl -Polen pl -Polen pl -Polen pl -Polen pl -Polònia pl -ਪੋਲੈਂਡ pl -Polska pl -Polónia pl -Polônia pl -Polonia pl -Польша pl -Polonye pl -Polska pl -Poľsko pl -Poljska pl -ПољÑка pl -Poljska pl -I-Poland pl -Polen pl -போலாநà¯à®¤à¯ pl -ÐŸÐ¾Ð»Ð°Ð½Ð´Ð¸Ñ pl -โปà¹à¸¥à¸™à¸”์ pl -Polonya pl -Polonia, PolÅŸa pl -Польща pl -Полша pl -Pholandi pl -Ba Lan pl -Pologne pl -波兰 pl -波蘭 pl -Saint Pierre and Miquelon pm -St Pierre en Miquelon pm -سانت بيير Ùˆ ميكيلون pm -Saint Pierre vÉ™ Miquelon pm -СÑн-П'ер Ñ– Мікелон pm -Св. Пиер и Магелан pm -সেনà§à¦Ÿ পিয়ের à¦à¦¬à¦‚ মিকেলন pm -Sant Per ha Mikelon pm -Sveti Pjer i Migelon pm -Saint Pierre i Miquelon pm -Saint Pierre a Miquelon pm -Ynysoedd Sant Pierre a Micwelon pm -Saint Pierre og Miquelon pm -Saint Pierre und Miquelon pm -Σαιν Î Î¹Î­Ï (Άγιος ΠέτÏος) και Μικελόν pm -Sent-Piero kaj Mikelono pm -Saint Pierre y Miquelon pm -Saint Pierre ja Miquelon pm -Saint Pierre eta Miquelon pm -سنت Ù¾ÛŒÙØ± Ùˆ میکولئون pm -Saint-Pierre ja Miquelon pm -Saint-Pierre-et-Miquelon pm -Saint Pierre en Miquelon pm -Peadar Naofa agus Micilín pm -Saint Pierre e Miquelon pm -ס×ן פייר ומיקלון pm -सेंट पियरे तथा मिकà¥à¤µà¥‡à¤²à¤¨ pm -Saint Pierre i Miquelon pm -Saint Pierre és Miquelon pm -Sankti Pierre og Miquelon pm -Saint Pierre e Miquelon pm -フランス海外領土サンピエールミクロン諸島 pm -세ì¸íЏ 피ì—르 미쿠엘론 pm -SenpjÄ“ra un Mikelona pm -Свети Пјер и Микелон pm -Сайнт пиерре ба микуелон pm -Saint Pierre u Miquelon pm -Saint-Pierre-et-Miquelon pm -Sankt Pierre un Miquelon pm -Saint Pierre en Miquelon pm -Saint-Pierre-et-Miquelon pm -ਸੇਂਟ ਪੀਈਰੀ ਤੇ ਮਾਕਿਉਲੋਨ pm -Saint Pierre i Miquelon pm -S. Pedro e Miquelão pm -Saint Pierre e Miquelon pm -Saint Pierre ÅŸi Miquelon pm -Сен-Пьер и Микелон pm -Mutagatifu Petero na Mikelo pm -Saint-Pierre-et-Miquelon pm -Saint Pierre a Miquelon pm -Sveti Pierre in Miquelon pm -Св. Пјер и Микелон pm -Sv. Pjer i Mikelon pm -Saint Pierre och Miquelon pm -செயினà¯à®Ÿà¯ பியரி மறà¯à®±à¯à®®à¯ மிகà¯à®¯à¯à®²à®©à¯ pm -Синт Пир Миколеюн pm -เซนต์ปิà¹à¸­à¸£à¹Œ à¹à¸¥à¸°à¸¡à¸´à¹€à¸„อลอน pm -Saint Pierre ve Miquelon pm -Saint Pierre wä Miquelon pm -Сент-П'єр Ñ– Мікелон pm -Сент-Пер ва Микелон pm -Sint Pire et Miquelon pm -圣皮埃尔和密克隆 pm -è–皮埃爾島åŠå¯†å…‹éš†å³¶ pm -Pitcairn pn -بيتكايرن pn -ПіткÑрн pn -ОÑтрови Питкерн pn -পিটকেম pn -Pitkern pn -Ynys Pitcairn pn -ΠίτκαιÏν pn -Pitkarna Insulo pn -پیت Ú©ÙØ±Ù† pn -פיטקרן pn -पिटकैरà¥à¤¨ pn -英領ピトケアン諸島 pn -í•케언 pn -ລງບ pn -PitkÄ“rna pn -Питкерн pn -Питкайрн pn -ਪੀਟਕਾਰਨ pn -Питкаирн pn -பிடà¯à®•ாயà¯à®©à¯ pn -Питкорин pn -เà¸à¸²à¸°à¸žà¸´à¸•à¹à¸„ร์น pn -Pitkairn pn -Питкерн pn -çš®ç‰¹å¼€æ© pn -匹特開æ©å³¶ pn -Puerto Rico pr -بورتوريكو pr -Puerto Riko pr -ПуÑрта Рыка pr -Порто Рико pr -পà§à§Ÿà§‡à¦°à§à¦¤à§‹ রিকো pr -Porto Rico pr -Portoriko pr -Portoriko pr -Pwerto Rico pr -ΠουέÏτο Ρίκο pr -Puerto-Riko pr -پورتوریکو pr -Porto Rico pr -Portó Ríce pr -Porto Rico pr -פורטו ריקו pr -पà¥à¤¯à¥‚रà¥à¤Ÿà¥‹ रिको pr -Portoriko pr -Púertó Ríkó pr -Portorico pr -プエルトリコ pr -áž–áŸážšážáž¼ážšáž¸áž€áž¼ pr -푸ì—르토리코 pr -ໂປຣໂຕຄອນ pr -Puerto Rikas pr -Puertoriko pr -Порто Рико pr -Пуерто Рико pr -ਰੂਇਰਟੂ ਰੀਕੋ pr -Porto Rico pr -Porto Rico pr -ПуÑрто-Рико pr -Porito Riko pr -Portoriko pr -Порторико pr -Portoriko pr -பà¯à®¯à¯à®°à¯à®Ÿà¯‹ ரிகோ pr -Пурто Рико pr -เปอร์โตริโภpr -Porta Riko pr -Puerto Riko pr -Пуерто-Ріко pr -ПуÑрто-Рико pr -Porto Rico pr -æ³¢å¤šé»Žå„ pr -æ³¢å¤šé»Žå„ pr -Palestinian Territory ps -Palesteinse Gebied ps -السلطة الÙلسطينية ps -FÉ™lÉ™stin SahÉ™si ps -ПалеÑтынÑÐºÐ°Ñ Ñ‚ÑÑ€Ñ‹Ñ‚Ð¾Ñ€Ñ‹Ñ ps -ПалеÑтина ps -পà§à¦¯à¦¾à¦²à§‡à¦¸à§à¦Ÿà¦¿à¦¨à¦¿à§Ÿà¦¾à¦¨ টেরিটরি ps -Palestinska teritorija ps -Territori Palestí ps -Palestinské území ps -Tiriogaeth Palesteina ps -Palæstinensiske selvstyreomrÃ¥der ps -Palästinensisches Gebiet ps -Παλαιστίνη ps -Palestina Teritorio ps -Territorio palestino ps -Palestiina ps -Palestina ps -Ùلسطین ps -Palestiinalaisalue ps -Palestinensiska økið ps -Territoire palestinien ps -Palestijnsk territorium ps -Críoch na bPalaistíneach ps -Território Palestino ps -×”×©×˜×—×™× ×”×¤×œ×¡×˜×™× ×™×™× ps -फिलीसà¥à¤¤à¥€à¤¨à¥€ टेरिटरी ps -Palestinski teritorij ps -Palesztin területek ps -Palestína ps -Palestina ps -パレスãƒãƒŠè‡ªæ²»åŒº ps -ប៉ាលáŸážŸáŸ’ទីន ps -íŒ”ë ˆìŠ¤íƒ€ì¸ ìžì¹˜êµ¬ ps -àºàº²àº™àºžàº´àº¡àºœàº´àº”ພາດ ps -Palestinos teritorija ps -PalestÄ«nieÅ¡u treitorija ps -ПалеÑтинÑки територии ps -ПалеÑтины газар нутаг ps -Palestina ps -Palestinske territorier ps -De palästinensche sülvenregeerte Regioon ps -Palestijns territorium ps -Palestinske territorium ps -Bohwa bja Palestina ps -ਫਲਾਸਤੀਨ ਖੇਤਰ ps -Palestyna ps -Território Palestiniano ps -Território Palestino ps -Teritoriul Palestinian ps -ПалеÑтинÑкие территории ps -Igihugu cya Palesitina ps -PalestiinnalaÅ¡ territoria ps -Palestínske územia ps -Palestinski teritorij ps -ПалеÑтина ps -Palestina ps -I-Palestinian Territory ps -Palestina ps -பாலஸà¯à®¤à¯€à®© ஆணையம௠ps -ФалаÑтин ps -เขตปà¸à¸„รองปาเลสไตน์ ps -Filistin Bölgesi ps -Fälestin ps -ПалеÑтинÑька Ñ‚ÐµÑ€Ð¸Ñ‚Ð¾Ñ€Ñ–Ñ ps -ФалаÑтин Ерлари ps -Mukano wa maphalesitina ps -Lãnh thổ cá»§a Palestine ps -Palestene ps -Umhlaba wePalestina ps -å·´å‹’æ–¯å¦åœ°åŒº ps -å·´å‹’æ–¯å¦é ˜åœ° ps -Indawo yama-Phalesitina ps -Portugal pt -البرتغال pt -Portuqaliya pt -ÐŸÐ°Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ñ–Ñ pt -ÐŸÐ¾Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ð¸Ñ pt -পোরà§à¦¤à§à¦—াল pt -Portugalsko pt -Portiwgal pt -ΠοÏτογαλία pt -Portugalo pt -پرتغال pt -Portugali pt -An Phortaingéil pt -פורטוגל pt -पà¥à¤°à¥à¤¤à¤—ाल pt -Portugália pt -Portúgal pt -Portogallo pt -ãƒãƒ«ãƒˆã‚¬ãƒ« pt -áž–áŸážšáž‘ុយហ្គាល់ pt -í¬ë¥´íˆ¬ê°ˆ pt -ໂປຣຕຸເàºàºª pt -Portugalija pt -PortugÄle pt -Португалија pt -Португал pt -Portugall pt -ਪà©à¨°à¨¤à¨—ਾਲ pt -Portugalia pt -Portugalia pt -ÐŸÐ¾Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ð¸Ñ pt -Poritigali pt -Portugalsko pt -Portugalska pt -Португал pt -I-Portugal pt -போரà¯à®¤à¯à®¤à¯à®•ல௠pt -Пуртуқол pt -โปรตุเà¸à¸ª pt -Portekiz pt -Portugalia pt -ÐŸÐ¾Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ñ–Ñ pt -ÐŸÐ¾Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ð¸Ñ pt -Bồ Äào Nha pt -è‘¡è„牙 pt -è‘¡è„牙 pt -Palau pw -بالاو pw -Палау pw -Палау pw -পালাউ pw -Palaw pw -Παλάου pw -Palao pw -پالائو pw -פל×ו pw -पलाऊ pw -Palá pw -パラオ pw -ប៉ាឡូ pw -팔ë¼ìš° pw -ມອລຕາ pw -Палау pw -Палау pw -ਪਾਲਾਉ pw -Палау pw -Palawu pw -Палау pw -பலாவ௠pw -Палау pw -เà¸à¸²à¸°à¸žà¸²à¹€à¸¥à¸² pw -Палау pw -Палау pw -Palawou pw -帕劳 pw -å¸›ç‰ pw -Paraguay py -Paraguaai py -باراغواي py -Paraqvay py -Парагвай py -Парагвай py -পà§à¦¯à¦¾à¦°à¦¾à¦—à§à§Ÿà§‡ py -Paragwae py -Paragvaj py -Paraguai py -Paragw?i py -ΠαÏαγουάη py -Paragvajo py -Paraguai py -پاراگویه py -Paragua py -Paraguai py -פרגו××™ py -पैरागà¥à¤ py -Paragvaj py -Paragvæ py -パラグアイ py -ប៉ារ៉ាហ្គាយ py -파ë¼ê³¼ì´ py -ປາລາàºàºàº§àº py -Paragvajus py -Paragvaja py -Парагвај py -Парагвай py -Paragwaj py -Paraguai py -ਪਾਰਾਗà©à¨† py -Paragwaj py -Paraguai py -Paraguai py -Paraguai py -Парагвай py -Paragwe py -Portugalsko py -Paragvaj py -Парагвај py -Paragvaj py -I-Paraguay py -பராகà¯à®µà¯‡ py -Порогвие py -ปาราà¸à¸§à¸±à¸¢ py -Парагвай py -Парагвай py -Paragway py -巴拉圭 py -巴拉圭 py -Qatar qa -قطر qa -Катар qa -Катар qa -কাতার qa -Kwatar qa -Katar qa -Katar qa -Catar qa -Katar qa -ÎšÎ±Ï„Î¬Ï qa -Kataro qa -Katar qa -قطر qa -Katar qa -Catar qa -קטר qa -क़तर qa -Katar qa -Katar qa -Katar qa -カタール qa -កាážáž¶ážš qa -카타르 qa -ມອລຕາ qa -Kataras qa -Katara qa -Катар qa -Катар qa -Katar qa -ਕਤਰ qa -Katar qa -Катар qa -Katari qa -Katar qa -Katar qa -Катар qa -Katar qa -I-Qatar qa -கதார௠qa -Қатар qa -ควาตาร์ qa -Katar qa -Катар qa -Қатар qa -Katar qa -å¡å¡”å°” qa -å¡é” qa -Romania ro -Romenië ro -رومانيا ro -Rumıniya ro -Ð ÑƒÐ¼Ñ‹Ð½Ñ–Ñ ro -Ð ÑƒÐ¼ÑŠÐ½Ð¸Ñ ro -রà§à¦®à§‡à¦¨à¦¿à§Ÿà¦¾ ro -Roumani ro -Rumunija ro -Rumunsko ro -Rumænien ro -Rumänien ro -Ρουμανία ro -Rumanio ro -Rumanía ro -Rumeenia ro -Errumania ro -رومانی ro -Rumenia ro -Roumanie ro -Roemenië ro -An Rómáin ro -Románia ro -רומניה ro -रोमानिया ro -Rumunjska ro -Románia ro -Rumania ro -Rúmenía ro -ルーマニア ro -រូម៉ានី ro -루마니아 ro -ໂລມາເນີຠro -Rumunija ro -RumÄnija ro -Романија ro -Румын ro -Rumanija ro -Rumänien ro -Roemenië ro -ਰੋਮਾਨੀਆ ro -Rumunia ro -Roménia ro -Romênia ro -România ro -Ð ÑƒÐ¼Ñ‹Ð½Ð¸Ñ ro -Romaniya ro -Románia ro -Rumunsko ro -Romunija ro -Румунија ro -Rumunija ro -I-Romania ro -Rumänien ro -à®°à¯à®®à¯‡à®©à®¿à®¯à®¾ ro -Ð ÑƒÐ¼Ð¸Ð½Ð¸Ñ ro -โรมาเนีย ro -Romanya ro -Ð ÑƒÐ¼ÑƒÐ½Ñ–Ñ ro -Ð ÑƒÐ¼Ð¸Ð½Ð¸Ñ ro -Roumaneye ro -罗马尼亚 ro -羅馬尼亞 ro -Russia ru -Rusland ru -روسيا ru -Rusiya ru -РаÑÐµÑ ru -РуÑÐ¸Ñ ru -রাশিয়া ru -Rusia ru -Rusija ru -Rússia ru -Rusko ru -Rwsia ru -Rusland ru -Russland ru -Ρωσία ru -Ruslando ru -Rusia ru -Venemaa ru -Errusia ru -روسیه ru -Venäjä ru -Russland ru -Russie ru -Rusland ru -An Rúis ru -Rúsia ru -רוסיה ru -रà¥à¤¸ ru -Rusija ru -Oroszország ru -Rusia ru -Rússland ru -ロシア ru -រូស្ស៊ី ru -러시아 ru -ລັດເຊີຠru -Rusija ru -Krievija ru -РуÑија ru -ÐžÑ€Ð¾Ñ ru -Russja ru -Russland ru -Russland ru -Rusland ru -Russland ru -ਰੂਸ ru -Rosja ru -Rússia ru -Rússia ru -Rusia ru -РоÑÑÐ¸Ñ ru -Uburusiya ru -Ruošša ru -Rusko ru -Rusija ru -РуÑија ru -Rusija ru -I-Russia ru -Ryssland ru -ரசியா ru -РуÑÑÐ¸Ñ ru -รัสเซีย ru -Rusya ru -Urısia, Räsäy ru -РоÑÑ–Ñ ru -РоÑÑÐ¸Ñ ru -Rashia ru -Nga ru -Rûsseye ru -Rashiya ru -ä¿„ç½—æ–¯ ru -ä¿„ç¾…æ–¯ ru -Rwanda rw -رواندا rw -Ruanda rw -Руанда rw -Руанда rw -রোয়ানà§à¦¡à¦¾ rw -Ruanda rw -Ruanda rw -Ruanda rw -Ρουάντα rw -Ruando rw -Ruanda rw -رواندا rw -Ruanda rw -Ruanda rw -Ruanda rw -רו×נדה rw -रवांडा rw -Ruanda rw -Ruanda rw -Rúanda rw -Ruanda rw -ルワンダ rw -រវ៉ាន់ដា rw -르완다 rw -à»àºžàº™àº”້າ rw -Ruanda rw -Ruanda rw -Руанда rw -Рванда rw -Ruanda rw -ਰਵਾਂਡਾ rw -Ruanda rw -Ruanda rw -Ruanda rw -Ruanda rw -Руанда rw -Ruanda rw -Руанда rw -Ruanda rw -வானà¯à®Ÿà®¾ rw -Руондо rw -รวันด้า rw -Ruanda rw -Руанда rw -Рванда rw -墿—ºè¾¾ rw -ç›§å®‰é” rw -Saudi Arabia sa -Saudi Arabië sa -السعودية sa -SÉ™udi ÆrÉ™bistan sa -СаудаўÑÐºÐ°Ñ ÐÑ€Ð°Ð±Ñ–Ñ sa -СаудитÑка ÐÑ€Ð°Ð±Ð¸Ñ sa -সৌদি আরব sa -Arabi Saudiet sa -Saudijska Arabija sa -Aràbia Saurí sa -Saúdská Arábie sa -Sawdi Arabia sa -Saudi Arabien sa -Saudi-Arabien sa -Σαουδική ΑÏαβία sa -SaÅ­da Arabio sa -Arabia Saudí sa -Saudi Araabia sa -عربستان سعودی sa -Saudi-Arabia sa -Arabie Saoudite sa -Saudi-Arabië sa -An Araib Shádach sa -Arabia Saudita sa -ערב הסעודית sa -सऊदी अरब sa -Saudijska Arabija sa -Szaúd-Arábia sa -Sádi-Arabía sa -Arabia Saudita sa -サウジアラビア sa -អារ៉ាប៊ីសាអ៊ូឌីហsa -사우디 ì•„ë¼ë¹„ì•„ sa -ອາລະບິຠsa -Saudo Arabija sa -SaÅ«da ArÄbija sa -СаудиÑка Ðрабија sa -Саудын араб sa -Għarabja Sawdita sa -Saudi-Arabia sa -Saudi Arabien sa -Saudi-Arabië sa -Saudi-Arabia sa -ਸਾਊਦੀ ਅਰਬ sa -Arabia Saudyjska sa -Arábia Saudita sa -Arábia Saudita sa -Arabia Saudită sa -СаудовÑÐºÐ°Ñ ÐÑ€Ð°Ð²Ð¸Ñ sa -Arabiya Sawudite sa -Saudi Arábia sa -Saudská arábia sa -Saudova Arabija sa -СаудијÑка Ðрабија sa -Saudijska Arabija sa -I-Saudi Arabia sa -Saudiarabien sa -சவà¯à®¤à®¿ அரேபியா sa -ÐрабиÑтони Саудӣ sa -ซาอุดิอาระเบีย sa -Suudi Arabistan sa -Söğüd Ğäräbstan sa -СаудівÑька ÐÑ€Ð°Ð²Ñ–Ñ sa -Ð¡Ð°ÑƒÐ´Ð¸Ñ ÐрабиÑтони sa -Ẩrập Saudi sa -Arabeye Sawoudite sa -沙特阿拉伯 sa -æ²™çƒåœ°é˜¿æ‹‰ä¼¯ sa -Solomon Islands sb -Solomon Eilande sb -جزر سليمان sb -Solomon Adaları sb -Саламонавы аÑтравы sb -Соломонови оÑтрови sb -সলোমন দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ sb -Inizi Salaun sb -Solomonska ostrva sb -Illes Solomon sb -Å alamounovy ostrovy sb -Ynysoedd Solomon sb -Salomon-øerne sb -Salomon-Inseln sb -Îήσοι Σολομώντος sb -Salomonoj sb -Islas Salomón sb -Saalomoni saared sb -Solomon Irlak sb -جزایر سلیمان sb -Solomon-saaret sb -ÃŽles Salomon sb -Solomon Eilannen sb -Oileáin Sholamón sb -Illas Salomón sb -××™×™ שלמה sb -सोलोमन आइलैंड sb -Solomonova otoÄja sb -Salamon-szigetek sb -Salómonseyjar sb -Isole Salomone sb -ソロモン諸島 sb -កោះ​សូឡូម៉ូន sb -솔로몬 ì œë„ sb -ສະໂລວະເນີຠsb -Saliamono salos sb -Solomonu salas sb -СоломонÑки ОÑтрови sb -Соломоны арлууд sb -Gżejjer Solomon sb -Salomonøyene sb -Salomonen sb -Solomon Eilanden sb -Salomonøyane sb -ਸੋਲੋਮੋਨ ਆਈਸਲੈਂਡ sb -Wyspy Salomona sb -Ilhas Salomão sb -Ilhas Salomão sb -Insulele Solomon sb -Соломоновы оÑтрова sb -Ibirwa bya Salomo sb -Salomonsullot sb -Å alamúnove ostrovy sb -Solomonovi otoki sb -Соломонова оÑтрва sb -Solomonova ostrva sb -Salomonöarna sb -சாலமன௠தீவà¯à®•ள௠sb -Ҷазираи Сулаймон sb -หมู่เà¸à¸²à¸°à¹‚ซโลมอน sb -Solomon Adaları sb -Solomon Utrawları sb -Соломонові оÑтрови sb -Соломон Ороллари sb -Quần đảo Solomon sb -Iyes Salomon sb -所罗门群岛 sb -索羅門群島 sb -Seychelles sc -سيشل sc -СÑйшÑлы sc -СейшелÑки оÑтрови sc -সীচিলিস sc -Sechell sc -SejÅ¡eli sc -Ynysoedd y Seisi?l sc -Seychellerne sc -Seychellen sc -Σεϋχέλλες sc -SejÅeloj sc -SeiÅ¡ellid sc -سیشل sc -Seychellit sc -Seychellen sc -Na Séiséil sc -Seicheles sc -××™×™ סיישל sc -शेसेलà¥à¤¸ sc -SejÅ¡eli sc -Seychelles-eyjar sc -セイシェル sc -សីស្ហែល sc -세ì´ì…¸ sc -ເຊລ sc -SeiÅ¡eļu salas sc -Сејшели sc -Ð¡ÐµÐ¹Ñ‡ÐµÐ»Ð»Ð¸Ñ sc -Seychellene sc -Seychellen sc -Seychellen sc -Seychellane sc -ਸੀਲਚੀਲੀਸ sc -Seszele sc -Ilhas Seychelles sc -СейшельÑкие оÑтрова sc -Seyishele sc -SeyÅ¡ellat sc -SejÅ¡eli sc -Сејшели sc -SejÅ¡eli sc -Seychellerna sc -சேசெலà¯à®²à®¸à¯ sc -Сейшелӣ sc -ซีเชลล์ sc -SeyÅŸeller sc -SeyÅŸellär sc -СейшельÑькі оÑтрови sc -Сейшел Ороллари sc -Seycheles sc -塞舌尔 sc -塞席爾 sc -Sudan sd -السودان sd -Судан sd -Судан sd -সà§à¦¦à¦¾à¦¨ sd -Sondan sd -Sudán sd -Swdan sd -Σουδάν sd -Sudano sd -Sudán sd -Sudaan sd -سودان sd -Sudania sd -Soudan sd -An tSúdáin sd -Sudán sd -סודן sd -सूडान sd -Szudán sd -Súdan sd -スーダン sd -ស៊ូដង់ sd -수단 sd -ຊູດານ sd -Sudanas sd -SudÄna sd -Судан sd -Судан sd -ਸੂਡਾਨ sd -Sudão sd -Sudão sd -Судан sd -Sudani sd -Sudán sd -Судан sd -I-Sudan sd -சூடான௠sd -Судон sd -ซูดาน sd -Судан sd -Судан sd -Sudani sd -Soudan sd -è‹ä¸¹ sd -蘇丹 sd -Sweden se -Swede se -السويد se -İsveç se -ШвÑÑ†Ñ‹Ñ se -Ð¨Ð²ÐµÑ†Ð¸Ñ se -সà§à¦‡à¦¡à§‡à¦¨ se -Å vedska se -Suècia se -Å védsko se -Sverige se -Schweden se -Σουηδία se -Svedio se -Suecia se -Rootsi se -Suedia se -سوئد se -Ruotsi se -Svøriki se -Suède se -Zweden se -An tSualainn se -Suécia se -שבדיה se -सà¥à¤µà¥€à¤¡à¤¨ se -Å vedska se -Svédország se -Swedia se -Svíþjóð se -Svezia se -スウェーデン se -ស៊ុយអែដ se -ìŠ¤ì›¨ë´ se -ສະວີເດນ se -Å vedija se -Zviedrija se -ШведÑка se -Швед se -Svezja se -Sverige se -Zweden se -Sverige se -Suècia se -ਸਵੀਡਨ se -Szwecja se -Suécia se -Suécia se -Suedia se -Ð¨Ð²ÐµÑ†Ð¸Ñ se -Suwede se -Ruoŧŧa se -Å védsko se -Å vedska se -ШведÑка se -Å vedska se -I-Sweden se -Sverige se -சà¯à®µà¯€à®Ÿà®©à¯ se -Шведӣ se -สวีเดน se -İsveç se -İswäc, Åžwedsia se -Ð¨Ð²ÐµÑ†Ñ–Ñ se -Ð¨Ð²ÐµÑ†Ð¸Ñ se -Swidene se -Thuỵ Äiển se -Suwede se -瑞典 se -瑞典 se -Singapore sg -سنغاÙورة sg -Sinqapur sg -Сынгапур sg -Сингапур sg -সিঙà§à¦—াপà§à¦° sg -Singapour sg -Singapur sg -Singapur sg -Singapur sg -Singap?r sg -Singapur sg -ΣινγκαποÏÏη sg -Singapuro sg -Singapur sg -Singapur sg -سنگاپور sg -Singapour sg -Singeapór sg -Singapur sg -סינגפור sg -सिंगापोर sg -Singapur sg -Szingapúr sg -Singapúr sg -シンガãƒãƒ¼ãƒ« sg -សិង្ហបុរី sg -싱가í¬ë¥´ sg -ໂຊນາ sg -SingapÅ«ras sg -SingapÅ«ra sg -Сингапур sg -Сингафур sg -Singapura sg -Singapor sg -Singapur sg -ਸਿੰਘਾਪà©à¨° sg -Singapur sg -Singapura sg -Singapura sg -Сингапур sg -Singapur sg -Singapur sg -Сингапур sg -Singapur sg -சிஙà¯à®•பà¯à®ªà¯‚ர௠sg -Сингопур sg -สิงคโปร์ sg -Singapur sg -Singapur sg -Сінгапур sg -Сингапур sg -Singapour sg -æ–°åŠ å¡ sg -æ–°åŠ å¡ sg -Saint Helena sh -St Helena sh -سانت هيلانة sh -ВоÑтраў СьвÑтой Ðлены sh -Св. Елена sh -সেনà§à¦Ÿ হেলেনা sh -Sant Lena sh -Sveta Helena sh -Santa Helena sh -Svatá Helena sh -Ynys Santes Helena sh -St. Helena sh -St. Helena sh -Αγία Ελένη sh -Sent-Heleno sh -Santa Helena sh -سنت هلن sh -Sainte-Hélène sh -Sint Helena sh -San Héilin sh -Santa Helena sh -סט. הלנה sh -सेंट हेलेना sh -Sveta Helena sh -Szent Heléna sh -Sankti Helena sh -Sant'Elena sh -英領セントヘレナ島 sh -សង់ហáŸáž¡áŸážŽáž¶ sh -세ì¸íŠ¸í—¬ë ˆë‚˜ sh -ຫົວເລື່ອງ sh -Å v. Elenos sala sh -Sv. HelÄ“nas sala sh -Света Елена sh -Сайнт Хелена sh -St. Helena sh -Sankt Helena sh -St. Helena sh -ਸੇਂਟ ਹੀਲੀਨਆ sh -ÅšwiÄ™ta Helena sh -Santa Helena sh -Santa Helena sh -Sfînta Elena sh -оÑтров СвÑтой Елены sh -Mutagatifu Helena sh -St. Helena sh -Svätá Helena sh -Sveta Helena sh -Света Јелена sh -Sveta Jelena sh -செயினà¯à®Ÿà¯ ஹேலேனா sh -Синт Ҳилин sh -เซนต์เฮเลน่า sh -ОÑтрів СвÑтої Єлени sh -Ðвлиё Елена Ороли sh -Sint Elene sh -圣赫勒拿 sh -è–赫勒拿島 sh -Slovenia si -Slovenië si -سلوÙينيا si -Sloveniya si -Ð¡Ð»Ð°Ð²ÐµÐ½Ñ–Ñ si -Ð¡Ð»Ð¾Ð²ÐµÐ½Ð¸Ñ si -সà§à¦²à§‹à¦­à§‡à¦¨à¦¿à§Ÿà¦¾ si -Sloveni si -Slovenija si -Eslovènia si -Slovinsko si -Slofenia si -Slovenien si -Slowenien si -Σλοβενία si -Slovenio si -Eslovenia si -Sloveenia si -Eslovenia si -اسلوانی si -Slovénie si -Slowenië si -An tSlóivéin si -Eslovénia si -סלובניה si -सà¥à¤²à¥‹à¤µà¥‡à¤¨à¤¿à¤¯à¤¾ si -Slovenija si -Szlovénia si -Slóvenía si -スロベニア si -ស្លូវ៉ានី si -슬로베니아 si -ສະໂລວະເນີຠsi -SlovÄ—nija si -SlovÄ“nija si -Словенија si -Слован si -Slovenja si -Slowenien si -Slowenië si -Eslovenia si -ਸਲੋਵੀਨੀਆ si -SÅ‚owenia si -Eslovénia si -Eslovênia si -Ð¡Ð»Ð¾Ð²ÐµÐ½Ð¸Ñ si -Siloveniya si -Slovinsko si -Slovenija si -Словенија si -Slovenija si -I-Slovenia si -Slovenien si -சà¯à®²à¯‹à®µà®¿à®©à®¿à®¯à®¾ si -УÑлувонӣ si -สโลเวเนีย si -Slovenya si -Ð¡Ð»Ð¾Ð²ÐµÐ½Ñ–Ñ si -Ð¡Ð»Ð¾Ð²ÐµÐ½Ð¸Ñ si -Esloveneye si -斯洛文尼亚 si -斯洛維尼亞 si -Slovakia sk -Slovakië sk -Ø³Ù„ÙˆÙØ§ÙƒÙŠØ§ sk -Slovakiya sk -Ð¡Ð»Ð°Ð²Ð°ÐºÑ–Ñ sk -Ð¡Ð»Ð¾Ð²Ð°ÐºÐ¸Ñ sk -সà§à¦²à§‹à¦­à¦¾à¦•িয়া sk -Slovaki sk -SlovaÄka sk -Eslovàquia sk -Slovensko sk -Slofacia sk -Slovakiet sk -Slowakien sk -Σλοβακία sk -Slovakujo sk -Eslovaquia sk -Slovakkia sk -Eslovakia sk -اسلواکی sk -Slovaquie sk -Slowakije sk -An tSlóvaic sk -Eslováquia sk -סלובקיה sk -सà¥à¤²à¥‹à¤µà¤¾à¤•िया sk -SlovaÄka sk -Szlovákia sk -Slóvakía sk -Slovacchia sk -スロãƒã‚­ã‚¢ sk -ស្លូវ៉ាគី sk -슬로바키아 sk -ສະໂລວັຠsk -Slovakija sk -SlovÄkija sk -Словачка sk -Словак sk -Slovakja sk -Slowakei sk -Slowakije sk -ਸਲੋਵਾਕਿਆ sk -SÅ‚owacja sk -Eslováquia sk -Eslováquia sk -Slovacia sk -Ð¡Ð»Ð¾Ð²Ð°ÐºÐ¸Ñ sk -Silovakiya sk -Slovákia sk -Slovensko sk -SlovaÅ¡ka sk -Словачка sk -SlovaÄka sk -I-Slovakia sk -Slovakien sk -சà¯à®²à¯‹à®µà®¾à®•à¯à®•ிய sk -УÑлувок sk -สโลวาเà¸à¸µà¸¢ sk -Slovakya sk -Ð¡Ð»Ð¾Ð²Ð°ÐºÑ–Ñ sk -Ð¡Ð»Ð¾Ð²Ð°ÐºÐ¸Ñ sk -Eslovakeye sk -斯洛ä¼å…‹ sk -斯洛ä¼å…‹ sk -San Marino sm -سان مارينو sm -Сан-Марына sm -Сан Марино sm -সান মারিনো sm -Σαν ΜαÏίνο sm -San-Marino sm -سن‌مارینو sm -Saint-Marin sm -San Mairíne sm -סן מרינו sm -सेन मेरिनो sm -San Marínó sm -サンマリノ sm -សាន់ម៉ារីណូ sm -산마리노 sm -ໂຊນາ sm -San Marinas sm -SanmarÄ«no sm -Сан Марино sm -Сан Марино sm -ਸਨ ਮਰੀਨੋ sm -São Marino sm -Сан-Марино sm -Mutagatifu Marini sm -Сан Марино sm -சான௠மரினோ sm -Сан Морину sm -ซานมาริโน sm -Сан-Маріно sm -Сан-Марино sm -Sint Marin sm -圣马力诺 sm -è–馬力諾 sm -Senegal sn -السنغال sn -Seneqal sn -СÑнÑгал sn -Сенегал sn -সেনেগল sn -Σενεγάλη sn -Senegalo sn -سنگال sn -Senegali sn -Sénégal sn -An tSeineagáil sn -סנגל sn -सेनेगल sn -Szenegál sn -ã‚»ãƒã‚¬ãƒ« sn -សáŸáž“áŸáž áŸ’គាល់ sn -세네갈 sn -ທົ່ວໄປ sn -Senegalas sn -SenegÄla sn -Сенегал sn -Сенегал sn -Senegall sn -ਸੈਨੇਗਾਲ sn -Сенегал sn -Senegali sn -Сенегал sn -சீனேகல௠sn -Синегол sn -เซนีà¸à¸±à¸¥ sn -Сенегал sn -Сенегал sn -SenegÃ¥l sn -塞内加尔 sn -塞內加爾 sn -Somalia so -Somalië so -صومال so -Somali so -Самалі so -Ð¡Ð¾Ð¼Ð°Ð»Ð¸Ñ so -সোমালিয়া so -Somali so -Somalija so -Somàlia so -Somálsko so -Σομαλία so -Somalio so -Somaalia so -سومالی so -Somalie so -Somalie so -An tSomáil so -Somália so -סומליה so -सोमालिया so -Somalija so -Szomália so -Sómalía so -ソマリア so -សូម៉ាលី so -소ë§ë¦¬ì•„ so -ໂລມາເນີຠso -Somalis so -SomÄlija so -Сомалија so -Сомали so -Somalija so -Somalien so -Somalie so -ਸੋਮਾਲੀਆ so -Somália so -Somália so -Сомали so -Somaliya so -Somália so -Somálsko so -Somalija so -Сомалија so -Somalija so -I-Somalia so -சோமாலியா so -Сумалӣ so -โซมาเลีย so -Somali so -Сомалі so -Сомали so -Somaleye so -索马里 so -索馬利亞 so -Suriname sr -سورينام sr -Surinam sr -Сурынам sr -Суринам sr -সà§à¦°à¦¿à¦¨à¦¾à¦® sr -Surinam sr -Surinam sr -Surinam sr -Swrinam sr -Surinam sr -ΣουÏινάμ sr -Surinamo sr -Surinam sr -Surinam sr -سورینام sr -Surinam sr -Suranam sr -סורינ×× sr -सूरीनाम sr -Surinam sr -Súrínam sr -スリナム sr -ស៊ូរីណាមី sr -수리남 sr -ເຊີເບີຠsr -Surinamas sr -Surinama sr -Суринам sr -Суринам sr -Surinam sr -Surinam sr -Surinam sr -Surinam sr -ਸੂਰੀਨਾਮੀ sr -Surinam sr -Surinam sr -Суринам sr -Surinamu sr -Surinam sr -Surinam sr -Surinam sr -Суринам sr -Surinam sr -Surinam sr -சà¯à®°à®¿à®¨à¯‡à®®à¯ sr -Суринам sr -ซูรีนามิ sr -Surinam sr -Surinam sr -Сурінам sr -Суринам sr -è‹é‡Œå— sr -è˜‡åˆ©å— sr -Sao Tome and Principe st -Sao Tome en Principe st -ساو تومي Ùˆ البرنسيب st -Sao Tome vÉ™ Principe st -Сан-Ð¢Ð°Ð¼Ñ Ñ– ПрынÑіпі st -Сао Томе и ПринÑипи st -সাও টোম à¦à¦¬à¦‚ পà§à¦°à¦¿à¦¨à§à¦¸à¦¿à¦ª st -Sao Tome ha Principe st -Sao Tome i Principe st -Sao Tome i Principe st -Sao Tome a Principe st -Ynysoedd Sao Tome a Principe st -Sao Tomé og Principe st -Sao Tome und Principe st -Σάο Τομέ και ΠÏίνσιπε st -Sao-Tomeo kaj Principeo st -Sao Tome y Príncipe st -Sao Tome ja Principe st -Sao Tome eta Principe st -سائوتومه Ùˆ پرینسیپه st -São Tomé ja Príncipe st -Sao Tomé et Principe st -Sao Tome en Principe st -São Tomé agus Príncipe st -Santo Tomé e Príncipe st -साओ टोम तथा पà¥à¤°à¤¿à¤‚सिपी st -Sv. Toma i Princip st -Sao Tome és Principe st -Saó Tóme og Prinsípe st -São Tomé e Príncipe st -サントメプリンシペ st -ìƒíˆ¬ë©” 프린시페 st -ບà»àº¥àº´àºàº²àº™ st -Santome un Prinsipi st -Сао Томе и ПринÑипе st -Сао Ð¢Ð¾Ð¼Ñ Ð±Ð° Принцип st -Sao Tome u Principe st -São Tomé og Príncipe st -São Tomé un Príncipe st -Sao Tome en Principe st -São Tomé og Príncipe st -ਸਾਓ ਟੋਮੀ ਤੇ ਪਰੀਸਿਪੀ st -Sao Tome i Principe st -São Tomé and Príncipe st -São Tome e Príncipe st -Sao Tome ÅŸi Principe st -Сан-Томе и ПринÑипи st -Sawo Tome na Purencipe st -São Tomé ja Príncipe st -Sao Tome a Principe st -Sao Tome in Principe st -Св. Тома и Принцип st -Sv. Toma i Princip st -São Tomé och Príncipe st -சயோ டோம௠மறà¯à®±à¯à®®à¯ பிரினà¯à®¸à®¿à®ªà®¿ st -Синт Том ва ПринÑип st -ซาวโทม à¹à¸¥à¸° พรินซิป st -Sao Tome ve Principe st -Sao Tome wä Principe st -Сан-Томе Ñ– ПрінÑіпі st -Сан-Томе ва ПринÑипи st -São Tomé et Prince st -圣多美和普林西比 st -è–å¤šç¾ŽåŠæ™®æž—西比 st -El Salvador sv -Ø§Ù„Ø³Ù„ÙØ§Ø¯ÙˆØ± sv -Сальвадор sv -Салвадор sv -à¦à¦² সালভাডোর sv -Ar Salvador sv -Salvador sv -El Salfador sv -Ελ Î£Î±Î»Î²Î±Î½Ï„ÏŒÏ sv -Salvadoro sv -Salvador sv -السالوادور sv -Salvador sv -An tSalvadóir sv -O Salvador sv -×ל סלבדור sv -अल सलà¥à¤µà¤¾à¤¡à¥‹à¤° sv -Salvador sv -エルサルãƒãƒ‰ãƒ« sv -អែលសាល់វ៉ាឌáŸážš sv -엘살바ë„르 sv -ເອລຊັນວາດດ໠sv -Salvadoras sv -Salvadora sv -Ел Салвадор sv -Эл Салвадор sv -ਈਲ ਸਾਲਵੇਡੋਰ sv -Salwador sv -Salvador sv -Сальвадор sv -Eli Salivadoro sv -Salvádor sv -Salvador sv -Ел Салвадор sv -I-El Salvador sv -எல௠சாலà¯à®µà®Ÿà¯‹ ர௠sv -Ðл Салвадур sv -เอลซัลวาดอร์ sv -Ель-Сальвадор sv -Салвадор sv -è¨å°”瓦多 sv -薩爾瓦多 sv -Syria sy -Sirië sy -سوريا sy -SuriyÉ™ sy -Ð¡Ñ‹Ñ€Ñ‹Ñ sy -Ð¡Ð¸Ñ€Ð¸Ñ sy -সিরিয়া sy -Siri sy -Sirija sy -Síria sy -Sýrie sy -Syrien sy -Syrien sy -ΣυÏία sy -Sirio sy -Siria sy -Süüria sy -Siria sy -سوریه sy -Syyria sy -Syrie sy -Syrië sy -An tSiria sy -Síria sy -סוריה sy -सीरिया sy -Sirija sy -Szíria sy -Sýrland sy -Siria sy -シリア sy -ស៊ីរី sy -시리아 sy -ເຊີເບີຠsy -Sirija sy -SÄ«rija sy -Сирија sy -Сири sy -Siria sy -Syrien sy -Syrië sy -ਸੀਰੀਆ sy -Síria sy -Síria sy -Siria sy -Ð¡Ð¸Ñ€Ð¸Ñ sy -Siriya sy -Sýria sy -Sirija sy -Сирија sy -Sirija sy -I-Syria sy -Syrien sy -சிரியா sy -Ð¡ÑƒÑ€Ð¸Ñ sy -ซีเรีย sy -Suriye sy -Süriä sy -Ð¡Ð¸Ñ€Ñ–Ñ sy -Ð¡ÑƒÑ€Ð¸Ñ sy -Sireye sy -å™åˆ©äºš sy -敘利亞 sy -Swaziland sz -Swasiland sz -سوازيلاند sz -Svaziland sz -СвазылÑнд sz -Свазиленд sz -সোয়াজিলà§à¦¯à¦¾à¦£à§à¦¡ sz -Svazilend sz -Neozelàndia sz -Gwlad y Swasi sz -Swasiland sz -Σουαζιλάνδη sz -Svazilando sz -Swazilandia sz -Svaasimaa sz -Swazilandia sz -سووازیلند sz -Swazimaa sz -An tSuasalainn sz -Suacilándia sz -סוו×זילנד sz -सà¥à¤µà¤¾à¤œà¥€à¤²à¥ˆà¤‚ड sz -Svazilend sz -Szváziföld sz -Svasíland sz -スワジランド sz -ស្វាហ្ស៊ីឡង់ sz -스와질란드 sz -ລາດສະນາຈັàºà»„ທຠsz -Svazilenda sz -Свазиленд sz -Свациланд sz -Sważilandja sz -Swasiland sz -ਸਵਾਜ਼ੀਲੈਂਡ sz -Suazi sz -Suazilândia sz -Suazilândia sz -Suaziland sz -Свазиленд sz -Swazilande sz -Swazijsko sz -Svazi sz -Свазиленд sz -Svazilend sz -ஸà¯à®µà®¾à®šà®¿à®²à®¾à®©à¯à®Ÿà¯ sz -Свозиланд sz -สวาซิà¹à¸¥à¸™à¸”์ sz -Свазіленд sz -Свазиленд sz -Suwazilande sz -æ–¯å¨å£«å…° sz -å²ç“¦æ¿Ÿè˜­ sz -Turks and Caicos Islands tc -Turks en Caicos Eilande tc -جزر الترك Ùˆ الكايكوس tc -Türk vÉ™ Caicos Adaları tc -ÐÑтравы ТÑÑ€ÐºÑ Ñ– ÐšÐ°Ð¹ÐºÐ°Ñ tc -ОÑтрови Ð¢ÑŠÑ€ÐºÑ Ð¸ ÐšÐ°Ð¹ÐºÐ¾Ñ tc -টারà§à¦•স à¦à¦¬à¦‚ কাইকোস দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ tc -Inizi Turks ha Kaikos tc -Turks i Kaikos ostrva tc -Illes Turks i Caicos tc -Turks a Caicos ostrovy tc -Ynysoedd Twrc a Chaicos tc -Turks- og Caicosøerne tc -Turks- und Caicos-Inseln tc -Îήσοι ΤεÏκς και Κάικος tc -Turkoj kaj Kajkoj tc -Islas Turcos y Caicos tc -Turks ja Caicos tc -Turks eta Caicos Irlak tc -جزایر تورکس Ùˆ کایکوس tc -Turks- ja Caicos-saaret tc -ÃŽles Turks et Caicos tc -Turks en Caicos Eilânen tc -Na hOileáin Turks agus Caicos tc -Illas Caicos e Turks tc -××™×™ ×§×יקוס וטורקס tc -तà¥à¤°à¥à¤• तथा कैकोस आइलैंड tc -Turks i Caicos otoÄje tc -Turks- és Caicos-szigetek tc -Turks- og Caicos-eyjar tc -Isole Turks e Caicos tc -英領タークス諸島 カイコス諸島 tc -កោះ​ទួក និង​ កៃកូស tc -í„°í¬ìФ ì¼€ì´ì»¤ìФ ì œë„ tc -TÄ“rksa un Kaikosa tc -ОÑтрови Турк и ÐšÐ°Ð¸ÐºÐ¾Ñ tc -Турк ба Кайкогийн арлууд tc -Gżejjer Turks u Caicos tc -Turks- og Caicosøyene tc -Turks- un Caicosinseln tc -Turks en Caicos Eilanden tc -Turks- og Caicosøyane tc -ਤà©à¨°à¨•ਸ ਤੇ ਕਾਇਕੋਸ ਟਾਪੂ tc -Wyspy Turks i Caicos tc -Ilhas Turks e Caicos tc -Ilhas Caicos e Turca tc -Insulele Turks ÅŸi Caicos tc -ОÑтрова Ð¢ÐµÑ€ÐºÑ Ð¸ ÐšÐ°Ð¹ÐºÐ¾Ñ tc -Ibirwa bya Turike na Kayikosi tc -Turks- ja Kaikossullot tc -Turks a Caicos ostrovy tc -Otoka Turks in Caicos tc -Турка и Кајкошка оÑтрва tc -Turka i KajkoÅ¡ka ostrva tc -Turks- och Caicosöarna tc -தà¯à®°à¯à®•à¯à®•ிகள௠மறà¯à®±à¯à®®à¯ காயà¯à®•ோஸ௠தீவà¯à®•ள௠tc -Ҷазираи Турк ва ÐšÐ¾Ð¹ÐºÑƒÑ tc -เà¸à¸²à¸°à¸”ติร์à¸à¹à¸¥à¸°à¹€à¸„คอส tc -Turks ve Caicos Adaları tc -Türks wä Caicos Utrawları tc -ОÑтрови Ð¢ÐµÑ€ÐºÑ Ñ– ÐšÐ°Ð¹ÐºÐ¾Ñ tc -Ð¢ÑƒÑ€ÐºÑ Ð²Ð° ÐšÐ°Ð¸ÐºÐ¾Ñ ÐžÑ€Ð¾Ð»Ð»Ð°Ñ€Ð¸ tc -Quần đảo Turks và Caicos tc -Iyes Turks et Caicos tc -特克斯和凯科斯群岛 tc -åœŸå…‹æ–¯å’Œé–‹å¡æ–¯ç¾¤å³¶ tc -Chad td -تشاد td -Çad td -Чад td -Чад td -চà§à¦¯à¦¾à¦¡ td -Tchad td -ÄŒad td -Txad td -ÄŒad td -Tsiad td -Tchad td -Tschad td -Τσαντ td -Ĉado td -TÅ¡aad td -Txad td -چاد td -Tchad td -Tsjaad td -Sead td -Chade td -צ'×ד td -चाड td -Äad td -Csád td -Tsjad td -Ciad td -ãƒãƒ£ãƒ‰ td -ឆាដ td -차드 td -ເàºàº¡à»„ພ່ td -ÄŒada td -Чад td -Чад td -ÄŠad td -Tsjad td -Tschad td -Tsjaad td -Tsjad td -ਚਾਂਦ td -Czad td -Chade td -Chade td -Ciad td -Чад td -Cade td -ÄŒad td -ÄŒad td -ÄŒad td -Чад td -ÄŒad td -Tchad td -சாட௠td -Чод td -ชาด td -Çad td -Çad td -Чад td -Чад td -Tchad td -ä¹å¾— td -查德 td -Togo tg -توغو tg -Тога tg -Того tg -টোগো tg -Τόγκο tg -توگو tg -Tógó tg -טוגו tg -टोगो tg -Tógó tg -トーゴ tg -ážáž¼áž áŸ’គោ tg -토고 tg -ຂອງເລ່ນສະນຸຠtg -Того tg -Того tg -ਤੋਗੋ tg -Того tg -Того tg -டோகோ tg -Того tg -โตโภtg -Того tg -Того tg -多哥 tg -多哥 tg -Thailand th -تايلاند th -Tayland th -ТайлÑнд th -Тайланд th -থাইলà§à¦¯à¦¾à¦£à§à¦¡ th -Tajland th -Tailàndia th -Thajsko th -Gwlad y Tai th -Ταϊλάνδη th -Tajlando th -Tailandia th -Tai th -Thailandia th -تایلند th -Thaimaa th -Tailand th -Thaïlande th -Thailân th -An Téalainn th -Tailándia th -ת×ילנד th -थाइलैंड th -Tajland th -Thaiföld th -Taíland th -Tailandia th -タイ th -ážáŸƒ th -태국 th -ລາດສະນາຈັàºà»„ທຠth -Tailandas th -Taizeme th -Тајланд th -Тайланд th -Tajlandja th -Tailandia th -ਥਾਈਲੈਂਡ th -Tajlandia th -Tailândia th -Tailândia th -Tailanda th -Таиланд th -Tayilande th -Thajsko th -Tajska th -Тајланд th -Tajland th -I-Thailand th -தாயà¯à®²à®¾à®¨à¯à®¤à¯ th -Тойлонд th -ราชอาณาจัà¸à¸£à¹„ทย th -Tayland th -Tayland th -Таїланд th -Таиланд th -Thái Lan th -Taylande th -泰国 th -泰國 th -Tajikistan tj -طاجيكستان tj -Tacikistan tj -ТаджыкіÑтан tj -ТаджикиÑтан tj -তাজিকিসà§à¦¤à¦¾à¦¨ tj -Tadjikistan tj -Tadžikistan tj -Tadjikistan tj -Tádžikistán tj -Tajicistan tj -Tadschikistan tj -Τατζικιστάν tj -TaÄikujo tj -Tajikistán tj -Tadžikistan tj -تاجیکستان tj -Tadjikistan tj -An Táidsíceastáin tj -Taxiquistán tj -טג'קיסטן tj -ताजिकिसà¥à¤¤à¤¾à¤¨ tj -Tadžikistan tj -Tadzsikisztán tj -Tadsjikistan tj -Tagikistan tj -タジキスタン tj -ážáž¶áž áŸ’ស៊ីគីស្ážáž„់ tj -타지키스탄 tj -ໃຕ້ຫວັນ tj -Tadžikistanas tj -TadžikistÄna tj -ТаџикиÑтан tj -ТажикÑтан tj -TaÄ¡ikistan tj -Tadsjikistan tj -Tadschikistan tj -Tadjikistan tj -Tadsjikistan tj -ਤਜ਼ਾਕਸਤਾਨ tj -Tadżykistan tj -Tajiquistão tj -Tajiquistão tj -ТаджикиÑтан tj -Tajikisitani tj -Tažikistan tj -Tadžikistan tj -Tadžikistan tj -ТаџикиÑтан tj -Tadžikistan tj -Tadzjikistan tj -தஜிகிஸà¯à®¤à®¾à®©à¯ tj -ТоҷикиÑтон tj -ธาจีà¸à¸´à¸ªà¸–าน tj -Tacikistan tj -Tajıqstan tj -ТаджикиÑтан tj -ТожикиÑтон tj -Tadjikistan tj -å¡”å‰å…‹æ–¯å¦ tj -å¡”å‰å…‹ tj -Tokelau tk -توكيلاو tk -Такелау tk -Токело tk -টোকেলো tk -Tokelo tk -Tocelaw tk -Τοκελάου tk -Tokelao tk -توکلائو tk -Na hOileáin Tócala tk -טוקל×ו tk -तोकेलाऊ tk -Tókelá tk -ニュージーランド自治領トケラウ tk -ážáž¼áž€áŸáž¡áž¼ tk -토켈로 tk -ເບລາລັສ tk -Токелау tk -Токелау tk -Tokelaw tk -ਤੋਕੀਲਾਉ tk -Токелау tk -Tokelawu tk -Токелау tk -டோகேலா tk -Токилау tk -โทเคเลา tk -Tokelauça tk -Токелау tk -Токелау tk -托克劳 tk -托克勞 tk -Turkmenistan tm -تركمانستان tm -TürkmÉ™nistan tm -ТуркмÑніÑтан tm -ТуркмениÑтан tm -তà§à¦°à§à¦•মেনিসà§à¦¤à¦¾à¦¨ tm -Turcmenistan tm -Turkmenistán tm -Twrcmenistan tm -ΤουÏκμενιστάν tm -Turkmenujo tm -Turkmenistán tm -Türkmenistan tm -ترکمنستان tm -Turkménistan tm -An Tuircméanastáin tm -Turkmenistán tm -טורקמניסטן tm -तà¥à¤°à¥à¤•मेनिसà¥à¤¤à¤¾à¤¨ tm -Türkmenisztán tm -Túrkmenistan tm -トルクメニスタン tm -ទួគមáŸáž“ីស្ážáž„់ tm -투르í¬ë©”니스탄 tm -ຕຸລະàºàºµ tm -TurkmenistÄna tm -ТуркмениÑтан tm -ТуркменÑтан tm -ਤà©à¨°à¨•ੇਮਸਤਾਨ tm -Turquemenistão tm -Turcomenistão tm -Turcmenistan tm -ТуркмениÑтан tm -Turikimenisitani tm -ТуркмениÑтан tm -தà¯à®°à¯à®•à¯à®®à¯†à®©à®¿à®¸à¯à®¤à®¾à®©à¯ tm -ТуркманиÑтон tm -เตอร์à¸à¹€à¸¡à¸™à¸´à¸ªà¸–าน tm -Türkmenistan tm -ТуркменіÑтан tm -ТуркманиÑтон tm -Turcmenistan tm -åœŸåº“æ›¼æ–¯å¦ tm -土庫曼 tm -Tunisia tn -Tunisië tn -تونس tn -Tunis tn -Ð¢ÑƒÐ½Ñ–Ñ tn -Ð¢ÑƒÐ½Ð¸Ñ tn -টিউনিসিয়া tn -Tunizi tn -Tunis tn -Tunísia tn -Tunisko tn -Tiwnisia tn -Tunesien tn -Tunesien tn -Τυνησία tn -Tunizio tn -Túnez tn -Tuneesia tn -تونس tn -Tunesia tn -Tunisie tn -Tunisie tn -An Túinéis tn -Túnez tn -תוניסיה tn -टà¥à¤¯à¥‚नीशिया tn -Tunis tn -Tunézia tn -Túnis tn -ãƒãƒ¥ãƒ‹ã‚¸ã‚¢ tn -ទុយនáŸážŸáŸŠáž¸ tn -튀니지 tn -ລັດເຊີຠtn -Tunisas tn -Tunisija tn -Ð¢ÑƒÐ½Ð¸Ñ tn -Ð¢ÑƒÐ½Ð¸Ñ tn -Tuneżija tn -Tunesien tn -Tunisie tn -ਟà©à¨¨à©€à¨¶à©€à¨† tn -Tunezja tn -Tunísia tn -Tunísia tn -Ð¢ÑƒÐ½Ð¸Ñ tn -Tuniziya tn -Tunisko tn -Tunizija tn -Ð¢ÑƒÐ½Ð¸Ñ tn -Tunis tn -I-Tunisia tn -Tunisien tn -தà¯à®©à®¿à®šà®¿à®¯à®¾ tn -Ð¢ÑƒÐ½Ð¸Ñ tn -ตูนีเซีย tn -Tunus tn -Ð¢ÑƒÐ½Ñ–Ñ tn -Ð¢ÑƒÐ½Ð¸Ñ tn -Tunizeye tn -çªå°¼æ–¯ tn -çªå°¼è¥¿äºž tn -Tonga to -تونغا to -Tonqa to -Тонга to -Тонга to -টোংগা to -Inizi Tonga to -Τόνγκα to -Tongo to -تونگو to -טונגה to -टोंगा to -トンガ to -ážáž»áž„ហ្គោ to -통가 to -ໂຊນາ to -Тонга to -Тонга to -ਟਾਂਗਾ to -Тонга to -Тонга to -டோஙà¯à®•ா to -Тонго to -ตองà¸à¹‰à¸² to -Тонга to -Тонга to -汤加 to -æ±åŠ  to -East Timor tp -Oos Timor tp -تيمور الشرقية tp -Şərqi Timor tp -УÑходні Тымор tp -Източен Тимор tp -পূরà§à¦¬ টিমর tp -Timor reter tp -IstoÄni Timor tp -Timor Est tp -Východní Timor tp -Dwyrain Timor tp -Østtimor tp -Ost-Timor tp -Ανατολικό Î¤Î¹Î¼ÏŒÏ tp -Orienta Timoro tp -Timor oriental tp -Ida-Timor tp -Ekialdeko Timor tp -تیمور شرقی tp -Itä-Timor tp -Timor oriental tp -Oost Timor tp -Tíomór Thoir tp -Timor do Leste tp -מזרח טימור tp -पूरà¥à¤µà¥€ तिमोर tp -IstoÄni Timor tp -Kelet-Timor tp -Austur-Tímor tp -Timor Est tp -æ±ãƒ†ã‚£ãƒ¢ãƒ¼ãƒ« tp -ទីមáŸážšâ€‹ážáž¶áž„​កើហtp -ë™í‹°ëª¨ë¥´ tp -ວັນà»àº¥àº°à»€àº§àº¥àº² tp -Rytų Timoras tp -Austrumtimora tp -ИÑточен Тимор tp -Зүүн тимор tp -Timor Timur tp -Timor tal-Lvant tp -Øst-Timor tp -Oosttimor tp -Oost Timor tp -Aust-Timor tp -ਪੂਰਬੀ ਤਾਮੋਰ tp -Timor Wschodni tp -Timor Leste tp -Timor Leste tp -Timorul de Est tp -ВоÑточный Тимор tp -Timoro y'Uburasirazuba tp -Nuorta-Timor tp -Východný Timor tp -Vzhodni Timor tp -ИÑточни Тимор tp -IstoÄni Timor tp -Östtimor tp -கிழகà¯à®•௠திமார௠tp -Тимури Шарқ tp -ติมอร์ตะวันออภtp -DoÄŸu Timur tp -Çığış Timor tp -Східний Тімор tp -Шарқий Тимур tp -Äông Timo tp -Timor Ess tp -ä¸œå¸æ±¶ tp -æ±å¸æ±¶ tp -Turkey tr -Turkeye tr -تركيا tr -TürkiyÉ™ tr -Ð¢ÑƒÑ€Ñ†Ñ‹Ñ tr -Ð¢ÑƒÑ€Ñ†Ð¸Ñ tr -তà§à¦°à§à¦•à§€ tr -Turkia tr -Turska tr -Turquia tr -Turecko tr -Twrci tr -Tyrkiet tr -Türkei tr -ΤουÏκία tr -Turkujo tr -Turquía tr -Türgi tr -Turkia tr -ترکیه tr -Turkki tr -Turkaland tr -Turquie tr -Turkije tr -An Tuirc tr -Turquia tr -טורקיה tr -तà¥à¤°à¥à¤•ी tr -Turska tr -Törökország tr -Turki tr -Tyrkland tr -Turchia tr -トルコ tr -ទួរគី tr -터키 tr -ຕຸລະàºàºµ tr -Turkija tr -Turcija tr -Турција tr -Турк tr -Turki tr -Turkija tr -Tyrkia tr -Törkei tr -Turkije tr -Tyrkia tr -Turquia tr -ਤà©à¨°à¨•à©€ tr -Turcja tr -Turquia tr -Turquia tr -Turcia tr -Ð¢ÑƒÑ€Ñ†Ð¸Ñ tr -Turukiya tr -Durka tr -Turecko tr -TurÄija tr -ТурÑка tr -Turska tr -I-Turkey tr -Turkiet tr -தà¯à®°à¯à®•à¯à®•ி tr -Туркиё tr -ตุรà¸à¸µ tr -Türkiye tr -Törkiä tr -Туреччина tr -Ð¢ÑƒÑ€ÐºÐ¸Ñ tr -Thổ NhÄ© Kì tr -Turkeye tr -土耳其 tr -土耳其 tr -Trinidad and Tobago tt -Trinidad en Tobago tt -ترينيداد Ùˆ توباغو tt -Trinidad vÉ™ Tabaqo tt -Трынідад Ñ– Табага tt -Тринидад и Тобаго tt -তà§à¦°à¦¿à¦¨à¦¿à¦¦à¦¾à¦¦ à¦à¦¬à¦‚ টোবাগো tt -Trinidad ha Tobago tt -Trinidad i Tobago tt -Trinidad i Tobago tt -Trinidad a Tobago tt -Ynysoedd Trinidad a Thobago tt -Trinidad og Tobago tt -Trinidad und Tobago tt -ΤÏίνινταντ και Τομπάγκο tt -Trinidado kaj Tobago tt -Trinidad y Tobago tt -Trinidad ja Tobago tt -Trinidad eta Tobago tt -ترینیداد Ùˆ ØªÙØ¨Ø§Ú¯Ùˆ tt -Trinidad ja Tobago tt -Trinidad og Tobago tt -Trinidad et Tobago tt -Trinidad en Tobago tt -Oileán na Tríonóide agus Tobága tt -Trinidade e Tobago tt -טרינידד וטובגו tt -टà¥à¤°à¤¿à¤¨à¤¿à¤¡à¤¾à¤¡ और टोबैगो tt -Trinidad i Tobago tt -Trinidad és Tobago tt -Trinidad dan Tobago tt -Trínidad og Tóbagó tt -Trinidad e Tobago tt -トリニダードトãƒã‚³ tt -ទ្រីនីដាដ និង​​ ážáž¼áž”ាហ្គោ tt -트리니다드 토바고 tt -ຕີນິà»àº”ດà»àº¥àº°à»‚ທບາໂຠtt -Trinidadas ir Tobagas tt -Trinidada un Tobago tt -Тринидад и Тобаго tt -Тринида ба Тобаго tt -Trinidad dan Tobago tt -Trinidad u Tobago tt -Trinidad og Tobago tt -Trinidad un Tobago tt -Trinidad en Tobago tt -Trinidad og Tobago tt -Trinidad le Tobago tt -Trinidad e Tobago tt -ਤਰੀਨੀਡਾਡ ਤੇ ਤੋਬਾਗੋ tt -Trinidad i Tobago tt -Trindade e Tobago tt -Trinidad e Tobago tt -Trinidad ÅŸi Tobago tt -Тринидад и Тобаго tt -Tirinida na Tobago tt -Trinidad ja Tobago tt -Trinidad a Tobago tt -Trinidad in Tabago tt -Тринидад и Тобаго tt -Trinidad i Tobago tt -I-Trinidad kanye neTobago tt -Trinidad och Tobago tt -டà¯à®°à®¿à®©à®¿à®Ÿà®¾à®Ÿà¯ & டொபாகோ tt -Туриндод ва Тубогу tt -ตรีนิà¹à¸”ดà¹à¸¥à¸°à¹‚ทบาโภtt -Trinidad veTabago tt -Trinidad wä Tobago tt -РеÑпубліка Трінідад та Тобаго tt -Тринидад ва Тобаго tt -Trinidad na Tobago tt -Trinidad và Tobago tt -Trinité et Tobago tt -Trinidad ne Tobago tt -特立尼达和多巴哥 tt -åƒé‡Œé”åŠæ‰˜è²å“¥ tt -Trinidad knaye ne-Tobago tt -Tuvalu tv -ØªÙˆÙØ§Ù„Ùˆ tv -Тувалу tv -Тувалу tv -টà§à¦­à¦¾à¦²à§ tv -Twfalw tv -Î¤Î¿Ï…Î²Î±Î»Î¿Ï tv -Tuvalo tv -توالو tv -טוב×לו tv -तà¥à¤µà¤¾à¤²à¥‚ tv -Túvalú tv -ツãƒãƒ« tv -ទុយវ៉ាលុយ tv -투발루 tv -ຊູລູ tv -Тувалу tv -Тувалу tv -ਤà©à¨µà¨¾à¨²à©‚ tv -Тувалу tv -Тувалу tv -தà¯à®µà®²à¯ tv -Тувалу tv -ตูวาลู tv -Tuvaluça tv -Тувалу tv -Тувалу tv -Touvalou tv -å›¾ç“¦å¢ tv -å瓦魯 tv -Taiwan tw -تايوان tw -Tayvan tw -Тайвань tw -Тайван tw -তাইওয়ান tw -Tajvan tw -Ταϊβάν tw -Tajvano tw -Taiwán tw -تایوان tw -Taivan tw -Taïwan tw -An Téaváin tw -Taiwán tw -טיוו×ן tw -ताईवान tw -Tajvan tw -Tajvan tw -Taívan tw -å°æ¹¾ tw -ážáŸƒážœáŸ‰áž¶áž“់ tw -대만 tw -ໃຕ້ຫວັນ tw -Taivanis tw -TaivÄna tw -Тајван tw -Тайван tw -Tajwan tw -ਤਾਈਵਾਨ tw -Tajwan tw -Formosa tw -Taivan tw -Тайвань tw -Tayiwani tw -Tajvan tw -Тајван tw -Tajvan tw -I-Taiwan tw -தாயà¯à®µà®¾à®©à¯ tw -Тойвон tw -ไต้หวัน tw -Tayvan tw -Taywan tw -Тайвань tw -Тайван tw -Äài Loan tw -䏭国尿¹¾ tw -å°ç£ tw -Tanzania, United Republic of tz -Tanzanië, Vereenigde Republiek van tz -جمهورية تنزانيا المتحدة tz -Tanzaniya tz -Ð—Ð»ÑƒÑ‡Ð°Ð½Ð°Ñ Ð ÑÑпубліка Ð¢Ð°Ð½Ð·Ð°Ð½Ñ–Ñ tz -Ð¢Ð°Ð½Ð·Ð°Ð½Ð¸Ñ tz -তানজানিয়া tz -Tanzanija, Ujedinjena Republika tz -Tanzània, República Unida de tz -Tanzánie tz -Tansania, Gweriniaeth Unedig tz -Tanzania tz -Tansania, vereinigte Republik tz -Τανζανία, Ενωμένη δημοκÏατία της tz -Tanzanio, UnuiÄinta Respubliko de tz -Tanzania, Republica de tz -Tansaania tz -Tanaziar Errepublika Batua tz -جمهوری متحده تانزانیا tz -Tansanian yhdistäytynyt tasavalta tz -Tanzanie, République unie de tz -Tanzanië, Ferienigd republyk fan tz -An Tansáin tz -República Unida de Tanzánia tz -טנזניה, הרפובליקה המ×וחדת של tz -तंजानिया यूनाइटेड रिपबà¥à¤²à¤¿à¤• tz -Ujedinjena Republika Tanzanija tz -Tanzánia tz -Tansanía tz -Tanzania tz -タンザニア,共和国連邦 tz -ážáž„់ហ្សានី tz -탄ìžë‹ˆì•„ 합중국 tz -ໂດມິນິàºàº±àº™ tz -Tanzanijos Respublika tz -TanzÄnija tz -Танзанија, Обединета Република tz -Танканы нÑгдÑÑн ÑƒÐ»Ñ tz -Republik Bersatu Tanzania tz -Tanżania tz -Tanzania tz -Tansania tz -Tanzania, Verenigde republiek van tz -Tanzania tz -ਤਾਨਜ਼ੂਈਆ, ਸੰਯà©à¨•ਤ ਗਣਰਾਜ tz -Zjednoczna Republika Tanzanii tz -República da União da Tanzânia tz -República da Tanzânia tz -Tanzania, Republica Unită tz -Ð¢Ð°Ð½Ð·Ð°Ð½Ð¸Ñ tz -Tanzaniya, Repubulika Yunze Ubumwe ya tz -Tanzania tz -Tanzánia, Spojená republika tz -Tanzanija, Združena republika tz -Танзанија, Уједињена Република tz -Tanzanija, Ujedinjena Republika tz -Förenade republiken Tanzania tz -டானà¯à®œà®¾à®¨à®¿à®¯à®¾, à®à®•à¯à®•ிய கà¯à®Ÿà®¿à®¯à®°à®šà¯ tz -Ҷумҳурии Муттаҳидаи Тонзониё tz -สาธารณรัà¸à¹à¸—นซาเนีย tz -Tanzanya tz -Tanzania, Berläşkän Cömhüriätläre tz -ТанзаніÑ, об'єднана реÑпубліка tz -Ð¢Ð°Ð½Ð·Ð°Ð½Ð¸Ñ Ð‘Ð¸Ñ€Ð»Ð°ÑˆÐ³Ð°Ð½ РеÑпубликаÑи tz -Tanzania, Cá»™ng hoà thống nhât tz -Tanzaneye tz -妿¡‘尼亚è”åˆå…±å’Œå›½ tz -å¦å°šå°¼äºž tz -Ukraine ua -Ukraïne ua -أوكرانيا ua -Ukrayna ua -Украіна ua -Украйна ua -ইউকà§à¦°à§‡à¦¨ ua -Ukraina ua -Ukrajina ua -Ucraïna ua -Ukrajina ua -Wcr?in ua -ΟυκÏανία ua -Ukrainio ua -Ucrania ua -Ukraina ua -Ukrania ua -اکراین ua -Ukraina ua -Ukraina ua -Oekraïne ua -An Úcráin ua -Ucrania ua -×וקר××™× ×” ua -उकà¥à¤°à¥‡à¤¨ ua -Ukrajina ua -Ukrajna ua -Ukraina ua -Úkraína ua -Ucraina ua -ウクライナ ua -អ៊ុយក្រែន ua -ìš°í¬ë¼ì´ë‚˜ ua -àºàº¹à»€àº„ຣນ ua -Ukraina ua -Ukraina ua -Украина ua -Украйн ua -Ukranja ua -Ukraina ua -Oekraïne ua -Ukraina ua -Ucraina ua -ਯੂਕਰੇਨ ua -Ukraina ua -Ucrânia ua -Ucrânia ua -Ucraina ua -Украина ua -Ukerene ua -Ukraina ua -Ukrajina ua -Ukrajina ua -Украјина ua -Ukrajina ua -I-Ukraine ua -Ukraina ua -உகà¯à®°à¯†à®¯à¯à®©à¯ ua -Украина ua -ยูเครน ua -Ukrayna ua -Ukrain ua -Україна ua -Украина ua -Ukraina ua -Oucrinne ua -乌克兰 ua -çƒå…‹è˜­ ua -Uganda ug -أوغندا ug -Uqanda ug -Уганда ug -Уганда ug -ইউগাণà§à¦¡à¦¾ ug -Ouganda ug -Wganda ug -Ουγκάντα ug -Ugando ug -اوگاندا ug -Ouganda ug -×וגנדה ug -उगांडा ug -Úganda ug -ウガンダ ug -អ៊ូហ្គង់ដា ug -우간다 ug -à»àºžàº™àº”້າ ug -Уганда ug -Уганда ug -ਯੂਗਾਂਡਾ ug -Уганда ug -Уганда ug -உகானà¯à®Ÿà®¾ ug -Угондо ug -ยูà¸à¸±à¸™à¸”า ug -Уганда ug -Уганда ug -Ouganda ug -乌干达 ug -çƒå¹²é” ug -United States of America us -Vereenigde State van Amerika us -الولايات المتحدة الأمريكية us -Amerika BirləşmiÅŸ Åžtatları us -Ð—Ð»ÑƒÑ‡Ð°Ð½Ñ‹Ñ Ð¨Ñ‚Ð°Ñ‚Ñ‹ ÐмÑрыкі us -СÐЩ us -মারà§à¦•িন যà§à¦•à§à¦¤à¦°à¦¾à¦·à§à¦Ÿà§à¦° us -Stadoù-Unanet Amerika us -Sjedinjene AmeriÄke Države us -Estats Units d'Amèrica us -Spojené státy americké us -Unol Daleithau America us -USA us -USA us -Ηνωμένες Πολιτείες της ΑμεÏικής us -Usono us -Estados Unidos de América us -Ameerika Ühendriigid us -Ameriketako Estatu Batuak us -ایالات متحده‌ی آمریکا us -Yhdysvallat us -Sambandsríki Amerika (USA) us -États Unis d'Amérique us -Ferienigde Staten fan Amerika us -Stáit Aontaithe Mheiriceá us -Estados Unidos de América us -×רצות הברית us -संयà¥à¤•à¥à¤¤ राजà¥à¤¯ अमेरिका us -Sjedinjene AmeriÄke Države us -Amerikai Egyesült Ãllamok us -Amerika Serikat us -Bandaríkin us -Stati Uniti d'America us -アメリカåˆè¡†å›½ us -សហរដ្ឋអាមáŸážšáž·áž€ us -미 합중국 us -ສະຫະລັດອາເມລິàºàº² us -JungtinÄ—s Amerikos Valstijos us -Amerikas SavienotÄs Valstis us -Соединети ÐмериканÑки Држави us -ÐÐУ us -Amerika Syarikat us -Stati Uniti us -USA us -Vereenigte Staten vun Amerika us -Verenigde Staten van Amerika us -USA us -Estats Units d'Amèrica us -ਸੰਯà©à¨•ਤ ਰਾਜ ਅਮਰੀਕਾ us -Stany Zjednoczone Ameryki us -Estados Unidos da América us -Estados Unidos da América us -Statele Unite ale Americii us -Соединённые Штаты Ðмерики us -Leta Zunze Ubumwe z'Amerika us -Amerihká ovttastuvvan stáhtat us -USA us -Združene države Amerike us -Сједињене америчке државе us -Sjedinjene ameriÄke države us -I-United States of America us -Amerikas förenta stater us -à®à®•à¯à®•ிய அமெரிகà¯à®•ா us -Иёлоти Муттаҳидаи Ðмрико us -สหรัà¸à¸­à¹€à¸¡à¸£à¸´à¸à¸² us -Amerika BirleÅŸik Devletleri us -Amerika QuÅŸma Åžtatları us -СШРus -Ðмерика Қўшма Штатлари us -mashango o tangananaho a America us -Hợp chá»§ng quốc Hoa Kỳ us -Estats Unis us -United States ye Melika us -美国 us -美利堅åˆçœ¾åœ‹ us -Uruguay uy -الأوروغواي uy -Uruqvay uy -Уругвай uy -Уругвай uy -উরà§à¦—à§à§Ÿà§‡ uy -Urugvaj uy -Uruguai uy -Wrwgw?i uy -ΟυÏουγουάη uy -Urugvajo uy -Uruguai uy -اروگویه uy -Uragua uy -Uruguai uy -×ורוגו××™ uy -उरूगà¥à¤µà¥‡ uy -Urugvaj uy -Úrúgvæ uy -ウルグアイ uy -អ៊ុយរុយហ្គាយ uy -ìš°ë£¨ê³¼ì´ uy -ອຸລຸàºàºàº§àº uy -Urugvajus uy -Urugvaja uy -Уругвај uy -Уругвай uy -Urugwaj uy -Uruguai uy -ਉਰੂਗਵੇ uy -Urugwaj uy -Uruguai uy -Uruguai uy -Uruguai uy -Уругвай uy -Irigwe uy -Uruguaj uy -Urugvaj uy -Уругвај uy -Urugvaj uy -I-Uruguay uy -உரà¯à®•à¯à®µà¯‡ uy -Уругвай uy -อุรุà¸à¸§à¸±à¸¢ uy -Уругвай uy -Уругвай uy -Ourougway uy -乌拉圭 uy -çƒæ‹‰åœ­ uy -Uzbekistan uz -أوزبكستان uz -ÖzbÉ™kistan uz -УзбÑкіÑтан uz -УзбекиÑтан uz -উজবেকিসà§à¦¤à¦¾à¦¨ uz -Ouzbekistan uz -Uzbekistán uz -Wsbecist?n uz -Usbekistan uz -Ουζμπεκιστάν uz -Uzbekujo uz -Uzbekistán uz -Usbekistan uz -ازبکستان uz -Ouzbékistan uz -Úisbéiceastáin uz -Uzbekistán uz -×וזבקיסטן uz -उजà¥à¤¬à¥‡à¤•िसà¥à¤¤à¤¾à¤¨ uz -Üzbegisztán uz -Úsbekistan uz -ウズベキスタン uz -អ៊ូហ្សបáŸáž‚ីស្ážáž„់ uz -우즈베키스탄 uz -ເດນ່ງນ uz -UzbekistÄna uz -УзбекиÑтан uz -УзбекÑтан uz -Użbekistan uz -Usbekistan uz -Usbekistan uz -Usbekistan uz -ਉਜ਼ੇਬਕਸਤਾਨ uz -Uzbequistão uz -Uzbequistão uz -УзбекиÑтан uz -Uzibekisitani uz -Usbekistan uz -УзбекиÑтан uz -உஸà¯à®ªà¯†à®•ிஸà¯à®¤à®¾à®©à¯ uz -ӮзбекиÑтон uz -อุซเบà¸à¸´à¸ªà¸–าน uz -Özbekistan uz -Özbäkstan uz -УзбекиÑтан uz -ЎзбекиÑтон uz -Ouzbekistan uz -ä¹Œå…¹åˆ«å…‹æ–¯å¦ uz -çƒèŒ²åˆ¥å…‹ uz -Vatican City va -Vatikaan Stad va -مدينة Ø§Ù„ÙØ§ØªÙŠÙƒØ§Ù† va -Vatican ŞəhÉ™ri va -Ватыкан va -Ватикана va -ভà§à¦¯à¦¾à¦Ÿà¦¿à¦•ান সিটি va -Ker Vatikan va -Vatikan va -Ciutat del Vaticà va -Vatikán va -Dinas y Fatican va -Vatikanstaten va -Vatikanstadt va -Βατικανό va -Vatikano va -Vaticano va -Vatikan va -Batikano Hiria va -شهر واتیکان va -Vatikaani va -Vatican va -Vaticaanstad va -An Chathaoir Naofa va -Cidade do Vaticano va -הוותיקן va -वेटिकन सिटी va -Vatikan va -Vatikán va -Vatíkanið va -Città del Vaticano va -ãƒãƒã‚«ãƒ³å¸‚国 va -ក្រុង​វ៉ាទីកង់ va -바티칸 시티 va -ລັດເວີຠva -VatikÄns va -Ватикан va -Ватикан Ñити va -Vatikan va -Vatikanstaten va -Vatikaan va -Vaticaanstad va -Vatikanstaten va -ਵਾਟੀਕੇਨ ਸਿਟੀ va -Watykan va -Cidade do Vaticano va -Cidade do Vaticano va -Vatican, OraÅŸul va -Ватикан va -Umujyi wa Vatikani va -Vatikanstáhta va -Vatikán va -Vatikan va -Ватикан va -Vatikan va -Vatikanstaten va -வாடிகன௠நகரம௠va -Шаҳри Ватикан va -นครรัà¸à¸§à¸²à¸•ิà¸à¸±à¸™ va -Vatikan va -Vatikan va -Ватікан va -Ватикан Шаҳри va -Thành phố Vatican va -Vatican va -梵蒂冈 va -梵諦岡城 va -St. Vincent and the Grenadines vc -St. Vincent en die Grenadene vc -سانت Ùينسنت Ùˆ الغرينادين vc -St. Vincent vÉ™ Grenadines vc -СÑнт-ВінÑÑнт Ñ– ГрÑнадыны vc -Св. ВинÑет и Гренадините vc -সেনà§à¦Ÿ ভিনসেনà§à¦Ÿ ও গà§à¦°à§‡à¦¨à¦¾à¦¡à¦¿à¦¨ vc -S. Visant hag ar Grenadinez vc -Sveti Vincent i Grenadini vc -St. Vincent i les Granadines vc -St. Vincent a Grenadiny vc -Ynysoedd St. Finsent a'r Grenadinau vc -St. Vincent og Grenadinerne vc -St. Vincent und Grenadinen vc -Άγιος Βικέντιος και ΓÏεναδίνες vc -Sent-Vincento kaj la Grenadinoj vc -San Vicente y las Granadinas vc -St. Vincent ja Grenadiinid vc -St. Vincent eta Grenadines vc -سن وینسن Ùˆ گرادینس vc -St. Vincent ja Grenadiinit vc -Sankta Vinsent og Grenadinoyggjar vc -St Vincent et les Grenadines vc -St. Vincent en de Grenadines vc -St. Vincent agus Grenadines vc -Santo Vicente e as Granadinas vc -סנט וינסנט ×•×”×’×¨× ×“×™× ×™× vc -सेंट विंसेंट तथा गà¥à¤°à¥‡à¤¨à¥‡à¤¡à¤¾à¤‡à¤¨à¥à¤¸ vc -St. Vincent és Grenadines vc -St. Vincent dan the Grenadines vc -Sankti Vinsent og Grenadíneyjar vc -Saint Vincent e Grenadines vc -セントヴィンセントグレナディン vc -សង់វាំងសង់ និង ​ហ្គ្រីណាឌីន vc -세ì¸íЏ 빈센트 그레나딘 vc -ເຊີນວິນà»àºŠàº™ à»àº¥àº°à»€àºàº™àº²àº”ີນ vc -Å v. Vincentas ir Grenadinai vc -Sentvinsenta un GrenadÄ«nes vc -Св. ВинÑент и Гренадите vc -St. ВинÑент ба Гренадин vc -St. Vincent dan Grenadines vc -St. VinÄ‹enz u l-Grenadini vc -St. Vincent og Grenadinene vc -St. Vincent un de Grenadinen vc -St. Vincent en de Grenadines vc -St. Vincent og Grenadinane vc -St. Vincent le Grenadines vc -St. Vincent e les Granadines vc -ਸੇਂਟ ਵੀਨਸੈਂਟ ਤੇ ਗਰੀਨਾਜੀਨਸ vc -St. Vincent i Grenadyny vc -São Vicente e Granadinas vc -São Vicente e Grenadines vc -Sf. Vincent ÅŸi Grenadines vc -Сент-ВинÑент и Гренадины vc -Mutagatifu Visenti na Gerenadine vc -St. Vincent ja the Grenadiinnat vc -St. Vincent a Grenadines vc -Sv. Vincent in Grenadini vc -Св. ВинÑент и Гренадини vc -Sv. Vinsent i Grenadini vc -I-St. Vincent and the Grenadines vc -St. Vincent och Grenadinerna vc -செயினà¯à®Ÿà¯ வினà¯à®šà¯†à®©à¯à®Ÿà¯ மறà¯à®±à¯à®®à¯ கà¯à®°à¯€à®©à®¾à®Ÿà¯ˆà®©à¯à®¸à¯ vc -Синт ВинÑент ва Гренадина vc -เà¸à¸²à¸°à¹€à¸‹à¸™à¸•์วินเซนต์ vc -St. Vincent ve Grenadines vc -Sain Vinsent wä Grenadinnär vc -Сент-ВінÑент Ñ– Гренадіни vc -Сент-ВинÑент ва Гренадина vc -St. Vincent na Grenadines vc -St. Vincent và Grenadines vc -St. Vincint et les Grenadines vc -St. Vincent ne Grenadines vc -åœ£æ–‡æ£®ç‰¹å’Œæ ¼æž—çº³ä¸æ–¯ vc -è–æ–‡æ£®åŠæ ¼ç´é‚£ä¸ vc -I-St. Vincent kanye ne-Grenadines vc -Venezuela ve -Ùنزويلا ve -Venesuella ve -Ð’ÑнÑÑуÑла ve -ВенеÑуела ve -ভেনেজà§à§Ÿà§‡à¦²à¦¾ ve -Venecuela ve -Veneçuela ve -Feneswela ve -Βενεζουέλα ve -Venezuelo ve -Venetsueela ve -ونزویلا ve -Venesuela ve -Vénézuela ve -Veiniséala ve -ונצו×לה ve -वेनेजà¥à¤à¤²à¤¾ ve -Venecuela ve -Venesúela ve -ベãƒã‚ºã‚§ãƒ© ve -ážœáŸážŽáŸáž áŸ’សុ៊យអáŸáž¡áž¶ ve -ë² ë„¤ìˆ˜ì—˜ë¼ ve -ເວເນຊຸເອລາ ve -Venesuela ve -VenecuÄ“la ve -Венецуела ve -ВинеÑÑуел ve -Veneżwela ve -ਵੈਂਨਜ਼ੂà¨à¨²à¨¾ ve -Wenezuela ve -ВенеÑуÑла ve -Venezuwela ve -Венецуела ve -Venecuela ve -I-Venezuela ve -வெனிசà¯à®²à®¾ ve -ВинизуÑлло ve -เวเนซุเอลา ve -ВенеÑуела ve -ВенеÑуÑла ve -Venezwela ve -委内瑞拉 ve -委內瑞拉 ve -Virgin Islands, British vg -Virgin Eilande, Brits vg -الجزر العذراء, بريطانيا vg -Virgin Adaları, Britanya vg -БрытанÑÐºÑ–Ñ Ð’Ñ–Ñ€Ð³Ñ–Ð½ÑÐºÑ–Ñ Ð°Ñтравы vg -БританÑки ВирджинÑки оÑтрови vg -ভারà§à¦œà¦¿à¦¨ আইলà§à¦¯à¦¾à¦£à§à¦¡à¦¸, বà§à¦°à¦¿à¦Ÿà¦¿à¦¶ vg -DjeviÄanska ostrva, Britanska vg -Illes Verges, Angleses vg -Ynysoedd yr Wyryf, Prydeinig vg -Britiske jomfruøer vg -Virgin-Inseln, britisch vg -ΠαÏθένοι Îήσοι, Î’Ïετανικές vg -Virgininsuloj, Britaj vg -Islas Vírgenes Británicas vg -Briti Neitsisaared vg -Britaniar Irla Birjinak vg -جزایر ویرجین انگلیسی vg -Brittien Neitsytsaaret vg -ÃŽles Vierges britanniques vg -Virgin Eilannen, Britse vg -Oileáin Bhriotanacha na Maighdean vg -Illas Virxes, Británicas vg -××™×™ הבתולה, בריטי vg -वरà¥à¤œà¤¿à¤¨ आइलैंड, बà¥à¤°à¤¿à¤Ÿà¤¿à¤¶ vg -DjeviÄansko otoÄje, Britanski vg -Virgin-szigetek (brit) vg -Bresku Jómfrúareyjar vg -Isole Vergini Britanniche vg -英領ãƒãƒ¼ã‚¸ãƒ³è«¸å³¶ vg -កោះ​ស្មោង អង់គ្លáŸážŸ vg -ì˜êµ­ë ¹ 버진 ì œë„ vg -Britu Virdžinu salas vg -ДевÑтвени ОÑтрови, БританÑки vg -Виржин арлууд, британи vg -Kepulauan Virgin, British vg -Jomfruøyene (Storbritannia) vg -Britsche Jumferninseln vg -Virgin Eilanden, Britse vg -Jomfruøyane (Storbritannia) vg -ਵੀਰਗੀਨ ਟਾਪੂ, ਬਰਤਾਨੀਆ vg -Wyspy Dziewicze (Brytyjskie) vg -Ilhas Virgens, Inglaterra vg -Ilhas Virgens, Inglaterra vg -Insulele Virgine, Anglia vg -ВиргинÑкие БританÑкие оÑтрова vg -Ibirwa by'Isugi, Nyongereza vg -Panenské Ostrovy, Britské vg -DeviÅ¡ki otoki, Britanski vg -ДевичанÑка оÑтрва, БританÑка vg -DeviÄanska ostrva, Britanska vg -Brittiska Jungfruöarna vg -விரà¯à®œà®¿à®©à¯ தீவà¯à®•ளà¯, பிரிடà¯à®Ÿà®¿à®·à¯ vg -Ҷазираи ВирҷиниÑ, Бритониё vg -หมู่เà¸à¸²à¸°à¹€à¸§à¸­à¸£à¹Œà¸ˆà¸´à¸™, อังà¸à¸¤à¸© vg -Virgin Adaları (İngiltere) vg -Virgin Utrawları, Britan vg -ВіргінÑькі оÑтрови (БританіÑ) vg -ÐÐ½Ð³Ð»Ð¸Ñ Ð’Ð¸Ñ€Ð¶Ð¸Ð½ Ороллари vg -Quần đảo Trinh nữ, Vưong quốc Anh vg -Iyes Viedjes, britanikes vg -英属维京群岛 vg -英屬維爾京群島 vg -Virgin Islands, U.S. vi -Virgin Eilande, VSA vi -الجزر العذراء, الولايات المتحدة vi -Virgin Adaları, ABÅž vi -ÐмÑрыканÑÐºÑ–Ñ Ð’Ñ–Ñ€Ð³Ñ–Ð½ÑÐºÑ–Ñ Ð°Ñтравы vi -ÐмериканÑки ВирджинÑки оÑтрови vi -ভারà§à¦œà¦¿à¦¨ আইলà§à¦¯à¦¾à¦£à§à¦¡à¦¸, মারà§à¦•িন যà§à¦•à§à¦¤à¦°à¦¾à¦·à§à¦Ÿà§à¦° vi -DjeviÄanska ostrva, AmeriÄka vi -Illes Verges, Americanes vi -Panenské ostrovy, U.S. vi -Ynysoedd yr Wyryf, Americanaidd vi -Jomfruøerne vi -Virgin-Inseln, amerikanisch vi -ΠαÏθένοι Îήσοι, Η.Π.A. vi -Virgininsuloj, Usonaj vi -Islas Vírgenes Americanas vi -USA Neitsisaared vi -Estatu Batuar Irla Birjinak vi -جزایر ویرجین امریکا. vi -USA:n Neitsytsaaret vi -ÃŽles Vierges américaines vi -Virgin Eilannen, U.S. vi -Oileáin na Maighdean S.A.M. vi -Illas Virxes, U.S. vi -××™×™ הבתולה, ×רצות־הברית vi -वरà¥à¤œà¤¿à¤¨ आइलैंड, यू.à¤à¤¸. vi -DjeviÄansko otoÄje, SAD vi -Virgin-szigetek (USA) vi -Bandarísku Jómfrúareyjar vi -Isole Vergini Americane vi -米領ãƒãƒ¼ã‚¸ãƒ³è«¸å³¶ vi -កោះ​ស្មោង អាមáŸážšáž·áž€ vi -미국령 버진 ì œë„ vi -Virdžinu salas, ASV. vi -ДевÑтвени ОÑтрови, СÐД vi -Виржин арлууд, ÐÐУ vi -Kepulauan Virgin, U.S. vi -Jomfruøyene (USA) vi -Jumferninseln, U.S. vi -Virgin Eilanden, U.S. vi -Jomfruøyane (USA) vi -ਵੀਰਗੀਨ ਟਾਪੂ, ਅਮਰੀਕਾ vi -Wyspy Dziewicze (USA) vi -Ilhas Virgens, E.U.A. vi -Ilhas Virgens, EUA vi -Insulele Virgine, S.U.A. vi -ВиргинÑкие оÑтрова (СШÐ) vi -Ibirwa by'Isugi, U.S. vi -Panenské Ostrovy, Americké vi -DeviÅ¡ki otoki, ZDA vi -ДевичанÑка оÑтрва, СÐД vi -DeviÄanska ostrva, SAD vi -Amerikanska Jungfruöarna vi -விரà¯à®œà®¿à®©à¯ தீவà¯à®•ளà¯, U.S. vi -Ҷазираи ВирҷиниÑ, Ш.М.Ð vi -หมู่เà¸à¸²à¸°à¹€à¸§à¸­à¸£à¹Œà¸ˆà¸´à¸™, สหรัà¸à¸­à¹€à¸¡à¸£à¸´à¸à¸² vi -Virgin Adaları (ABD) vi -Virgin Utrawları, AQÅž vi -ВіргінÑькі оÑтрови (СШÐ) vi -ÐҚШ Виржин Ороллари vi -Quần đảo Trinh nữ, Hoa Kỳ vi -Iyes Viedjes, etazunyinnes vi -美属维京群岛 vi -美屬維爾京群島 vi -Vietnam vn -Viëtnam vn -Ùييتنام vn -Vyetnam vn -Віетнам vn -Виетнам vn -ভিয়েতনাম vn -Vijetnam vn -Panenské ostrovy, U.K. vn -Fiet-nam vn -Βιετνάμ vn -Vjetnamio vn -ویتنام vn -Viëtnam vn -Vítneam vn -וייטנ×× vn -विà¤à¤¤à¤¨à¤¾à¤® vn -Vijetnam vn -Víetnam vn -ベトナム vn -វៀážážŽáž¶áž˜ vn -베트남 vn -ຫວງດນາມ vn -Vietnamas vn -Vjetnama vn -Виетнам vn -Витнам vn -Vjetnam vn -Viëtnam vn -ਵੀਅਤਨਾਮ vn -Wietnam vn -Vietname vn -Vietnã vn -Вьетнам vn -Viyetinamu vn -Вијетнам vn -Vijetnam vn -I-Vietnam vn -வியடà¯à®¨à®¾à®®à¯ vn -Ветнам vn -เวียตนาม vn -Ð’'єтнам vn -Ветнам vn -Việt Nam vn -è¶Šå— vn -è¶Šå— vn -Vanuatu vu -ÙØ§Ù†ÙˆØ§ØªÙˆ vu -Вануату vu -Вануату vu -ভানà§à§Ÿà¦¾à¦Ÿà§ vu -Fanwatw vu -Βανουάτου vu -Vanuatuo vu -وانواتو vu -Vanuatú vu -ונו×טו vu -वनौतू vu -Vanúatú vu -ãƒãƒŒã‚¢ãƒ„ vu -វ៉ានុយអាទុយ vu -바누아투 vu -ຈີນ vu -Вануату vu -Вануату vu -ਵਾਨà©à¨†à¨Ÿà©‚ vu -Vanatu vu -Вануату vu -Vanuwatu vu -Вануату vu -வனட௠vu -Вануату vu -à¹à¸§à¸™à¸±à¸§à¸•ู vu -Вануату vu -Вануату vu -瓦努阿图 vu -è¬é‚£æœ vu -Wallis and Futuna wf -Wallis en Futuna wf -واليس Ùˆ Ùوتونا wf -Vallis vÉ™ Futuna wf -ÐŽÐ¾Ð»Ñ–Ñ Ñ– Футуна wf -ОÑтрови Ð£Ð¾Ð»Ð¸Ñ Ð¸ Футина wf -ওয়ালিস à¦à¦¬à¦‚ ফà§à¦Ÿà§à¦¨à¦¾ wf -Wallis ha Futuna wf -Valis i Futuna wf -Wallis i Futuna wf -Wallis a Futuna wf -Ynysoedd Walis a Ffwtwna wf -Wallis- og Futuna-øerne wf -Wallis und Futuna wf -Βαλίς και ΦουτοÏνα wf -Valiso kaj Futuno wf -Wallis y Futuna wf -Wallis ja Futuna wf -Wallis eta Futuna wf -والیس Ùˆ Ùوتونا wf -Wallis ja Futuna wf -Wallis et Futuna wf -Wallis en Futuna wf -Bhailís agus Futúna wf -Wallis e Futuna wf -ו×ליס ופוטונה wf -वालिस तथा फà¥à¤¤à¥à¤¨à¤¾ wf -Wallis i Futuna wf -Wallis és Futuna wf -Wallis- og Fútúnaeyjar wf -Wallis e Futuna wf -ä»é ˜ãƒ¯ãƒªã‚¹ãƒ•ツナ諸島 wf -월리스 후투나 ì œë„ wf -ປັàºàº­àº´àº™àºžàº²àºš wf -Volisa salas un Futuna wf -Ð’Ð°Ð»Ð¸Ñ Ð¸ Футуна wf -ВилÑÐ¼Ñ Ð±Ð° футуна wf -Wallis dan Futuna wf -Wallis u Futuna wf -Wallis og Futuna wf -Wallis un Futuna wf -Wallis en Futuna wf -Wallis og Futuna wf -ਵਾਲਿਸ਼ ਤੇ ਫੂਟੂਨਾ wf -Wallis i Futuna wf -Wallis e Futuna wf -Wallis e Futuna wf -Wallis ÅŸi Futuna wf -ОÑтрова Ð£Ð¾Ð»Ð»Ð¸Ñ Ð¸ Футуна wf -Walisi na Futuna wf -Wallis ja Futuna wf -Wallis a Futuna wf -Wallis in Futuna wf -Ð’Ð°Ð»Ð¸Ñ Ð¸ Футуна wf -Valis i Futuna wf -Wallis och Futuna wf -வாலிஸ௠மறà¯à®±à¯à®®à¯ பà¯à®¯à¯à®Ÿà®©à®¾ wf -УÑÐ»Ñ Ð²Ð° Футуна wf -วอลลิสà¹à¸¥à¸°à¸Ÿà¸¹à¸—ูนา wf -Wallis ve Futuna wf -Wallis wä Futuna wf -Ð£Ð¾Ð»Ð»Ð¸Ñ Ñ– Футуна wf -Ð£Ð¾Ð»Ð»Ð¸Ñ Ð²Ð° Футуна Ороллари wf -Wallis và Futuna wf -Wallis et Futuna wf -瓦利斯和富图纳群岛 wf -瓦利斯群島和富圖ç´ç¾¤å³¶ wf -Samoa ws -ساموا ws -Самоа ws -Самоа ws -সামোয়া ws -Inizi Samoe ws -Σαμόα ws -Samoo ws -ساموآ ws -Samó ws -סמו××” ws -सामोआ ws -Szamoa ws -Samóa ws -サモア ws -សាមូអា ws -사모아 ì œë„ ws -ໂຊນາ ws -Самоа ws -Самолоа ws -ਸਾਮੋਆ ws -Самоа ws -Samowa ws -Самоа ws -சாமோயா ws -Самоа ws -ซามัว ws -Самоа ws -Самоа ws -Samowa ws -è¨æ‘©äºšç¾¤å²› ws -薩摩亞 ws -Yemen ye -اليمن ye -YÉ™mÉ™n ye -Емен ye -Йемен ye -ইয়েমেন ye -Ihlemeñ ye -Jemen ye -Iemen ye -Jemen ye -Yr Iemen ye -Jemen ye -Υεμένη ye -Jemeno ye -Jeemen ye -یمن ye -Jemen ye -Jemen ye -Jemen ye -Éimin ye -Iemen ye -תימן ye -यमन ye -Jemen ye -Jemen ye -Jemen ye -イエメン ye -áž™áŸáž˜áŸ‚áž“ ye -예멘 ye -ເດມອນ ye -Jemenas ye -Jemena ye -Јемен ye -Емен ye -Yaman ye -Jemen ye -Jemen ye -Jemen ye -Jemen ye -Jemen ye -ਯਮਨ ye -Jemen ye -Iémen ye -Йемен ye -Yemeni ye -Jemen ye -Jemen ye -Jemen ye -Јемен ye -Jemen ye -I-Yemen ye -Jemen ye -யேமன௠ye -Яман ye -เยเมน ye -Ємен ye -Яман ye -也门 ye -葉門 ye -Serbia and Montenegro yu -Serbië en Montenegro yu -Ð¡ÑŠÑ€Ð±Ð¸Ñ Ð¸ Черна гора yu -সারà§à¦¬à¦¿à§Ÿà¦¾ à¦à¦¬à¦‚ মনà§à¦Ÿà§‡à¦¨à¦¿à¦—à§à¦°à§‹ yu -Serbi ha Montenegro yu -Sèrbia i Montenegro yu -Srbsko a ÄŒerná hora yu -Serbien og Montenegro yu -Serbien und Montenegro yu -ΣεÏβία - ΜαυÏοβοÏνιο yu -Serbia y Montenegro yu -Serbia ja TÅ¡ernogooria yu -Serbia eta Montenegro yu -Serbia ja Montenegro yu -Serbie and Monténégro yu -Servië en Montenegro yu -Sérbia e Montenegro yu -Szerbia és Montenegró yu -Serbía og Svartfjallaland yu -Serbia e Montenegro yu -セルビアモンテãƒã‚°ãƒ­ yu -សែប៊ី និង ម៉ុងážáŸážŽáŸáž áŸ’ក្រូ yu -Serbija ir Juodkalnija yu -Србија и Црна Гора yu -Serbia og Montenegro yu -Serbien un Montenegro yu -Servië en Montenegro yu -Serbia og Montenegro yu -ਸਰਬੀਆ ਅਤੇ ਮਾਂਤਾਂਗਰੋ yu -Serbia i Czarnogóra yu -Sérvia e Montenegro yu -Sérvia e Montenegro yu -Ð¡ÐµÑ€Ð±Ð¸Ñ Ð¸ Ð§ÐµÑ€Ð½Ð¾Ð³Ð¾Ñ€Ð¸Ñ yu -Seribiya na Montenegoro yu -Serbia ja Montenegro yu -Srbija in ÄŒrna gora yu -Србија и Црна Гора yu -Srbija i Crna Gora yu -Serbien och Montenegro yu -เซอร์เบีย à¹à¸¥à¸°à¸¡à¸­à¸™à¸•ิเนโà¸à¸£ yu -Sırbistan KaradaÄŸ yu -Serbia wä Montenegro yu -Ð¡ÐµÑ€Ð±Ñ–Ñ Ñ– Ð§Ð¾Ñ€Ð½Ð¾Ð³Ð¾Ñ€Ñ–Ñ yu -Ð¡ÐµÑ€Ð±Ð¸Ñ Ð²Ð° Монтенегро yu -塞尔维亚和黑山 yu -塞爾維亞和黑山 yu -South Africa za -Suid-Afrika za -جنوب Ø£ÙØ±ÙŠÙ‚يا za -CÉ™nubi Afrika za -ÐŸÐ°ÑžÐ´Ð½Ñ‘Ð²Ð°Ñ Ðфрыка za -Южна Ðфрика za -দকà§à¦·à¦¿à¦£ আফà§à¦°à¦¿à¦•া za -Suafrika za -Južna Afrika za -Sudàfrica za -Jižní Afrika za -De Affrica za -Sydafrikanske republik za -Südafrika za -Îότια ΑφÏική za -Sudafriko za -Sudáfrica za -Lõuna-Aafrika za -Hego Afrika za -Ø¢ÙØ±ÛŒÙ‚ای جنوبی za -Etelä-Afrikka za -Suðurafrika za -Afrique du sud za -Sûd-Afrika za -An Afraic Theas za -Ãfrica do Sur za -×“×¨×•× ×פריקה za -दकà¥à¤·à¤¿à¤£à¥€ अफà¥à¤°à¥€à¤•ा za -Južna Afrika za -Dél-Afrika za -Afrika Selatan za -Suður-Afríka za -Sud Africa za -å—アフリカ za -អាហ្វ្រិក​ážáž¶áž„​ážáŸ’បូង za -남 아프리카 공화국 za -à»àº­àºšàºžàº´àºàº²à»ƒàº•້ za -Afrika, Pietų za -DienvidÄfrika za -Јужна Ðфрика za -Өмнөд африк za -Afrika Selatan za -Afrika t'Isfel za -Sør-Afrika za -Söödafrika za -Zuid-Afrika za -Sør-Afrika za -Afrika Borwa za -Sudafrica za -ਦੱਖਣੀ ਅਫਰੀਕਾ za -Afryka PoÅ‚udniowa za -Ãfrica do Sul za -Ãfrica do Sul za -Africa de Sud za -Ð®Ð¶Ð½Ð°Ñ Ðфрика za -Afurika Yepfo za -Lulli-Afrihká za -Južná Afrika za -Južna Afrika za -Јужна Ðфрика za -Južna Afrika za -I-South Africa za -Sydafrika za -தென௠ஆபà¯à®°à®¿à®•à¯à®•ா za -Ðфриқои Ҷанубӣ za -à¹à¸­à¸Ÿà¸£à¸´à¸à¸²à¹ƒà¸•้ za -Güney Afrika za -Könyaq Afrika za -Південна Ðфрика za -Жанубий Ðфрика za -Afurika tshipembe za -Nam Phi za -Nonne Afrike za -Mzantsi Afrika za -å—éž za -å—éž za -Emzantsi Afrika za -Zambia zm -Zambië zm -زامبيا zm -Zambiya zm -Ð—Ð°Ð¼Ð±Ñ–Ñ zm -Ð—Ð°Ð¼Ð±Ð¸Ñ zm -জামবিয়া zm -Zambi zm -Zàmbia zm -Zambie zm -Sambia zm -Sambia zm -Ζάμπια zm -Zambio zm -Sambia zm -زامبیا zm -Sambia zm -Zambie zm -An tSaimbia zm -Zámbia zm -זמביה zm -ज़ामà¥à¤¬à¤¿à¤¯à¤¾ zm -Zambija zm -Sambía zm -ザンビア zm -ហ្សាំប៊ី zm -잠비아 zm -ຈາໄມàºàº²à»‰ zm -Zambija zm -Замбија zm -Замби zm -Å»ambia zm -Sambia zm -ਜੈਂਬੀਆ zm -Zâmbia zm -Zâmbia zm -Ð—Ð°Ð¼Ð±Ð¸Ñ zm -Zambiya zm -Zambija zm -Замбија zm -Zambija zm -ஜாமà¯à®ªà®¿à®¯à®¾ zm -Зомбиё zm -à¹à¸‹à¸¡à¹€à¸šà¸µà¸¢ zm -Ð—Ð°Ð¼Ð±Ñ–Ñ zm -Ð—Ð°Ð¼Ð±Ð¸Ñ zm -Zambeye zm -赞比亚 zm -尚比亞 zm -Zimbabwe zw -زيمبابوي zw -Zimbabve zw -Ð—Ñ‹Ð¼Ð±Ð°Ð±Ð²Ñ zw -Зимбабве zw -জিমà§à¦¬à¦¾à¦¬à§‹à§Ÿà§‡ zw -Zimbabve zw -Simbabwe zw -Simbabwe zw -Ζιμπάμπουε zw -Zimbabvo zw -زیمبابوه zw -An tSiombáib zw -Zimbabué zw -זימבבווה zw -जिमà¥à¤¬à¤¾à¤¬à¤µà¥‡ zw -Zimbabve zw -Simbabve zw -ジンãƒãƒ–エ zw -ហ្ស៊ីមបាបវ៉០zw -ì§ë°”브웨 zw -ລິຊາ zw -Zimbabve zw -Зимбабве zw -Замбабив zw -Å»imbabwe zw -Simbabwe zw -ਜਿੰਬਾਬਵੇਂ zw -Zimbabue zw -Зимбабве zw -Zimbabve zw -Зимбабве zw -Zimbabve zw -ஜிமà¯à®ªà®¾à®ªà¯‡ zw -Зимбобве zw -ซิมบับเว zw -Зімбабве zw -Зимбабве zw -Zimbabwè zw -津巴布韦 zw -è¾›å·´å¨ zw -Czech Republic cz diff --git a/kabc/distributionlist.cpp b/kabc/distributionlist.cpp deleted file mode 100644 index bb89b6d00..000000000 --- a/kabc/distributionlist.cpp +++ /dev/null @@ -1,298 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqapplication.h> -#include <tqpair.h> -#include <tqvaluelist.h> - -#include <ksimpleconfig.h> -#include <kstandarddirs.h> -#include <kdebug.h> - -#include "distributionlist.h" - -using namespace KABC; - -DistributionList::DistributionList( DistributionListManager *manager, - const TQString &name ) : - mManager( manager ), mName( name ) -{ - mManager->insert( this ); -} - -DistributionList::~DistributionList() -{ - mManager->remove( this ); -} - -void DistributionList::setName( const TQString &name ) -{ - mName = name; -} - -TQString DistributionList::name() const -{ - return mName; -} - -void DistributionList::insertEntry( const Addressee &a, const TQString &email ) -{ - Entry e( a, email ); - - TQValueList<Entry>::Iterator it; - for( it = mEntries.begin(); it != mEntries.end(); ++it ) { - if ( (*it).addressee.uid() == a.uid() ) { - /** - We have to check if both email addresses contains no data, - a simple 'email1 == email2' wont work here - */ - if ( ( (*it).email.isNull() && email.isEmpty() ) || - ( (*it).email.isEmpty() && email.isNull() ) || - ( (*it).email == email ) ) { - *it = e; - return; - } - } - } - mEntries.append( e ); -} - -void DistributionList::removeEntry( const Addressee &a, const TQString &email ) -{ - TQValueList<Entry>::Iterator it; - for( it = mEntries.begin(); it != mEntries.end(); ++it ) { - if ( (*it).addressee.uid() == a.uid() && (*it).email == email ) { - mEntries.remove( it ); - return; - } - } -} - -TQStringList DistributionList::emails() const -{ - TQStringList emails; - - Entry::List::ConstIterator it; - for( it = mEntries.begin(); it != mEntries.end(); ++it ) { - Addressee a = (*it).addressee; - TQString email = (*it).email.isEmpty() ? a.fullEmail() : - a.fullEmail( (*it).email ); - - if ( !email.isEmpty() ) { - emails.append( email ); - } - } - - return emails; -} - -DistributionList::Entry::List DistributionList::entries() const -{ - return mEntries; -} - -typedef TQValueList< QPair<TQString, TQString> > MissingEntryList; - -class DistributionListManager::DistributionListManagerPrivate -{ - public: - AddressBook *mAddressBook; - TQMap< TQString, MissingEntryList > mMissingEntries; -}; - -DistributionListManager::DistributionListManager( AddressBook *ab ) - : d( new DistributionListManagerPrivate ) -{ - d->mAddressBook = ab; - mLists.setAutoDelete( true ); -} - -DistributionListManager::~DistributionListManager() -{ - mLists.clear(); - - delete d; - d = 0; -} - -DistributionList *DistributionListManager::list( const TQString &name ) -{ - DistributionList *list; - for( list = mLists.first(); list; list = mLists.next() ) { - if ( list->name() == name ) return list; - } - - return 0; -} - -void DistributionListManager::insert( DistributionList *l ) -{ - if ( !l ) - return; - - DistributionList *list; - for( list = mLists.first(); list; list = mLists.next() ) { - if ( list->name() == l->name() ) { - mLists.remove( list ); - break; - } - } - mLists.append( l ); -} - -void DistributionListManager::remove( DistributionList *l ) -{ - if ( !l ) - return; - - DistributionList *list; - for( list = mLists.first(); list; list = mLists.next() ) { - if ( list->name() == l->name() ) { - mLists.remove( list ); - return; - } - } -} - -TQStringList DistributionListManager::listNames() -{ - TQStringList names; - - DistributionList *list; - for( list = mLists.first(); list; list = mLists.next() ) { - names.append( list->name() ); - } - - return names; -} - -bool DistributionListManager::load() -{ - KSimpleConfig cfg( locateLocal( "data", "kabc/distlists" ) ); - - TQMap<TQString,TQString> entryMap = cfg.entryMap( "DistributionLists" ); - cfg.setGroup( "DistributionLists" ); - - // clear old lists - mLists.clear(); - d->mMissingEntries.clear(); - - TQMap<TQString,TQString>::ConstIterator it; - for( it = entryMap.constBegin(); it != entryMap.constEnd(); ++it ) { - TQString name = it.key(); - TQStringList value = cfg.readListEntry( name ); - - kdDebug(5700) << "DLM::load(): " << name << ": " << value.join(",") << endl; - - DistributionList *list = new DistributionList( this, name ); - - MissingEntryList missingEntries; - TQStringList::ConstIterator entryIt = value.constBegin(); - while( entryIt != value.constEnd() ) { - TQString id = *entryIt++; - TQString email = *entryIt; - - kdDebug(5700) << "----- Entry " << id << endl; - - Addressee a = d->mAddressBook->findByUid( id ); - if ( !a.isEmpty() ) { - list->insertEntry( a, email ); - } else { - missingEntries.append( qMakePair( id, email ) ); - } - - if ( entryIt == value.end() ) - break; - ++entryIt; - } - - d->mMissingEntries.insert( name, missingEntries ); - } - - return true; -} - -bool DistributionListManager::save() -{ - kdDebug(5700) << "DistListManager::save()" << endl; - - KSimpleConfig cfg( locateLocal( "data", "kabc/distlists" ) ); - - cfg.deleteGroup( "DistributionLists" ); - cfg.setGroup( "DistributionLists" ); - - DistributionList *list; - for( list = mLists.first(); list; list = mLists.next() ) { - kdDebug(5700) << " Saving '" << list->name() << "'" << endl; - - TQStringList value; - const DistributionList::Entry::List entries = list->entries(); - DistributionList::Entry::List::ConstIterator it; - for( it = entries.begin(); it != entries.end(); ++it ) { - value.append( (*it).addressee.uid() ); - value.append( (*it).email ); - } - - if ( d->mMissingEntries.find( list->name() ) != d->mMissingEntries.end() ) { - const MissingEntryList missList = d->mMissingEntries[ list->name() ]; - MissingEntryList::ConstIterator missIt; - for ( missIt = missList.begin(); missIt != missList.end(); ++missIt ) { - value.append( (*missIt).first ); - value.append( (*missIt).second ); - } - } - - cfg.writeEntry( list->name(), value ); - } - - cfg.sync(); - - return true; -} - -DistributionListWatcher* DistributionListWatcher::mSelf = 0; - -DistributionListWatcher::DistributionListWatcher() - : TQObject( tqApp, "DistributionListWatcher" ) -{ - mDirWatch = new KDirWatch; - mDirWatch->addFile( locateLocal( "data", "kabc/distlists" ) ); - - connect( mDirWatch, TQT_SIGNAL( dirty( const TQString& ) ), TQT_SIGNAL( changed() ) ); - mDirWatch->startScan(); -} - -DistributionListWatcher::~DistributionListWatcher() -{ - delete mDirWatch; - mDirWatch = 0; -} - -DistributionListWatcher *DistributionListWatcher::self() -{ - kdWarning( !tqApp ) << "No TQApplication object available, you'll get a memleak!" << endl; - - if ( !mSelf ) - mSelf = new DistributionListWatcher(); - - return mSelf; -} - -#include "distributionlist.moc" diff --git a/kabc/distributionlist.h b/kabc/distributionlist.h deleted file mode 100644 index 78d182467..000000000 --- a/kabc/distributionlist.h +++ /dev/null @@ -1,217 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_DISTRIBUTIONLIST_H -#define KABC_DISTRIBUTIONLIST_H - -#include <kdirwatch.h> - -#include "addressbook.h" - -namespace KABC { - -class DistributionListManager; - -/** - @short Distribution list of email addresses - - This class represents a list of email addresses. Each email address is - associated with an address book entry. If the address book entry changes, the - entry in the distribution list is automatically updated. -*/ -class KABC_EXPORT DistributionList -{ - public: - /** - @short Distribution List Entry - - This class represents an entry of a distribution list. It consists of an - addressee and an email address. If the email address is null, the - preferred email address of the addressee is used. - */ - struct Entry - { - typedef TQValueList<Entry> List; - - Entry() {} - Entry( const Addressee &_addressee, const TQString &_email ) : - addressee( _addressee ), email( _email ) {} - - Addressee addressee; - TQString email; - }; - - /** - Create distribution list object. - - @param manager Managing object of this list. - @param name Name of this list. - */ - DistributionList( DistributionListManager *manager, const TQString &name ); - - /** - Destructor. - */ - ~DistributionList(); - - /** - Set name of this list. The name is used as key by the - DistributinListManager. - */ - void setName( const TQString & ); - - /** - Get name of this list. - */ - TQString name() const; - - /** - Insert an entry into this distribution list. If the entry already exists - nothing happens. - */ - void insertEntry( const Addressee &, const TQString &email=TQString::null ); - - /** - Remove an entry from this distribution list. If the entry doesn't exist - nothing happens. - */ - void removeEntry( const Addressee &, const TQString &email=TQString::null ); - - /** - Return list of email addresses, which belong to this distributon list. - These addresses can be directly used by e.g. a mail client. - */ - TQStringList emails() const; - - /** - Return list of entries belonging to this distribution list. This function - is mainly useful for a distribution list editor. - */ - Entry::List entries() const; - - private: - DistributionListManager *mManager; - TQString mName; - - Entry::List mEntries; -}; - -/** - @short Manager of distribution lists - - This class represents a collection of distribution lists, which are associated - with a given address book. -*/ -class KABC_EXPORT DistributionListManager -{ - public: - /** - Create manager for given address book. - */ - DistributionListManager( AddressBook * ); - - /** - Destructor. - */ - ~DistributionListManager(); - - /** - Return distribution list with given name. - */ - DistributionList *list( const TQString &name ); // KDE4: add bool caseSensitive = true - - /** - Insert distribution list. If a list with this name already exists, nothing - happens. The passed object is deleted by the manager. - */ - void insert( DistributionList * ); - - /** - Remove distribution list. If a list with this name doesn't exist, nothing - happens. - */ - void remove( DistributionList * ); - - /** - Return names of all distribution lists managed by this manager. - */ - TQStringList listNames(); - - /** - Load distribution lists form disk. - */ - bool load(); - - /** - Save distribution lists to disk. - */ - bool save(); - - private: - class DistributionListManagerPrivate; - DistributionListManagerPrivate *d; - - TQPtrList<DistributionList> mLists; -}; - -/** - @short Watchdog for distribution lists - - This class provides a changed() signal that i emitted when the - distribution lists has changed in some way. - - Exapmle: - - \code - KABC::DistributionListWatcher *watchdog = KABC::DistributionListWatcher::self() - - connect( watchdog, TQT_SIGNAL( changed() ), TQT_SLOT( doSomething() ) ); - \endcode -*/ - -class KABC_EXPORT DistributionListWatcher : public TQObject -{ - Q_OBJECT - - public: - /** - * Returns the watcher object. - */ - static DistributionListWatcher *self(); - - signals: - /** - * This signal is emmitted whenever the distribution lists has - * changed (if a list was added or removed, when a list was - * renamed or the entries of the list changed). - */ - void changed(); - - protected: - DistributionListWatcher(); - ~DistributionListWatcher(); - - private: - static DistributionListWatcher* mSelf; - KDirWatch *mDirWatch; -}; - -} -#endif diff --git a/kabc/distributionlistdialog.cpp b/kabc/distributionlistdialog.cpp deleted file mode 100644 index b00b14d42..000000000 --- a/kabc/distributionlistdialog.cpp +++ /dev/null @@ -1,399 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqlistview.h> -#include <tqlayout.h> -#include <tqlabel.h> -#include <tqpushbutton.h> -#include <tqcombobox.h> -#include <kinputdialog.h> -#include <tqbuttongroup.h> -#include <tqradiobutton.h> - -#include <klocale.h> -#include <kdebug.h> -#include <kmessagebox.h> - -#include "addressbook.h" -#include "addresseedialog.h" -#include "distributionlist.h" - -#include "distributionlistdialog.h" -#include "distributionlistdialog.moc" - -using namespace KABC; - -DistributionListDialog::DistributionListDialog( AddressBook *addressBook, TQWidget *parent) - : KDialogBase( parent, "", true, i18n("Configure Distribution Lists"), Ok, Ok, true) -{ - mEditor = new DistributionListEditorWidget( addressBook, this ); - setMainWidget( mEditor ); - - connect( this, TQT_SIGNAL( okClicked() ), mEditor, TQT_SLOT( save() ) ); -} - -DistributionListDialog::~DistributionListDialog() -{ -} - -// TODO KDE4: Add d-pointer to EmailSelector, make sEmailMap a member variable -static TQMap<TQWidget*,TQString> *sEmailMap = 0; - -EmailSelector::EmailSelector( const TQStringList &emails, const TQString ¤t, - TQWidget *parent ) : - KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, - parent ) -{ - if (!sEmailMap) - sEmailMap = new TQMap<TQWidget*,TQString>(); - TQFrame *topFrame = plainPage(); - TQBoxLayout *topLayout = new TQVBoxLayout( topFrame ); - - mButtonGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), - topFrame ); - topLayout->addWidget( mButtonGroup ); - - TQStringList::ConstIterator it; - for( it = emails.begin(); it != emails.end(); ++it ) { - TQRadioButton *button = new TQRadioButton( *it, mButtonGroup ); - sEmailMap->insert( button, *it ); - if ( (*it) == current ) { - mButtonGroup->setButton(mButtonGroup->id(button)); - } - } -} - -TQString EmailSelector::selected() -{ - TQButton *button = mButtonGroup->selected(); - if ( button ) return (*sEmailMap)[button]; - return TQString::null; -} - -TQString EmailSelector::getEmail( const TQStringList &emails, const TQString ¤t, - TQWidget *parent ) -{ - EmailSelector *dlg = new EmailSelector( emails, current, parent ); - dlg->exec(); - - TQString result = dlg->selected(); - - delete dlg; - - return result; -} - -class EntryItem : public TQListViewItem -{ - public: - EntryItem( TQListView *parent, const Addressee &addressee, - const TQString &email=TQString::null ) : - TQListViewItem( parent ), - mAddressee( addressee ), - mEmail( email ) - { - setText( 0, addressee.realName() ); - if( email.isEmpty() ) { - setText( 1, addressee.preferredEmail() ); - setText( 2, i18n("Yes") ); - } else { - setText( 1, email ); - setText( 2, i18n("No") ); - } - } - - Addressee addressee() const - { - return mAddressee; - } - - TQString email() const - { - return mEmail; - } - - private: - Addressee mAddressee; - TQString mEmail; -}; - -DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *addressBook, TQWidget *parent) : - TQWidget( parent ), - mAddressBook( addressBook ) -{ - kdDebug(5700) << "DistributionListEditor()" << endl; - - TQBoxLayout *topLayout = new TQVBoxLayout( this ); - topLayout->setSpacing( KDialog::spacingHint() ); - - TQBoxLayout *nameLayout = new TQHBoxLayout( topLayout) ; - - mNameCombo = new TQComboBox( this ); - nameLayout->addWidget( mNameCombo ); - connect( mNameCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateEntryView() ) ); - - mNewButton = new TQPushButton( i18n("New List..."), this ); - nameLayout->addWidget( mNewButton ); - connect( mNewButton, TQT_SIGNAL( clicked() ), TQT_SLOT( newList() ) ); - - mEditButton = new TQPushButton( i18n("Rename List..."), this ); - nameLayout->addWidget( mEditButton ); - connect( mEditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editList() ) ); - - mRemoveButton = new TQPushButton( i18n("Remove List"), this ); - nameLayout->addWidget( mRemoveButton ); - connect( mRemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeList() ) ); - - TQGridLayout *gridLayout = new TQGridLayout( topLayout, 3, 3 ); - gridLayout->setColStretch(1, 1); - - TQLabel *listLabel = new TQLabel( i18n("Available addresses:"), this ); - gridLayout->addWidget( listLabel, 0, 0 ); - - mListLabel = new TQLabel( this ); - gridLayout->addMultiCellWidget( mListLabel, 0, 0, 1, 2 ); - - mAddresseeView = new TQListView( this ); - mAddresseeView->addColumn( i18n("Name") ); - mAddresseeView->addColumn( i18n("Preferred Email") ); - mAddresseeView->setAllColumnsShowFocus( true ); - gridLayout->addWidget( mAddresseeView, 1, 0 ); - connect( mAddresseeView, TQT_SIGNAL( selectionChanged() ), - TQT_SLOT( slotSelectionAddresseeViewChanged() ) ); - connect( mAddresseeView, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), - TQT_SLOT( addEntry() ) ); - - mAddEntryButton = new TQPushButton( i18n("Add Entry"), this ); - mAddEntryButton->setEnabled(false); - gridLayout->addWidget( mAddEntryButton, 2, 0 ); - connect( mAddEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addEntry() ) ); - - mEntryView = new TQListView( this ); - mEntryView->addColumn( i18n("Name") ); - mEntryView->addColumn( i18n("Email") ); - mEntryView->addColumn( i18n("Use Preferred") ); - mEntryView->setEnabled(false); - mEntryView->setAllColumnsShowFocus( true ); - gridLayout->addMultiCellWidget( mEntryView, 1, 1, 1, 2 ); - connect( mEntryView, TQT_SIGNAL( selectionChanged() ), - TQT_SLOT( slotSelectionEntryViewChanged() ) ); - - mChangeEmailButton = new TQPushButton( i18n("Change Email..."), this ); - gridLayout->addWidget( mChangeEmailButton, 2, 1 ); - connect( mChangeEmailButton, TQT_SIGNAL( clicked() ), TQT_SLOT( changeEmail() ) ); - - mRemoveEntryButton = new TQPushButton( i18n("Remove Entry"), this ); - gridLayout->addWidget( mRemoveEntryButton, 2, 2 ); - connect( mRemoveEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeEntry() ) ); - - mManager = new DistributionListManager( mAddressBook ); - mManager->load(); - - updateAddresseeView(); - updateNameCombo(); -} - -DistributionListEditorWidget::~DistributionListEditorWidget() -{ - kdDebug(5700) << "~DistributionListEditor()" << endl; - - delete mManager; -} - -void DistributionListEditorWidget::save() -{ - mManager->save(); -} - -void DistributionListEditorWidget::slotSelectionEntryViewChanged() -{ - EntryItem *entryItem = static_cast<EntryItem *>( mEntryView->selectedItem() ); - bool state=entryItem; - - mChangeEmailButton->setEnabled(state); - mRemoveEntryButton->setEnabled(state); -} - -void DistributionListEditorWidget::newList() -{ - bool ok; - TQString name = KInputDialog::getText( i18n( "New Distribution List" ), - i18n( "Please enter &name:" ), TQString::null, &ok ); - if (!ok) return; - - new DistributionList( mManager, name ); - - mNameCombo->clear(); - mNameCombo->insertStringList( mManager->listNames() ); - mNameCombo->setCurrentItem( mNameCombo->count() - 1 ); - - updateEntryView(); - slotSelectionAddresseeViewChanged(); -} - -void DistributionListEditorWidget::editList() -{ - TQString oldName = mNameCombo->currentText(); - bool ok; - TQString name = KInputDialog::getText( i18n( "Distribution List" ), - i18n( "Please change &name:" ), oldName, &ok ); - if (!ok) return; - - DistributionList *list = mManager->list( oldName ); - list->setName( name ); - - mNameCombo->clear(); - mNameCombo->insertStringList( mManager->listNames() ); - mNameCombo->setCurrentItem( mNameCombo->count() - 1 ); - - updateEntryView(); - slotSelectionAddresseeViewChanged(); -} - -void DistributionListEditorWidget::removeList() -{ - int result = KMessageBox::warningContinueCancel( this, - i18n("Delete distribution list '%1'?") .arg( mNameCombo->currentText() ), - TQString::null, KStdGuiItem::del() ); - - if ( result != KMessageBox::Continue ) return; - - mManager->remove( mManager->list( mNameCombo->currentText() ) ); - mNameCombo->removeItem( mNameCombo->currentItem() ); - - updateEntryView(); - slotSelectionAddresseeViewChanged(); -} - -void DistributionListEditorWidget::addEntry() -{ - AddresseeItem *addresseeItem = - static_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); - - if( !addresseeItem ) { - kdDebug(5700) << "DLE::addEntry(): No addressee selected." << endl; - return; - } - - DistributionList *list = mManager->list( mNameCombo->currentText() ); - if ( !list ) { - kdDebug(5700) << "DLE::addEntry(): No dist list '" << mNameCombo->currentText() << "'" << endl; - return; - } - - list->insertEntry( addresseeItem->addressee() ); - updateEntryView(); - slotSelectionAddresseeViewChanged(); -} - -void DistributionListEditorWidget::removeEntry() -{ - DistributionList *list = mManager->list( mNameCombo->currentText() ); - if ( !list ) return; - - EntryItem *entryItem = - static_cast<EntryItem *>( mEntryView->selectedItem() ); - if ( !entryItem ) return; - - list->removeEntry( entryItem->addressee(), entryItem->email() ); - delete entryItem; -} - -void DistributionListEditorWidget::changeEmail() -{ - DistributionList *list = mManager->list( mNameCombo->currentText() ); - if ( !list ) return; - - EntryItem *entryItem = - static_cast<EntryItem *>( mEntryView->selectedItem() ); - if ( !entryItem ) return; - - TQString email = EmailSelector::getEmail( entryItem->addressee().emails(), - entryItem->email(), this ); - list->removeEntry( entryItem->addressee(), entryItem->email() ); - list->insertEntry( entryItem->addressee(), email ); - - updateEntryView(); -} - -void DistributionListEditorWidget::updateEntryView() -{ - if ( mNameCombo->currentText().isEmpty() ) { - mListLabel->setText( i18n("Selected addressees:") ); - } else { - mListLabel->setText( i18n("Selected addresses in '%1':") - .arg( mNameCombo->currentText() ) ); - } - - mEntryView->clear(); - - DistributionList *list = mManager->list( mNameCombo->currentText() ); - if ( !list ) { - mEditButton->setEnabled(false); - mRemoveButton->setEnabled(false); - mChangeEmailButton->setEnabled(false); - mRemoveEntryButton->setEnabled(false); - mAddresseeView->setEnabled(false); - mEntryView->setEnabled(false); - return; - } else { - mEditButton->setEnabled(true); - mRemoveButton->setEnabled(true); - mAddresseeView->setEnabled(true); - mEntryView->setEnabled(true); - } - - DistributionList::Entry::List entries = list->entries(); - DistributionList::Entry::List::ConstIterator it; - for( it = entries.begin(); it != entries.end(); ++it ) { - new EntryItem( mEntryView, (*it).addressee, (*it).email ); - } - - EntryItem *entryItem = static_cast<EntryItem *>( mEntryView->selectedItem() ); - bool state=entryItem; - - mChangeEmailButton->setEnabled(state); - mRemoveEntryButton->setEnabled(state); -} - -void DistributionListEditorWidget::updateAddresseeView() -{ - mAddresseeView->clear(); - - AddressBook::Iterator it; - for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { - new AddresseeItem( mAddresseeView, *it ); - } -} - -void DistributionListEditorWidget::updateNameCombo() -{ - mNameCombo->insertStringList( mManager->listNames() ); - - updateEntryView(); -} - -void DistributionListEditorWidget::slotSelectionAddresseeViewChanged() -{ - AddresseeItem *addresseeItem = - static_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); - bool state=addresseeItem; - mAddEntryButton->setEnabled( state && !mNameCombo->currentText().isEmpty()); -} diff --git a/kabc/distributionlistdialog.h b/kabc/distributionlistdialog.h deleted file mode 100644 index 1bd6fc788..000000000 --- a/kabc/distributionlistdialog.h +++ /dev/null @@ -1,139 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_DISTRIBUTIONLISTDIALOG_H -#define KABC_DISTRIBUTIONLISTDIALOG_H - -#include <tqwidget.h> - -#include <kdialogbase.h> - -class TQListView; -class TQComboBox; -class TQButtonGroup; - -namespace KABC { - -class AddressBook; -class DistributionListEditorWidget; -class DistributionListManager; - -/** - @short Frontend to create distribution lists - - Creating a new DistributionListDialog does automatically - load all addressees and distribution lists from the config - files. The changes will be saved when clicking the 'OK' - button. - - Example: - - \code - KABC::DistributionListDialog *dlg = new - KABC::DistributionListDialog( KABC::StdAddressBook::self(), this ); - - dlg->exec(); - \endcode -*/ -class KABC_EXPORT DistributionListDialog : public KDialogBase -{ - Q_OBJECT - - public: - /** - Constructor. - - @param ab The addressbook, the addressees should be used from - @param parent The parent widget - */ - DistributionListDialog( AddressBook *ab, TQWidget *parent ); - - /** - Destructor. - */ - virtual ~DistributionListDialog(); - - private: - DistributionListEditorWidget *mEditor; - - struct Data; - Data *d; -}; - -/** - @short Helper class -*/ -class KABC_EXPORT EmailSelector : public KDialogBase -{ - public: - EmailSelector( const TQStringList &emails, const TQString ¤t, - TQWidget *parent ); - - TQString selected(); - - static TQString getEmail( const TQStringList &emails, const TQString ¤t, - TQWidget *parent ); - - private: - TQButtonGroup *mButtonGroup; -}; - -/** - @short Helper class -*/ -class KABC_EXPORT DistributionListEditorWidget : public TQWidget -{ - Q_OBJECT - - public: - DistributionListEditorWidget( AddressBook *, TQWidget *parent ); - virtual ~DistributionListEditorWidget(); - - private slots: - void newList(); - void editList(); - void removeList(); - void addEntry(); - void removeEntry(); - void changeEmail(); - void updateEntryView(); - void updateAddresseeView(); - void updateNameCombo(); - void slotSelectionEntryViewChanged(); - void slotSelectionAddresseeViewChanged(); - void save(); - - private: - TQComboBox *mNameCombo; - TQLabel *mListLabel; - TQListView *mEntryView; - TQListView *mAddresseeView; - - AddressBook *mAddressBook; - DistributionListManager *mManager; - TQPushButton *mNewButton, *mEditButton, *mRemoveButton; - TQPushButton *mChangeEmailButton, *mRemoveEntryButton, *mAddEntryButton; - - struct Data; - Data *d; -}; - -} -#endif diff --git a/kabc/distributionlisteditor.cpp b/kabc/distributionlisteditor.cpp deleted file mode 100644 index 573f0970a..000000000 --- a/kabc/distributionlisteditor.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqlistview.h> -#include <tqlayout.h> -#include <tqpushbutton.h> -#include <tqcombobox.h> -#include <tqbuttongroup.h> -#include <tqradiobutton.h> - -#include <kinputdialog.h> -#include <klocale.h> -#include <kdebug.h> - -#include "addressbook.h" -#include "addresseedialog.h" -#include "distributionlist.h" - -#include "distributionlisteditor.h" -#include "distributionlisteditor.moc" - -using namespace KABC; - -EmailSelectDialog::EmailSelectDialog( const TQStringList &emails, const TQString ¤t, - TQWidget *parent ) : - KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, - parent ) -{ - TQFrame *topFrame = plainPage(); - TQBoxLayout *topLayout = new TQVBoxLayout( topFrame ); - - mButtonGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), - topFrame ); - mButtonGroup->setRadioButtonExclusive( true ); - topLayout->addWidget( mButtonGroup ); - - TQStringList::ConstIterator it; - for( it = emails.begin(); it != emails.end(); ++it ) { - TQRadioButton *button = new TQRadioButton( *it, mButtonGroup ); - if ( (*it) == current ) { - button->setDown( true ); - } - } -} - -TQString EmailSelectDialog::selected() -{ - TQButton *button = mButtonGroup->selected(); - if ( button ) return button->text(); - return TQString::null; -} - -TQString EmailSelectDialog::getEmail( const TQStringList &emails, const TQString ¤t, - TQWidget *parent ) -{ - EmailSelectDialog *dlg = new EmailSelectDialog( emails, current, parent ); - dlg->exec(); - - TQString result = dlg->selected(); - - delete dlg; - - return result; -} - -class EditEntryItem : public TQListViewItem -{ - public: - EditEntryItem( TQListView *parent, const Addressee &addressee, - const TQString &email=TQString::null ) : - TQListViewItem( parent ), - mAddressee( addressee ), - mEmail( email ) - { - setText( 0, addressee.realName() ); - if( email.isEmpty() ) { - setText( 1, addressee.preferredEmail() ); - setText( 2, i18n("Yes") ); - } else { - setText( 1, email ); - setText( 2, i18n("No") ); - } - } - - Addressee addressee() const - { - return mAddressee; - } - - TQString email() const - { - return mEmail; - } - - private: - Addressee mAddressee; - TQString mEmail; -}; - -DistributionListEditor::DistributionListEditor( AddressBook *addressBook, TQWidget *parent) : - TQWidget( parent ), - mAddressBook( addressBook ) -{ - kdDebug(5700) << "DistributionListEditor()" << endl; - - TQBoxLayout *topLayout = new TQVBoxLayout( this ); - topLayout->setMargin( KDialog::marginHint() ); - topLayout->setSpacing( KDialog::spacingHint() ); - - TQBoxLayout *nameLayout = new TQHBoxLayout( topLayout) ; - - mNameCombo = new TQComboBox( this ); - nameLayout->addWidget( mNameCombo ); - connect( mNameCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateEntryView() ) ); - - newButton = new TQPushButton( i18n("New List"), this ); - nameLayout->addWidget( newButton ); - connect( newButton, TQT_SIGNAL( clicked() ), TQT_SLOT( newList() ) ); - - removeButton = new TQPushButton( i18n("Remove List"), this ); - nameLayout->addWidget( removeButton ); - connect( removeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeList() ) ); - - mEntryView = new TQListView( this ); - mEntryView->addColumn( i18n("Name") ); - mEntryView->addColumn( i18n("Email") ); - mEntryView->addColumn( i18n("Use Preferred") ); - topLayout->addWidget( mEntryView ); - connect(mEntryView,TQT_SIGNAL(selectionChanged ()),this, TQT_SLOT(slotSelectionEntryViewChanged())); - - changeEmailButton = new TQPushButton( i18n("Change Email"), this ); - topLayout->addWidget( changeEmailButton ); - connect( changeEmailButton, TQT_SIGNAL( clicked() ), TQT_SLOT( changeEmail() ) ); - - removeEntryButton = new TQPushButton( i18n("Remove Entry"), this ); - topLayout->addWidget( removeEntryButton ); - connect( removeEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeEntry() ) ); - - addEntryButton = new TQPushButton( i18n("Add Entry"), this ); - topLayout->addWidget( addEntryButton ); - connect( addEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addEntry() ) ); - - mAddresseeView = new TQListView( this ); - mAddresseeView->addColumn( i18n("Name") ); - mAddresseeView->addColumn( i18n("Preferred Email") ); - topLayout->addWidget( mAddresseeView ); - - - connect(mAddresseeView,TQT_SIGNAL(selectionChanged ()),this, TQT_SLOT(slotSelectionAddresseeViewChanged())); - - mManager = new DistributionListManager( mAddressBook ); - mManager->load(); - - updateAddresseeView(); - updateNameCombo(); - removeButton->setEnabled(!mManager->listNames().isEmpty()); -} - -DistributionListEditor::~DistributionListEditor() -{ - kdDebug(5700) << "~DistributionListEditor()" << endl; - - mManager->save(); - delete mManager; -} - -void DistributionListEditor::slotSelectionEntryViewChanged() -{ - EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); - bool state = (entryItem != 0L); - - changeEmailButton->setEnabled(state); - removeEntryButton->setEnabled(state); -} - -void DistributionListEditor::newList() -{ - bool ok = false; - TQString name = KInputDialog::getText( i18n("New Distribution List"), - i18n("Please enter name:"), - TQString::null, &ok, this ); - if ( !ok ) - return; - - new DistributionList( mManager, name ); - - mNameCombo->insertItem( name ); - removeButton->setEnabled(true); - updateEntryView(); -} - -void DistributionListEditor::removeList() -{ - mManager->remove( mManager->list( mNameCombo->currentText() ) ); - mNameCombo->removeItem( mNameCombo->currentItem() ); - removeButton->setEnabled(!mManager->listNames().isEmpty()); - addEntryButton->setEnabled( !mNameCombo->currentText().isEmpty()); - updateEntryView(); -} - -void DistributionListEditor::addEntry() -{ - AddresseeItem *addresseeItem = - dynamic_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); - - if( !addresseeItem ) { - kdDebug(5700) << "DLE::addEntry(): No addressee selected." << endl; - return; - } - - DistributionList *list = mManager->list( mNameCombo->currentText() ); - if ( !list ) { - kdDebug(5700) << "DLE::addEntry(): No dist list '" << mNameCombo->currentText() << "'" << endl; - return; - } - - list->insertEntry( addresseeItem->addressee() ); - updateEntryView(); - slotSelectionAddresseeViewChanged(); -} - -void DistributionListEditor::removeEntry() -{ - DistributionList *list = mManager->list( mNameCombo->currentText() ); - if ( !list ) return; - - EditEntryItem *entryItem = - dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); - if ( !entryItem ) return; - - list->removeEntry( entryItem->addressee(), entryItem->email() ); - delete entryItem; -} - -void DistributionListEditor::changeEmail() -{ - DistributionList *list = mManager->list( mNameCombo->currentText() ); - if ( !list ) return; - - EditEntryItem *entryItem = - dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); - if ( !entryItem ) return; - - TQString email = EmailSelectDialog::getEmail( entryItem->addressee().emails(), - entryItem->email(), this ); - list->removeEntry( entryItem->addressee(), entryItem->email() ); - list->insertEntry( entryItem->addressee(), email ); - - updateEntryView(); -} - -void DistributionListEditor::updateEntryView() -{ - DistributionList *list = mManager->list( mNameCombo->currentText() ); - if ( !list ) return; - - mEntryView->clear(); - DistributionList::Entry::List entries = list->entries(); - DistributionList::Entry::List::ConstIterator it; - for( it = entries.begin(); it != entries.end(); ++it ) { - new EditEntryItem( mEntryView, (*it).addressee, (*it).email ); - } - EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); - bool state = (entryItem != 0L); - - changeEmailButton->setEnabled(state); - removeEntryButton->setEnabled(state); -} - -void DistributionListEditor::updateAddresseeView() -{ - mAddresseeView->clear(); - - AddressBook::Iterator it; - for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { - new AddresseeItem( mAddresseeView, *it ); - } -} - -void DistributionListEditor::updateNameCombo() -{ - mNameCombo->insertStringList( mManager->listNames() ); - - updateEntryView(); -} - -void DistributionListEditor::slotSelectionAddresseeViewChanged() -{ - AddresseeItem *addresseeItem = - dynamic_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); - bool state = (addresseeItem != 0L); - addEntryButton->setEnabled( state && !mNameCombo->currentText().isEmpty()); -} diff --git a/kabc/distributionlisteditor.h b/kabc/distributionlisteditor.h deleted file mode 100644 index faec280e6..000000000 --- a/kabc/distributionlisteditor.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_DISTRIBUTIONLISTEDITOR_H -#define KABC_DISTRIBUTIONLISTEDITOR_H - -#include <tqwidget.h> - -#include <kdialogbase.h> - -class TQListView; -class TQComboBox; -class TQButtonGroup; - -namespace KABC { - -class AddressBook; -class DistributionListManager; - -class KABC_EXPORT EmailSelectDialog : public KDialogBase -{ - public: - EmailSelectDialog( const TQStringList &emails, const TQString ¤t, - TQWidget *parent ); - - TQString selected(); - - static TQString getEmail( const TQStringList &emails, const TQString ¤t, - TQWidget *parent ); - - private: - TQButtonGroup *mButtonGroup; -}; - -/** - @obsolete -*/ -class DistributionListEditor : public TQWidget -{ - Q_OBJECT - public: - DistributionListEditor( AddressBook *, TQWidget *parent ); - virtual ~DistributionListEditor(); - - private slots: - void newList(); - void removeList(); - void addEntry(); - void removeEntry(); - void changeEmail(); - void updateEntryView(); - void updateAddresseeView(); - void updateNameCombo(); - void slotSelectionEntryViewChanged(); - void slotSelectionAddresseeViewChanged(); - - private: - TQComboBox *mNameCombo; - TQListView *mEntryView; - TQListView *mAddresseeView; - - AddressBook *mAddressBook; - DistributionListManager *mManager; - TQPushButton *newButton, *removeButton; - TQPushButton *changeEmailButton,*removeEntryButton,*addEntryButton; -}; - -} - -#endif diff --git a/kabc/errorhandler.cpp b/kabc/errorhandler.cpp deleted file mode 100644 index d8ab650c7..000000000 --- a/kabc/errorhandler.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> - Copyright (c) 2003 Cornelius Schumacher <schumacher@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 <kdebug.h> -#include <klocale.h> -#include <kmessagebox.h> - -#include <tqapplication.h> - -#include "errorhandler.h" - -using namespace KABC; - -void ConsoleErrorHandler::error( const TQString &msg ) -{ - // no debug area is ok here - kdError() << msg << endl; -} - - -void GUIErrorHandler::error( const TQString &msg ) -{ - KMessageBox::error( 0, msg, i18n( "Error in libkabc" ) ); -} - - -GuiErrorHandler::GuiErrorHandler( TQWidget *parent ) - : mParent( parent ) -{ -} - -void GuiErrorHandler::error( const TQString &msg ) -{ - if (tqApp) - KMessageBox::error( mParent, msg ); -} diff --git a/kabc/errorhandler.h b/kabc/errorhandler.h deleted file mode 100644 index 9a316541d..000000000 --- a/kabc/errorhandler.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> - Copyright (c) 2003 Cornelius Schumacher <schumacher@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 KABC_ERRORHANDLER_H -#define KABC_ERRORHANDLER_H - -#include <tqstring.h> - -#include <tdelibs_export.h> - -class TQWidget; - -namespace KABC { - -/** - Abstract class that provides displaying of error messages. - We need this to make libkabc gui independent on the one side - and provide user friendly error messages on the other side. - Use @p ConsoleErrorHandler or @p GuiErrorHandler in your - application or provide your own ErrorHandler. -*/ -class KABC_EXPORT ErrorHandler -{ - public: - /** - Show error message. - */ - virtual void error( const TQString &msg ) = 0; -}; - -/** - This class prints the error messages to stderr via kdError(). -*/ -class KABC_EXPORT ConsoleErrorHandler : public ErrorHandler -{ - public: - virtual void error( const TQString &msg ); -}; - -/** - This class shows messages boxes for every - error message. - - \deprecated Use GuiErrorHandler instead. -*/ -class KABC_EXPORT GUIErrorHandler : public ErrorHandler -{ - public: - virtual void error( const TQString &msg ); -}; - -/** - This class shows messages boxes for every - error message. -*/ -class KABC_EXPORT GuiErrorHandler : public ErrorHandler -{ - public: - /** - Create error handler. - - \param parent Widget which is used as parent for the error dialogs. - */ - GuiErrorHandler( TQWidget *parent ); - - virtual void error( const TQString &msg ); - - private: - TQWidget *mParent; - - class Private; - Private *d; -}; - -} - -#endif diff --git a/kabc/field.h b/kabc/field.h deleted file mode 100644 index 118ce2d51..000000000 --- a/kabc/field.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Cornelius Schumacher <schumacher@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 KABC_FIELD_H -#define KABC_FIELD_H - -#include <tqstring.h> -#include <tqvaluelist.h> - -#include "addressee.h" - -class TDEConfig; - -namespace KABC { - -class KABC_EXPORT Field -{ - class FieldImpl; - friend class FieldImpl; - -public: - typedef TQValueList<Field *> List; - - /** - * @li @p All - - * @li @p Frequent - - * @li @p Address - - * @li @p Email - - * @li @p Personal - - * @li @p Organization - - * @li @p CustomCategory - - */ - enum FieldCategory - { - All = 0x0, - Frequent = 0x01, - Address = 0x02, - Email = 0x04, - Personal = 0x08, - Organization = 0x10, - CustomCategory = 0x20 - }; - - /** - * Returns the translated label for this field. - */ - virtual TQString label(); - - /** - * Returns the ored categories the field belongs to. - */ - virtual int category(); - - /** - * Returns the translated label for field category. - */ - static TQString categoryLabel( int category ); - - /** - * Returns a string representation of the value the field has in the given - * Addressee. Returns TQString::null, if it is not possible to convert the - * value to a string. - */ - virtual TQString value( const KABC::Addressee & ); - - /** - * Sets the value of the field in the given Addressee. Returns true on success - * or false, if the given string couldn't be converted to a valid value. - */ - virtual bool setValue( KABC::Addressee &, const TQString & ); - - /** - * Returns a string, that can be used for sorting. - */ - TQString sortKey( const KABC::Addressee & ); - - /** - * Returns, if the field is a user-defined field. - */ - virtual bool isCustom(); - - /** - * Returns, if the field is equal with @a field. - */ - virtual bool equals( Field *field ); - - /** - * Returns a list of all fields. - */ - static Field::List allFields(); - - /** - * Returns a list of the default fields. - */ - static Field::List defaultFields(); - - /** - * Creates a custom field. - * - * @param label The label for this field - * @param category The category of this field - * @param key Unique key for this field - * @param app Unique app name for this field - */ - static Field *createCustomField( const TQString &label, int category, - const TQString &key, const TQString &app ); - - /** - * Delete all fields from list. - */ - static void deleteFields(); - - /** - * Save the field settings to a config file. - * - * @param cfg The config file object - * @param identifier The unique identifier - * @param fields The list of the fields - */ - static void saveFields( TDEConfig *cfg, const TQString &identifier, - const Field::List &fields ); - /** - * This is the same as above, with the difference, that - * the list is stored in TDEGlobal::config() in group "KABCFields". - */ - static void saveFields( const TQString &identifier, - const Field::List &fields ); - - /** - * Load the field settings from a config file. - * - * @param cfg The config file object - * @param identifier The unique identifier - */ - static Field::List restoreFields( TDEConfig *cfg, const TQString &identifier ); - - /** - * This is the same as above, with the difference, that - * the list is loaded from TDEGlobal::config() from group "KABCFields". - */ - static Field::List restoreFields( const TQString &identifier ); - -protected: - static void createField( int id, int category = 0 ); - static void createDefaultField( int id, int category = 0 ); - -private: - Field( FieldImpl * ); - virtual ~Field(); - - FieldImpl *mImpl; - - static Field::List mAllFields; - static Field::List mDefaultFields; - static Field::List mCustomFields; -}; - -} -#endif diff --git a/kabc/format.h b/kabc/format.h deleted file mode 100644 index ed036673c..000000000 --- a/kabc/format.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_FORMAT_H -#define KABC_FORMAT_H - -#include <tqstring.h> - -#include <tdelibs_export.h> - -namespace KABC { - -class AddressBook; - -/** - @deprecated use FormatPlugin instead -*/ -class KABC_EXPORT_DEPRECATED Format -{ - public: - /** - Load addressbook from file. - */ - virtual bool load( AddressBook *, const TQString &fileName ) = 0; - /** - Save addressbook to file. - */ - virtual bool save( AddressBook *, const TQString &fileName ) = 0; -}; - -} - -#endif diff --git a/kabc/formatfactory.cpp b/kabc/formatfactory.cpp deleted file mode 100644 index 17e7b0f33..000000000 --- a/kabc/formatfactory.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <kdebug.h> -#include <klocale.h> -#include <ksimpleconfig.h> -#include <kstandarddirs.h> -#include <kstaticdeleter.h> - -#include <tqfile.h> - -#include "vcardformatplugin.h" - -#include "formatfactory.h" - -using namespace KABC; - -FormatFactory *FormatFactory::mSelf = 0; -static KStaticDeleter<FormatFactory> factoryDeleter; - -FormatFactory *FormatFactory::self() -{ - kdDebug(5700) << "FormatFactory::self()" << endl; - - if ( !mSelf ) - factoryDeleter.setObject( mSelf, new FormatFactory ); - - return mSelf; -} - -FormatFactory::FormatFactory() -{ - mFormatList.setAutoDelete( true ); - - // dummy entry for default format - FormatInfo *info = new FormatInfo; - info->library = "<NoLibrary>"; - info->nameLabel = i18n( "vCard" ); - info->descriptionLabel = i18n( "vCard Format" ); - mFormatList.insert( "vcard", info ); - - const TQStringList list = TDEGlobal::dirs()->findAllResources( "data" ,"kabc/formats/*.desktop", true, true ); - for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) - { - KSimpleConfig config( *it, true ); - - if ( !config.hasGroup( "Misc" ) || !config.hasGroup( "Plugin" ) ) - continue; - - info = new FormatInfo; - - config.setGroup( "Plugin" ); - TQString type = config.readEntry( "Type" ); - info->library = config.readEntry( "X-TDE-Library" ); - - config.setGroup( "Misc" ); - info->nameLabel = config.readEntry( "Name" ); - info->descriptionLabel = config.readEntry( "Comment", i18n( "No description available." ) ); - - mFormatList.insert( type, info ); - } -} - -FormatFactory::~FormatFactory() -{ - mFormatList.clear(); -} - -TQStringList FormatFactory::formats() -{ - TQStringList retval; - - // make sure 'vcard' is the first entry - retval << "vcard"; - - TQDictIterator<FormatInfo> it( mFormatList ); - for ( ; it.current(); ++it ) - if ( it.currentKey() != "vcard" ) - retval << it.currentKey(); - - return retval; -} - -FormatInfo *FormatFactory::info( const TQString &type ) -{ - if ( type.isEmpty() ) - return 0; - else - return mFormatList[ type ]; -} - -FormatPlugin *FormatFactory::format( const TQString& type ) -{ - FormatPlugin *format = 0; - - if ( type.isEmpty() ) - return 0; - - if ( type == "vcard" ) { - format = new VCardFormatPlugin; - format->setType( type ); - format->setNameLabel( i18n( "vCard" ) ); - format->setDescriptionLabel( i18n( "vCard Format" ) ); - return format; - } - - FormatInfo *fi = mFormatList[ type ]; - if (!fi) - return 0; - TQString libName = fi->library; - - KLibrary *library = openLibrary( libName ); - if ( !library ) - return 0; - - void *format_func = library->symbol( "format" ); - - if ( format_func ) { - format = ((FormatPlugin* (*)())format_func)(); - format->setType( type ); - format->setNameLabel( fi->nameLabel ); - format->setDescriptionLabel( fi->descriptionLabel ); - } else { - kdDebug( 5700 ) << "'" << libName << "' is not a format plugin." << endl; - return 0; - } - - return format; -} - - -KLibrary *FormatFactory::openLibrary( const TQString& libName ) -{ - KLibrary *library = 0; - - TQString path = KLibLoader::findLibrary( TQFile::encodeName( libName ) ); - - if ( path.isEmpty() ) { - kdDebug( 5700 ) << "No format plugin library was found!" << endl; - return 0; - } - - library = KLibLoader::self()->library( TQFile::encodeName( path ) ); - - if ( !library ) { - kdDebug( 5700 ) << "Could not load library '" << libName << "'" << endl; - return 0; - } - - return library; -} diff --git a/kabc/formatfactory.h b/kabc/formatfactory.h deleted file mode 100644 index ff9da5504..000000000 --- a/kabc/formatfactory.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_FORMATFACTORY_H -#define KABC_FORMATFACTORY_H - -#include <tqdict.h> -#include <tqstring.h> - -#include <tdeconfig.h> -#include <klibloader.h> - -#include "formatplugin.h" - -namespace KABC { - -struct FormatInfo -{ - TQString library; - TQString nameLabel; - TQString descriptionLabel; -}; - -/** - * Class for loading format plugins. - * - * Example: - * - * \code - * KABC::FormatFactory *factory = KABC::FormatFactory::self(); - * - * TQStringList list = factory->formats(); - * TQStringList::Iterator it; - * for ( it = list.begin(); it != list.end(); ++it ) { - * KABC::FormatPlugin *format = factory->format( (*it) ); - * // do something with format - * } - * \endcode - */ -class KABC_EXPORT FormatFactory -{ - public: - - /** - Destructor. - */ - ~FormatFactory(); - - /** - * Returns the global format factory. - */ - static FormatFactory *self(); - - /** - * Returns a pointer to a format object or a null pointer - * if format type doesn't exist. - * - * @param type The type of the format, returned by formats() - */ - FormatPlugin *format( const TQString &type ); - - /** - * Returns a list of all available format types. - */ - TQStringList formats(); - - /** - * Returns the info structure for a special type. - */ - FormatInfo *info( const TQString &type ); - - protected: - FormatFactory(); - - private: - KLibrary *openLibrary( const TQString& libName ); - - static FormatFactory *mSelf; - - TQDict<FormatInfo> mFormatList; -}; - -} -#endif diff --git a/kabc/formatplugin.h b/kabc/formatplugin.h deleted file mode 100644 index 33f4beea0..000000000 --- a/kabc/formatplugin.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_FORMATPLUGIN_H -#define KABC_FORMATPLUGIN_H - -#include <tqfile.h> - -#include "plugin.h" -#include "resource.h" - -namespace KABC { - -class AddressBook; -class Addressee; - -/** - * @short Base class for address book formats. - * - * This class provides an abstract interface for ResourceFile and - * ResourceDir formats. - * - * @internal - */ -class KABC_EXPORT FormatPlugin : public Plugin -{ -public: - - /** - * Load single addressee from file. - */ - virtual bool load( Addressee &, TQFile *file ) = 0; - - /** - * Load whole addressbook from file. - */ - virtual bool loadAll( AddressBook *, Resource *, TQFile *file ) = 0; - - /** - * Save a single Addressee to file. - */ - virtual void save( const Addressee &, TQFile *file ) = 0; - - /** - * Save whole addressbook to file. - */ - virtual void saveAll( AddressBook *, Resource *, TQFile *file ) = 0; - - /** - * Checks if given file contains the right format - */ - virtual bool checkFormat( TQFile *file ) const = 0; -}; - -} -#endif diff --git a/kabc/formats/CMakeLists.txt b/kabc/formats/CMakeLists.txt deleted file mode 100644 index 60ea1c3fd..000000000 --- a/kabc/formats/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_BINARY_DIR}/kabc - ${CMAKE_SOURCE_DIR}/kabc - - ${TQT_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdeio -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### other data ################################ - -install( FILES binary.desktop DESTINATION ${DATA_INSTALL_DIR}/kabc/formats ) - - -##### kabcformat_binary ######################### - -set( target kabcformat_binary ) - -set( ${target}_SRCS - binaryformat.cpp -) - -tde_add_kpart( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK kabc-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/kabc/formats/Makefile.am b/kabc/formats/Makefile.am deleted file mode 100644 index 57c2caaa3..000000000 --- a/kabc/formats/Makefile.am +++ /dev/null @@ -1,22 +0,0 @@ -INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) - -kde_module_LTLIBRARIES = kabcformat_binary.la - -kabcformat_binary_la_SOURCES = binaryformat.cpp -kabcformat_binary_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) \ - -no-undefined -kabcformat_binary_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(LIB_TDECORE) -kabcformat_binary_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h - -# these are the headers for your project -noinst_HEADERS = binaryformat.h - -# let automoc handle all of the meta source files (moc) -METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kabcformat_binary.pot - -linkdir = $(kde_datadir)/kabc/formats -link_DATA = binary.desktop -EXTRA_DIST = $(link_DATA) diff --git a/kabc/formats/binary.desktop b/kabc/formats/binary.desktop deleted file mode 100644 index 993286ad5..000000000 --- a/kabc/formats/binary.desktop +++ /dev/null @@ -1,89 +0,0 @@ -[Misc] -Name=Binary -Name[af]=Binêre -Name[ar]=ثنائي -Name[az]=İcraçı -Name[be]=Двайковы -Name[bg]=Двоичен -Name[bn]=বাইনারি -Name[br]=Binarel -Name[bs]=Binarno -Name[ca]=Binari -Name[cs]=Binární -Name[csb]=Binarny -Name[cy]=Deuaidd -Name[da]=Binær -Name[de]=Binär -Name[el]=Δυαδικό -Name[eo]=Duuma -Name[es]=Binario -Name[et]=Binaar -Name[eu]=Bitarra -Name[fa]=دوگانی -Name[fi]=Binääri -Name[fr]=Binaire -Name[fy]=Binêr -Name[ga]=Dénártha -Name[gl]=Binário -Name[he]=בינרית -Name[hi]=दà¥à¤µà¤¿à¤šà¤° -Name[hr]=Binarno -Name[hsb]=Binarny -Name[hu]=Bináris -Name[id]=Biner -Name[is]=Tvíunda -Name[it]=Binario -Name[ja]=ãƒã‚¤ãƒŠãƒª -Name[ka]=áƒáƒ áƒáƒ‘ითი -Name[kk]=Бинарлық -Name[km]=គោលពីរ -Name[ko]=ë°”ì´ë„ˆë¦¬ -Name[lb]=Binär -Name[lt]=Dvejetainis -Name[lv]=BinÄrs -Name[mk]=Бинарен -Name[mn]=Бинар -Name[ms]=Binari -Name[mt]=Binarju -Name[nb]=Binær -Name[nds]=Bineer -Name[ne]=बाइनरी -Name[nl]=Binair -Name[nn]=Binær -Name[nso]=Tselapedi -Name[pa]=ਬਾਈਨਰੀ -Name[pl]=Binarny -Name[pt]=Binário -Name[pt_BR]=Binário -Name[ro]=Binar -Name[ru]=Двоичный -Name[rw]=Nyabibiri -Name[se]=Binára -Name[sk]=Binárny -Name[sl]=DvojiÅ¡ko -Name[sq]=Binarë -Name[sr]=Бинарни -Name[sr@Latn]=Binarni -Name[ss]=Lokuhamab ngakubili -Name[sv]=Binär -Name[ta]=இரà¯à®®à®®à¯ -Name[te]=à°¦à±à°µà°¿à°¯à°¾à°¶à°‚ -Name[tg]=Дутартиба -Name[th]=ไบนารี -Name[tr]=İkili -Name[tt]=Binar -Name[uk]=Двійковий -Name[uz]=Binar -Name[uz@cyrillic]=Бинар -Name[ven]=Zwivhili -Name[vi]=Nhị phân -Name[wa]=Binaire -Name[xh]=Ephindwe kabini -Name[zh_CN]=二进制 -Name[zh_HK]=äºŒé€²ä½ -Name[zh_TW]=äºŒé€²ä½ -Name[zu]=Okuhambisana ngambili - -[Plugin] -Type=binary -X-TDE-Library=kabcformat_binary diff --git a/kabc/formats/binaryformat.cpp b/kabc/formats/binaryformat.cpp deleted file mode 100644 index a82a017a3..000000000 --- a/kabc/formats/binaryformat.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqdatastream.h> -#include <tqimage.h> - -#include <kdebug.h> -#include <klocale.h> -#include <kstandarddirs.h> - -#include "addressbook.h" -#include "addressee.h" -#include "picture.h" -#include "sound.h" - -#include "binaryformat.h" - -#define BINARY_FORMAT_VERSION 1 - -using namespace KABC; - -extern "C" -{ - KDE_EXPORT FormatPlugin *format() - { - return new BinaryFormat; - } -} - -bool BinaryFormat::load( Addressee &addressee, TQFile *file ) -{ - kdDebug(5700) << "BinaryFormat::load()" << endl; - TQDataStream stream( file ); - - if ( !checkHeader( stream ) ) - return false; - - loadAddressee( addressee, stream ); - - return true; -} - -bool BinaryFormat::loadAll( AddressBook*, Resource *resource, TQFile *file ) -{ - kdDebug(5700) << "BinaryFormat::loadAll()" << endl; - - TQDataStream stream( file ); - - if ( !checkHeader( stream ) ) - return false; - - TQ_UINT32 entries; - - stream >> entries; - - for ( uint i = 0; i < entries; ++i ) { - Addressee addressee; - loadAddressee( addressee, stream ); - addressee.setResource( resource ); - addressee.setChanged( false ); - resource->insertAddressee( addressee ); - } - - return true; -} - -void BinaryFormat::save( const Addressee &addressee, TQFile *file ) -{ - kdDebug(5700) << "BinaryFormat::save()" << endl; - - TQDataStream stream( file ); - - writeHeader( stream ); - - TQ_UINT32 entries = 1; - stream << entries; - saveAddressee( addressee, stream ); -} - -void BinaryFormat::saveAll( AddressBook*, Resource *resource, TQFile *file ) -{ - kdDebug(5700) << "BinaryFormat::saveAll()" << endl; - - TQ_UINT32 counter = 0; - TQDataStream stream( file ); - - writeHeader( stream ); - // set dummy number of entries - stream << counter; - - Resource::Iterator it; - for ( it = resource->begin(); it != resource->end(); ++it ) { - saveAddressee( (*it), stream ); - counter++; - (*it).setChanged( false ); - } - - // set real number of entries - stream.device()->at( 2 * sizeof( TQ_UINT32 ) ); - stream << counter; -} - -bool BinaryFormat::checkFormat( TQFile *file ) const -{ - kdDebug(5700) << "BinaryFormat::checkFormat()" << endl; - - TQDataStream stream( file ); - - return checkHeader( stream ); -} - -bool BinaryFormat::checkHeader( TQDataStream &stream ) const -{ - TQ_UINT32 magic, version; - - stream >> magic >> version; - - TQFile *file = dynamic_cast<TQFile*>( stream.device() ); - - if ( !file ) { - kdError() << i18n("Not a file?") << endl; - return false; - } - - if ( magic != 0x2e93e ) { - kdError() << TQString(i18n("File '%1' is not binary format.").arg( file->name() )) << endl; - return false; - } - - if ( version != BINARY_FORMAT_VERSION ) { - kdError() << TQString(i18n("File '%1' is the wrong version.").arg( file->name() )) << endl; - return false; - } - - return true; -} - -void BinaryFormat::writeHeader( TQDataStream &stream ) -{ - TQ_UINT32 magic, version; - - magic = 0x2e93e; - version = BINARY_FORMAT_VERSION; - - stream << magic << version; -} - -void BinaryFormat::loadAddressee( Addressee &addressee, TQDataStream &stream ) -{ - stream >> addressee; -/* - // load pictures - Picture photo = addressee.photo(); - Picture logo = addressee.logo(); - - if ( photo.isIntern() ) { - TQImage img; - if ( !img.load( locateLocal( "data", "kabc/photos/" ) + addressee.uid() ) ) - kdDebug(5700) << "No photo available for '" << addressee.uid() << "'." << endl; - - addressee.setPhoto( img ); - } - - if ( logo.isIntern() ) { - TQImage img; - if ( !img.load( locateLocal( "data", "kabc/logos/" ) + addressee.uid() ) ) - kdDebug(5700) << "No logo available for '" << addressee.uid() << "'." << endl; - - addressee.setLogo( img ); - } - - // load sound - // TODO: load sound data from file -*/ -} - -void BinaryFormat::saveAddressee( const Addressee &addressee, TQDataStream &stream ) -{ - stream << addressee; -/* - // load pictures - Picture photo = addressee.photo(); - Picture logo = addressee.logo(); - - if ( photo.isIntern() ) { - TQImage img = photo.data(); - TQString fileName = locateLocal( "data", "kabc/photos/" ) + addressee.uid(); - - if ( !img.save( fileName, "PNG" ) ) - kdDebug(5700) << "Unable to save photo for '" << addressee.uid() << "'." << endl; - } - - if ( logo.isIntern() ) { - TQImage img = logo.data(); - TQString fileName = locateLocal( "data", "kabc/logos/" ) + addressee.uid(); - - if ( !img.save( fileName, "PNG" ) ) - kdDebug(5700) << "Unable to save logo for '" << addressee.uid() << "'." << endl; - } - - // save sound - // TODO: save the sound data to file -*/ -} diff --git a/kabc/formats/binaryformat.h b/kabc/formats/binaryformat.h deleted file mode 100644 index 09efde41a..000000000 --- a/kabc/formats/binaryformat.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_BINARYFORMAT_H -#define KABC_BINARYFORMAT_H - -#include "formatplugin.h" - -namespace KABC { - -class AddressBook; -class Addressee; - -/** - @short binary file format for addressbook entries. -*/ -class BinaryFormat : public FormatPlugin -{ -public: - /** - * Load single addressee from file. - */ - bool load( Addressee &, TQFile *file ); - - /** - * Load whole addressee from file. - */ - bool loadAll( AddressBook *, Resource *, TQFile *file ); - - /** - * Save single addressee to file. - */ - void save( const Addressee &, TQFile *file ); - - /** - * Save all addressees to file. - */ - void saveAll( AddressBook *, Resource *, TQFile *file ); - - /** - * Check for valid format of a file. - */ - bool checkFormat( TQFile *file ) const; - -private: - void loadAddressee( Addressee &, TQDataStream & ); - void saveAddressee( const Addressee &, TQDataStream & ); - bool checkHeader( TQDataStream & ) const; - void writeHeader( TQDataStream & ); -}; - -} -#endif diff --git a/kabc/geo.cpp b/kabc/geo.cpp deleted file mode 100644 index 44f9851e4..000000000 --- a/kabc/geo.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqdatastream.h> - -#include "geo.h" - -using namespace KABC; - -Geo::Geo() - : mLatitude( 91 ), mLongitude( 181 ), mValidLat( false ), mValidLong( false ) -{ -} - -Geo::Geo( float latitude, float longitude ) -{ - setLatitude( latitude ); - setLongitude( longitude ); -} - -void Geo::setLatitude( float latitude ) -{ - if ( latitude >= -90 && latitude <= 90 ) { - mLatitude = latitude; - mValidLat = true; - } else { - mLatitude = 91; - mValidLat = false; - } -} - -float Geo::latitude() const -{ - return mLatitude; -} - -void Geo::setLongitude( float longitude) -{ - if ( longitude >= -180 && longitude <= 180 ) { - mLongitude = longitude; - mValidLong = true; - } else { - mLongitude = 181; - mValidLong = false; - } -} - -float Geo::longitude() const -{ - return mLongitude; -} - -bool Geo::isValid() const -{ - return mValidLat && mValidLong; -} - -bool Geo::operator==( const Geo &g ) const -{ - if ( !g.isValid() && !isValid() ) return true; - if ( !g.isValid() || !isValid() ) return false; - if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude ) return true; - return false; -} - -bool Geo::operator!=( const Geo &g ) const -{ - if ( !g.isValid() && !isValid() ) return false; - if ( !g.isValid() || !isValid() ) return true; - if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude ) return false; - return true; -} - -TQString Geo::asString() const -{ - return "(" + TQString::number(mLatitude) + "," + TQString::number(mLongitude) + ")"; -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Geo &geo ) -{ - return s << (float)geo.mLatitude << (float)geo.mLongitude; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Geo &geo ) -{ - s >> geo.mLatitude >> geo.mLongitude; - - geo.mValidLat = true; - geo.mValidLong = true; - - return s; -} diff --git a/kabc/geo.h b/kabc/geo.h deleted file mode 100644 index cac6abaff..000000000 --- a/kabc/geo.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_GEO_H -#define KABC_GEO_H - -#include <tqstring.h> - -#include <tdelibs_export.h> - -namespace KABC { - -/** - @short Geographic position - - This class represents a geographic position. -*/ -class KABC_EXPORT Geo -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Geo & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Geo & ); - - public: - /** - Construct invalid geographics position object. - */ - Geo(); - - /** - Construct geographics position object. - - @param latitude Geographical latitude - @param longitude Geographical longitude - */ - Geo( float latitude, float longitude ); - - /** - Sets the latitude. - */ - void setLatitude( float ); - - /** - Returns the latitude. - */ - float latitude() const; - - /** - Sets the longitude. - */ - void setLongitude( float ); - - /** - Returns the longitude. - */ - float longitude() const; - - /** - Returns, if this object contains a valid geographical position. - */ - bool isValid() const; - - bool operator==( const Geo & ) const; - bool operator!=( const Geo & ) const; - - /** - Returns string representation of geographical position. - */ - TQString asString() const; - - private: - float mLatitude; - float mLongitude; - - bool mValid; - bool mValidLat; - bool mValidLong; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Geo & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Geo & ); - -} - -#endif diff --git a/kabc/kabc_manager.desktop b/kabc/kabc_manager.desktop deleted file mode 100644 index 0af910f52..000000000 --- a/kabc/kabc_manager.desktop +++ /dev/null @@ -1,76 +0,0 @@ -[Desktop Entry] -Name=Contacts -Name[af]=Kontakte -Name[ar]=المراسلين -Name[be]=Кантакты -Name[br]=Darempredoù -Name[bs]=Kontakti -Name[ca]=Contactes -Name[cs]=Kontakty -Name[csb]=ÅÄ…czbë -Name[cy]=Cysylltau -Name[da]=Kontakter -Name[de]=Kontakte -Name[el]=Επαφές -Name[eo]=Kontaktoj -Name[es]=Contactos -Name[et]=Kontaktid -Name[eu]=Kontaktuak -Name[fa]=تماسها -Name[fi]=Yhteystiedot -Name[fy]=Kontakten -Name[ga]=Teagmhálacha -Name[gl]=Contactos -Name[he]=×נשי קשר -Name[hi]=समà¥à¤ªà¤°à¥à¤• -Name[hr]=Kontakti -Name[hsb]=Adresy -Name[hu]=Névjegyek -Name[id]=Kontak -Name[is]=Tengiliðir -Name[it]=Contatti -Name[ja]=コンタクト -Name[ka]=კáƒáƒœáƒ¢áƒáƒ¥áƒ¢áƒ”ბი -Name[kk]=Контакттар -Name[km]=ទំនាក់ទំនង -Name[ku]=Tekilî -Name[lb]=Kontakter -Name[lt]=Kontaktai -Name[lv]=Kontakti -Name[mk]=Контакти -Name[ms]=Hubungan -Name[nb]=Kontakter -Name[nds]=Kontakten -Name[ne]=समà¥à¤ªà¤°à¥à¤• -Name[nl]=Contactpersonen -Name[nn]=Kontaktar -Name[pa]=ਸੰਪਰਕ -Name[pl]=Kontakty -Name[pt]=Contactos -Name[pt_BR]=Contatos -Name[ro]=Contacte -Name[ru]=Контакты -Name[rw]=Amaderesi -Name[se]=OktavuoÄ‘at -Name[sk]=Kontakty -Name[sl]=Stiki -Name[sr]=Контакти -Name[sr@Latn]=Kontakti -Name[sv]=Kontakter -Name[ta]=தொடரà¯à®ªà¯à®•ள௠-Name[te]=సంపà±à°°à°¦à°¿à°‚à°ªà±à°²à± -Name[tg]=Ðлоқаҳо -Name[th]=รายชื่อติดต่อ -Name[tr]=BaÄŸlantılar -Name[tt]=Elemtälär -Name[uk]=Контакти -Name[uz]=Aloqalar -Name[uz@cyrillic]=Ðлоқалар -Name[vi]=Liên lạc -Name[zh_CN]=è”系人 -Name[zh_HK]=è¯çµ¡äºº -Name[zh_TW]=è¯çµ¡äºº -Type=Service -ServiceTypes=KResources/Manager - -X-TDE-ResourceFamily=contact diff --git a/kabc/key.cpp b/kabc/key.cpp deleted file mode 100644 index 7c66579b3..000000000 --- a/kabc/key.cpp +++ /dev/null @@ -1,153 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <tdeapplication.h> -#include <klocale.h> - -#include "key.h" - -using namespace KABC; - -Key::Key( const TQString &text, int type ) - : mTextData( text ), mIsBinary( false ), mType( type ) -{ - mId = TDEApplication::randomString(8); -} - -Key::~Key() -{ -} - -bool Key::operator==( const Key &k ) const -{ - if ( mIsBinary != k.mIsBinary ) return false; - if ( mIsBinary ) - if ( mBinaryData != k.mBinaryData ) return false; - else - if ( mTextData != k.mTextData ) return false; - if ( mType != k.mType ) return false; - if ( mCustomTypeString != k.mCustomTypeString ) return false; - - return true; -} - -bool Key::operator!=( const Key &k ) const -{ - return !( k == *this ); -} - -void Key::setId( const TQString &id ) -{ - mId = id; -} - -TQString Key::id() const -{ - return mId; -} - -void Key::setBinaryData( const TQByteArray &binary ) -{ - mBinaryData = binary; - mIsBinary = true; -} - -TQByteArray Key::binaryData() const -{ - return mBinaryData; -} - -void Key::setTextData( const TQString &text ) -{ - mTextData = text; - mIsBinary = false; -} - -TQString Key::textData() const -{ - return mTextData; -} - -bool Key::isBinary() const -{ - return mIsBinary; -} - -void Key::setType( int type ) -{ - mType = type; -} - -void Key::setCustomTypeString( const TQString &custom ) -{ - mCustomTypeString = custom; -} - -int Key::type() const -{ - return mType; -} - -TQString Key::customTypeString() const -{ - return mCustomTypeString; -} - -Key::TypeList Key::typeList() -{ - TypeList list; - list << X509; - list << PGP; - list << Custom; - - return list; -} - -TQString Key::typeLabel( int type ) -{ - switch ( type ) { - case X509: - return i18n( "X509" ); - break; - case PGP: - return i18n( "PGP" ); - break; - case Custom: - return i18n( "Custom" ); - break; - default: - return i18n( "Unknown type" ); - break; - } -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Key &key ) -{ - return s << key.mId << key.mIsBinary << key.mTextData << key.mBinaryData << - key.mCustomTypeString << key.mType; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Key &key ) -{ - s >> key.mId >> key.mIsBinary >> key.mTextData >> key.mBinaryData >> - key.mCustomTypeString >> key.mType; - - return s; -} diff --git a/kabc/key.h b/kabc/key.h deleted file mode 100644 index 08df0264d..000000000 --- a/kabc/key.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_KEY_H -#define KABC_KEY_H - -#include <tqvaluelist.h> - -#include <tdelibs_export.h> - -namespace KABC { - -/** - * @short A class to store an encryption key. - */ -class KABC_EXPORT Key -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Key & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Key & ); - -public: - typedef TQValueList<Key> List; - typedef TQValueList<int> TypeList; - - /** - * Key types - * - * @li X509 - X509 key - * @li PGP - Pretty Good Privacy key - * @li Custom - Custom or IANA conform key - */ - enum Types { - X509, - PGP, - Custom - }; - - /** - * Constructor. - * - * @param text The text data. - * @param type The key type, see Types. - */ - Key( const TQString &text = TQString::null, int type = PGP ); - - /** - * Destructor. - */ - ~Key(); - - bool operator==( const Key & ) const; - bool operator!=( const Key & ) const; - - /** - * Sets the unique identifier. - */ - void setId( const TQString &id ); - - /** - * Returns the unique identifier. - */ - TQString id() const; - - /** - * Sets binary data. - */ - void setBinaryData( const TQByteArray &binary ); - - /** - * Returns the binary data. - */ - TQByteArray binaryData() const; - - /** - * Sets text data. - */ - void setTextData( const TQString &text ); - - /** - * Returns the text data. - */ - TQString textData() const; - - /** - * Returns whether the key contains binary or text data. - */ - bool isBinary() const; - - /** - * Sets the type, see Type. - */ - void setType( int type ); - - /** - * Sets custom type string. - */ - void setCustomTypeString( const TQString &custom ); - - /** - * Returns the type, see Type. - */ - int type() const; - - /** - * Returns the custom type string. - */ - TQString customTypeString() const; - - /** - * Returns a list of all available key types. - */ - static TypeList typeList(); - - /** - * Returns a translated label for a given key type. - */ - static TQString typeLabel( int type ); - -private: - TQByteArray mBinaryData; - TQString mId; - TQString mTextData; - TQString mCustomTypeString; - - int mIsBinary; - int mType; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Key & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Key & ); - -} -#endif diff --git a/kabc/ldapclient.cpp b/kabc/ldapclient.cpp deleted file mode 100644 index 1c2b2d833..000000000 --- a/kabc/ldapclient.cpp +++ /dev/null @@ -1,427 +0,0 @@ -/* kldapclient.cpp - LDAP access - * Copyright (C) 2002 Klarälvdalens Datakonsult AB - * - * Author: Steffen Hansen <hansen@kde.org> - * - * Ported to KABC by Daniel Molkentin <molkentin@kde.org> - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This file 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - - - -#include <tqfile.h> -#include <tqimage.h> -#include <tqlabel.h> -#include <tqpixmap.h> -#include <tqtextstream.h> -#include <tqurl.h> - -#include <tdeapplication.h> -#include <tdeconfig.h> -#include <kdebug.h> -#include <kmdcodec.h> -#include <kprotocolinfo.h> - -#include "ldapclient.h" -#include "ldif.h" -#include "ldapurl.h" - -using namespace KABC; - -class LdapClient::LdapClientPrivate{ -public: - TQString bindDN; - TQString pwdBindDN; - LDIF ldif; -}; - -TQString LdapObject::toString() const -{ - TQString result = TQString::fromLatin1( "\ndn: %1\n" ).arg( dn ); - for ( LdapAttrMap::ConstIterator it = attrs.begin(); it != attrs.end(); ++it ) { - TQString attr = it.key(); - for ( LdapAttrValue::ConstIterator it2 = (*it).begin(); it2 != (*it).end(); ++it2 ) { - result += TQString::fromUtf8( LDIF::assembleLine( attr, *it2, 76 ) ) + "\n"; - } - } - - return result; -} - -void LdapObject::clear() -{ - dn = TQString::null; - attrs.clear(); -} - -void LdapObject::assign( const LdapObject& that ) -{ - if ( &that != this ) { - dn = that.dn; - attrs = that.attrs; - client = that.client; - } -} - -LdapClient::LdapClient( TQObject* parent, const char* name ) - : TQObject( parent, name ), mJob( 0 ), mActive( false ) -{ - d = new LdapClientPrivate; -} - -LdapClient::~LdapClient() -{ - cancelQuery(); - delete d; d = 0; -} - -void LdapClient::setHost( const TQString& host ) -{ - mHost = host; -} - -void LdapClient::setPort( const TQString& port ) -{ - mPort = port; -} - -void LdapClient::setBase( const TQString& base ) -{ - mBase = base; -} - -void LdapClient::setBindDN( const TQString& bindDN ) -{ - d->bindDN = bindDN; -} - -void LdapClient::setPwdBindDN( const TQString& pwdBindDN ) -{ - d->pwdBindDN = pwdBindDN; -} - -void LdapClient::setAttrs( const TQStringList& attrs ) -{ - mAttrs = attrs; -} - -void LdapClient::startQuery( const TQString& filter ) -{ - cancelQuery(); - LDAPUrl url; - - url.setProtocol( "ldap" ); - url.setUser( d->bindDN ); - url.setPass( d->pwdBindDN ); - url.setHost( mHost ); - url.setPort( mPort.toUInt() ); - url.setDn( mBase ); - url.setAttributes( mAttrs ); - url.setScope( mScope == "one" ? LDAPUrl::One : LDAPUrl::Sub ); - url.setFilter( "("+filter+")" ); - - kdDebug(5700) << "Doing query: " << url.prettyURL() << endl; - - startParseLDIF(); - mActive = true; - mJob = TDEIO::get( url, false, false ); - connect( mJob, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), - this, TQT_SLOT( slotData( TDEIO::Job*, const TQByteArray& ) ) ); - connect( mJob, TQT_SIGNAL( infoMessage( TDEIO::Job*, const TQString& ) ), - this, TQT_SLOT( slotInfoMessage( TDEIO::Job*, const TQString& ) ) ); - connect( mJob, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( slotDone() ) ); -} - -void LdapClient::cancelQuery() -{ - if ( mJob ) { - mJob->kill(); - mJob = 0; - } - - mActive = false; -} - -void LdapClient::slotData( TDEIO::Job*, const TQByteArray& data ) -{ -#ifndef NDEBUG // don't create the QString -// TQString str( data ); -// kdDebug(5700) << "LdapClient: Got \"" << str << "\"\n"; -#endif - parseLDIF( data ); -} - -void LdapClient::slotInfoMessage( TDEIO::Job*, const TQString & ) -{ - //tqDebug("Job said \"%s\"", info.latin1()); -} - -void LdapClient::slotDone() -{ - endParseLDIF(); - mActive = false; -#if 0 - for ( TQValueList<LdapObject>::Iterator it = mObjects.begin(); it != mObjects.end(); ++it ) { - tqDebug( (*it).toString().latin1() ); - } -#endif - int err = mJob->error(); - if ( err && err != TDEIO::ERR_USER_CANCELED ) { - emit error( TDEIO::buildErrorString( err, TQString("%1:%2").arg( mHost ).arg( mPort ) ) ); - } - emit done(); -} - -void LdapClient::startParseLDIF() -{ - mCurrentObject.clear(); - mLastAttrName = 0; - mLastAttrValue = 0; - mIsBase64 = false; - d->ldif.startParsing(); -} - -void LdapClient::endParseLDIF() -{ -} - -void LdapClient::parseLDIF( const TQByteArray& data ) -{ - if ( data.size() ) { - d->ldif.setLDIF( data ); - } else { - d->ldif.endLDIF(); - } - - LDIF::ParseVal ret; - TQString name; - do { - ret = d->ldif.nextItem(); - switch ( ret ) { - case LDIF::Item: - { - name = d->ldif.attr(); - // Must make a copy! TQByteArray is explicitely shared - TQByteArray value = d->ldif.val().copy(); - mCurrentObject.attrs[ name ].append( value ); - break; - } - case LDIF::EndEntry: - mCurrentObject.dn = d->ldif.dn(); - mCurrentObject.client = this; - emit result( mCurrentObject ); - mCurrentObject.clear(); - break; - default: - break; - } - } while ( ret != LDIF::MoreData ); -} - -TQString LdapClient::bindDN() const -{ - return d->bindDN; -} - -TQString LdapClient::pwdBindDN() const -{ - return d->pwdBindDN; -} - -LdapSearch::LdapSearch() - : mActiveClients( 0 ), mNoLDAPLookup( false ) -{ - if ( !KProtocolInfo::isKnownProtocol( KURL("ldap://localhost") ) ) { - mNoLDAPLookup = true; - return; - } - - // stolen from KAddressBook - TDEConfig config( "kabldaprc", true ); - config.setGroup( "LDAP" ); - int numHosts = config.readUnsignedNumEntry( "NumSelectedHosts"); - if ( !numHosts ) { - mNoLDAPLookup = true; - return; - } else { - for ( int j = 0; j < numHosts; j++ ) { - LdapClient* ldapClient = new LdapClient( this ); - - TQString host = config.readEntry( TQString( "SelectedHost%1" ).arg( j ), "" ).stripWhiteSpace(); - if ( !host.isEmpty() ) - ldapClient->setHost( host ); - - TQString port = TQString::number( config.readUnsignedNumEntry( TQString( "SelectedPort%1" ).arg( j ) ) ); - if ( !port.isEmpty() ) - ldapClient->setPort( port ); - - TQString base = config.readEntry( TQString( "SelectedBase%1" ).arg( j ), "" ).stripWhiteSpace(); - if ( !base.isEmpty() ) - ldapClient->setBase( base ); - - TQString bindDN = config.readEntry( TQString( "SelectedBind%1" ).arg( j ) ).stripWhiteSpace(); - if ( !bindDN.isEmpty() ) - ldapClient->setBindDN( bindDN ); - - TQString pwdBindDN = config.readEntry( TQString( "SelectedPwdBind%1" ).arg( j ) ); - if ( !pwdBindDN.isEmpty() ) - ldapClient->setPwdBindDN( pwdBindDN ); - - TQStringList attrs; - attrs << "cn" << "mail" << "givenname" << "sn"; - ldapClient->setAttrs( attrs ); - - connect( ldapClient, TQT_SIGNAL( result( const KABC::LdapObject& ) ), - this, TQT_SLOT( slotLDAPResult( const KABC::LdapObject& ) ) ); - connect( ldapClient, TQT_SIGNAL( done() ), - this, TQT_SLOT( slotLDAPDone() ) ); - connect( ldapClient, TQT_SIGNAL( error( const TQString& ) ), - this, TQT_SLOT( slotLDAPError( const TQString& ) ) ); - - mClients.append( ldapClient ); - } - } - - connect( &mDataTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotDataTimer() ) ); -} - -void LdapSearch::startSearch( const TQString& txt ) -{ - if ( mNoLDAPLookup ) - return; - - cancelSearch(); - - int pos = txt.find( '\"' ); - if( pos >= 0 ) - { - ++pos; - int pos2 = txt.find( '\"', pos ); - if( pos2 >= 0 ) - mSearchText = txt.mid( pos , pos2 - pos ); - else - mSearchText = txt.mid( pos ); - } else - mSearchText = txt; - - TQString filter = TQString( "|(cn=%1*)(mail=%2*)(givenName=%3*)(sn=%4*)" ) - .arg( mSearchText ).arg( mSearchText ).arg( mSearchText ).arg( mSearchText ); - - TQValueList< LdapClient* >::Iterator it; - for ( it = mClients.begin(); it != mClients.end(); ++it ) { - (*it)->startQuery( filter ); - ++mActiveClients; - } -} - -void LdapSearch::cancelSearch() -{ - TQValueList< LdapClient* >::Iterator it; - for ( it = mClients.begin(); it != mClients.end(); ++it ) - (*it)->cancelQuery(); - - mActiveClients = 0; - mResults.clear(); -} - -void LdapSearch::slotLDAPResult( const KABC::LdapObject& obj ) -{ - mResults.append( obj ); - if ( !mDataTimer.isActive() ) - mDataTimer.start( 500, true ); -} - -void LdapSearch::slotLDAPError( const TQString& ) -{ - slotLDAPDone(); -} - -void LdapSearch::slotLDAPDone() -{ - if ( --mActiveClients > 0 ) - return; - - finish(); -} - -void LdapSearch::slotDataTimer() -{ - TQStringList lst; - LdapResultList reslist; - makeSearchData( lst, reslist ); - if ( !lst.isEmpty() ) - emit searchData( lst ); - if ( !reslist.isEmpty() ) - emit searchData( reslist ); -} - -void LdapSearch::finish() -{ - mDataTimer.stop(); - - slotDataTimer(); // emit final bunch of data - emit searchDone(); -} - -void LdapSearch::makeSearchData( TQStringList& ret, LdapResultList& resList ) -{ - TQString search_text_upper = mSearchText.upper(); - - TQValueList< KABC::LdapObject >::ConstIterator it1; - for ( it1 = mResults.begin(); it1 != mResults.end(); ++it1 ) { - TQString name, mail, givenname, sn; - - LdapAttrMap::ConstIterator it2; - for ( it2 = (*it1).attrs.begin(); it2 != (*it1).attrs.end(); ++it2 ) { - TQString tmp = TQString::fromUtf8( (*it2).first(), (*it2).first().size() ); - if ( it2.key() == "cn" ) - name = tmp; // TODO loop? - else if( it2.key() == "mail" ) - mail = tmp; - else if( it2.key() == "givenName" ) - givenname = tmp; - else if( it2.key() == "sn" ) - sn = tmp; - } - - if( mail.isEmpty()) - continue; // nothing, bad entry - else if ( name.isEmpty() ) - ret.append( mail ); - else { - kdDebug(5700) << "<" << name << "><" << mail << ">" << endl; - ret.append( TQString( "%1 <%2>" ).arg( name ).arg( mail ) ); - } - - LdapResult sr; - sr.clientNumber = mClients.findIndex( (*it1).client ); - sr.name = name; - sr.email = mail; - resList.append( sr ); - } - - mResults.clear(); -} - -bool LdapSearch::isAvailable() const -{ - return !mNoLDAPLookup; -} - - - -#include "ldapclient.moc" diff --git a/kabc/ldapclient.h b/kabc/ldapclient.h deleted file mode 100644 index f43a644ce..000000000 --- a/kabc/ldapclient.h +++ /dev/null @@ -1,248 +0,0 @@ -/* kldapclient.h - LDAP access - * Copyright (C) 2002 Klarälvdalens Datakonsult AB - * - * Author: Steffen Hansen <hansen@kde.org> - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This file 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA - */ - - -#ifndef KABC_LDAPCLIENT_H -#define KABC_LDAPCLIENT_H - - -#include <tqobject.h> -#include <tqstring.h> -#include <tqcstring.h> -#include <tqstringlist.h> -#include <tqmemarray.h> -#include <tqguardedptr.h> -#include <tqtimer.h> - -#include <tdeio/job.h> - -namespace KABC { - -class LdapClient; -typedef TQValueList<TQByteArray> LdapAttrValue; -typedef TQMap<TQString,LdapAttrValue > LdapAttrMap; - -/** - * This class is internal. Binary compatibiliy might be broken any time - * without notification. Do not use it. - * - * We mean it! - * - */ -class KABC_EXPORT LdapObject -{ - public: - LdapObject() - : dn( TQString::null ), client( 0 ) {} - explicit LdapObject( const TQString& _dn, LdapClient* _cl ) : dn( _dn ), client( _cl ) {} - LdapObject( const LdapObject& that ) { assign( that ); } - - LdapObject& operator=( const LdapObject& that ) - { - assign( that ); - return *this; - } - - TQString toString() const; - - void clear(); - - TQString dn; - LdapAttrMap attrs; - LdapClient* client; - - protected: - void assign( const LdapObject& that ); - - private: - //class LdapObjectPrivate* d; -}; - -/** - * This class is internal. Binary compatibiliy might be broken any time - * without notification. Do not use it. - * - * We mean it! - * - */ -class KABC_EXPORT LdapClient : public TQObject -{ - Q_OBJECT - - public: - LdapClient( TQObject* parent = 0, const char* name = 0 ); - virtual ~LdapClient(); - - /*! returns true if there is a query running */ - bool isActive() const { return mActive; } - - signals: - /*! Emitted when the query is done */ - void done(); - - /*! Emitted in case of error */ - void error( const TQString& ); - - /*! Emitted once for each object returned - * from the query - */ - void result( const KABC::LdapObject& ); - - public slots: - /*! - * Set the name or IP of the LDAP server - */ - void setHost( const TQString& host ); - TQString host() const { return mHost; } - - /*! - * Set the port of the LDAP server - * if using a nonstandard port - */ - void setPort( const TQString& port ); - TQString port() const { return mPort; } - - /*! - * Set the base DN - */ - void setBase( const TQString& base ); - TQString base() const { return mBase; } - - /*! - * Set the bind DN - */ - void setBindDN( const TQString& bindDN ); - TQString bindDN() const; - - /*! - * Set the bind password DN - */ - void setPwdBindDN( const TQString& pwdBindDN ); - TQString pwdBindDN() const; - - /*! Set the attributes that should be - * returned, or an empty list if - * all attributes are wanted - */ - void setAttrs( const TQStringList& attrs ); - TQStringList attrs() const { return mAttrs; } - - void setScope( const TQString scope ) { mScope = scope; } - - /*! - * Start the query with filter filter - */ - void startQuery( const TQString& filter ); - - /*! - * Abort a running query - */ - void cancelQuery(); - - protected slots: - void slotData( TDEIO::Job*, const TQByteArray &data ); - void slotInfoMessage( TDEIO::Job*, const TQString &info ); - void slotDone(); - - protected: - void startParseLDIF(); - void parseLDIF( const TQByteArray& data ); - void endParseLDIF(); - - TQString mHost; - TQString mPort; - TQString mBase; - TQString mScope; - TQStringList mAttrs; - - TQGuardedPtr<TDEIO::SimpleJob> mJob; - bool mActive; - - LdapObject mCurrentObject; - TQCString mBuf; - TQCString mLastAttrName; - TQCString mLastAttrValue; - bool mIsBase64; - - private: - class LdapClientPrivate; - LdapClientPrivate* d; -}; - -/** - * Structure describing one result returned by a LDAP query - */ -struct LdapResult { - TQString name; ///< full name - TQString email; ///< email - int clientNumber; ///< for sorting -}; -typedef TQValueList<LdapResult> LdapResultList; - - -/** - * This class is internal. Binary compatibiliy might be broken any time - * without notification. Do not use it. - * - * We mean it! - * - */ -class KABC_EXPORT LdapSearch : public TQObject -{ - Q_OBJECT - - public: - LdapSearch(); - - void startSearch( const TQString& txt ); - void cancelSearch(); - bool isAvailable() const; - - signals: - /// Results, assembled as "Full Name <email>" - /// (This signal can be emitted many times) - void searchData( const TQStringList& ); - /// Another form for the results, with separate fields - /// (This signal can be emitted many times) - void searchData( const KABC::LdapResultList& ); - void searchDone(); - - private slots: - void slotLDAPResult( const KABC::LdapObject& ); - void slotLDAPError( const TQString& ); - void slotLDAPDone(); - void slotDataTimer(); - - private: - void finish(); - void makeSearchData( TQStringList& ret, LdapResultList& resList ); - TQValueList< LdapClient* > mClients; - TQString mSearchText; - TQTimer mDataTimer; - int mActiveClients; - bool mNoLDAPLookup; - TQValueList< LdapObject > mResults; - - private: - class LdapSearchPrivate* d; -}; - -} -#endif // KABC_LDAPCLIENT_H diff --git a/kabc/ldapconfigwidget.cpp b/kabc/ldapconfigwidget.cpp deleted file mode 100644 index 5996477a0..000000000 --- a/kabc/ldapconfigwidget.cpp +++ /dev/null @@ -1,626 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> - - 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 <tqapplication.h> - -#include <tqobjectlist.h> -#include <tqcheckbox.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqpushbutton.h> -#include <tqspinbox.h> -#include <tqvgroupbox.h> -#include <tqhbuttongroup.h> -#include <tqradiobutton.h> - -#include <kmessagebox.h> -#include <tdeaccelmanager.h> -#include <kdialogbase.h> -#include <klocale.h> -#include <klineedit.h> -#include <kcombobox.h> -#include <kprogress.h> - -#include <kdebug.h> - -#include "ldapconfigwidget.h" -#include "ldapconfigwidget.moc" - -using namespace KABC; - -LdapConfigWidget::LdapConfigWidget( TQWidget* parent, - const char* name, WFlags fl ) : TQWidget( parent, name, fl ) -{ - mProg = 0; - mFlags = 0; - mainLayout = new TQGridLayout( this, 12, 4, 0, - KDialog::spacingHint() ); -} - -LdapConfigWidget::LdapConfigWidget( int flags, TQWidget* parent, - const char* name, WFlags fl ) : TQWidget( parent, name, fl ) -{ - mFlags = flags; - mProg = 0; - mainLayout = new TQGridLayout( this, 12, 4, 0, - KDialog::spacingHint() ); - initWidget(); -} - -LdapConfigWidget::~LdapConfigWidget() -{ -} - -void LdapConfigWidget::initWidget() -{ - TQLabel *label; - - mUser = mPassword = mHost = mDn = mBindDN = mRealm = mFilter = 0; - mPort = mVer = mTimeLimit = mSizeLimit = 0; - mAnonymous = mSimple = mSASL = mSecNO = mSecTLS = mSecSSL = 0; - mEditButton = mQueryMech = 0; - mMech = 0; - int row = 0; - int col; - - if ( mFlags & W_USER ) { - label = new TQLabel( i18n( "User:" ), this ); - mUser = new KLineEdit( this, "kcfg_ldapuser" ); - - mainLayout->addWidget( label, row, 0 ); - mainLayout->addMultiCellWidget( mUser, row, row, 1, 3 ); - row++; - } - - if ( mFlags & W_BINDDN ) { - label = new TQLabel( i18n( "Bind DN:" ), this ); - mBindDN = new KLineEdit( this, "kcfg_ldapbinddn" ); - - mainLayout->addWidget( label, row, 0 ); - mainLayout->addMultiCellWidget( mBindDN, row, row, 1, 3 ); - row++; - } - - if ( mFlags & W_REALM ) { - label = new TQLabel( i18n( "Realm:" ), this ); - mRealm = new KLineEdit( this, "kcfg_ldaprealm" ); - - mainLayout->addWidget( label, row, 0 ); - mainLayout->addMultiCellWidget( mRealm, row, row, 1, 3 ); - row++; - } - - if ( mFlags & W_PASS ) { - label = new TQLabel( i18n( "Password:" ), this ); - mPassword = new KLineEdit( this, "kcfg_ldappassword" ); - mPassword->setEchoMode( KLineEdit::Password ); - - mainLayout->addWidget( label, row, 0 ); - mainLayout->addMultiCellWidget( mPassword, row, row, 1, 3 ); - row++; - } - - if ( mFlags & W_HOST ) { - label = new TQLabel( i18n( "Host:" ), this ); - mHost = new KLineEdit( this, "kcfg_ldaphost" ); - - mainLayout->addWidget( label, row, 0 ); - mainLayout->addMultiCellWidget( mHost, row, row, 1, 3 ); - row++; - } - - col = 0; - if ( mFlags & W_PORT ) { - label = new TQLabel( i18n( "Port:" ), this ); - mPort = new TQSpinBox( 0, 65535, 1, this, "kcfg_ldapport" ); - mPort->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); - mPort->setValue( 389 ); - - mainLayout->addWidget( label, row, col ); - mainLayout->addWidget( mPort, row, col+1 ); - col += 2; - } - - if ( mFlags & W_VER ) { - label = new TQLabel( i18n( "LDAP version:" ), this ); - mVer = new TQSpinBox( 2, 3, 1, this, "kcfg_ldapver" ); - mVer->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); - mVer->setValue( 3 ); - mainLayout->addWidget( label, row, col ); - mainLayout->addWidget( mVer, row, col+1 ); - } - if ( mFlags & ( W_PORT | W_VER ) ) row++; - - col = 0; - if ( mFlags & W_SIZELIMIT ) { - label = new TQLabel( i18n( "Size limit:" ), this ); - mSizeLimit = new TQSpinBox( 0, 9999999, 1, this, "kcfg_ldapsizelimit" ); - mSizeLimit->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); - mSizeLimit->setValue( 0 ); - mSizeLimit->setSpecialValueText( i18n("Default") ); - mainLayout->addWidget( label, row, col ); - mainLayout->addWidget( mSizeLimit, row, col+1 ); - col += 2; - } - - if ( mFlags & W_TIMELIMIT ) { - label = new TQLabel( i18n( "Time limit:" ), this ); - mTimeLimit = new TQSpinBox( 0, 9999999, 1, this, "kcfg_ldaptimelimit" ); - mTimeLimit->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); - mTimeLimit->setValue( 0 ); - mTimeLimit->setSuffix( i18n(" sec") ); - mTimeLimit->setSpecialValueText( i18n("Default") ); - mainLayout->addWidget( label, row, col ); - mainLayout->addWidget( mTimeLimit, row, col+1 ); - } - if ( mFlags & ( W_SIZELIMIT | W_TIMELIMIT ) ) row++; - - if ( mFlags & W_DN ) { - label = new TQLabel( i18n( "Distinguished Name", "DN:" ), this ); - mDn = new KLineEdit( this, "kcfg_ldapdn" ); - - mainLayout->addWidget( label, row, 0 ); - mainLayout->addMultiCellWidget( mDn, row, row, 1, 1 ); - //without host query doesn't make sense - if ( mHost ) { - TQPushButton *dnquery = new TQPushButton( i18n( "Query Server" ), this ); - connect( dnquery, TQT_SIGNAL( clicked() ), TQT_SLOT( mQueryDNClicked() ) ); - mainLayout->addMultiCellWidget( dnquery, row, row, 2, 3 ); - } - row++; - } - - if ( mFlags & W_FILTER ) { - label = new TQLabel( i18n( "Filter:" ), this ); - mFilter = new KLineEdit( this, "kcfg_ldapfilter" ); - - mainLayout->addWidget( label, row, 0 ); - mainLayout->addMultiCellWidget( mFilter, row, row, 1, 3 ); - row++; - } - - if ( mFlags & W_SECBOX ) { - TQHButtonGroup *btgroup = new TQHButtonGroup( i18n( "Security" ), this ); - mSecNO = new TQRadioButton( i18n( "No" ), btgroup, "kcfg_ldapnosec" ); - mSecTLS = new TQRadioButton( i18n( "TLS" ), btgroup, "kcfg_ldaptls" ); - mSecSSL = new TQRadioButton( i18n( "SSL" ), btgroup, "kcfg_ldapssl" ); - mainLayout->addMultiCellWidget( btgroup, row, row, 0, 3 ); - - connect( mSecNO, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPPort() ) ); - connect( mSecTLS, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPPort() ) ); - connect( mSecSSL, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPSPort( ) ) ); - - mSecNO->setChecked( true ); - row++; - } - - if ( mFlags & W_AUTHBOX ) { - - TQButtonGroup *authbox = - new TQButtonGroup( 3, Qt::Horizontal, i18n( "Authentication" ), this ); - - mAnonymous = new TQRadioButton( i18n( "Anonymous" ), authbox, "kcfg_ldapanon" ); - mSimple = new TQRadioButton( i18n( "Simple" ), authbox, "kcfg_ldapsimple" ); - mSASL = new TQRadioButton( i18n( "SASL" ), authbox, "kcfg_ldapsasl" ); - - label = new TQLabel( i18n( "SASL mechanism:" ), authbox ); - mMech = new KComboBox( false, authbox, "kcfg_ldapsaslmech" ); - mMech->setEditable( true ); - mMech->insertItem( "DIGEST-MD5" ); - mMech->insertItem( "GSSAPI" ); - mMech->insertItem( "PLAIN" ); - - //without host query doesn't make sense - if ( mHost ) { - mQueryMech = new TQPushButton( i18n( "Query Server" ), authbox ); - connect( mQueryMech, TQT_SIGNAL( clicked() ), TQT_SLOT( mQueryMechClicked() ) ); - } - - mainLayout->addMultiCellWidget( authbox, row, row+1, 0, 3 ); - - connect( mAnonymous, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setAnonymous(int) ) ); - connect( mSimple, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setSimple(int) ) ); - connect( mSASL, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setSASL(int) ) ); - - mAnonymous->setChecked( true ); - } - -} - -void LdapConfigWidget::loadData( TDEIO::Job*, const TQByteArray& d ) -{ - LDIF::ParseVal ret; - - if ( d.size() ) { - mLdif.setLDIF( d ); - } else { - mLdif.endLDIF(); - } - do { - ret = mLdif.nextItem(); - if ( ret == LDIF::Item && mLdif.attr().lower() == mAttr ) { - mProg->progressBar()->advance( 1 ); - mQResult.push_back( TQString::fromUtf8( mLdif.val(), mLdif.val().size() ) ); - } - } while ( ret != LDIF::MoreData ); -} - -void LdapConfigWidget::loadResult( TDEIO::Job* job) -{ - int error = job->error(); - if ( error && error != TDEIO::ERR_USER_CANCELED ) - mErrorMsg = job->errorString(); - else - mErrorMsg = ""; - - mCancelled = false; - mProg->close(); -} - -void LdapConfigWidget::sendQuery() -{ - LDAPUrl _url; - - mQResult.clear(); - mCancelled = true; - - _url.setProtocol( ( mSecSSL && mSecSSL->isChecked() ) ? "ldaps" : "ldap" ); - if ( mHost ) _url.setHost( mHost->text() ); - if ( mPort ) _url.setPort( mPort->value() ); - _url.setDn( "" ); - _url.setAttributes( mAttr ); - _url.setScope( LDAPUrl::Base ); - if ( mVer ) _url.setExtension( "x-ver", TQString::number( mVer->value() ) ); - if ( mSecTLS && mSecTLS->isChecked() ) _url.setExtension( "x-tls", "" ); - - kdDebug(5700) << "sendQuery url: " << _url.prettyURL() << endl; - mLdif.startParsing(); - TDEIO::Job *job = TDEIO::get( _url, true, false ); - job->addMetaData("no-auth-prompt","true"); - connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), - this, TQT_SLOT( loadData( TDEIO::Job*, const TQByteArray& ) ) ); - connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( loadResult( TDEIO::Job* ) ) ); - - if ( mProg == NULL ) - mProg = new KProgressDialog( this, 0, i18n("LDAP Query"), _url.prettyURL(), true ); - else - mProg->setLabel( _url.prettyURL() ); - mProg->progressBar()->setValue( 0 ); - mProg->progressBar()->setTotalSteps( 1 ); - mProg->exec(); - if ( mCancelled ) { - kdDebug(5700) << "query cancelled!" << endl; - job->kill( true ); - } else { - if ( !mErrorMsg.isEmpty() ) KMessageBox::error( this, mErrorMsg ); - } -} - -void LdapConfigWidget::mQueryMechClicked() -{ - mAttr = "supportedsaslmechanisms"; - sendQuery(); - if ( !mQResult.isEmpty() ) { - mQResult.sort(); - mMech->clear(); - mMech->insertStringList( mQResult ); - } -} - -void LdapConfigWidget::mQueryDNClicked() -{ - mAttr = "namingcontexts"; - sendQuery(); - if ( !mQResult.isEmpty() ) mDn->setText( mQResult.first() ); -} - -void LdapConfigWidget::setAnonymous( int state ) -{ - if ( state == TQButton::Off ) return; - if ( mUser ) mUser->setEnabled(false); - if ( mPassword ) mPassword->setEnabled(false); - if ( mBindDN ) mBindDN->setEnabled(false); - if ( mRealm ) mRealm->setEnabled(false); - if ( mMech ) mMech->setEnabled(false); - if ( mQueryMech ) mQueryMech->setEnabled(false); -} - -void LdapConfigWidget::setSimple( int state ) -{ - if ( state == TQButton::Off ) return; - if ( mUser ) mUser->setEnabled(true); - if ( mPassword ) mPassword->setEnabled(true); - if ( mBindDN ) mBindDN->setEnabled(false); - if ( mRealm ) mRealm->setEnabled(false); - if ( mMech ) mMech->setEnabled(false); - if ( mQueryMech ) mQueryMech->setEnabled(false); -} - -void LdapConfigWidget::setSASL( int state ) -{ - if ( state == TQButton::Off ) return; - if ( mUser ) mUser->setEnabled(true); - if ( mPassword ) mPassword->setEnabled(true); - if ( mBindDN ) mBindDN->setEnabled(true); - if ( mRealm ) mRealm->setEnabled(true); - if ( mMech ) mMech->setEnabled(true); - if ( mQueryMech ) mQueryMech->setEnabled(true); -} - -void LdapConfigWidget::setLDAPPort() -{ - mPort->setValue( 389 ); -} - -void LdapConfigWidget::setLDAPSPort() -{ - mPort->setValue( 636 ); -} - - -LDAPUrl LdapConfigWidget::url() const -{ - LDAPUrl _url; - if ( mSecSSL && mSecSSL->isChecked() ) - _url.setProtocol( "ldaps" ); - else - _url.setProtocol( "ldap" ); - - if ( mUser ) _url.setUser( mUser->text() ); - if ( mPassword ) _url.setPass( mPassword->text() ); - if ( mHost ) _url.setHost( mHost->text() ); - if ( mPort ) _url.setPort( mPort->value() ); - if ( mDn ) _url.setDn( mDn->text() ); - if ( mVer ) _url.setExtension( "x-ver", TQString::number( mVer->value() ) ); - if ( mSizeLimit && mSizeLimit->value() != 0 ) - _url.setExtension( "x-sizelimit", TQString::number( mSizeLimit->value() ) ); - if ( mTimeLimit && mTimeLimit->value() != 0 ) - _url.setExtension( "x-timelimit", TQString::number( mTimeLimit->value() ) ); - if ( mSecTLS && mSecTLS->isChecked() ) _url.setExtension( "x-tls","" ); - if ( mFilter && !mFilter->text().isEmpty() ) - _url.setFilter( mFilter->text() ); - if ( mSASL && mSASL->isChecked() ) { - _url.setExtension( "x-sasl", "" ); - _url.setExtension( "x-mech", mMech->currentText() ); - if ( mBindDN && !mBindDN->text().isEmpty() ) - _url.setExtension( "bindname", mBindDN->text() ); - if ( mRealm && !mRealm->text().isEmpty() ) - _url.setExtension( "x-realm", mRealm->text() ); - } - return ( _url ); -} - -void LdapConfigWidget::setUser( const TQString &user ) -{ - if ( mUser ) mUser->setText( user ); -} - -TQString LdapConfigWidget::user() const -{ - return ( mUser ? mUser->text() : TQString::null ); -} - -void LdapConfigWidget::setPassword( const TQString &password ) -{ - if ( mPassword ) mPassword->setText( password ); -} - -TQString LdapConfigWidget::password() const -{ - return ( mPassword ? mPassword->text() : TQString::null ); -} - -void LdapConfigWidget::setBindDN( const TQString &binddn ) -{ - if ( mBindDN ) mBindDN->setText( binddn ); -} - -TQString LdapConfigWidget::bindDN() const -{ - return ( mBindDN ? mBindDN->text() : TQString::null ); -} - -void LdapConfigWidget::setRealm( const TQString &realm ) -{ - if ( mRealm ) mRealm->setText( realm ); -} - -TQString LdapConfigWidget::realm() const -{ - return ( mRealm ? mRealm->text() : TQString::null ); -} - -void LdapConfigWidget::setHost( const TQString &host ) -{ - if ( mHost ) mHost->setText( host ); -} - -TQString LdapConfigWidget::host() const -{ - return ( mHost ? mHost->text() : TQString::null ); -} - -void LdapConfigWidget::setPort( int port ) -{ - if ( mPort ) mPort->setValue( port ); -} - -int LdapConfigWidget::port() const -{ - return ( mPort ? mPort->value() : 389 ); -} - -void LdapConfigWidget::setVer( int ver ) -{ - if ( mVer ) mVer->setValue( ver ); -} - -int LdapConfigWidget::ver() const -{ - return ( mVer ? mVer->value() : 3 ); -} - -void LdapConfigWidget::setDn( const TQString &dn ) -{ - if ( mDn ) mDn->setText( dn ); -} - -TQString LdapConfigWidget::dn() const -{ - return ( mDn ? mDn->text() : TQString::null ); -} - -void LdapConfigWidget::setFilter( const TQString &filter ) -{ - if ( mFilter ) mFilter->setText( filter ); -} - -TQString LdapConfigWidget::filter() const -{ - return ( mFilter ? mFilter->text() : TQString::null ); -} - -void LdapConfigWidget::setMech( const TQString &mech ) -{ - if ( mMech == 0 ) return; - if ( !mech.isEmpty() ) { - int i = 0; - while ( i < mMech->count() ) { - if ( mMech->text( i ) == mech ) break; - i++; - } - if ( i == mMech->count() ) mMech->insertItem( mech ); - mMech->setCurrentItem( i ); - } -} - -TQString LdapConfigWidget::mech() const -{ - return ( mMech ? mMech->currentText() : TQString::null ); -} - -void LdapConfigWidget::setSecNO( bool b ) -{ - if ( mSecNO ) mSecNO->setChecked( b ); -} - -bool LdapConfigWidget::isSecNO() const -{ - return ( mSecNO ? mSecNO->isChecked() : true ); -} - -void LdapConfigWidget::setSecTLS( bool b ) -{ - if ( mSecTLS ) mSecTLS->setChecked( b ); -} - -bool LdapConfigWidget::isSecTLS() const -{ - return ( mSecTLS ? mSecTLS->isChecked() : false ); -} - -void LdapConfigWidget::setSecSSL( bool b ) -{ - if ( mSecSSL ) mSecSSL->setChecked( b ); -} - -bool LdapConfigWidget::isSecSSL() const -{ - return ( mSecSSL ? mSecSSL->isChecked() : false ); -} - -void LdapConfigWidget::setAuthAnon( bool b ) -{ - if ( mAnonymous ) mAnonymous->setChecked( b ); -} - -bool LdapConfigWidget::isAuthAnon() const -{ - return ( mAnonymous ? mAnonymous->isChecked() : true ); -} - -void LdapConfigWidget::setAuthSimple( bool b ) -{ - if ( mSimple ) mSimple->setChecked( b ); -} - -bool LdapConfigWidget::isAuthSimple() const -{ - return ( mSimple ? mSimple->isChecked() : false ); -} - -void LdapConfigWidget::setAuthSASL( bool b ) -{ - if ( mSASL ) mSASL->setChecked( b ); -} - -bool LdapConfigWidget::isAuthSASL() const -{ - return ( mSASL ? mSASL->isChecked() : false ); -} - -void LdapConfigWidget::setSizeLimit( int sizelimit ) -{ - if ( mSizeLimit ) mSizeLimit->setValue( sizelimit ); -} - -int LdapConfigWidget::sizeLimit() const -{ - return ( mSizeLimit ? mSizeLimit->value() : 0 ); -} - -void LdapConfigWidget::setTimeLimit( int timelimit ) -{ - if ( mTimeLimit ) mTimeLimit->setValue( timelimit ); -} - -int LdapConfigWidget::timeLimit() const -{ - return ( mTimeLimit ? mTimeLimit->value() : 0 ); -} - -int LdapConfigWidget::flags() const -{ - return mFlags; -} - -void LdapConfigWidget::setFlags( int flags ) -{ - mFlags = flags; - - // First delete all the child widgets. - // FIXME: I hope it's correct - const TQObjectList ch = childrenListObject(); - TQObjectList ch2 = ch; - TQObject *obj; - TQWidget *widget; - - obj = ch2.first(); - while ( obj != 0 ) { - widget = dynamic_cast<TQWidget*> (obj); - if ( widget && TQT_BASE_OBJECT(widget->parent()) == TQT_BASE_OBJECT(this) ) { - mainLayout->remove( widget ); - delete ( widget ); - } - obj = ch2.next(); - } - // Re-create child widgets according to the new flags - initWidget(); -} diff --git a/kabc/ldapconfigwidget.h b/kabc/ldapconfigwidget.h deleted file mode 100644 index 01074292e..000000000 --- a/kabc/ldapconfigwidget.h +++ /dev/null @@ -1,300 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> - - 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 LDAPCONFIGWIDGET_H -#define LDAPCONFIGWIDGET_H - -#include <tqwidget.h> -#include <tqmap.h> -#include <tqstring.h> - -#include <kabc/ldapurl.h> -#include <kabc/ldif.h> -#include <tdeio/job.h> - -class TQGridLayout; -class TQSpinBox; -class TQPushButton; -class TQCheckBox; -class TQRadioButton; -class KComboBox; -class KLineEdit; -class KProgressDialog; - -namespace KABC { - - /** - @short LDAP Configuration widget - - This class can be used to query the user for LDAP connection parameters. - It's TDEConfigXT compatible, using widget names starting with kcfg_ - */ - - class KABC_EXPORT LdapConfigWidget : public TQWidget - { - Q_OBJECT - - TQ_PROPERTY( LCW_Flags flags READ flagsProp WRITE setFlagsProp ) - TQ_PROPERTY( TQString user READ user WRITE setUser ) - TQ_PROPERTY( TQString password READ password WRITE setPassword ) - TQ_PROPERTY( TQString bindDN READ bindDN WRITE setBindDN ) - TQ_PROPERTY( TQString realm READ realm WRITE setRealm ) - TQ_PROPERTY( TQString host READ host WRITE setHost ) - TQ_PROPERTY( int port READ port WRITE setPort ) - TQ_PROPERTY( int ver READ ver WRITE setVer ) - TQ_PROPERTY( TQString dn READ dn WRITE setDn ) - TQ_PROPERTY( TQString filter READ filter WRITE setFilter ) - TQ_PROPERTY( TQString mech READ mech WRITE setMech ) - TQ_PROPERTY( bool secNO READ isSecNO WRITE setSecNO ) - TQ_PROPERTY( bool secSSL READ isSecSSL WRITE setSecSSL ) - TQ_PROPERTY( bool secTLS READ isSecSSL WRITE setSecTLS ) - TQ_PROPERTY( bool authAnon READ isAuthAnon WRITE setAuthAnon ) - TQ_PROPERTY( bool authSimple READ isAuthSimple WRITE setAuthSimple ) - TQ_PROPERTY( bool authSASL READ isAuthSASL WRITE setAuthSASL ) - TQ_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit ) - TQ_PROPERTY( int timeLimit READ timeLimit WRITE setTimeLimit ) - TQ_SETS ( LCW_Flags ) - - public: - - enum LCW_Flags { - W_USER = 0x1, - W_PASS = 0x2, - W_BINDDN = 0x4, - W_REALM = 0x8, - W_HOST = 0x10, - W_PORT = 0x20, - W_VER = 0x40, - W_DN = 0x80, - W_FILTER = 0x100, - W_SECBOX = 0x400, - W_AUTHBOX = 0x800, - W_TIMELIMIT = 0x1000, - W_SIZELIMIT = 0x2000, - W_ALL = 0xFFFFFFF - }; - - /** Constructs an empty configuration widget. - * You need to call setFlags() after this. - */ - LdapConfigWidget( TQWidget* parent = 0, - const char* name = 0, WFlags fl = 0 ); - /** Constructs a configuration widget */ - LdapConfigWidget( int flags, TQWidget* parent = 0, - const char* name = 0, WFlags fl = 0 ); - /** Destructs a configuration widget */ - virtual ~LdapConfigWidget(); - - /** Sets the user name. Kconfig widget name: kcfg_ldapuser */ - void setUser( const TQString &user ); - /** Gets the user name. Kconfig widget name: kcfg_ldapuser */ - TQString user() const; - - /** Sets the password. Kconfig widget name: kcfg_ldappassword */ - void setPassword( const TQString &password ); - /** Gets the password. Kconfig widget name: kcfg_ldappassword */ - TQString password() const; - - /** - * Sets the bind dn. Useful for SASL proxy auth. - * Kconfig widget name: kcfg_ldapbinddn - */ - void setBindDN( const TQString &binddn ); - /** Gets the bind dn. Kconfig widget name: kcfg_ldapbinddn*/ - TQString bindDN() const; - - /** Sets the SASL realm. Kconfig widget name: kcfg_ldaprealm */ - void setRealm( const TQString &realm ); - /** Gets the SASL realm. Kconfig widget name: kcfg_ldaprealm */ - TQString realm() const; - - /** Sets the host name. Kconfig widget name: kcfg_ldaphost */ - void setHost( const TQString &host ); - /** Gets the host name. Kconfig widget name: kcfg_ldaphost */ - TQString host() const; - - /** Sets the LDAP port. Kconfig widget name: kcfg_ldapport */ - void setPort( int port ); - /** Gets the LDAP port. Kconfig widget name: kcfg_ldapport */ - int port() const; - - /** Sets the LDAP protocol version. Kconfig widget name: kcfg_ldapver */ - void setVer( int ver ); - /** Gets the LDAP protocol version. Kconfig widget name: kcfg_ldapver */ - int ver() const; - - /** Sets the LDAP Base DN. Kconfig widget name: kcfg_ldapdn */ - void setDn( const TQString &dn ); - /** Gets the LDAP Base DN. Kconfig widget name: kcfg_ldapdn */ - TQString dn() const; - - /** Sets the LDAP Filter. Kconfig widget name: kcfg_ldapfilter */ - void setFilter( const TQString &filter ); - /** Gets the LDAP Filter. Kconfig widget name: kcfg_ldapfilter */ - TQString filter() const; - - /** Sets the SASL Mechanism. Kconfig widget name: kcfg_ldapsaslmech */ - void setMech( const TQString &mech ); - /** Gets the SASL Mechanism. Kconfig widget name: kcfg_ldapsaslmech */ - TQString mech() const; - - /** - * Sets the configuration to no transport security. - * Kconfig widget name: kcfg_ldapnosec - */ - void setSecNO( bool b = true ); - /** - * Returns true if no transport security selected. - * Kconfig widget name: kcfg_ldapnosec - */ - bool isSecNO() const; - - /** - * Sets the configuration to TLS. - * Kconfig widget name: kcfg_ldaptls - */ - void setSecTLS( bool b = true ); - /** - * Returns true if TLS selected. - * Kconfig widget name: kcfg_ldaptls - */ - bool isSecTLS() const; - - /** - * Sets the configuration to SSL. - * Kconfig widget name: kcfg_ldapssl - */ - void setSecSSL( bool b = true ); - /** - * Returns true if SSL selected. - * Kconfig widget name: kcfg_ldapssl - */ - bool isSecSSL() const; - - /** - * Sets the authentication to anonymous. - * Kconfig widget name: kcfg_ldapanon - */ - void setAuthAnon( bool b = true ); - /** - * Returns true if Anonymous authentication selected. - * Kconfig widget name: kcfg_ldapanon - */ - bool isAuthAnon() const; - - /** - * Sets the authentication to simple. - * Kconfig widget name: kcfg_ldapsimple - */ - void setAuthSimple( bool b = true ); - /** - * Returns true if Simple authentication selected. - * Kconfig widget name: kcfg_ldapsimple - */ - bool isAuthSimple() const; - - /** - * Sets the authentication to SASL. - * Kconfig widget name: kcfg_ldapsasl - */ - void setAuthSASL( bool b = true ); - /** - * Returns true if SASL authentication selected. - * Kconfig widget name: kcfg_ldapsasl - */ - bool isAuthSASL() const; - - /** - * Sets the size limit. - * TDEConfig widget name: kcfg_ldapsizelimit - */ - void setSizeLimit( int sizelimit ); - /** - * Returns the size limit. - * TDEConfig widget name: kcfg_ldapsizelimit - */ - int sizeLimit() const; - - /** - * Sets the time limit. - * TDEConfig widget name: kcfg_ldaptimelimit - */ - void setTimeLimit( int timelimit ); - /** - * Returns the time limit. - * TDEConfig widget name: kcfg_ldaptimelimit - */ - int timeLimit() const; - - int flags() const; - void setFlags( int flags ); - inline LCW_Flags flagsProp() const { return (LCW_Flags)flags(); } - inline void setFlagsProp( LCW_Flags flags ) { setFlags((int)flags); } - - /** - * Returns a LDAP Url constructed from the settings given. - * Extensions are filled for use in the LDAP ioslave - */ - KABC::LDAPUrl url() const; - - private slots: - void setLDAPPort(); - void setLDAPSPort(); - void setAnonymous( int state ); - void setSimple( int state ); - void setSASL( int state ); - void mQueryDNClicked(); - void mQueryMechClicked(); - void loadData( TDEIO::Job*, const TQByteArray& ); - void loadResult( TDEIO::Job* ); - private: - - int mFlags; - LDIF mLdif; - TQStringList mQResult; - TQString mAttr; - - KLineEdit *mUser; - KLineEdit *mPassword; - KLineEdit *mHost; - TQSpinBox *mPort, *mVer, *mSizeLimit, *mTimeLimit; - KLineEdit *mDn, *mBindDN, *mRealm; - KLineEdit *mFilter; - TQRadioButton *mAnonymous,*mSimple,*mSASL; - TQCheckBox *mSubTree; - TQPushButton *mEditButton; - TQPushButton *mQueryMech; - TQRadioButton *mSecNO,*mSecTLS,*mSecSSL; - KComboBox *mMech; - - TQString mErrorMsg; - bool mCancelled; - KProgressDialog *mProg; - - TQGridLayout *mainLayout; - class LDAPConfigWidgetPrivate; - LDAPConfigWidgetPrivate *d; - - void sendQuery(); - void initWidget(); - }; -} - -#endif diff --git a/kabc/ldapurl.cpp b/kabc/ldapurl.cpp deleted file mode 100644 index 9032c16d3..000000000 --- a/kabc/ldapurl.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> - - 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 <kdebug.h> -#include <tqstringlist.h> -#include <tqdir.h> - -#include "ldapurl.h" - -using namespace KABC; - -LDAPUrl::LDAPUrl() -{ - m_scope = Base; -} - -LDAPUrl::LDAPUrl(const KURL &_url) - : KURL(_url), m_extensions() -{ - m_dn = path(); - if ( !TQDir::isRelativePath(m_dn) ) -#ifdef Q_WS_WIN - m_dn.remove(0,3); // e.g. "c:/" -#else - m_dn.remove(0,1); -#endif - parseQuery(); -} - -void LDAPUrl::setDn( const TQString &dn) -{ - m_dn = dn; - if ( !TQDir::isRelativePath(m_dn) ) -#ifdef Q_WS_WIN - m_dn.remove(0,3); // e.g. "c:/" -#else - m_dn.remove(0,1); -#endif - setPath(m_dn); -} - -bool LDAPUrl::hasExtension( const TQString &key ) const -{ - return m_extensions.contains( key ); -} - -LDAPUrl::Extension LDAPUrl::extension( const TQString &key ) const -{ - TQMap<TQString, Extension>::const_iterator it; - - it = m_extensions.find( key ); - if ( it != m_extensions.constEnd() ) - return (*it); - else { - Extension ext; - ext.value = ""; - ext.critical = false; - return ext; - } -} - -TQString LDAPUrl::extension( const TQString &key, bool &critical ) const -{ - Extension ext; - - ext = extension( key ); - critical = ext.critical; - return ext.value; -} - -void LDAPUrl::setExtension( const TQString &key, const LDAPUrl::Extension &ext ) -{ - m_extensions[ key ] = ext; - updateQuery(); -} - -void LDAPUrl::setExtension( const TQString &key, const TQString &value, bool critical ) -{ - Extension ext; - ext.value = value; - ext.critical = critical; - setExtension( key, ext ); -} - -void LDAPUrl::removeExtension( const TQString &key ) -{ - m_extensions.remove( key ); - updateQuery(); -} - -void LDAPUrl::updateQuery() -{ - Extension ext; - TQMap<TQString, Extension>::iterator it; - TQString q = "?"; - - // set the attributes to query - if ( m_attributes.count() > 0 ) q += m_attributes.join(","); - - // set the scope - q += "?"; - switch( m_scope ) { - case Sub: - q += "sub"; - break; - case One: - q += "one"; - break; - case Base: - q += "base"; - break; - } - - // set the filter - q += "?"; - if ( m_filter != "(objectClass=*)" && !m_filter.isEmpty() ) - q += m_filter; - - // set the extensions - q += "?"; - for ( it = m_extensions.begin(); it != m_extensions.end(); ++it ) { - if ( it.data().critical ) q += "!"; - q += it.key(); - if ( !it.data().value.isEmpty() ) - q += "=" + it.data().value; - q += ","; - } - while ( q.endsWith("?") || q.endsWith(",") ) - q.remove( q.length() - 1, 1 ); - - setQuery(q); - kdDebug(5700) << "LDAP URL updateQuery(): " << prettyURL() << endl; -} - -void LDAPUrl::parseQuery() -{ - Extension ext; - TQStringList extensions; - TQString q = query(); - // remove first ? - if (q.startsWith("?")) - q.remove(0,1); - - // split into a list - TQStringList url_items = TQStringList::split("?", q, true); - - m_attributes.clear(); - m_scope = Base; - m_filter = "(objectClass=*)"; - m_extensions.clear(); - - int i = 0; - for ( TQStringList::Iterator it = url_items.begin(); it != url_items.end(); ++it, i++ ) { - switch (i) { - case 0: - m_attributes = TQStringList::split(",", (*it), false); - break; - case 1: - if ( (*it) == "sub" ) m_scope = Sub; else - if ( (*it) == "one") m_scope = One; - break; - case 2: - m_filter = decode_string( *it ); - break; - case 3: - extensions = TQStringList::split(",", (*it), false); - break; - } - } - - TQString name,value; - for ( TQStringList::Iterator it = extensions.begin(); it != extensions.end(); ++it ) { - ext.critical = false; - name = decode_string( (*it).section('=',0,0) ).lower(); - value = decode_string( (*it).section('=',1) ); - if ( name.startsWith("!") ) { - ext.critical = true; - name.remove(0, 1); - } - kdDebug(5700) << "LDAPUrl extensions name= " << name << " value: " << value << endl; - ext.value = value.replace( "%2", "," ); - setExtension( name, ext ); - } -} diff --git a/kabc/ldapurl.h b/kabc/ldapurl.h deleted file mode 100644 index 0c2693758..000000000 --- a/kabc/ldapurl.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> - - 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 _K_LDAPURL_H_ -#define _K_LDAPURL_H_ - -#include <tqstring.h> -#include <tqstringlist.h> -#include <tqmap.h> - -#include <kurl.h> - -namespace KABC { - -/** - * LDAPUrl - - * LDAPUrl implements an RFC 2255 compliant LDAP Url parser, with minimal - * differences. LDAP Urls implemented by this class has the following format: - * ldap[s]://[user[:password]@]hostname[:port]["/" [dn ["?" [attributes] - * ["?" [scope] ["?" [filter] ["?" extensions]]]]]] - */ - - - class KABC_EXPORT LDAPUrl : public KURL - { - public: - - struct Extension { - TQString value; - bool critical; - }; - - typedef enum Scope { Base, One, Sub }; - - /** Constructs an empty KLDAPUrl. */ - LDAPUrl(); - /** Constructs a KLDAPUrl from a KURL. */ - LDAPUrl( const KURL &url ); - - /** - * Returns the dn part of the LDAP Url (same as path(), but slash removed - * from the beginning). - */ - const TQString& dn() const { return m_dn; } - /** Sets the the dn part of the LDAP Url. */ - void setDn( const TQString &dn ); - - /** Returns the attributes part of the LDAP Url */ - const TQStringList &attributes() { return m_attributes; } - /** Sets the attributes part of the LDAP Url */ - void setAttributes( const TQStringList &attributes ) - { m_attributes=attributes; updateQuery(); } - - /** Returns the scope part of the LDAP Url */ - Scope scope() const { return m_scope; } - /** Sets the scope part of the LDAP Url */ - void setScope(Scope scope) { m_scope = scope; updateQuery(); } - - /** Returns the filter part of the LDAP Url */ - const TQString &filter() const { return m_filter; } - /** Sets the filter part of the LDAP Url */ - void setFilter( TQString filter ) { m_filter = filter; updateQuery(); } - - /** Returns if the specified extension exists in the LDAP Url */ - bool hasExtension( const TQString &key ) const; - /** Returns the specified extension */ - Extension extension( const TQString &key ) const; - /** Returns the specified extension */ - TQString extension( const TQString &key, bool &critical ) const; - /** Sets the specified extension key with the value and criticality in ext */ - void setExtension( const TQString &key, const Extension &ext ); - /** Sets the specified extension key with the value and criticality specified */ - void setExtension( const TQString &key, const TQString &value, bool critical = false ); - /** Removes the specified extension */ - void removeExtension( const TQString &key ); - /** Updates the query component from the attributes, scope, filter and extensions */ - void updateQuery(); - - protected: - void parseQuery(); - - private: - - TQMap<TQString, Extension> m_extensions; - TQString m_dn; - TQStringList m_attributes; - Scope m_scope; - TQString m_filter; - }; -} - -#endif diff --git a/kabc/ldif.cpp b/kabc/ldif.cpp deleted file mode 100644 index 408f5223f..000000000 --- a/kabc/ldif.cpp +++ /dev/null @@ -1,365 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> - - 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 <kdebug.h> -#include <kmdcodec.h> - -#include "ldif.h" - -using namespace KABC; - -LDIF::LDIF() -{ - startParsing(); -} - -LDIF::~LDIF() -{ -} - -TQCString LDIF::assembleLine( const TQString &fieldname, const TQByteArray &value, - uint linelen, bool url ) -{ - bool safe = false; - bool isDn; - TQCString result; - uint i; - - if ( url ) { - result = fieldname.utf8() + ":< " + TQCString( value.data(), value.size()+1 ); - } else { - isDn = fieldname.lower() == "dn"; - //SAFE-INIT-CHAR - if ( value.size() > 0 && value[0] > 0 && value[0] != '\n' && - value[0] != '\r' && value[0] != ':' && value[0] != '<' ) safe = true; - - //SAFE-CHAR - if ( safe ) { - for ( i=1; i < value.size(); i++ ) { - //allow utf-8 in Distinguished Names - if ( ( isDn && value[i] == 0 ) || - ( !isDn && value[i] <= 0 ) || - value[i] == '\r' || value[i] == '\n' ) { - safe = false; - break; - } - } - } - - if ( value.size() == 0 ) safe = true; - - if( safe ) { - result = fieldname.utf8() + ": " + TQCString( value.data(), value.size()+1 ); - } else { - result = fieldname.utf8() + ":: " + KCodecs::base64Encode( value, false ); - } - - if ( linelen > 0 ) { - i = (fieldname.length()+2) > linelen ? fieldname.length()+2 : linelen; - while ( i < result.length() ) { - result.insert( i, "\n " ); - i += linelen+2; - } - } - } - return result; -} - -TQCString LDIF::assembleLine( const TQString &fieldname, const TQCString &value, - uint linelen, bool url ) -{ - TQCString ret; - TQByteArray tmp; - uint valuelen = value.length(); - const char *data = value.data(); - - tmp.setRawData( data, valuelen ); - ret = assembleLine( fieldname, tmp, linelen, url ); - tmp.resetRawData( data, valuelen ); - return ret; - -} - -TQCString LDIF::assembleLine( const TQString &fieldname, const TQString &value, - uint linelen, bool url ) -{ - return assembleLine( fieldname, value.utf8(), linelen, url ); -} - -bool LDIF::splitLine( const TQCString &line, TQString &fieldname, TQByteArray &value ) -{ - int position; - TQByteArray tmp; - int linelen; - const char *data; - -// kdDebug(5700) << "splitLine line: " << TQString::fromUtf8(line) << endl; - - position = line.find( ":" ); - if ( position == -1 ) { - // strange: we did not find a fieldname - fieldname = ""; - TQCString str; - str = line.stripWhiteSpace(); - linelen = str.length(); - data = str.data(); - tmp.setRawData( data, linelen ); - value = tmp.copy(); - tmp.resetRawData( data, linelen ); -// kdDebug(5700) << "value : " << value[0] << endl; - return false; - } - - linelen = line.length(); - - if ( linelen > ( position + 1 ) && line[ position + 1 ] == ':' ) { - // String is BASE64 encoded -> decode it now. - fieldname = TQString::fromUtf8( - line.left( position ).stripWhiteSpace() ); - if ( linelen <= ( position + 3 ) ) { - value.resize( 0 ); - return false; - } - data = &line.data()[ position + 3 ]; - tmp.setRawData( data, linelen - position - 3 ); - KCodecs::base64Decode( tmp, value ); - tmp.resetRawData( data, linelen - position - 3 ); - return false; - } - - if ( linelen > ( position + 1 ) && line[ position + 1 ] == '<' ) { - // String is an URL. - fieldname = TQString::fromUtf8( - line.left( position ).stripWhiteSpace() ); - if ( linelen <= ( position + 3 ) ) { - value.resize( 0 ); - return false; - } - data = &line.data()[ position + 3]; - tmp.setRawData( data, linelen - position - 3 ); - value = tmp.copy(); - tmp.resetRawData( data, linelen - position - 3 ); - return true; - } - - fieldname = TQString::fromUtf8(line.left( position ).stripWhiteSpace()); - if ( linelen <= ( position + 2 ) ) { - value.resize( 0 ); - return false; - } - data = &line.data()[ position + 2 ]; - tmp.setRawData( data, linelen - position - 2 ); - value = tmp.copy(); - tmp.resetRawData( data, linelen - position - 2 ); - return false; -} - -bool LDIF::splitControl( const TQCString &line, TQString &oid, bool &critical, - TQByteArray &value ) -{ - TQString tmp; - critical = false; - bool url = splitLine( line, tmp, value ); - - kdDebug(5700) << "splitControl: value: " << TQString(TQString::fromUtf8(value, value.size())) << endl; - if ( tmp.isEmpty() ) { - tmp = TQString::fromUtf8( value, value.size() ); - value.resize( 0 ); - } - if ( tmp.right( 4 ) == "true" ) { - critical = true; - tmp.truncate( tmp.length() - 5 ); - } else if ( tmp.right( 5 ) == "false" ) { - critical = false; - tmp.truncate( tmp.length() - 6 ); - } - oid = tmp; - return url; -} - -LDIF::ParseVal LDIF::processLine() -{ - - if ( mIsComment ) return None; - - ParseVal retval = None; - if ( mLastParseVal == EndEntry ) mEntryType = Entry_None; - - mUrl = splitLine( line, mAttr, mVal ); - - TQString attrLower = mAttr.lower(); - - switch ( mEntryType ) { - case Entry_None: - if ( attrLower == "version" ) { - if ( !mDn.isEmpty() ) retval = Err; - } else if ( attrLower == "dn" ) { - kdDebug(5700) << "ldapentry dn: " << TQString(TQString::fromUtf8( mVal, mVal.size() )) << endl; - mDn = TQString::fromUtf8( mVal, mVal.size() ); - mModType = Mod_None; - retval = NewEntry; - } else if ( attrLower == "changetype" ) { - if ( mDn.isEmpty() ) - retval = Err; - else { - TQString tmpval = TQString::fromUtf8( mVal, mVal.size() ); - kdDebug(5700) << "changetype: " << tmpval << endl; - if ( tmpval == "add" ) mEntryType = Entry_Add; - else if ( tmpval == "delete" ) mEntryType = Entry_Del; - else if ( tmpval == "modrdn" || tmpval == "moddn" ) { - mNewRdn = ""; - mNewSuperior = ""; - mDelOldRdn = true; - mEntryType = Entry_Modrdn; - } - else if ( tmpval == "modify" ) mEntryType = Entry_Mod; - else retval = Err; - } - } else if ( attrLower == "control" ) { - mUrl = splitControl( TQCString( mVal, mVal.size() + 1 ), mOid, mCritical, mVal ); - retval = Control; - } else if ( !mAttr.isEmpty() && mVal.size() > 0 ) { - mEntryType = Entry_Add; - retval = Item; - } - break; - case Entry_Add: - if ( mAttr.isEmpty() && mVal.size() == 0 ) - retval = EndEntry; - else - retval = Item; - break; - case Entry_Del: - if ( mAttr.isEmpty() && mVal.size() == 0 ) - retval = EndEntry; - else - retval = Err; - break; - case Entry_Mod: - if ( mModType == Mod_None ) { - kdDebug(5700) << "tdeio_ldap: new modtype " << mAttr << endl; - if ( mAttr.isEmpty() && mVal.size() == 0 ) { - retval = EndEntry; - } else if ( attrLower == "add" ) { - mModType = Mod_Add; - } else if ( attrLower == "replace" ) { - mModType = Mod_Replace; - mAttr = TQString::fromUtf8( mVal, mVal.size() ); - mVal.resize( 0 ); - retval = Item; - } else if ( attrLower == "delete" ) { - mModType = Mod_Del; - mAttr = TQString::fromUtf8( mVal, mVal.size() ); - mVal.resize( 0 ); - retval = Item; - } else { - retval = Err; - } - } else { - if ( mAttr.isEmpty() ) { - if ( TQString::fromUtf8( mVal, mVal.size() ) == "-" ) { - mModType = Mod_None; - } else if ( mVal.size() == 0 ) { - retval = EndEntry; - } else - retval = Err; - } else - retval = Item; - } - break; - case Entry_Modrdn: - if ( mAttr.isEmpty() && mVal.size() == 0 ) - retval = EndEntry; - else if ( attrLower == "newrdn" ) - mNewRdn = TQString::fromUtf8( mVal, mVal.size() ); - else if ( attrLower == "newsuperior" ) - mNewSuperior = TQString::fromUtf8( mVal, mVal.size() ); - else if ( attrLower == "deleteoldrdn" ) { - if ( mVal.size() > 0 && mVal[0] == '0' ) - mDelOldRdn = false; - else if ( mVal.size() > 0 && mVal[0] == '1' ) - mDelOldRdn = true; - else - retval = Err; - } else - retval = Err; - break; - } - return retval; -} - -LDIF::ParseVal LDIF::nextItem() -{ - ParseVal retval = None; - char c=0; - - while( retval == None ) { - if ( mPos < mLdif.size() ) { - c = mLdif[mPos]; - mPos++; - if ( mIsNewLine && c == '\r' ) continue; //handle \n\r line end - if ( mIsNewLine && ( c == ' ' || c == '\t' ) ) { //line folding - mIsNewLine = false; - continue; - } - if ( mIsNewLine ) { - mIsNewLine = false; - retval = processLine(); - mLastParseVal = retval; - line.resize( 0 ); - mIsComment = ( c == '#' ); - } - if ( c == '\n' || c == '\r' ) { - mLineNo++; - mIsNewLine = true; - continue; - } - } else { - retval = MoreData; - break; - } - - if ( !mIsComment ) line += c; - } - return retval; -} - -void LDIF::endLDIF() -{ - TQByteArray tmp( 3 ); - tmp[ 0 ] = '\n'; - tmp[ 1 ] = '\n'; - tmp[ 2 ] = '\n'; - mLdif = tmp; - mPos = 0; -} - -void LDIF::startParsing() -{ - mPos = mLineNo = 0; - mDelOldRdn = false; - mEntryType = Entry_None; - mModType = Mod_None; - mDn = mNewRdn = mNewSuperior = ""; - line = ""; - mIsNewLine = false; - mIsComment = false; - mLastParseVal = None; -} diff --git a/kabc/ldif.h b/kabc/ldif.h deleted file mode 100644 index f4da5f4f3..000000000 --- a/kabc/ldif.h +++ /dev/null @@ -1,182 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Szombathelyi Gyorgy <gyurco@freemail.hu> - - 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 _K_LDIF_H_ -#define _K_LDIF_H_ - -#include <tqstring.h> -#include <tqcstring.h> -#include <tqmemarray.h> - -#include <tdelibs_export.h> - -namespace KABC { - - /** - * LDIF - - * LDIF implements an RFC 2849 compliant LDIF parser. LDIF files are used to - * represent directory information on LDAP-based servers, or to describe a set - * of changes which are to be applied to a directory. - */ - - class KABC_EXPORT LDIF - { - public: - - enum ParseVal{ None, NewEntry, EndEntry, Item, Control, Err, MoreData }; - enum EntryType{ Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn }; - enum ModType{ Mod_None, Mod_Add, Mod_Replace, Mod_Del }; - LDIF(); - virtual ~LDIF(); - - /** - * Assembles fieldname and value into a valid LDIF line, BASE64 encodes the - * value if neccessary and optionally splits into more lines. - * @param fieldname The name of the entry. - * @param value The value of the entry. - * @param linelen Maximum length of the lines in the result. - * @param url If true, encode value as url ( use :< ). - */ - static TQCString assembleLine( const TQString &fieldname, - const TQByteArray &value, uint linelen=0, bool url=false ); - /** - * This is the same as the above function, the only difference that - * this accepts TQCString as the value. - */ - static TQCString assembleLine( const TQString &fieldname, - const TQCString &value, uint linelen=0, bool url=false ); - /** - * This is the same as the above function, the only difference that - * this accepts TQString as the value. - */ - static TQCString assembleLine( const TQString &fieldname, - const TQString &value, uint linelen=0, bool url=false ); - - /** - * Splits one line from an LDIF file to attribute and value components. - * @returns true if value is an URL, false otherwise - */ - static bool splitLine( const TQCString &line, TQString &fieldname, TQByteArray &value ); - /** - * Splits a control specification (without the "control:" directive) - * @param line is the control directive - * @param oid will contain the OID - * @param critical will contain the criticality of control - * @param value is the control value - */ - static bool splitControl( const TQCString &line, TQString &oid, bool &critical, - TQByteArray &value ); - /** - * Starts the parsing of a new LDIF - */ - void startParsing(); - /** - * Process one LDIF line - */ - ParseVal processLine(); - /** - * Process the LDIF until a complete item can be returned - * @returns NewEntry if a new DN encountered, - * Item if a new item returned, - * Err if the LDIF contains error, - * EndEntry if the parser reached the end of the current entry - * and MoreData if the parser encountered the end of the current chunk of - * the LDIF. If you want to finish the parsing after receiving - * MoreData, then call endLDIF(), so the parser can safely flush - * the current entry. - */ - ParseVal nextItem(); - /** - * Sets a chunk of LDIF. Call before startParsing(), or if nextItem() returned - * MoreData. - */ - void setLDIF( const TQByteArray &ldif ) { mLdif = ldif; mPos = 0; } - /** - * Indicates the end of the LDIF file/stream. Call if nextItem() returned - * MoreData, but actually you don't have more data. - */ - void endLDIF(); - /** - * Returns the requested LDAP operation extracted from the current entry. - */ - EntryType entryType() const { return mEntryType; } - /** - * Returns the LDAP modify request type if entryType() returned Entry_Mod. - */ - int modType() const { return mModType; } - /** - * Returns the Distinguished Name of the current entry. - */ - const TQString& dn() const { return mDn; } - /** - * Returns the new Relative Distinguished Name if modType() returned Entry_Modrdn. - */ - const TQString& newRdn() const { return mNewRdn; } - /** - * Returns the new parent of the entry if modType() returned Entry_Modrdn. - */ - const TQString& newSuperior() const { return mNewSuperior; } - /** - * Returns if the delete of the old RDN is required. - */ - bool delOldRdn() const { return mDelOldRdn; } - /** - * Returns the attribute name. - */ - const TQString& attr() const { return mAttr; } - /** - * Returns the attribute value. - */ - const TQByteArray& val() const { return mVal; } - /** - * Returns if val() is an url - */ - bool isUrl() const { return mUrl; } - /** - * Returns the criticality level when modType() returned Control. - */ - bool critical() const { return mCritical; } - /** - * Returns the OID when modType() returned Control. - */ - const TQString& oid() const { return mOid; } - /** - * Returns the line number which the parser processes. - */ - uint lineNo() const { return mLineNo; } - private: - int mModType; - bool mDelOldRdn, mUrl; - TQString mDn,mAttr,mNewRdn,mNewSuperior, mOid; - TQByteArray mLdif, mVal; - EntryType mEntryType; - - bool mIsNewLine, mIsComment,mCritical; - ParseVal mLastParseVal; - uint mPos,mLineNo; - TQCString line; - - class LDIFPrivate; - LDIFPrivate *d; - }; -} - -#endif diff --git a/kabc/ldifconverter.cpp b/kabc/ldifconverter.cpp deleted file mode 100644 index 4bf989395..000000000 --- a/kabc/ldifconverter.cpp +++ /dev/null @@ -1,573 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Helge Deller <deller@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. -*/ - - -/* - Useful links: - - http://tldp.org/HOWTO/LDAP-Implementation-HOWTO/schemas.html - - http://www.faqs.org/rfcs/rfc2849.html - - Not yet handled items: - - objectclass microsoftaddressbook - - info, - - initials, - - otherfacsimiletelephonenumber, - - otherpager, - - physicaldeliveryofficename, -*/ - -#include <tqstring.h> -#include <tqstringlist.h> -#include <tqregexp.h> -#include <tqtextstream.h> - -#include <klocale.h> -#include <kdebug.h> -#include <kmdcodec.h> - -#include "addressee.h" -#include "address.h" - -#include "ldif.h" -#include "ldifconverter.h" -#include "vcardconverter.h" - -using namespace KABC; - -/* generate LDIF stream */ - -bool LDIFConverter::addresseeToLDIF( const AddresseeList &addrList, TQString &str ) -{ - AddresseeList::ConstIterator it; - for ( it = addrList.begin(); it != addrList.end(); ++it ) { - addresseeToLDIF( *it, str ); - } - return true; -} - - - -static void ldif_out( TQTextStream &t, TQString formatStr, TQString value ) -{ - if ( value.isEmpty() ) - return; - - TQCString txt = LDIF::assembleLine( formatStr, value, 72 ); - - // write the string - t << TQString::fromUtf8(txt) << "\n"; -} - -bool LDIFConverter::addresseeToLDIF( const Addressee &addr, TQString &str ) -{ - if ( addr.isEmpty() ) - return false; - - TQTextStream t( str, IO_WriteOnly|IO_Append ); - t.setEncoding( TQTextStream::UnicodeUTF8 ); - - const Address homeAddr = addr.address( Address::Home ); - const Address workAddr = addr.address( Address::Work ); - - ldif_out( t, "dn", TQString( "cn=%1,mail=%2" ) - .arg( TQString(addr.formattedName()).simplifyWhiteSpace() ) - .arg( addr.preferredEmail() ) ); - ldif_out( t, "givenname", addr.givenName() ); - ldif_out( t, "sn", addr.familyName() ); - ldif_out( t, "cn", TQString(addr.formattedName()).simplifyWhiteSpace() ); - ldif_out( t, "uid", addr.uid() ); - ldif_out( t, "nickname", addr.nickName() ); - ldif_out( t, "xmozillanickname", addr.nickName() ); - - ldif_out( t, "mail", addr.preferredEmail() ); - if ( addr.emails().count() > 1 ) - ldif_out( t, "mozillasecondemail", addr.emails()[ 1 ] ); -//ldif_out( t, "mozilla_AIMScreenName: %1\n", "screen_name" ); - - ldif_out( t, "telephonenumber", addr.phoneNumber( PhoneNumber::Work ).number() ); - ldif_out( t, "facsimiletelephonenumber", addr.phoneNumber( PhoneNumber::Fax ).number() ); - ldif_out( t, "homephone", addr.phoneNumber( PhoneNumber::Home ).number() ); - ldif_out( t, "mobile", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 7 - ldif_out( t, "cellphone", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 4.x - ldif_out( t, "pager", addr.phoneNumber( PhoneNumber::Pager ).number() ); - ldif_out( t, "pagerphone", addr.phoneNumber( PhoneNumber::Pager ).number() ); - - ldif_out( t, "streethomeaddress", homeAddr.street() ); - ldif_out( t, "postalcode", workAddr.postalCode() ); - ldif_out( t, "postofficebox", workAddr.postOfficeBox() ); - - TQStringList streets = TQStringList::split( '\n', homeAddr.street() ); - if ( streets.count() > 0 ) - ldif_out( t, "homepostaladdress", streets[ 0 ] ); // Netscape 7 - if ( streets.count() > 1 ) - ldif_out( t, "mozillahomepostaladdress2", streets[ 1 ] ); // Netscape 7 - ldif_out( t, "mozillahomelocalityname", homeAddr.locality() ); // Netscape 7 - ldif_out( t, "mozillahomestate", homeAddr.region() ); - ldif_out( t, "mozillahomepostalcode", homeAddr.postalCode() ); - ldif_out( t, "mozillahomecountryname", Address::ISOtoCountry(homeAddr.country()) ); - ldif_out( t, "locality", workAddr.locality() ); - ldif_out( t, "streetaddress", workAddr.street() ); // Netscape 4.x - - streets = TQStringList::split( '\n', workAddr.street() ); - if ( streets.count() > 0 ) - ldif_out( t, "postaladdress", streets[ 0 ] ); - if ( streets.count() > 1 ) - ldif_out( t, "mozillapostaladdress2", streets[ 1 ] ); - ldif_out( t, "countryname", Address::ISOtoCountry(workAddr.country()) ); - ldif_out( t, "l", workAddr.locality() ); - ldif_out( t, "c", Address::ISOtoCountry(workAddr.country()) ); - ldif_out( t, "st", workAddr.region() ); - - ldif_out( t, "title", addr.title() ); - ldif_out( t, "vocation", addr.prefix() ); - ldif_out( t, "ou", addr.role() ); - ldif_out( t, "o", addr.organization() ); - ldif_out( t, "organization", addr.organization() ); - ldif_out( t, "organizationname", addr.organization() ); - - // Compatibility with older kabc versions. - if ( !addr.department().isEmpty() ) - ldif_out( t, "department", addr.department() ); - else - ldif_out( t, "department", addr.custom("KADDRESSBOOK", "X-Department") ); - - ldif_out( t, "workurl", addr.url().prettyURL() ); - ldif_out( t, "homeurl", addr.url().prettyURL() ); - ldif_out( t, "description", addr.note() ); - if (addr.revision().isValid()) - ldif_out(t, "modifytimestamp", dateToVCardString( TQT_TQDATETIME_OBJECT(addr.revision())) ); - - t << "objectclass: top\n"; - t << "objectclass: person\n"; - t << "objectclass: organizationalPerson\n"; - - t << "\n"; - - return true; -} - - -/* convert from LDIF stream */ - -bool LDIFConverter::LDIFToAddressee( const TQString &str, AddresseeList &addrList, TQDateTime dt ) -{ - if (str.isEmpty()) - return true; - - bool endldif = false, end = false; - LDIF ldif; - LDIF::ParseVal ret; - const char *latinstr = str.latin1(); - int latinstrlen = tqstrlen( latinstr ); - TQByteArray data; - Addressee a; - Address homeAddr, workAddr; - - data.setRawData( latinstr, latinstrlen ); - ldif.setLDIF( data ); - if (!dt.isValid()) - dt = TQDateTime::currentDateTime(); - a.setRevision(dt); - homeAddr = Address( Address::Home ); - workAddr = Address( Address::Work ); - - do { - ret = ldif.nextItem(); - switch ( ret ) { - case LDIF::Item: { - TQString fieldname = ldif.attr().lower(); - TQString value = TQString::fromUtf8( ldif.val(), ldif.val().size() ); - evaluatePair( a, homeAddr, workAddr, fieldname, value ); - break; - } - case LDIF::EndEntry: - // if the new address is not empty, append it - if ( !a.formattedName().isEmpty() || !a.name().isEmpty() || - !a.familyName().isEmpty() ) { - if ( !homeAddr.isEmpty() ) - a.insertAddress( homeAddr ); - if ( !workAddr.isEmpty() ) - a.insertAddress( workAddr ); - addrList.append( a ); - } - a = Addressee(); - a.setRevision(dt); - homeAddr = Address( Address::Home ); - workAddr = Address( Address::Work ); - break; - case LDIF::MoreData: { - if ( endldif ) - end = true; - else { - ldif.endLDIF(); - endldif = true; - break; - } - } - default: - break; - } - } while ( !end ); - - data.resetRawData( latinstr, latinstrlen ); - - return true; -} - -bool LDIFConverter::evaluatePair( Addressee &a, Address &homeAddr, - Address &workAddr, - TQString &fieldname, TQString &value ) -{ - if ( fieldname == TQString::fromLatin1( "dn" ) ) // ignore & return false! - return false; - - if ( fieldname.startsWith("#") ) { - return true; - } - - if ( fieldname.isEmpty() && !a.note().isEmpty() ) { - // some LDIF export filters are borken and add additional - // comments on stand-alone lines. Just add them to the notes for now. - a.setNote( a.note() + "\n" + value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "givenname" ) ) { - a.setGivenName( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "xmozillanickname") || - fieldname == TQString::fromLatin1( "nickname") ) { - a.setNickName( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "sn" ) ) { - a.setFamilyName( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "uid" ) ) { - a.setUid( value ); - return true; - } - if ( fieldname == TQString::fromLatin1( "mail" ) || - fieldname == TQString::fromLatin1( "mozillasecondemail" ) ) { // mozilla - if ( a.emails().findIndex( value ) == -1 ) - a.insertEmail( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "title" ) ) { - a.setTitle( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "vocation" ) ) { - a.setPrefix( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "cn" ) ) { - a.setFormattedName( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "o" ) || - fieldname == TQString::fromLatin1( "organization" ) || // Exchange - fieldname == TQString::fromLatin1( "organizationname" ) ) { // Exchange - a.setOrganization( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "description" ) ) { -addComment: - if ( !a.note().isEmpty() ) - a.setNote( a.note() + "\n" ); - a.setNote( a.note() + value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "custom1" ) || - fieldname == TQString::fromLatin1( "custom2" ) || - fieldname == TQString::fromLatin1( "custom3" ) || - fieldname == TQString::fromLatin1( "custom4" ) ) { - goto addComment; - } - - if ( fieldname == TQString::fromLatin1( "homeurl" ) || - fieldname == TQString::fromLatin1( "workurl" ) ) { - if (a.url().isEmpty()) { - a.setUrl( KURL( value ) ); - return true; - } - if ( a.url().prettyURL() == KURL(value).prettyURL() ) - return true; - // TODO: current version of kabc only supports one URL. - // TODO: change this with KDE 4 - } - - if ( fieldname == TQString::fromLatin1( "homephone" ) ) { - a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Home ) ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "telephonenumber" ) ) { - a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Work ) ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "mobile" ) ) { // mozilla/Netscape 7 - a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Cell ) ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "cellphone" ) ) { - a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Cell ) ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "pager" ) || // mozilla - fieldname == TQString::fromLatin1( "pagerphone" ) ) { // mozilla - a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Pager ) ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "facsimiletelephonenumber" ) ) { - a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Fax ) ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "xmozillaanyphone" ) ) { // mozilla - a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Work ) ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "street" ) || - fieldname == TQString::fromLatin1( "streethomeaddress" ) ) { - homeAddr.setStreet( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "postaladdress" ) ) { // mozilla - workAddr.setStreet( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "mozillapostaladdress2" ) ) { // mozilla - workAddr.setStreet( workAddr.street() + TQString::fromLatin1( "\n" ) + value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "postalcode" ) ) { - workAddr.setPostalCode( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "postofficebox" ) ) { - workAddr.setPostOfficeBox( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "homepostaladdress" ) ) { // Netscape 7 - homeAddr.setStreet( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "mozillahomepostaladdress2" ) ) { // mozilla - homeAddr.setStreet( homeAddr.street() + TQString::fromLatin1( "\n" ) + value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "mozillahomelocalityname" ) ) { // mozilla - homeAddr.setLocality( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "mozillahomestate" ) ) { // mozilla - homeAddr.setRegion( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "mozillahomepostalcode" ) ) { // mozilla - homeAddr.setPostalCode( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "mozillahomecountryname" ) ) { // mozilla - if ( value.length() <= 2 ) - value = Address::ISOtoCountry(value); - homeAddr.setCountry( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "locality" ) ) { - workAddr.setLocality( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "streetaddress" ) ) { // Netscape 4.x - workAddr.setStreet( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "countryname" ) || - fieldname == TQString::fromLatin1( "c" ) ) { // mozilla - if ( value.length() <= 2 ) - value = Address::ISOtoCountry(value); - workAddr.setCountry( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "l" ) ) { // mozilla - workAddr.setLocality( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "st" ) ) { - workAddr.setRegion( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "ou" ) ) { - a.setRole( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "department" ) ) { - a.setDepartment( value ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "member" ) ) { - // this is a mozilla list member (cn=xxx, mail=yyy) - TQStringList list( TQStringList::split( ',', value ) ); - TQString name, email; - - TQStringList::Iterator it; - for ( it = list.begin(); it != list.end(); ++it ) { - if ( (*it).startsWith( "cn=" ) ) - name = (*it).mid( 3 ).stripWhiteSpace(); - if ( (*it).startsWith( "mail=" ) ) - email = (*it).mid( 5 ).stripWhiteSpace(); - } - if ( !name.isEmpty() && !email.isEmpty() ) - email = " <" + email + ">"; - a.insertEmail( name + email ); - a.insertCategory( i18n( "List of Emails" ) ); - return true; - } - - if ( fieldname == TQString::fromLatin1( "modifytimestamp" ) ) { - if (value == TQString::fromLatin1("0Z")) // ignore - return true; - TQDateTime dt = VCardStringToDate( value ); - if ( dt.isValid() ) { - a.setRevision(dt); - return true; - } - } - - if ( fieldname == TQString::fromLatin1( "objectclass" ) ) // ignore - return true; - - kdWarning() << TQString(TQString("LDIFConverter: Unknown field for '%1': '%2=%3'\n") - .arg(a.formattedName()).arg(fieldname).arg(value)); - - return true; -} - -/* The following functions are obsoleted. Similar functionality can be found - * in the LDIF class */ - -bool LDIFConverter::parseSingleLine( Addressee &a, Address &homeAddr, - Address &workAddr, TQString &line ) -{ - if ( line.isEmpty() ) - return true; - - TQString fieldname, value; - TQByteArray val; - - LDIF::splitLine( line.latin1(), fieldname, val ); - value = TQString::fromUtf8( val.data(), val.size() ); - return evaluatePair( a, homeAddr, workAddr, fieldname, value); -} - - -bool LDIFConverter::splitLine( TQString &line, TQString &fieldname, TQString &value) -{ - TQByteArray val; - bool ret = LDIF::splitLine( line.latin1(), fieldname, val ); - value = TQString::fromUtf8( val.data(), val.size() ); - return ret; -} - - -TQString LDIFConverter::makeLDIFfieldString( TQString formatStr, TQString value, bool allowEncode ) -{ - if ( value.isEmpty() ) - return TQString(); - - // append format if not given - if (formatStr.find(':') == -1) - formatStr.append(": %1\n"); - - // check if base64-encoding is needed - bool printable = true; - unsigned int i, len; - len = value.length(); - for (i = 0; i<len; ++i ) { - if (!value[i].isPrint()) { - printable = false; - break; - } - } - - if (printable) // always encode if we find special chars... - printable = (value.find('\n') == -1); - - if (!printable && allowEncode) { - // encode to base64 - value = KCodecs::base64Encode( value.utf8() ); - int p = formatStr.find(':'); - if (p>=0) - formatStr.insert(p, ':'); - } - - // generate the new string and split it to 72 chars/line - TQCString txt = TQString(formatStr.arg(value)).utf8(); - - if (allowEncode) { - len = txt.length(); - if (len && txt[len-1] == '\n') - --len; - i = 72; - while (i < len) { - txt.insert(i, "\n "); - i += 72+1; - len += 2; - } - } - - return TQString::fromUtf8(txt); -} - diff --git a/kabc/ldifconverter.h b/kabc/ldifconverter.h deleted file mode 100644 index a8052a65f..000000000 --- a/kabc/ldifconverter.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Helge Deller <deller@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 version 2 only as published by the Free Software Foundation. - - 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 KABC_LDIFCONVERTER_H -#define KABC_LDIFCONVERTER_H - -#include <tqstring.h> -#include <tqdatetime.h> - -#include "addressee.h" -#include "addresseelist.h" - -namespace KABC { - - /** - * A set of functions to convert a string with LDIF information to addressees - * and vice versa. It is useful for addressbook import- and exportfilters - * and might be used to read and write Mozilla and Netscape addresssbooks. - */ - - namespace LDIFConverter { - - /** - * Converts a LDIF string to a list of addressees. - * - * @param str The vcard string. - * @param addrList The addresseelist. - * @param dt The date & time value of the last modification (e.g. file modification time). - * @since 3.2 - */ - KABC_EXPORT bool LDIFToAddressee( const TQString &str, AddresseeList &addrList, TQDateTime dt = TQDateTime::currentDateTime() ); - - /** - * Converts a list of addressees to a LDIF string. - * - * @param addrList The addresseelist. - * @param str The LDIF string. - * @since 3.2 - */ - KABC_EXPORT bool addresseeToLDIF( const AddresseeList &addrList, TQString &str ); - - /** - * Converts an addressee to a LDIF string. - * - * @param addr The addressee. - * @param str The LDIF string. - * @since 3.2 - */ - KABC_EXPORT bool addresseeToLDIF( const Addressee &addr, TQString &str ); - - /** - * @deprecated - * Obsoleted - please use LDIF::assembleLine() - * Returns a LDIF compatible string representing a given field/value pair. - * If necessary, the value parameter will be base64encoded and split into multiple. - * This function will return an empty string if the given value is empty. - * - * @param field The LDAP field name or a complete LDIF field string (e.g. "cn" or "cn = %1\n"). - * @param value The value for this field. - * @param allowEncode Set to false if you wish no encoding of the value. - * @since 3.2 - */ - KABC_EXPORT TQString makeLDIFfieldString( TQString field, TQString value, bool allowEncode = true ) KDE_DEPRECATED; - - - - /* internal functions - do not use !! */ - - /** No need for this function anymore - use LDIF::splitLine() + evaluatePair() */ - KABC_EXPORT bool parseSingleLine( Addressee &a, - Address &homeAddr, Address &workAddr, TQString &line ); - - /** No need for this function anymore - use LDIF::splitLine() */ - KABC_EXPORT bool splitLine( TQString &line, TQString &fieldname, TQString &value); - - - KABC_EXPORT bool evaluatePair( Addressee &a, Address &homeAddr, Address &workAddr, - TQString &fieldname, TQString &value ); - - } - -} -#endif - diff --git a/kabc/lock.cpp b/kabc/lock.cpp deleted file mode 100644 index 8f64a3c23..000000000 --- a/kabc/lock.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@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 "lock.h" - -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <kstandarddirs.h> -#include <ktempfile.h> - -#include <tqfile.h> - -#include <signal.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> - -using namespace KABC; - -Lock::Lock( const TQString &identifier ) - : mIdentifier( identifier ) -{ - mIdentifier.replace( "/", "_" ); -} - -Lock::~Lock() -{ - unlock(); -} - -TQString Lock::locksDir() -{ - return locateLocal( "data", "kabc/lock/" ); -} - -bool Lock::readLockFile( const TQString &filename, int &pid, TQString &app ) -{ - TQFile file( filename ); - if ( !file.open( IO_ReadOnly ) ) return false; - - TQTextStream t( &file ); - pid = t.readLine().toInt(); - app = t.readLine(); - - return true; -} - -bool Lock::writeLockFile( const TQString &filename ) -{ - TQFile file( filename ); - if ( !file.open( IO_WriteOnly ) ) return false; - TQTextStream t( &file ); - t << ::getpid() << endl << TQString( TDEGlobal::instance()->instanceName() ); - - return true; -} - -TQString Lock::lockFileName() const -{ - return locksDir() + mIdentifier + ".lock"; -} - -bool Lock::lock() -{ - kdDebug(5700) << "Lock::lock()" << endl; - - TQString lockName = lockFileName(); - kdDebug(5700) << "-- lock name: " << lockName << endl; - - if ( TQFile::exists( lockName ) ) { // check if it is a stale lock file - int pid; - TQString app; - - if ( !readLockFile( lockFileName(), pid, app ) ) { - mError = i18n("Unable to open lock file."); - return false; - } - - int retval = ::kill( pid, 0 ); - if ( retval == -1 && errno == ESRCH ) { // process doesn't exists anymore - TQFile::remove( lockName ); - kdWarning(5700) << "Removed stale lock file from process '" << app << "'" - << endl; - } else { - TQString identifier( mIdentifier ); - identifier.replace( '_', '/' ); - - mError = i18n("The address book '%1' is locked by application '%2'.\nIf you believe this is incorrect, just remove the lock file from '%3'") - .arg( identifier ).arg( app ).arg( locateLocal( "data", "kabc/lock/*.lock" ) ); - return false; - } - } - - TQString lockUniqueName; - lockUniqueName = mIdentifier + kapp->randomString( 8 ); - mLockUniqueName = locateLocal( "data", "kabc/lock/" + lockUniqueName ); - kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; - - // Create unique file - writeLockFile( mLockUniqueName ); - - // Create lock file - int result = ::link( TQFile::encodeName( mLockUniqueName ), - TQFile::encodeName( lockName ) ); - - if ( result == 0 ) { - mError = ""; - emit locked(); - return true; - } - - // TODO: check stat - - mError = i18n("Error"); - return false; -} - -bool Lock::unlock() -{ - int pid; - TQString app; - if ( readLockFile( lockFileName(), pid, app ) ) { - if ( pid == getpid() ) { - TQFile::remove( lockFileName() ); - TQFile::remove( mLockUniqueName ); - emit unlocked(); - } else { - mError = i18n("Unlock failed. Lock file is owned by other process: %1 (%2)") - .arg( app ).arg( TQString::number( pid ) ); - kdDebug() << "Lock::unlock(): " << mError << endl; - return false; - } - } - - mError = ""; - return true; -} - -TQString Lock::error() const -{ - return mError; -} - -#include "lock.moc" diff --git a/kabc/lock.h b/kabc/lock.h deleted file mode 100644 index addc2032f..000000000 --- a/kabc/lock.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@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 KABC_LOCK_H -#define KABC_LOCK_H - -#include <tqstring.h> -#include <tqobject.h> - -#include <tdelibs_export.h> - -namespace KABC { - -/** - This class provides locking functionality for a file, directory or an - arbitrary string-represented resource. -*/ -class KABC_EXPORT Lock : public TQObject -{ - Q_OBJECT - public: - /** - Constructor. - - @param identifier An identifier for the resource to be locked, e.g. a file - name. - */ - Lock( const TQString &identifier ); - - /** - Destruct lock object. This also removes the lock on the resource. - */ - ~Lock(); - - /** - Lock resource. - */ - virtual bool lock(); - - /** - Unlock resource. - */ - virtual bool unlock(); - - virtual TQString error() const; - - TQString lockFileName() const; - - static bool readLockFile( const TQString &filename, int &pid, TQString &app ); - static bool writeLockFile( const TQString &filename ); - - static TQString locksDir(); - - signals: - void locked(); - void unlocked(); - - private: - TQString mIdentifier; - - TQString mLockUniqueName; - - TQString mError; - - class Private; - Private *d; -}; - -} - -#endif diff --git a/kabc/locknull.cpp b/kabc/locknull.cpp deleted file mode 100644 index 234c2c214..000000000 --- a/kabc/locknull.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2003 Cornelius Schumacher <schumacher@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 "locknull.h" - -#include <klocale.h> -#include <kdebug.h> - -using namespace KABC; - -LockNull::LockNull( bool allowAccess ) - : Lock( TQString::null ), mAllowAccess( allowAccess ) -{ -} - -LockNull::~LockNull() -{ - unlock(); -} - -bool LockNull::lock() -{ - if ( !mAllowAccess ) return false; - - kdWarning() << "LockNull::lock() force success. Doesn't actually lock." - << endl; - - emit locked(); - - return true; -} - -bool LockNull::unlock() -{ - emit unlocked(); - return true; -} - -TQString LockNull::error() const -{ - if ( mAllowAccess ) - return i18n("LockNull: All locks succeed but no actual locking is done."); - else - return i18n("LockNull: All locks fail."); -} diff --git a/kabc/locknull.h b/kabc/locknull.h deleted file mode 100644 index dfefe122a..000000000 --- a/kabc/locknull.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2003 Cornelius Schumacher <schumacher@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 KABC_LOCKNULL_H -#define KABC_LOCKNULL_H - -#include <tqstring.h> - -#include "lock.h" - -namespace KABC { - -/** - This class provides a lock without actually locking. It can be constructed in - two ways: One that let all locks succeed and one that let all locks fail. -*/ -class KABC_EXPORT LockNull : public Lock -{ - public: - LockNull( bool allowAccess ); - ~LockNull(); - - bool lock(); - bool unlock(); - - TQString error() const; - - private: - bool mAllowAccess; - - class Private; - Private *d; -}; - -} - -#endif diff --git a/kabc/phonenumber.cpp b/kabc/phonenumber.cpp deleted file mode 100644 index adf8566f1..000000000 --- a/kabc/phonenumber.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tdeapplication.h> -#include <klocale.h> - -#include "phonenumber.h" - -using namespace KABC; - -PhoneNumber::PhoneNumber() : - mType( Home ) -{ - init(); -} - -PhoneNumber::PhoneNumber( const TQString &number, int type ) : - mType( type ) -{ - init(); - - validateNumber( number ); -} - -PhoneNumber::~PhoneNumber() -{ -} - -void PhoneNumber::init() -{ - mId = TDEApplication::randomString( 8 ); -} - -void PhoneNumber::validateNumber( const TQString &number ) -{ - mNumber = number; - - // remove line breaks - mNumber = mNumber.replace( '\n', "" ); - mNumber = mNumber.replace( '\r', "" ); -} - -bool PhoneNumber::operator==( const PhoneNumber &p ) const -{ - if ( mNumber != p.mNumber ) return false; - if ( mType != p.mType ) return false; - - return true; -} - -bool PhoneNumber::operator!=( const PhoneNumber &p ) const -{ - return !( p == *this ); -} - -void PhoneNumber::setId( const TQString &id ) -{ - mId = id; -} - -TQString PhoneNumber::id() const -{ - return mId; -} - -void PhoneNumber::setNumber( const TQString &number ) -{ - validateNumber( number ); -} - -TQString PhoneNumber::number() const -{ - return mNumber; -} - -void PhoneNumber::setType( int type ) -{ - mType = type; -} - -int PhoneNumber::type() const -{ - return mType; -} - -TQString PhoneNumber::typeLabel() const -{ - TQString label; - bool first = true; - - const TypeList list = typeList(); - - TypeList::ConstIterator it; - for ( it = list.begin(); it != list.end(); ++it ) { - if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { - label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); - if ( first ) - first = false; - } - } - - return label; -} - -TQString PhoneNumber::label() const -{ - return typeLabel( type() ); -} - -PhoneNumber::TypeList PhoneNumber::typeList() -{ - static TypeList list; - - if ( list.isEmpty() ) { - list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video - << Bbs << Modem << Car << Isdn << Pcs << Pager; - } - - return list; -} - -TQString PhoneNumber::label( int type ) -{ - return typeLabel( type ); -} - -TQString PhoneNumber::typeLabel( int type ) -{ - if ( type & Pref ) - return i18n( "Preferred phone", "Preferred" ); - - switch ( type ) { - case Home: - return i18n("Home phone", "Home"); - break; - case Work: - return i18n("Work phone", "Work"); - break; - case Msg: - return i18n("Messenger"); - break; - case Pref: - return i18n("Preferred Number"); - break; - case Voice: - return i18n("Voice"); - break; - case Fax: - return i18n("Fax"); - break; - case Cell: - return i18n("Mobile Phone", "Mobile" ); - break; - case Video: - return i18n("Video"); - break; - case Bbs: - return i18n("Mailbox"); - break; - case Modem: - return i18n("Modem"); - break; - case Car: - return i18n("Car Phone", "Car" ); - break; - case Isdn: - return i18n("ISDN"); - break; - case Pcs: - return i18n("PCS"); - break; - case Pager: - return i18n("Pager"); - break; - case Home | Fax: - return i18n("Home Fax"); - break; - case Work | Fax: - return i18n("Work Fax"); - break; - default: - return i18n("Other"); - } -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const PhoneNumber &phone ) -{ - return s << phone.mId << phone.mType << phone.mNumber; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, PhoneNumber &phone ) -{ - s >> phone.mId >> phone.mType >> phone.mNumber; - - return s; -} diff --git a/kabc/phonenumber.h b/kabc/phonenumber.h deleted file mode 100644 index 3e6ae0941..000000000 --- a/kabc/phonenumber.h +++ /dev/null @@ -1,161 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_PHONENUMBER_H -#define KABC_PHONENUMBER_H - -#include <tqvaluelist.h> -#include <tqstring.h> - -#include <tdelibs_export.h> - -namespace KABC { - -/** - @short Phonenumber information. - - This class provides phone number information. A phone number is classified by - a type. The following types are available, it's possible to use multiple types - Types for a number by combining them through a logical or. -*/ -class KABC_EXPORT PhoneNumber -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const PhoneNumber & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, PhoneNumber & ); - - public: - typedef TQValueList<PhoneNumber> List; - typedef TQValueList<int> TypeList; - - /** - @li @p Home - Home number - @li @p Work - Office number - @li @p Msg - Messaging - @li @p Pref - Preferred number - @li @p Voice - Voice - @li @p Fax - Fax machine - @li @p Cell - Cell phone - @li @p Video - Video phone - @li @p Bbs - Mailbox - @li @p Modem - Modem - @li @p Car - Car phone - @li @p Isdn - ISDN connection - @li @p Pcs - Personal Communication Service - @li @p Pager - Pager - */ - enum Types { Home = 1, Work = 2, Msg = 4, Pref = 8, Voice = 16, Fax = 32, - Cell = 64, Video = 128, Bbs = 256, Modem = 512, Car = 1024, - Isdn = 2048, Pcs = 4096, Pager = 8192 }; - - /** - Create an empty phone number object. - */ - PhoneNumber(); - - /** - Create a phonenumber object. - - @param number Number - @param type Type as defined in enum. Multiple types can be - specified by combining them by a logical or. - */ - PhoneNumber( const TQString &number, int type = Home ); - - /** - Destructor. - */ - ~PhoneNumber(); - - bool operator==( const PhoneNumber & ) const; - bool operator!=( const PhoneNumber & ) const; - - /** - Sets the unique identifier. - */ - void setId( const TQString &id ); - - /** - Returns the unique identifier. - */ - TQString id() const; - - /** - Sets the number. - */ - void setNumber( const TQString & ); - - /** - Returns the number. - */ - TQString number() const; - - /** - Sets the type. Multiple types can be specified by combining them by - a logical or. - */ - void setType( int ); - - /** - Returns the type. Can be a multiple types combined by a logical or. - */ - int type() const; - - /** - Returns a translated string of all types the address has. - */ - TQString typeLabel() const; - - /** - Returns the translated label for phone number depending on its type. - */ - TQString label() const; - - /** - Returns a list of all available types - */ - static TypeList typeList(); - - /** - Returns the translated label for phone number type. - */ - static TQString typeLabel( int type ); - - /** - Returns the translated label for phone number type. - @obsolete - */ - static TQString label( int type ); - - private: - void init(); - void validateNumber( const TQString& ); - - TQString mId; - - int mType; - TQString mNumber; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const PhoneNumber & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, PhoneNumber & ); - -} - -#endif diff --git a/kabc/picture.cpp b/kabc/picture.cpp deleted file mode 100644 index 4ddd3f537..000000000 --- a/kabc/picture.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 "picture.h" - -using namespace KABC; - -Picture::Picture() - : mIntern( false ) -{ -} - -Picture::Picture( const TQString &url ) - : mUrl( url ), mIntern( false ) -{ -} - -Picture::Picture( const TQImage &data ) - : mData( data ), mIntern( true ) -{ -} - -Picture::~Picture() -{ -} - -bool Picture::operator==( const Picture &p ) const -{ - if ( mIntern != p.mIntern ) return false; - - if ( mIntern ) { - if ( mData != p.mData ) - return false; - } else { - if ( mUrl != p.mUrl ) - return false; - } - - return true; -} - -bool Picture::operator!=( const Picture &p ) const -{ - return !( p == *this ); -} - -void Picture::setUrl( const TQString &url ) -{ - mUrl = url; - mIntern = false; -} - -void Picture::setData( const TQImage &data ) -{ - mData = data; - mIntern = true; -} - -void Picture::setType( const TQString &type ) -{ - mType = type; -} - -bool Picture::isIntern() const -{ - return mIntern; -} - -TQString Picture::url() const -{ - return mUrl; -} - -TQImage Picture::data() const -{ - return mData; -} - -TQString Picture::type() const -{ - return mType; -} - -TQString Picture::asString() const -{ - if ( mIntern ) - return "intern picture"; - else - return mUrl; -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Picture &picture ) -{ - return s << picture.mIntern << picture.mUrl << picture.mType; -// return s << picture.mIntern << picture.mUrl << picture.mType << picture.mData; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Picture &picture ) -{ - s >> picture.mIntern >> picture.mUrl >> picture.mType; -// s >> picture.mIntern >> picture.mUrl >> picture.mType >> picture.mData; - return s; -} diff --git a/kabc/picture.h b/kabc/picture.h deleted file mode 100644 index e6ed690c2..000000000 --- a/kabc/picture.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_PICTURE_H -#define KABC_PICTURE_H - -#include <tqimage.h> - -#include <tdelibs_export.h> - -namespace KABC { - -class KABC_EXPORT Picture -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Picture & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Picture & ); - -public: - - /** - * Consturctor. Creates an empty object. - */ - Picture(); - - /** - * Consturctor. - * - * @param url A URL that describes the position of the picture file. - */ - Picture( const TQString &url ); - - /** - * Consturctor. - * - * @param data The raw data of the picture. - */ - Picture( const TQImage &data ); - - /** - * Destructor. - */ - ~Picture(); - - - bool operator==( const Picture & ) const; - bool operator!=( const Picture & ) const; - - /** - * Sets a URL for the location of the picture file. When using this - * function, isIntern() will return 'false' until you use - * setData(). - * - * @param url The location URL of the picture file. - */ - void setUrl( const TQString &url ); - - /** - * Sets the raw data of the picture. When using this function, - * isIntern() will return 'true' until you use setUrl(). - * - * @param data The raw data of the picture. - */ - void setData( const TQImage &data ); - - /** - * Sets the type of the picture. - */ - void setType( const TQString &type ); - - /** - * Returns whether the picture is described by a URL (extern) or - * by the raw data (intern). - * When this method returns 'true' you can use data() to - * get the raw data. Otherwise you can request the URL of this - * picture by url() and load the raw data from that location. - */ - bool isIntern() const; - - /** - * Returns the location URL of this picture. - */ - TQString url() const; - - /** - * Returns the raw data of this picture. - */ - TQImage data() const; - - /** - * Returns the type of this picture. - */ - TQString type() const; - - /** - * Returns string representation of the picture. - */ - TQString asString() const; - -private: - TQString mUrl; - TQString mType; - TQImage mData; - - int mIntern; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Picture & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Picture & ); - -} -#endif diff --git a/kabc/plugin.cpp b/kabc/plugin.cpp deleted file mode 100644 index a53192559..000000000 --- a/kabc/plugin.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 "plugin.h" - -using namespace KABC; - -Plugin::Plugin() -{ -} - -Plugin::~Plugin() -{ -} - -void Plugin::setType( const TQString& type ) -{ - mType = type; -} - -TQString Plugin::type() const -{ - return mType; -} - -void Plugin::setNameLabel( const TQString& label ) -{ - mNameLabel = label; -} - -TQString Plugin::nameLabel() const -{ - return mNameLabel; -} - -void Plugin::setDescriptionLabel( const TQString& label ) -{ - mDescriptionLabel = label; -} - -TQString Plugin::descriptionLabel() const -{ - return mDescriptionLabel; -} diff --git a/kabc/plugin.h b/kabc/plugin.h deleted file mode 100644 index 0c8e3b338..000000000 --- a/kabc/plugin.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_PLUGIN_H -#define KABC_PLUGIN_H - -#include <tqstring.h> - -#include <tdelibs_export.h> - -namespace KABC { - -class KABC_EXPORT Plugin -{ -public: - Plugin(); - virtual ~Plugin(); - - virtual void setType( const TQString& type ); - virtual TQString type() const; - - virtual void setNameLabel( const TQString& label ); - virtual TQString nameLabel() const; - - virtual void setDescriptionLabel( const TQString& label ); - virtual TQString descriptionLabel() const; - -private: - TQString mType; - TQString mNameLabel; - TQString mDescriptionLabel; -}; - -} -#endif diff --git a/kabc/plugins/CMakeLists.txt b/kabc/plugins/CMakeLists.txt deleted file mode 100644 index 597486816..000000000 --- a/kabc/plugins/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -add_subdirectory( file ) -add_subdirectory( dir ) -add_subdirectory( net ) -add_subdirectory( ldaptdeio ) diff --git a/kabc/plugins/Makefile.am b/kabc/plugins/Makefile.am deleted file mode 100644 index bdedbec0f..000000000 --- a/kabc/plugins/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = file dir net ldaptdeio diff --git a/kabc/plugins/dir/CMakeLists.txt b/kabc/plugins/dir/CMakeLists.txt deleted file mode 100644 index 737d1144e..000000000 --- a/kabc/plugins/dir/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/kabc - ${CMAKE_SOURCE_DIR}/kabc - - ${TQT_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdefile -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - resourcedir.h - DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) - - -##### other data ################################ - -install( FILES dir.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) - - -##### kabc_dir (library) ######################## - -set( target kabc_dir ) - -set( ${target}_SRCS - resourcedir.cpp resourcedirconfig.cpp -) - -tde_add_library( ${target} SHARED AUTOMOC - SOURCES ${${target}_SRCS} - VERSION 1.0.0 - LINK kabc-shared - DESTINATION ${LIB_INSTALL_DIR} -) - - -##### kabc_dir (module) ######################### - -set( target kabc_dir ) - -set( ${target}_SRCS - resourcedirplugin.cpp -) - -tde_add_kpart( ${target} - SOURCES ${${target}_SRCS} - LINK kabc_dir-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/kabc/plugins/dir/Makefile.am b/kabc/plugins/dir/Makefile.am deleted file mode 100644 index 4b61d2828..000000000 --- a/kabc/plugins/dir/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_builddir) $(all_includes) - -# these are the headers for your project -noinst_HEADERS = resourcedirconfig.h - -lib_LTLIBRARIES = libkabc_dir.la -libkabc_dir_la_SOURCES = resourcedir.cpp resourcedirconfig.cpp -libkabc_dir_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined -libkabc_dir_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(top_builddir)/tderesources/libtderesources.la $(LIB_TDECORE) $(LIB_TDEFILE) $(LIB_TDEUI) -libkabc_dir_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h - -kde_module_LTLIBRARIES = kabc_dir.la -kabc_dir_la_SOURCES = resourcedirplugin.cpp -kabc_dir_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined -kabc_dir_la_LIBADD = libkabc_dir.la $(LIB_QT) $(LIB_TDECORE) - -METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kabc_dir.pot - -kabcincludedir = $(includedir)/kabc -kabcinclude_HEADERS = resourcedir.h - -servicedir = $(kde_servicesdir)/tderesources/kabc -service_DATA = dir.desktop - -resourcedirplugin.lo: ../../addressee.h diff --git a/kabc/plugins/dir/dir.desktop b/kabc/plugins/dir/dir.desktop deleted file mode 100644 index a841040f9..000000000 --- a/kabc/plugins/dir/dir.desktop +++ /dev/null @@ -1,92 +0,0 @@ -[Desktop Entry] -Name=Directory -Name[af]=Gids -Name[ar]=دليل -Name[az]=CÉ™rgÉ™ -Name[be]=ТÑчка -Name[bn]=ডিরেকà§à¦Ÿà¦°à¦¿ -Name[br]=Renkell -Name[bs]=Direktorij -Name[ca]=Directori -Name[cs]=Adresář -Name[csb]=Katalog -Name[cy]=Cyfeiriadur -Name[da]=Mappe -Name[de]=Verzeichnis -Name[el]=Κατάλογος -Name[eo]=Dosierujo -Name[es]=Directorio -Name[et]=Kataloog -Name[eu]=Direktorioa -Name[fa]=Ùهرست راهنما -Name[fi]=Hakemisto -Name[fo]=Fíluskrá -Name[fr]=Dossier -Name[fy]=Map -Name[ga]=Comhadlann -Name[gl]=Directório -Name[he]=ספריה -Name[hi]=डिरेकà¥à¤Ÿà¥à¤°à¥€ -Name[hr]=Mapa -Name[hsb]=Zapisk -Name[hu]=Könyvtár -Name[id]=Direktori -Name[is]=Mappa -Name[it]=Cartella -Name[ja]=ディレクトリ -Name[ka]=დáƒáƒ¡áƒ¢áƒ -Name[kk]=Каталог -Name[km]=ážáž -Name[ko]=ìžë£Œë°© -Name[ku]=Peldank -Name[lb]=Verzeechnis -Name[lt]=Aplankas -Name[lv]=Direktorija -Name[mk]=Именик -Name[mn]=Лавлах -Name[ms]=Direktori -Name[mt]=Direttorju -Name[nb]=Katalog -Name[nds]=Orner -Name[ne]=डाइरेकà¥à¤Ÿà¤°à¥€ -Name[nl]=Map -Name[nn]=Katalog -Name[nso]=Tshupetso -Name[oc]=Directori -Name[pa]=ਡਾਇਰੈਕਟਰੀ -Name[pl]=Katalog -Name[pt]=Directoria -Name[pt_BR]=Diretório -Name[ro]=Director -Name[ru]=Каталог -Name[rw]=ububiko -Name[se]=Ohcu -Name[sk]=PrieÄinok -Name[sl]=Imenik -Name[sq]=Fioka -Name[sr]=ФаÑцикла -Name[sr@Latn]=Fascikla -Name[ss]=I-directory -Name[sv]=Katalog -Name[ta]=அடைவ௠-Name[te]=డైరకà±à°Ÿà°°à°¿ -Name[tg]=ФеҳраÑÑ‚ -Name[th]=ไดเรà¸à¸—อรี -Name[tr]=Dizin -Name[tt]=Törgäk -Name[uk]=Каталог -Name[uz]=Jild -Name[uz@cyrillic]=Жилд -Name[ven]=Tsumbavhulwo -Name[vi]=Thư mục -Name[wa]=Ridant -Name[xh]=Ulawulo -Name[zh_CN]=目录 -Name[zh_HK]=目錄 -Name[zh_TW]=目錄 -Name[zu]=Uhlu lwamafayela -X-TDE-Library=kabc_dir -Type=Service -ServiceTypes=KResources/Plugin -X-TDE-ResourceFamily=contact -X-TDE-ResourceType=dir diff --git a/kabc/plugins/dir/resourcedir.cpp b/kabc/plugins/dir/resourcedir.cpp deleted file mode 100644 index 936eea6e4..000000000 --- a/kabc/plugins/dir/resourcedir.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 <errno.h> -#include <signal.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> - -#include <tqregexp.h> -#include <tqtimer.h> -#include <tqwidget.h> - -#include <tdeapplication.h> -#include <tdeconfig.h> -#include <kdebug.h> -#include <kgenericfactory.h> -#include <kglobal.h> -#include <klocale.h> -#include <kstandarddirs.h> -#include <kurlrequester.h> - -#include "addressbook.h" -#include "formatfactory.h" -#include "resourcedirconfig.h" -#include "stdaddressbook.h" -#include "lock.h" - -#include "resourcedir.h" - -using namespace KABC; - -extern "C" -{ - void *init_kabc_dir() - { - return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); - } -} - - -ResourceDir::ResourceDir( const TDEConfig *config ) - : Resource( config ), mAsynchronous( false ) -{ - if ( config ) { - init( config->readPathEntry( "FilePath", StdAddressBook::directoryName() ), - config->readEntry( "FileFormat", "vcard" ) ); - } else { - init( StdAddressBook::directoryName(), "vcard" ); - } -} - -ResourceDir::ResourceDir( const TQString &path, const TQString &format ) - : Resource( 0 ), mAsynchronous( false ) -{ - init( path, format ); -} - -void ResourceDir::init( const TQString &path, const TQString &format ) -{ - mFormatName = format; - - FormatFactory *factory = FormatFactory::self(); - mFormat = factory->format( mFormatName ); - - if ( !mFormat ) { - mFormatName = "vcard"; - mFormat = factory->format( mFormatName ); - } - - mLock = 0; - - connect( &mDirWatch, TQT_SIGNAL( dirty(const TQString&) ), TQT_SLOT( pathChanged() ) ); - connect( &mDirWatch, TQT_SIGNAL( created(const TQString&) ), TQT_SLOT( pathChanged() ) ); - connect( &mDirWatch, TQT_SIGNAL( deleted(const TQString&) ), TQT_SLOT( pathChanged() ) ); - - setPath( path ); -} - -ResourceDir::~ResourceDir() -{ - delete mFormat; - mFormat = 0; -} - -void ResourceDir::writeConfig( TDEConfig *config ) -{ - Resource::writeConfig( config ); - - if ( mPath == StdAddressBook::directoryName() ) - config->deleteEntry( "FilePath" ); - else - config->writePathEntry( "FilePath", mPath ); - - config->writeEntry( "FileFormat", mFormatName ); -} - -Ticket *ResourceDir::requestSaveTicket() -{ - kdDebug(5700) << "ResourceDir::requestSaveTicket()" << endl; - - if ( !addressBook() ) return 0; - - delete mLock; - mLock = new Lock( mPath ); - - if ( mLock->lock() ) { - addressBook()->emitAddressBookLocked(); - } else { - addressBook()->error( mLock->error() ); - kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock path '" - << mPath << "': " << mLock->error() << endl; - return 0; - } - - return createTicket( this ); -} - -void ResourceDir::releaseSaveTicket( Ticket *ticket ) -{ - delete ticket; - - delete mLock; - mLock = 0; -} - -bool ResourceDir::doOpen() -{ - TQDir dir( mPath ); - if ( !dir.exists() ) { // no directory available - return dir.mkdir( dir.path() ); - } else { - TQString testName = dir.entryList( TQDir::Files )[0]; - if ( testName.isNull() || testName.isEmpty() ) // no file in directory - return true; - - TQFile file( mPath + "/" + testName ); - if ( file.open( IO_ReadOnly ) ) - return true; - - if ( file.size() == 0 ) - return true; - - bool ok = mFormat->checkFormat( &file ); - file.close(); - return ok; - } -} - -void ResourceDir::doClose() -{ -} - -bool ResourceDir::load() -{ - kdDebug(5700) << "ResourceDir::load(): '" << mPath << "'" << endl; - - mAsynchronous = false; - - TQDir dir( mPath ); - TQStringList files = dir.entryList( TQDir::Files ); - - TQStringList::Iterator it; - bool ok = true; - for ( it = files.begin(); it != files.end(); ++it ) { - TQFile file( mPath + "/" + (*it) ); - - if ( !file.open( IO_ReadOnly ) ) { - addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) ); - ok = false; - continue; - } - - if ( !mFormat->loadAll( addressBook(), this, &file ) ) - ok = false; - - file.close(); - } - - return ok; -} - -bool ResourceDir::asyncLoad() -{ - mAsynchronous = true; - - bool ok = load(); - if ( !ok ) - emit loadingError( this, i18n( "Loading resource '%1' failed!" ) - .arg( resourceName() ) ); - else - emit loadingFinished( this ); - - return ok; -} - -bool ResourceDir::save( Ticket * ) -{ - kdDebug(5700) << "ResourceDir::save(): '" << mPath << "'" << endl; - - Addressee::Map::Iterator it; - bool ok = true; - - mDirWatch.stopScan(); - - for ( it = mAddrMap.begin(); it != mAddrMap.end(); ++it ) { - if ( !it.data().changed() ) - continue; - - TQFile file( mPath + "/" + (*it).uid() ); - if ( !file.open( IO_WriteOnly ) ) { - addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); - continue; - } - - mFormat->save( *it, &file ); - - // mark as unchanged - (*it).setChanged( false ); - - file.close(); - } - - mDirWatch.startScan(); - - return ok; -} - -bool ResourceDir::asyncSave( Ticket *ticket ) -{ - bool ok = save( ticket ); - if ( !ok ) - emit savingError( this, i18n( "Saving resource '%1' failed!" ) - .arg( resourceName() ) ); - else - emit savingFinished( this ); - - return ok; -} - -void ResourceDir::setPath( const TQString &path ) -{ - mDirWatch.stopScan(); - if ( mDirWatch.contains( mPath ) ) - mDirWatch.removeDir( mPath ); - - mPath = path; - mDirWatch.addDir( mPath, true ); - mDirWatch.startScan(); -} - -TQString ResourceDir::path() const -{ - return mPath; -} - -void ResourceDir::setFormat( const TQString &format ) -{ - mFormatName = format; - - if ( mFormat ) - delete mFormat; - - FormatFactory *factory = FormatFactory::self(); - mFormat = factory->format( mFormatName ); -} - -TQString ResourceDir::format() const -{ - return mFormatName; -} - -void ResourceDir::pathChanged() -{ - if ( !addressBook() ) - return; - - clear(); - if ( mAsynchronous ) - asyncLoad(); - else { - load(); - addressBook()->emitAddressBookChanged(); - } -} - -void ResourceDir::removeAddressee( const Addressee& addr ) -{ - TQFile::remove( mPath + "/" + addr.uid() ); - mAddrMap.erase( addr.uid() ); -} - -#include "resourcedir.moc" diff --git a/kabc/plugins/dir/resourcedir.h b/kabc/plugins/dir/resourcedir.h deleted file mode 100644 index f62ee91ba..000000000 --- a/kabc/plugins/dir/resourcedir.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 KABC_RESOURCEDIR_H -#define KABC_RESOURCEDIR_H - -#include <tdeconfig.h> -#include <kdirwatch.h> - -#include <sys/types.h> - -#include <kabc/resource.h> - -class TQTimer; - -namespace KABC { - -class FormatPlugin; -class Lock; - -/** - @internal -*/ -class KABC_EXPORT ResourceDir : public Resource -{ - Q_OBJECT - - public: - ResourceDir( const TDEConfig* ); - ResourceDir( const TQString &path, const TQString &type = "vcard" ); - ~ResourceDir(); - - virtual void writeConfig( TDEConfig* ); - - virtual bool doOpen(); - virtual void doClose(); - - virtual Ticket *requestSaveTicket(); - virtual void releaseSaveTicket( Ticket* ); - - virtual bool load(); - virtual bool asyncLoad(); - virtual bool save( Ticket* ticket ); - virtual bool asyncSave( Ticket* ticket ); - - /** - Set path to be used for saving. - */ - void setPath( const TQString & ); - - /** - Return path used for loading and saving the address book. - */ - TQString path() const; - - /** - Set the format by name. - */ - void setFormat( const TQString &format ); - - /** - Returns the format name. - */ - TQString format() const; - - /** - Remove a addressee from its source. - This method is mainly called by KABC::AddressBook. - */ - virtual void removeAddressee( const Addressee& addr ); - - protected slots: - void pathChanged(); - - protected: - void init( const TQString &path, const TQString &format ); - - private: - FormatPlugin *mFormat; - - KDirWatch mDirWatch; - - TQString mPath; - TQString mFormatName; - - Lock *mLock; - - bool mAsynchronous; - - class ResourceDirPrivate; - ResourceDirPrivate *d; -}; - -} - -#endif diff --git a/kabc/plugins/dir/resourcedirconfig.cpp b/kabc/plugins/dir/resourcedirconfig.cpp deleted file mode 100644 index 819d75d96..000000000 --- a/kabc/plugins/dir/resourcedirconfig.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqlabel.h> -#include <tqlayout.h> - -#include <kdebug.h> -#include <klocale.h> -#include <kstandarddirs.h> -#include <kdialog.h> - -#include "formatfactory.h" -#include "resourcedir.h" -#include "stdaddressbook.h" - -#include "resourcedirconfig.h" - -using namespace KABC; - -ResourceDirConfig::ResourceDirConfig( TQWidget* parent, const char* name ) - : KRES::ConfigWidget( parent, name ) -{ - TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2, 0, - KDialog::spacingHint() ); - - TQLabel *label = new TQLabel( i18n( "Format:" ), this ); - mFormatBox = new KComboBox( this ); - - mainLayout->addWidget( label, 0, 0 ); - mainLayout->addWidget( mFormatBox, 0, 1 ); - - label = new TQLabel( i18n( "Location:" ), this ); - mFileNameEdit = new KURLRequester( this ); - mFileNameEdit->setMode( KFile::Directory ); - - mainLayout->addWidget( label, 1, 0 ); - mainLayout->addWidget( mFileNameEdit, 1, 1 ); - - FormatFactory *factory = FormatFactory::self(); - TQStringList formats = factory->formats(); - TQStringList::Iterator it; - for ( it = formats.begin(); it != formats.end(); ++it ) { - FormatInfo *info = factory->info( *it ); - if ( info ) { - mFormatTypes << (*it); - mFormatBox->insertItem( info->nameLabel ); - } - } - - mInEditMode = false; -} - -void ResourceDirConfig::setEditMode( bool value ) -{ - mFormatBox->setEnabled( !value ); - mInEditMode = value; -} - -void ResourceDirConfig::loadSettings( KRES::Resource *res ) -{ - ResourceDir *resource = dynamic_cast<ResourceDir*>( res ); - - if ( !resource ) { - kdDebug(5700) << "ResourceDirConfig::loadSettings(): cast failed" << endl; - return; - } - - mFormatBox->setCurrentItem( mFormatTypes.findIndex( resource->format() ) ); - - mFileNameEdit->setURL( resource->path() ); - if ( mFileNameEdit->url().isEmpty() ) - mFileNameEdit->setURL( KABC::StdAddressBook::directoryName() ); -} - -void ResourceDirConfig::saveSettings( KRES::Resource *res ) -{ - ResourceDir *resource = dynamic_cast<ResourceDir*>( res ); - - if ( !resource ) { - kdDebug(5700) << "ResourceDirConfig::loadSettings(): cast failed" << endl; - return; - } - - if ( mInEditMode ) - resource->setFormat( mFormatTypes[ mFormatBox->currentItem() ] ); - - resource->setPath( mFileNameEdit->url() ); -} - -#include "resourcedirconfig.moc" diff --git a/kabc/plugins/dir/resourcedirconfig.h b/kabc/plugins/dir/resourcedirconfig.h deleted file mode 100644 index 9df1778d3..000000000 --- a/kabc/plugins/dir/resourcedirconfig.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 RESOURCEDIRCONFIG_H -#define RESOURCEDIRCONFIG_H - -#include <kcombobox.h> -#include <kurlrequester.h> - -#include <tderesources/configwidget.h> - -namespace KABC { - -class KABC_EXPORT ResourceDirConfig : public KRES::ConfigWidget -{ - Q_OBJECT - -public: - ResourceDirConfig( TQWidget* parent = 0, const char* name = 0 ); - - void setEditMode( bool value ); - -public slots: - void loadSettings( KRES::Resource* ); - void saveSettings( KRES::Resource* ); - -private: - KComboBox* mFormatBox; - KURLRequester* mFileNameEdit; - - TQStringList mFormatTypes; - - bool mInEditMode; -}; - -} -#endif diff --git a/kabc/plugins/dir/resourcedirplugin.cpp b/kabc/plugins/dir/resourcedirplugin.cpp deleted file mode 100644 index a2bd6d138..000000000 --- a/kabc/plugins/dir/resourcedirplugin.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 "resourcedir.h" -#include "resourcedirconfig.h" - -using namespace KABC; - -extern "C" -{ - KDE_EXPORT void *init_kabc_dir() - { - return new KRES::PluginFactory<ResourceDir, ResourceDirConfig>(); - } -} diff --git a/kabc/plugins/evolution/Makefile.am b/kabc/plugins/evolution/Makefile.am deleted file mode 100644 index fd7b9be3b..000000000 --- a/kabc/plugins/evolution/Makefile.am +++ /dev/null @@ -1,19 +0,0 @@ -INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) - -# these are the headers for your project -noinst_HEADERS = resourceevo.h dbwrapper.h - -kde_module_LTLIBRARIES = kabc_evo.la - -kabc_evo_la_SOURCES = dbwrapper.cpp resourceevo.cpp - -kabc_evo_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -kabc_evo_la_LIBADD = ../../../kabc/libkabc.la ../../../tdeui/libtdeui.la -ldb ../../../kabc/vcardparser/libvcards.la - -METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kabc_evolution.pot - -servicedir = $(kde_servicesdir)/tderesources/kabc -service_DATA = evolution.desktop diff --git a/kabc/plugins/evolution/README b/kabc/plugins/evolution/README deleted file mode 100644 index 7dfefce00..000000000 --- a/kabc/plugins/evolution/README +++ /dev/null @@ -1,15 +0,0 @@ -A Resource using DB3 to access the evolution -addressbook make sure the wombat is not running -In future versions I may use bonobo to access it... - - -DESIGN: -The Format vs Resource idea is somehow not applyable to the -Evolution PAS - -Format would be vCard and Resource would be DB3.. -BUT -Format get's a QFile* pointer which is just not usable -with a DB3 -INSTEAD we will use the vCardImpl directly to convert -a string to Addressee \ No newline at end of file diff --git a/kabc/plugins/evolution/dbwrapper.cpp b/kabc/plugins/evolution/dbwrapper.cpp deleted file mode 100644 index fbdff165a..000000000 --- a/kabc/plugins/evolution/dbwrapper.cpp +++ /dev/null @@ -1,187 +0,0 @@ -#include <db.h> - -#include <tqfile.h> - -#include "dbwrapper.h" - - -using namespace Evolution; - -struct DBIterator::Data { - DBWrapper *wrapper; - TQString key; - TQString data; - DBC* cursor; - bool atEnd; -}; - -DBIterator::DBIterator( DBWrapper* wra) { - data = new Data; - data->wrapper = wra; - data->atEnd = false; - data->cursor = 0l; -} -DBIterator::DBIterator( const DBIterator& copy ) { - data = new Data; - data->wrapper = copy.data->wrapper; - data->key = copy.data->key; - data->data = copy.data->data; - data->atEnd = copy.data->atEnd; - if (copy.data->cursor ) - copy.data->cursor->c_dup(copy.data->cursor, &data->cursor, 0 ); - else - data->cursor = 0l; -} -DBIterator::~DBIterator() { - if (data->cursor) - data->cursor->c_close(data->cursor); - delete data; -} -DBIterator& DBIterator::operator=( const DBIterator& rhs ) { - if ( *this == rhs ) - return *this; - if (data->cursor) - data->cursor->c_close(data->cursor); - delete data; - data = new Data; - data->wrapper = rhs.data->wrapper; - data->key = rhs.data->key; - data->data = rhs.data->data; - data->atEnd = rhs.data->atEnd; - if ( rhs.data->cursor ) - rhs.data->cursor->c_dup(rhs.data->cursor, &data->cursor, 0 ); - else - data->cursor = 0l; - - return *this; -} -TQString DBIterator::key()const{ - return data->key; -} -TQString DBIterator::value()const { - return data->data; -} -TQString DBIterator::operator*() { - return data->data; -} -DBIterator& DBIterator::operator++() { - DBT key, val; - ::memset(&key, 0, sizeof(key) ); - ::memset(&val, 0, sizeof(val) ); - if ( data->cursor ) - if ( data->cursor->c_get(data->cursor, &key, &val,DB_NEXT ) != 0 ) - data->atEnd = true; - data->key = TQString::fromUtf8( (char*)key.data, key.size ); - data->data = TQString::fromUtf8( (char*)val.data, val.size ); - return *this; -} -DBIterator& DBIterator::operator--() { - DBT key, val; - ::memset(&key, 0, sizeof(key) ); - ::memset(&val, 0, sizeof(val) ); - if ( data->cursor ) - if ( data->cursor->c_get(data->cursor, &key, &val,DB_PREV ) != 0 ) - data->atEnd = true; - data->key = TQString::fromUtf8( (char*)key.data, key.size ); - data->data = TQString::fromUtf8( (char*)val.data, val.size ); - return *this; -} -bool DBIterator::operator==( const DBIterator& rhs ) { - if ( data->atEnd && data->atEnd == rhs.data->atEnd ) return true; - - return false; -} -bool DBIterator::operator!=( const DBIterator& rhs ) { - return !this->operator==(rhs ); -} -struct DBWrapper::Data { - DB* db; - bool only; -}; -DBWrapper::DBWrapper() { - data = new Data; - (void)db_create(&data->db, NULL, 0 ); - data->only = false; -} -DBWrapper::~DBWrapper() { - data->db->close(data->db, 0 ); - delete data; -} -bool DBWrapper::open( const TQString& file, bool on) { - data->only = on; - return !data->db->open(data->db, TQFile::encodeName( file ), NULL, DB_HASH, 0, 0666 ); -} -bool DBWrapper::save() { - return true; -} -DBIterator DBWrapper::begin() { - DBIterator it(this); - DBC* cursor; - DBT key, val; - int ret; - ret = data->db->cursor(data->db, NULL, &cursor, 0 ); - if (ret ) { - it.data->atEnd = true; - return it; - } - - ::memset(&key, 0, sizeof(key) ); - ::memset(&val, 0, sizeof(val) ); - ret = cursor->c_get(cursor, &key, &val, DB_FIRST ); - if (ret ) { - it.data->atEnd = true; - return it; - } - - it.data->cursor = cursor; - it.data->key = TQString::fromUtf8((char*)key.data, key.size ); - it.data->data = TQString::fromUtf8((char*)val.data, val.size ); - - return it; -} -DBIterator DBWrapper::end() { - DBIterator it(this); - it.data->atEnd = true; - - return it; -} -bool DBWrapper::find( const TQString& _key, TQString& _val ) { - DBT key, val; - ::memset(&key, 0, sizeof(key) ); - ::memset(&val, 0, sizeof(val) ); - - TQCString db_key = _key.local8Bit(); - key.data = db_key.data(); - key.size = db_key.size(); - - int ret = data->db->get(data->db, NULL, &key, &val, 0 ); - if (!ret) { - _val = TQString::fromUtf8( (char*)val.data, val.size ); - tqWarning("key: %s val: %sXXX", (char*)key.data, (char*)val.data ); - return true; - } - return false; -} -bool DBWrapper::add( const TQString& _key, const TQString& _val ) { - TQCString db_key = _key.local8Bit(); - TQCString db_val = _val.local8Bit(); - DBT key, val; - ::memset(&key, 0, sizeof(key) ); - ::memset(&val, 0, sizeof(val) ); - - key.data = db_key.data(); - key.size = db_key.size(); - val.data = db_val.data(); - val.size = db_val.size(); - - return !data->db->put(data->db, NULL, &key, &val, 0 ); -} -bool DBWrapper::remove( const TQString& _key ) { - TQCString db_key = _key.local8Bit(); - DBT key; - memset(&key, 0, sizeof(key) ); - key.data = db_key.data(); - key.size = db_key.size(); - - return !data->db->del(data->db, NULL, &key, 0 ); -} diff --git a/kabc/plugins/evolution/dbwrapper.h b/kabc/plugins/evolution/dbwrapper.h deleted file mode 100644 index e5e0a2c33..000000000 --- a/kabc/plugins/evolution/dbwrapper.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef KABC_EVOLUTION_DB_WRAPPER -#define KABC_EVOLUTION_DB_WRAPPER - -#include <db.h> - -#include <tqstring.h> -#include <tqpair.h> - -namespace Evolution { - - class DBWrapper; - class DBIterator { - friend class DBWrapper; - public: - DBIterator( DBWrapper* = 0l ); - ~DBIterator(); - - DBIterator( const DBIterator& ); - DBIterator &operator=( const DBIterator& ); - - TQString key()const; - TQString value()const; - - TQString operator*(); - - DBIterator &operator++(); - DBIterator &operator--(); - - bool operator==( const DBIterator& ); - bool operator!=( const DBIterator& ); - private: - struct Data; - Data* data; - }; - class DBWrapper { - public: - DBWrapper(); - ~DBWrapper(); - - TQString lastError()const; - - bool open( const TQString& file, bool readOnly = false); - bool save(); - DBIterator begin(); - DBIterator end(); - - bool find( const TQString& key, TQString& value ); - bool add( const TQString& key, const TQString& val ); - bool remove( const TQString& key ); - private: - // DBT element( const TQString& ); - struct Data; - Data* data; - - }; - -} - - -#endif diff --git a/kabc/plugins/evolution/evolution.desktop b/kabc/plugins/evolution/evolution.desktop deleted file mode 100644 index 98030e906..000000000 --- a/kabc/plugins/evolution/evolution.desktop +++ /dev/null @@ -1,26 +0,0 @@ -[Desktop Entry] -Name=Evolution -Name[be]=Ð­Ð²Ð°Ð»ÑŽÑ†Ñ‹Ñ -Name[bn]=ইভোলিউশন -Name[eo]=Evoluo -Name[fa]=اوولوشن -Name[hi]=à¤à¤µà¥‰à¤²à¥à¤¯à¥‚शन -Name[ko]=ì—볼루션 -Name[mn]=Хөгжил -Name[ne]=इभोलà¥à¤¯à¥à¤¸à¤¨ -Name[pa]=à¨à¨µà©‚ਲੇਸ਼ਨ -Name[sr]=Еволуција -Name[sr@Latn]=Evolucija -Name[ta]=படிபà¯à®ªà®Ÿà®¿à®¯à®¾à®© வளரà¯à®šà¯à®šà®¿ -Name[te]=ఎవలà±à°¯à±à°·à°¨à± -Name[th]=เอฟโวลูชัน -Name[tt]=ÜseÅŸ -Name[ven]=Tsikoni -Name[wa]=Evolucion -Name[xh]=Utshintsho lwendawo ngokwenqanawa -Name[zu]=Evolushini -X-TDE-Library=kabc_evo -Type=Service -ServiceTypes=KResources/Plugin -X-TDE-ResourceFamily=contact -X-TDE-ResourceType=evolution diff --git a/kabc/plugins/evolution/resourceevo.cpp b/kabc/plugins/evolution/resourceevo.cpp deleted file mode 100644 index 415e9928a..000000000 --- a/kabc/plugins/evolution/resourceevo.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include <tqdir.h> - -#include <kglobal.h> -#include <klocale.h> -#include <kdebug.h> - -#include <stdio.h> - -#include <kabc/vcardparser/vcardtool.h> - -#include "dbwrapper.h" -#include "resourceevo.h" - -using namespace Evolution; -using namespace KABC; - -class EvolutionFactory : public KRES::PluginFactoryBase -{ - public: - KRES::Resource *resource( const TDEConfig *config ) - { - return new ResourceEvolution( config ); - } - - KRES::ConfigWidget *configWidget( TQWidget * ) - { - return 0; - } -}; - -extern "C" -{ - KDE_EXPORT void *init_kabc_evo() - { - return ( new EvolutionFactory() ); - } -} - -ResourceEvolution::ResourceEvolution( const TDEConfig* conf ) - : Resource( conf ), mWrap(0l) -{ - m_isOpen = false; -} -ResourceEvolution::~ResourceEvolution() { - delete mWrap; -} -bool ResourceEvolution::doOpen() { - mWrap = new DBWrapper; - if (!mWrap->open( TQDir::homeDirPath() + "/evolution/local/Contacts/addressbook.db" ) ) { - return false; - } - - TQString val; - if (!mWrap->find( "PAS-DB-VERSION", val ) ) - return false; - - if (!val.startsWith("0.2") ) - return false; - - m_isOpen = true; - - return true; -} -void ResourceEvolution::doClose() { - delete mWrap; - mWrap = 0l; - m_isOpen = false; -} -Ticket* ResourceEvolution::requestSaveTicket() { - if ( !addressBook() ) return 0; - return createTicket( this ); -} -/* - * skip the first key - */ - -bool ResourceEvolution::load() { - /* doOpen never get's called :( */ - if (!doOpen()) return false; - if (!mWrap ) return false; // open first! - - DBIterator it = mWrap->begin(); - // skip the "PAS-DB-VERSION" - - for ( ; it != mWrap->end(); ++it ) { - if ( it.key().startsWith("PAS-DB-VERSION") ) - continue; - - tqWarning( "val:%s", it.value().latin1() ); - VCardTool tool; - TQString str = it.value().stripWhiteSpace(); - Addressee::List list = tool.parseVCards( str ); - if (!list.first().isEmpty() ) { - Addressee adr = list.first(); - adr.setResource(this); - addressBook()->insertAddressee( adr ); - } - } - return true; -} -bool ResourceEvolution::save( Ticket* ticket ) { - delete ticket; - if (!m_isOpen ) return false; - - // just delete the summary so evolution will regenerate it - // on next start up - (void)TQFile::remove( TQDir::homeDirPath() + "/evolution/local/Contacts/addressbook.db.summary" ); - - - AddressBook::Iterator it; - Addressee::List list; - for ( it = addressBook()->begin(); it !=addressBook()->end(); ++it ) { - if ( (*it).resource() != this || !(*it).changed() ) - continue; - - // remove, convert add set unchanged false - list.clear(); - mWrap->remove( (*it).uid() ); - VCardTool tool; - list.append( (*it) ); - mWrap->add( (*it).uid(), tool.createVCards( list, VCard::v2_1) ); - - (*it).setChanged( false ); - } - - return true; -} -void ResourceEvolution::removeAddressee( const Addressee& rem) { - if (!m_isOpen) return; - - mWrap->remove( rem.uid() ); -} diff --git a/kabc/plugins/evolution/resourceevo.h b/kabc/plugins/evolution/resourceevo.h deleted file mode 100644 index 29e163e1c..000000000 --- a/kabc/plugins/evolution/resourceevo.h +++ /dev/null @@ -1,23 +0,0 @@ -#include "resource.h" - -namespace Evolution { - class DBWrapper; -} - -namespace KABC { - class ResourceEvolution : public Resource { - public: - ResourceEvolution( const TDEConfig* config ); - ~ResourceEvolution(); - - bool doOpen(); - void doClose(); - Ticket* requestSaveTicket(); - bool load(); - bool save( Ticket* ticket ); - void removeAddressee( const Addressee& ); - private: - Evolution::DBWrapper *mWrap; - bool m_isOpen : 1; - }; -} diff --git a/kabc/plugins/file/CMakeLists.txt b/kabc/plugins/file/CMakeLists.txt deleted file mode 100644 index f8847d7e9..000000000 --- a/kabc/plugins/file/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/kabc - ${CMAKE_SOURCE_DIR}/kabc - - ${TQT_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdefile -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - resourcefile.h - DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) - - -##### other data ################################ - -install( FILES file.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) - - -##### kabc_file (library) ####################### - -set( target kabc_file ) - -set( ${target}_SRCS - resourcefile.cpp resourcefileconfig.cpp -) - -tde_add_library( ${target} SHARED AUTOMOC - SOURCES ${${target}_SRCS} - VERSION 1.0.0 - LINK kabc-shared - DESTINATION ${LIB_INSTALL_DIR} -) - - -##### kabc_file (module) ######################## - -set( target kabc_file ) - -set( ${target}_SRCS - resourcefileplugin.cpp -) - -tde_add_kpart( ${target} - SOURCES ${${target}_SRCS} - LINK kabc_file-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/kabc/plugins/file/Makefile.am b/kabc/plugins/file/Makefile.am deleted file mode 100644 index b1530d97d..000000000 --- a/kabc/plugins/file/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) - -# these are the headers for your project -noinst_HEADERS = resourcefileconfig.h - -lib_LTLIBRARIES = libkabc_file.la -libkabc_file_la_SOURCES = resourcefile.cpp resourcefileconfig.cpp -libkabc_file_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined -libkabc_file_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(top_builddir)/tderesources/libtderesources.la $(LIB_TDEFILE) $(LIB_TDECORE) $(LIB_TDEUI) -libkabc_file_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h - - -kde_module_LTLIBRARIES = kabc_file.la -kabc_file_la_SOURCES = resourcefileplugin.cpp -kabc_file_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined -kabc_file_la_LIBADD = libkabc_file.la $(LIB_QT) $(LIB_TDECORE) -kabc_file_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h - -METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kabc_file.pot - -kabcincludedir = $(includedir)/kabc -kabcinclude_HEADERS = resourcefile.h - -servicedir = $(kde_servicesdir)/tderesources/kabc -service_DATA = file.desktop diff --git a/kabc/plugins/file/file.desktop b/kabc/plugins/file/file.desktop deleted file mode 100644 index 1359dd1c6..000000000 --- a/kabc/plugins/file/file.desktop +++ /dev/null @@ -1,82 +0,0 @@ -[Desktop Entry] -Name=File -Name[af]=Lêer -Name[ar]=ملÙÙ‘ -Name[az]=Fayl -Name[be]=Файл -Name[bn]=ফাইল -Name[br]=Restr -Name[bs]=Datoteka -Name[ca]=Fitxer -Name[cs]=Soubor -Name[csb]=Lopk -Name[cy]=Ffeil -Name[da]=Fil -Name[de]=Datei -Name[el]=ΑÏχείο -Name[eo]=Dosiero -Name[es]=Archivo -Name[et]=Fail -Name[eu]=Fitxategia -Name[fa]=پرونده -Name[fi]=Tiedosto -Name[fr]=Fichier -Name[fy]=Triem -Name[ga]=Comhad -Name[gl]=Ficheiro -Name[he]=קובץ -Name[hi]=फ़ाइल -Name[hr]=Datoteka -Name[hsb]=Dataja -Name[hu]=Fájl -Name[id]=Berkas -Name[is]=Skrá -Name[ja]=ファイル -Name[ka]=ფáƒáƒ˜áƒšáƒ˜ -Name[kk]=Файл -Name[km]=ឯកសារ -Name[ko]=íŒŒì¼ -Name[lb]=Datei -Name[lt]=Byla -Name[lv]=Fails -Name[mk]=Датотека -Name[mn]=Файл -Name[ms]=Fail -Name[nb]=Fil -Name[nds]=Datei -Name[ne]=फाइल -Name[nl]=Bestand -Name[nn]=Fil -Name[pa]=ਫਾਇਲ -Name[pl]=Plik -Name[pt]=Ficheiro -Name[pt_BR]=Arquivo -Name[ro]=FiÅŸier -Name[ru]=Файл -Name[rw]=Idosiye -Name[se]=Fiila -Name[sk]=Súbor -Name[sl]=Datoteka -Name[sq]=Skedë -Name[sr]=Фајл -Name[sr@Latn]=Fajl -Name[sv]=Fil -Name[ta]=கோபà¯à®ªà¯ -Name[te]=దసà±à°¤à±à°°à°‚ -Name[tg]=Файл -Name[th]=à¹à¸Ÿà¹‰à¸¡ -Name[tr]=Dosya -Name[tt]=Birem -Name[uk]=Файл -Name[uz]=Fayl -Name[uz@cyrillic]=Файл -Name[vi]=Tập tin -Name[wa]=Fitchî -Name[zh_CN]=文件 -Name[zh_HK]=檔案 -Name[zh_TW]=檔案 -X-TDE-Library=kabc_file -Type=Service -ServiceTypes=KResources/Plugin -X-TDE-ResourceFamily=contact -X-TDE-ResourceType=file diff --git a/kabc/plugins/file/resourcefile.cpp b/kabc/plugins/file/resourcefile.cpp deleted file mode 100644 index 7c99782c3..000000000 --- a/kabc/plugins/file/resourcefile.cpp +++ /dev/null @@ -1,395 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org> - Copyright (c) 2006 Tom Abers <tomalbers@kde.nl> - - 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 <signal.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> - -#include <tqfile.h> -#include <tqfileinfo.h> -#include <tqtimer.h> - -#include <tdeapplication.h> -#include <tdeconfig.h> -#include <kdebug.h> -#include <tdeio/scheduler.h> -#include <klocale.h> -#include <ksavefile.h> -#include <kstandarddirs.h> - -#include "formatfactory.h" -#include "resourcefileconfig.h" -#include "stdaddressbook.h" -#include "lock.h" - -#include "resourcefile.h" - -using namespace KABC; - -ResourceFile::ResourceFile( const TDEConfig *config ) - : Resource( config ), mFormat( 0 ), - mAsynchronous( false ) -{ - TQString fileName, formatName; - - if ( config ) { - fileName = config->readPathEntry( "FileName", StdAddressBook::fileName() ); - formatName = config->readEntry( "FileFormat", "vcard" ); - } else { - fileName = StdAddressBook::fileName(); - formatName = "vcard"; - } - - init( fileName, formatName ); -} - -ResourceFile::ResourceFile( const TQString &fileName, - const TQString &formatName ) - : Resource( 0 ), mFormat( 0 ), - mAsynchronous( false ) -{ - init( fileName, formatName ); -} - -void ResourceFile::init( const TQString &fileName, const TQString &formatName ) -{ - mFormatName = formatName; - - FormatFactory *factory = FormatFactory::self(); - mFormat = factory->format( mFormatName ); - - if ( !mFormat ) { - mFormatName = "vcard"; - mFormat = factory->format( mFormatName ); - } - - connect( &mDirWatch, TQT_SIGNAL( dirty(const TQString&) ), TQT_SLOT( fileChanged() ) ); - connect( &mDirWatch, TQT_SIGNAL( created(const TQString&) ), TQT_SLOT( fileChanged() ) ); - connect( &mDirWatch, TQT_SIGNAL( deleted(const TQString&) ), TQT_SLOT( fileChanged() ) ); - - setFileName( fileName ); - - mLock = 0; -} - -ResourceFile::~ResourceFile() -{ - delete mFormat; - mFormat = 0; -} - -void ResourceFile::writeConfig( TDEConfig *config ) -{ - Resource::writeConfig( config ); - - if ( mFileName == StdAddressBook::fileName() ) - config->deleteEntry( "FileName" ); - else - config->writePathEntry( "FileName", mFileName ); - - config->writeEntry( "FileFormat", mFormatName ); -} - -Ticket *ResourceFile::requestSaveTicket() -{ - kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; - - if ( !addressBook() ) return 0; - - delete mLock; - mLock = new Lock( mFileName ); - - if ( mLock->lock() ) { - addressBook()->emitAddressBookLocked(); - } else { - addressBook()->error( mLock->error() ); - kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock file '" - << mFileName << "': " << mLock->error() << endl; - return 0; - } - - return createTicket( this ); -} - -void ResourceFile::releaseSaveTicket( Ticket *ticket ) -{ - delete ticket; - - delete mLock; - mLock = 0; - - addressBook()->emitAddressBookUnlocked(); -} - -bool ResourceFile::doOpen() -{ - TQFile file( mFileName ); - - if ( !file.exists() ) { - // try to create the file - bool ok = file.open( IO_WriteOnly ); - if ( ok ) - file.close(); - - return ok; - } else { - TQFileInfo fileInfo( mFileName ); - if ( readOnly() || !fileInfo.isWritable() ) { - if ( !file.open( IO_ReadOnly ) ) - return false; - } else { - if ( !file.open( IO_ReadWrite ) ) - return false; - } - - if ( file.size() == 0 ) { - file.close(); - kdDebug() << "File size is zero. Evaluating backups" << endl; - for (int i=0; i!=20; i++) - { - TQFile backup( mFileName + "__" + TQString::number(i) ); - kdDebug() << "Evaluating" << backup.name() << " size: " << backup.size() << endl; - if ( backup.size() != 0 ) - { - kdDebug() << "Restoring backup " << i << endl; - const TQString src = mFileName + "__" + TQString::number(i); - const TQString dest = mFileName; - - // remove dest - TQFile::remove( dest ); - - // copy src to dest - if ( backup.open( IO_ReadOnly ) ) { - const TQByteArray data = backup.readAll(); - - TQFile out( dest ); - if ( out.open( IO_WriteOnly ) ) { - out.writeBlock( data ); - out.close(); - } - - backup.close(); - } - return true; - } - } - return true; - } - - bool ok = mFormat->checkFormat( &file ); - file.close(); - - return ok; - } -} - -void ResourceFile::doClose() -{ -} - -bool ResourceFile::load() -{ - kdDebug(5700) << "ResourceFile::load(): '" << mFileName << "'" << endl; - - mAsynchronous = false; - - TQFile file( mFileName ); - if ( !file.open( IO_ReadOnly ) ) { - addressBook()->error( i18n( "Unable to open file '%1'." ).arg( mFileName ) ); - return false; - } - - clear(); - - return mFormat->loadAll( addressBook(), this, &file ); -} - -bool ResourceFile::asyncLoad() -{ - kdDebug(5700) << "ResourceFile::asyncLoad()" << endl; - - mAsynchronous = true; - - bool ok = load(); - - if ( !ok ) - emitLoadingError(); - else - emitLoadingFinished(); - - return true; -} - -bool ResourceFile::save( Ticket * ) -{ - kdDebug(5700) << "ResourceFile::save()" << endl; - - // Only do the logrotate dance when the __0 file is not 0 bytes. - TQFile file( mFileName + "__0" ); - if ( file.size() != 0 ) { - const TQString last = mFileName + "__20"; - kdDebug() << "deleting " << last << endl; - - TQFile::remove( last ); - - for (int i=19; i>=0; i--) - { - const TQString src = mFileName + "__" + TQString::number(i); - const TQString dest = mFileName + "__" + TQString::number(i+1); - kdDebug() << "moving " << src << " -> " << dest << endl; - - // copy src to dest - TQFile in( src ); - if ( in.open( IO_ReadOnly ) ) { - const TQByteArray data = in.readAll(); - - TQFile out( dest ); - if ( out.open( IO_WriteOnly ) ) { - out.writeBlock( data ); - out.close(); - } - - in.close(); - } - - // remove src - TQFile::remove( src ); - } - } else - kdDebug() << "Not starting logrotate __0 is 0 bytes." << endl; - - TQString extension = "__0"; - (void) KSaveFile::backupFile( mFileName, TQString::null /*directory*/, - extension ); - - mDirWatch.stopScan(); - - KSaveFile saveFile( mFileName ); - bool ok = false; - - if ( saveFile.status() == 0 && saveFile.file() ) { - mFormat->saveAll( addressBook(), this, saveFile.file() ); - ok = saveFile.close(); - } - - if ( !ok ) { - saveFile.abort(); - addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); - } - - mDirWatch.startScan(); - - return ok; -} - -bool ResourceFile::asyncSave( Ticket *ticket ) -{ - kdDebug(5700) << "ResourceFile::asyncSave()" << endl; - - bool ok = save( ticket ); - - if ( !ok ) - TQTimer::singleShot( 0, this, TQT_SLOT( emitSavingError() ) ); - else - TQTimer::singleShot( 0, this, TQT_SLOT( emitSavingFinished() ) ); - - return ok; -} - -void ResourceFile::setFileName( const TQString &fileName ) -{ - mDirWatch.stopScan(); - if ( mDirWatch.contains( mFileName ) ) - mDirWatch.removeFile( mFileName ); - - mFileName = fileName; - - mDirWatch.addFile( mFileName ); - mDirWatch.startScan(); -} - -TQString ResourceFile::fileName() const -{ - return mFileName; -} - -void ResourceFile::setFormat( const TQString &format ) -{ - mFormatName = format; - delete mFormat; - - FormatFactory *factory = FormatFactory::self(); - mFormat = factory->format( mFormatName ); -} - -TQString ResourceFile::format() const -{ - return mFormatName; -} - -void ResourceFile::fileChanged() -{ - kdDebug(5700) << "ResourceFile::fileChanged(): " << mFileName << endl; - - if ( !addressBook() ) - return; - - if ( mAsynchronous ) - asyncLoad(); - else { - load(); - kdDebug() << "addressBookChanged() " << endl; - addressBook()->emitAddressBookChanged(); - } -} - -void ResourceFile::removeAddressee( const Addressee &addr ) -{ - TQFile::remove( TQFile::encodeName( locateLocal( "data", "kabc/photos/" ) + addr.uid() ) ); - TQFile::remove( TQFile::encodeName( locateLocal( "data", "kabc/logos/" ) + addr.uid() ) ); - TQFile::remove( TQFile::encodeName( locateLocal( "data", "kabc/sounds/" ) + addr.uid() ) ); - - mAddrMap.erase( addr.uid() ); -} - -void ResourceFile::emitSavingFinished() -{ - emit savingFinished( this ); -} - -void ResourceFile::emitSavingError() -{ - emit savingError( this, i18n( "Unable to save file '%1'." ).arg( mFileName ) ); -} - -void ResourceFile::emitLoadingFinished() -{ - emit loadingFinished( this ); -} - -void ResourceFile::emitLoadingError() -{ - emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mFileName ) ); -} - -#include "resourcefile.moc" diff --git a/kabc/plugins/file/resourcefile.h b/kabc/plugins/file/resourcefile.h deleted file mode 100644 index 3d2efe85f..000000000 --- a/kabc/plugins/file/resourcefile.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_RESOURCEFILE_H -#define KABC_RESOURCEFILE_H - -#include <tdeconfig.h> -#include <kdirwatch.h> - -#include <sys/types.h> - -#include <kabc/resource.h> - -namespace KABC { - -class FormatPlugin; -class ResourceConfigWidget; -class Lock; - -/** - This resource allows access to a local file. -*/ -class KABC_EXPORT ResourceFile : public Resource -{ - Q_OBJECT - - public: - /** - Constructor. - - @param cfg The config object where custom resource settings are stored. - */ - ResourceFile( const TDEConfig *cfg ); - - /** - Construct file resource on file @arg fileName using format @arg formatName. - */ - ResourceFile( const TQString &fileName, const TQString &formatName = "vcard" ); - - /** - Destructor. - */ - ~ResourceFile(); - - /** - Writes the config back. - */ - virtual void writeConfig( TDEConfig *cfg ); - - /** - Tries to open the file and checks for the proper format. - This method should be called before load(). - */ - virtual bool doOpen(); - - /** - Closes the file again. - */ - virtual void doClose(); - - /** - Requests a save ticket, that is used by save() - */ - virtual Ticket *requestSaveTicket(); - - virtual void releaseSaveTicket( Ticket* ); - - /** - Loads all addressees from file to the address book. - Returns true if all addressees could be loaded otherwise false. - */ - virtual bool load(); - - virtual bool asyncLoad(); - - /** - Saves all addresses from address book to file. - Returns true if all addressees could be saved otherwise false. - - @param ticket The ticket returned by requestSaveTicket() - */ - virtual bool save( Ticket *ticket ); - - virtual bool asyncSave( Ticket *ticket ); - - /** - Set name of file to be used for saving. - */ - void setFileName( const TQString & ); - - /** - Return name of file used for loading and saving the address book. - */ - TQString fileName() const; - - /** - Sets a new format by name. - */ - void setFormat( const TQString &name ); - - /** - Returns the format name. - */ - TQString format() const; - - /** - Remove a addressee from its source. - This method is mainly called by KABC::AddressBook. - */ - virtual void removeAddressee( const Addressee& addr ); - - private slots: - void emitLoadingFinished(); - void emitLoadingError(); - void emitSavingFinished(); - void emitSavingError(); - - protected slots: - void fileChanged(); - - protected: - void init( const TQString &fileName, const TQString &format ); - - bool lock( const TQString &fileName ); - void unlock( const TQString &fileName ); - - private: - TQString mFileName; - TQString mFormatName; - - FormatPlugin *mFormat; - - Lock *mLock; - - KDirWatch mDirWatch; - - bool mAsynchronous; - - class ResourceFilePrivate; - ResourceFilePrivate *d; -}; - -} - -#endif diff --git a/kabc/plugins/file/resourcefileconfig.cpp b/kabc/plugins/file/resourcefileconfig.cpp deleted file mode 100644 index 92b07594f..000000000 --- a/kabc/plugins/file/resourcefileconfig.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqlabel.h> -#include <tqlayout.h> - -#include <kdebug.h> -#include <klocale.h> -#include <kstandarddirs.h> -#include <kdialog.h> - -#include <unistd.h> - -#include "formatfactory.h" -#include "resourcefile.h" -#include "stdaddressbook.h" - -#include "resourcefileconfig.h" - -using namespace KABC; - -ResourceFileConfig::ResourceFileConfig( TQWidget* parent, const char* name ) - : ConfigWidget( parent, name ) -{ - TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2, 0, - KDialog::spacingHint() ); - - TQLabel *label = new TQLabel( i18n( "Format:" ), this ); - mFormatBox = new KComboBox( this ); - - mainLayout->addWidget( label, 0, 0 ); - mainLayout->addWidget( mFormatBox, 0, 1 ); - - label = new TQLabel( i18n( "Location:" ), this ); - mFileNameEdit = new KURLRequester( this ); - - connect( mFileNameEdit, TQT_SIGNAL( textChanged( const TQString & ) ), - TQT_SLOT( checkFilePermissions( const TQString & ) ) ); - - mainLayout->addWidget( label, 1, 0 ); - mainLayout->addWidget( mFileNameEdit, 1, 1 ); - - FormatFactory *factory = FormatFactory::self(); - TQStringList formats = factory->formats(); - TQStringList::Iterator it; - for ( it = formats.begin(); it != formats.end(); ++it ) { - FormatInfo *info = factory->info( *it ); - if ( info ) { - mFormatTypes << (*it); - mFormatBox->insertItem( info->nameLabel ); - } - } - - mInEditMode = false; -} - -void ResourceFileConfig::setEditMode( bool value ) -{ - mFormatBox->setEnabled( !value ); - mInEditMode = value; -} - -void ResourceFileConfig::loadSettings( KRES::Resource *res ) -{ - ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); - - if ( !resource ) { - kdDebug(5700) << "ResourceFileConfig::loadSettings(): cast failed" << endl; - return; - } - - mFormatBox->setCurrentItem( mFormatTypes.findIndex( resource->format() ) ); - - mFileNameEdit->setURL( resource->fileName() ); - if ( mFileNameEdit->url().isEmpty() ) - mFileNameEdit->setURL( KABC::StdAddressBook::fileName() ); -} - -void ResourceFileConfig::saveSettings( KRES::Resource *res ) -{ - ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); - - if ( !resource ) { - kdDebug(5700) << "ResourceFileConfig::saveSettings(): cast failed" << endl; - return; - } - - if ( !mInEditMode ) - resource->setFormat( mFormatTypes[ mFormatBox->currentItem() ] ); - - resource->setFileName( mFileNameEdit->url() ); -} - -void ResourceFileConfig::checkFilePermissions( const TQString& fileName ) -{ - // If file exist but is not writeable... - if ( access( TQFile::encodeName( fileName ), F_OK ) == 0 ) - emit setReadOnly( access( TQFile::encodeName( fileName ), W_OK ) < 0 ); -} - -#include "resourcefileconfig.moc" diff --git a/kabc/plugins/file/resourcefileconfig.h b/kabc/plugins/file/resourcefileconfig.h deleted file mode 100644 index 18c217eda..000000000 --- a/kabc/plugins/file/resourcefileconfig.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 RESOURCEFILECONFIG_H -#define RESOURCEFILECONFIG_H - -#include <kcombobox.h> -#include <kurlrequester.h> - -#include <tderesources/configwidget.h> - -namespace KABC { - -class KABC_EXPORT ResourceFileConfig : public KRES::ConfigWidget -{ - Q_OBJECT - -public: - ResourceFileConfig( TQWidget* parent = 0, const char* name = 0 ); - - void setEditMode( bool value ); - -public slots: - void loadSettings( KRES::Resource *resource ); - void saveSettings( KRES::Resource *resource ); - -protected slots: - void checkFilePermissions( const TQString& fileName ); - -private: - KComboBox* mFormatBox; - KURLRequester* mFileNameEdit; - bool mInEditMode; - - TQStringList mFormatTypes; -}; - -} - -#endif diff --git a/kabc/plugins/file/resourcefileplugin.cpp b/kabc/plugins/file/resourcefileplugin.cpp deleted file mode 100644 index 4dce19bc0..000000000 --- a/kabc/plugins/file/resourcefileplugin.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 "resourcefile.h" -#include "resourcefileconfig.h" - -using namespace KABC; - -extern "C" -{ - KDE_EXPORT void *init_kabc_file() - { - return new KRES::PluginFactory<ResourceFile, ResourceFileConfig>(); - } -} diff --git a/kabc/plugins/ldaptdeio/CMakeLists.txt b/kabc/plugins/ldaptdeio/CMakeLists.txt deleted file mode 100644 index 75098cc9d..000000000 --- a/kabc/plugins/ldaptdeio/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/kabc - ${CMAKE_SOURCE_DIR}/kabc - - ${TQT_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdefiles -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - resourceldaptdeio.h - DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) - - -##### other data ################################ - -install( FILES ldaptdeio.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) - - -##### kabc_ldaptdeio ############################## - -set( target kabc_ldaptdeio ) - -set( ${target}_SRCS - resourceldaptdeio.cpp resourceldaptdeioconfig.cpp -) - -tde_add_library( ${target} SHARED AUTOMOC - SOURCES ${${target}_SRCS} - VERSION 1.0.0 - LINK kabc-shared - DESTINATION ${LIB_INSTALL_DIR} -) - - -##### kabc_ldaptdeio ############################## - -set( target kabc_ldaptdeio ) - -set( ${target}_SRCS - resourceldaptdeioplugin.cpp -) - -tde_add_kpart( ${target} - SOURCES ${${target}_SRCS} - LINK kabc_ldaptdeio-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/kabc/plugins/ldaptdeio/Makefile.am b/kabc/plugins/ldaptdeio/Makefile.am deleted file mode 100644 index 9c2d31ad7..000000000 --- a/kabc/plugins/ldaptdeio/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) - -# these are the headers for your project -noinst_HEADERS = resourceldaptdeioconfig.h - -lib_LTLIBRARIES = libkabc_ldaptdeio.la -libkabc_ldaptdeio_la_SOURCES = resourceldaptdeio.cpp resourceldaptdeioconfig.cpp -libkabc_ldaptdeio_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined -libkabc_ldaptdeio_la_LIBADD = $(LIB_KABC) $(LIB_KIO) $(LIB_QT) $(top_builddir)/tderesources/libtderesources.la $(LIB_TDEUI) $(LIB_TDECORE) -libkabc_ldaptdeio_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h - -kde_module_LTLIBRARIES = kabc_ldaptdeio.la -kabc_ldaptdeio_la_SOURCES = resourceldaptdeioplugin.cpp -kabc_ldaptdeio_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -kabc_ldaptdeio_la_LIBADD = libkabc_ldaptdeio.la $(LIB_QT) $(LIB_TDECORE) - -METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kabc_ldaptdeio.pot - -kabcincludedir = $(includedir)/kabc -kabcinclude_HEADERS = resourceldaptdeio.h - -servicedir = $(kde_servicesdir)/tderesources/kabc -service_DATA = ldaptdeio.desktop - -resourceldaptdeioplugin.lo: ../../addressee.h diff --git a/kabc/plugins/ldaptdeio/ldaptdeio.desktop b/kabc/plugins/ldaptdeio/ldaptdeio.desktop deleted file mode 100644 index 9bcd13337..000000000 --- a/kabc/plugins/ldaptdeio/ldaptdeio.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Name=LDAP -Name[bn]=à¦à¦²-ডি-à¦-পি (LDAP) -Name[hi]=à¤à¤²à¤¡à¥€à¤à¤ªà¥€ (LDAP) -Name[te]=à°Žà°²à±à°¡à°¿à°à°ªà°¿ -X-TDE-Library=kabc_ldaptdeio -Type=Service -ServiceTypes=KResources/Plugin -X-TDE-ResourceFamily=contact -X-TDE-ResourceType=ldaptdeio diff --git a/kabc/plugins/ldaptdeio/resourceldaptdeio.cpp b/kabc/plugins/ldaptdeio/resourceldaptdeio.cpp deleted file mode 100644 index b28289ecb..000000000 --- a/kabc/plugins/ldaptdeio/resourceldaptdeio.cpp +++ /dev/null @@ -1,1041 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> - Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> - - 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 <tqapplication.h> -#include <tqbuffer.h> -#include <tqfile.h> - -#include <kdebug.h> -#include <kglobal.h> -#include <kstandarddirs.h> -#include <klineedit.h> -#include <klocale.h> -#include <tdeconfig.h> -#include <kstringhandler.h> -#include <ktempfile.h> - -#include <stdlib.h> -#include <tdeio/netaccess.h> -#include <kabc/ldif.h> -#include <kabc/ldapurl.h> - -#include "resourceldaptdeio.h" -#include "resourceldaptdeioconfig.h" - -using namespace KABC; - -// Hack from Netaccess -void tqt_enter_modal( TQWidget *widget ); -void tqt_leave_modal( TQWidget *widget ); - -class ResourceLDAPTDEIO::ResourceLDAPTDEIOPrivate -{ - public: - LDIF mLdif; - bool mTLS,mSSL,mSubTree; - TQString mResultDn; - Addressee mAddr; - Address mAd; - Resource::Iterator mSaveIt; - bool mSASL; - TQString mMech; - TQString mRealm, mBindDN; - LDAPUrl mLDAPUrl; - int mVer, mSizeLimit, mTimeLimit, mRDNPrefix; - int mError; - int mCachePolicy; - bool mReadOnly; - bool mAutoCache; - TQString mCacheDst; - KTempFile *mTmp; -}; - -ResourceLDAPTDEIO::ResourceLDAPTDEIO( const TDEConfig *config ) - : Resource( config ) -{ - d = new ResourceLDAPTDEIOPrivate; - if ( config ) { - TQMap<TQString, TQString> attrList; - TQStringList attributes = config->readListEntry( "LdapAttributes" ); - for ( uint pos = 0; pos < attributes.count(); pos += 2 ) - mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] ); - - mUser = config->readEntry( "LdapUser" ); - mPassword = KStringHandler::obscure( config->readEntry( "LdapPassword" ) ); - mDn = config->readEntry( "LdapDn" ); - mHost = config->readEntry( "LdapHost" ); - mPort = config->readNumEntry( "LdapPort", 389 ); - mFilter = config->readEntry( "LdapFilter" ); - mAnonymous = config->readBoolEntry( "LdapAnonymous" ); - d->mTLS = config->readBoolEntry( "LdapTLS" ); - d->mSSL = config->readBoolEntry( "LdapSSL" ); - d->mSubTree = config->readBoolEntry( "LdapSubTree" ); - d->mSASL = config->readBoolEntry( "LdapSASL" ); - d->mMech = config->readEntry( "LdapMech" ); - d->mRealm = config->readEntry( "LdapRealm" ); - d->mBindDN = config->readEntry( "LdapBindDN" ); - d->mVer = config->readNumEntry( "LdapVer", 3 ); - d->mTimeLimit = config->readNumEntry( "LdapTimeLimit", 0 ); - d->mSizeLimit = config->readNumEntry( "LdapSizeLimit", 0 ); - d->mRDNPrefix = config->readNumEntry( "LdapRDNPrefix", 0 ); - d->mCachePolicy = config->readNumEntry( "LdapCachePolicy", 0 ); - d->mAutoCache = config->readBoolEntry( "LdapAutoCache", true ); - } else { - mPort = 389; - mAnonymous = true; - mUser = mPassword = mHost = mFilter = mDn = ""; - d->mMech = d->mRealm = d->mBindDN = ""; - d->mTLS = d->mSSL = d->mSubTree = d->mSASL = false; - d->mVer = 3; d->mRDNPrefix = 0; - d->mTimeLimit = d->mSizeLimit = 0; - d->mCachePolicy = Cache_No; - d->mAutoCache = true; - } - d->mCacheDst = TDEGlobal::dirs()->saveLocation("cache", "ldaptdeio") + "/" + - type() + "_" + identifier(); - init(); -} - -ResourceLDAPTDEIO::~ResourceLDAPTDEIO() -{ - delete d; -} - -void ResourceLDAPTDEIO::enter_loop() -{ - TQWidget dummy(0,0,(WFlags)(WType_Dialog | WShowModal)); - dummy.setFocusPolicy( TQ_NoFocus ); - tqt_enter_modal(&dummy); - tqApp->enter_loop(); - tqt_leave_modal(&dummy); -} - -void ResourceLDAPTDEIO::entries( TDEIO::Job*, const TDEIO::UDSEntryList & list ) -{ - TDEIO::UDSEntryListConstIterator it = list.begin(); - TDEIO::UDSEntryListConstIterator end = list.end(); - for (; it != end; ++it) { - TDEIO::UDSEntry::ConstIterator it2 = (*it).begin(); - for( ; it2 != (*it).end(); it2++ ) { - if ( (*it2).m_uds == TDEIO::UDS_URL ) { - KURL tmpurl( (*it2).m_str ); - d->mResultDn = tmpurl.path(); - kdDebug(7125) << "findUid(): " << d->mResultDn << endl; - if ( d->mResultDn.startsWith("/") ) d->mResultDn.remove(0,1); - return; - } - } - } -} - -void ResourceLDAPTDEIO::listResult( TDEIO::Job *job) -{ - d->mError = job->error(); - if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) - mErrorMsg = job->errorString(); - else - mErrorMsg = ""; - tqApp->exit_loop(); -} - -TQString ResourceLDAPTDEIO::findUid( const TQString &uid ) -{ - LDAPUrl url( d->mLDAPUrl ); - TDEIO::UDSEntry entry; - - mErrorMsg = d->mResultDn = ""; - - url.setAttributes("dn"); - url.setFilter( "(" + mAttributes[ "uid" ] + "=" + uid + ")" + mFilter ); - url.setExtension( "x-dir", "one" ); - - kdDebug(7125) << "ResourceLDAPTDEIO::findUid() uid: " << uid << " url " << - url.prettyURL() << endl; - - TDEIO::ListJob * listJob = TDEIO::listDir( url, false /* no GUI */ ); - connect( listJob, - TQT_SIGNAL( entries( TDEIO::Job *, const TDEIO::UDSEntryList& ) ), - TQT_SLOT( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) ); - connect( listJob, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( listResult( TDEIO::Job* ) ) ); - - enter_loop(); - return d->mResultDn; -} - -TQCString ResourceLDAPTDEIO::addEntry( const TQString &attr, const TQString &value, bool mod ) -{ - TQCString tmp; - if ( !attr.isEmpty() ) { - if ( mod ) tmp += LDIF::assembleLine( "replace", attr ) + "\n"; - tmp += LDIF::assembleLine( attr, value ) + "\n"; - if ( mod ) tmp += "-\n"; - } - return ( tmp ); -} - -bool ResourceLDAPTDEIO::AddresseeToLDIF( TQByteArray &ldif, const Addressee &addr, - const TQString &olddn ) -{ - TQCString tmp; - TQString dn; - TQByteArray data; - bool mod = false; - - if ( olddn.isEmpty() ) { - //insert new entry - switch ( d->mRDNPrefix ) { - case 1: - dn = mAttributes[ "uid" ] + "=" + addr.uid() + "," +mDn; - break; - case 0: - default: - dn = mAttributes[ "commonName" ] + "=" + addr.assembledName() + "," +mDn; - break; - } - } else { - //modify existing entry - mod = true; - if ( olddn.startsWith( mAttributes[ "uid" ] ) ) { - dn = mAttributes[ "uid" ] + "=" + addr.uid() + "," + olddn.section( ',', 1 ); - } else if ( olddn.startsWith( mAttributes[ "commonName" ] ) ) { - dn = mAttributes[ "commonName" ] + "=" + addr.assembledName() + "," + - olddn.section( ',', 1 ); - } else { - dn = olddn; - } - - if ( olddn.lower() != dn.lower() ) { - tmp = LDIF::assembleLine( "dn", olddn ) + "\n"; - tmp += "changetype: modrdn\n"; - tmp += LDIF::assembleLine( "newrdn", dn.section( ',', 0, 0 ) ) + "\n"; - tmp += "deleteoldrdn: 1\n\n"; - } - } - - - tmp += LDIF::assembleLine( "dn", dn ) + "\n"; - if ( mod ) tmp += "changetype: modify\n"; - if ( !mod ) { - tmp += "objectClass: top\n"; - TQStringList obclass = TQStringList::split( ',', mAttributes[ "objectClass" ] ); - for ( TQStringList::iterator it = obclass.begin(); it != obclass.end(); it++ ) { - tmp += LDIF::assembleLine( "objectClass", *it ) + "\n"; - } - } - - tmp += addEntry( mAttributes[ "commonName" ], addr.assembledName(), mod ); - tmp += addEntry( mAttributes[ "formattedName" ], addr.formattedName(), mod ); - tmp += addEntry( mAttributes[ "givenName" ], addr.givenName(), mod ); - tmp += addEntry( mAttributes[ "familyName" ], addr.familyName(), mod ); - tmp += addEntry( mAttributes[ "uid" ], addr.uid(), mod ); - - PhoneNumber number; - number = addr.phoneNumber( PhoneNumber::Home ); - tmp += addEntry( mAttributes[ "phoneNumber" ], number.number().utf8(), mod ); - number = addr.phoneNumber( PhoneNumber::Work ); - tmp += addEntry( mAttributes[ "telephoneNumber" ], number.number().utf8(), mod ); - number = addr.phoneNumber( PhoneNumber::Fax ); - tmp += addEntry( mAttributes[ "facsimileTelephoneNumber" ], number.number().utf8(), mod ); - number = addr.phoneNumber( PhoneNumber::Cell ); - tmp += addEntry( mAttributes[ "mobile" ], number.number().utf8(), mod ); - number = addr.phoneNumber( PhoneNumber::Pager ); - tmp += addEntry( mAttributes[ "pager" ], number.number().utf8(), mod ); - - tmp += addEntry( mAttributes[ "description" ], addr.note(), mod ); - tmp += addEntry( mAttributes[ "title" ], addr.title(), mod ); - tmp += addEntry( mAttributes[ "organization" ], addr.organization(), mod ); - - Address ad = addr.address( Address::Home ); - if ( !ad.isEmpty() ) { - tmp += addEntry( mAttributes[ "street" ], ad.street(), mod ); - tmp += addEntry( mAttributes[ "state" ], ad.region(), mod ); - tmp += addEntry( mAttributes[ "city" ], ad.locality(), mod ); - tmp += addEntry( mAttributes[ "postalcode" ], ad.postalCode(), mod ); - } - - TQStringList emails = addr.emails(); - TQStringList::ConstIterator mailIt = emails.begin(); - - if ( !mAttributes[ "mail" ].isEmpty() ) { - if ( mod ) tmp += - LDIF::assembleLine( "replace", mAttributes[ "mail" ] ) + "\n"; - if ( mailIt != emails.end() ) { - tmp += LDIF::assembleLine( mAttributes[ "mail" ], *mailIt ) + "\n"; - mailIt ++; - } - if ( mod && mAttributes[ "mail" ] != mAttributes[ "mailAlias" ] ) tmp += "-\n"; - } - - if ( !mAttributes[ "mailAlias" ].isEmpty() ) { - if ( mod && mAttributes[ "mail" ] != mAttributes[ "mailAlias" ] ) tmp += - LDIF::assembleLine( "replace", mAttributes[ "mailAlias" ] ) + "\n"; - for ( ; mailIt != emails.end(); ++mailIt ) { - tmp += LDIF::assembleLine( mAttributes[ "mailAlias" ], *mailIt ) + "\n" ; - } - if ( mod ) tmp += "-\n"; - } - - if ( !mAttributes[ "jpegPhoto" ].isEmpty() ) { - TQByteArray pic; - TQBuffer buffer( pic ); - buffer.open( IO_WriteOnly ); - addr.photo().data().save( &buffer, "JPEG" ); - - if ( mod ) tmp += - LDIF::assembleLine( "replace", mAttributes[ "jpegPhoto" ] ) + "\n"; - tmp += LDIF::assembleLine( mAttributes[ "jpegPhoto" ], pic, 76 ) + "\n"; - if ( mod ) tmp += "-\n"; - } - - tmp += "\n"; - kdDebug(7125) << "ldif: " << TQString(TQString::fromUtf8(tmp)) << endl; - ldif = tmp; - return true; -} - -void ResourceLDAPTDEIO::setReadOnly( bool value ) -{ - //save the original readonly flag, because offline using disables writing - d->mReadOnly = true; - Resource::setReadOnly( value ); -} - -void ResourceLDAPTDEIO::init() -{ - if ( mPort == 0 ) mPort = 389; - - /** - If you want to add new attributes, append them here, add a - translation string in the ctor of AttributesDialog and - handle them in the load() method below. - These are the default values - */ - if ( !mAttributes.contains("objectClass") ) - mAttributes.insert( "objectClass", "inetOrgPerson" ); - if ( !mAttributes.contains("commonName") ) - mAttributes.insert( "commonName", "cn" ); - if ( !mAttributes.contains("formattedName") ) - mAttributes.insert( "formattedName", "displayName" ); - if ( !mAttributes.contains("familyName") ) - mAttributes.insert( "familyName", "sn" ); - if ( !mAttributes.contains("givenName") ) - mAttributes.insert( "givenName", "givenName" ); - if ( !mAttributes.contains("mail") ) - mAttributes.insert( "mail", "mail" ); - if ( !mAttributes.contains("mailAlias") ) - mAttributes.insert( "mailAlias", "" ); - if ( !mAttributes.contains("phoneNumber") ) - mAttributes.insert( "phoneNumber", "homePhone" ); - if ( !mAttributes.contains("telephoneNumber") ) - mAttributes.insert( "telephoneNumber", "telephoneNumber" ); - if ( !mAttributes.contains("facsimileTelephoneNumber") ) - mAttributes.insert( "facsimileTelephoneNumber", "facsimileTelephoneNumber" ); - if ( !mAttributes.contains("mobile") ) - mAttributes.insert( "mobile", "mobile" ); - if ( !mAttributes.contains("pager") ) - mAttributes.insert( "pager", "pager" ); - if ( !mAttributes.contains("description") ) - mAttributes.insert( "description", "description" ); - - if ( !mAttributes.contains("title") ) - mAttributes.insert( "title", "title" ); - if ( !mAttributes.contains("street") ) - mAttributes.insert( "street", "street" ); - if ( !mAttributes.contains("state") ) - mAttributes.insert( "state", "st" ); - if ( !mAttributes.contains("city") ) - mAttributes.insert( "city", "l" ); - if ( !mAttributes.contains("organization") ) - mAttributes.insert( "organization", "o" ); - if ( !mAttributes.contains("postalcode") ) - mAttributes.insert( "postalcode", "postalCode" ); - - if ( !mAttributes.contains("uid") ) - mAttributes.insert( "uid", "uid" ); - if ( !mAttributes.contains("jpegPhoto") ) - mAttributes.insert( "jpegPhoto", "jpegPhoto" ); - - d->mLDAPUrl = KURL(); - if ( !mAnonymous ) { - d->mLDAPUrl.setUser( mUser ); - d->mLDAPUrl.setPass( mPassword ); - } - d->mLDAPUrl.setProtocol( d->mSSL ? "ldaps" : "ldap"); - d->mLDAPUrl.setHost( mHost ); - d->mLDAPUrl.setPort( mPort ); - d->mLDAPUrl.setDn( mDn ); - - if (!mAttributes.empty()) { - TQMap<TQString,TQString>::Iterator it; - TQStringList attr; - for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) { - if ( !it.data().isEmpty() && it.key() != "objectClass" ) - attr.append( it.data() ); - } - d->mLDAPUrl.setAttributes( attr ); - } - - d->mLDAPUrl.setScope( d->mSubTree ? LDAPUrl::Sub : LDAPUrl::One ); - if ( !mFilter.isEmpty() && mFilter != "(objectClass=*)" ) - d->mLDAPUrl.setFilter( mFilter ); - d->mLDAPUrl.setExtension( "x-dir", "base" ); - if ( d->mTLS ) d->mLDAPUrl.setExtension( "x-tls", "" ); - d->mLDAPUrl.setExtension( "x-ver", TQString::number( d->mVer ) ); - if ( d->mSizeLimit ) - d->mLDAPUrl.setExtension( "x-sizelimit", TQString::number( d->mSizeLimit ) ); - if ( d->mTimeLimit ) - d->mLDAPUrl.setExtension( "x-timelimit", TQString::number( d->mTimeLimit ) ); - if ( d->mSASL ) { - d->mLDAPUrl.setExtension( "x-sasl", "" ); - if ( !d->mBindDN.isEmpty() ) d->mLDAPUrl.setExtension( "bindname", d->mBindDN ); - if ( !d->mMech.isEmpty() ) d->mLDAPUrl.setExtension( "x-mech", d->mMech ); - if ( !d->mRealm.isEmpty() ) d->mLDAPUrl.setExtension( "x-realm", d->mRealm ); - } - - d->mReadOnly = readOnly(); - - kdDebug(7125) << "resource_ldaptdeio url: " << d->mLDAPUrl.prettyURL() << endl; -} - -void ResourceLDAPTDEIO::writeConfig( TDEConfig *config ) -{ - Resource::writeConfig( config ); - - config->writeEntry( "LdapUser", mUser ); - config->writeEntry( "LdapPassword", KStringHandler::obscure( mPassword ) ); - config->writeEntry( "LdapDn", mDn ); - config->writeEntry( "LdapHost", mHost ); - config->writeEntry( "LdapPort", mPort ); - config->writeEntry( "LdapFilter", mFilter ); - config->writeEntry( "LdapAnonymous", mAnonymous ); - config->writeEntry( "LdapTLS", d->mTLS ); - config->writeEntry( "LdapSSL", d->mSSL ); - config->writeEntry( "LdapSubTree", d->mSubTree ); - config->writeEntry( "LdapSASL", d->mSASL ); - config->writeEntry( "LdapMech", d->mMech ); - config->writeEntry( "LdapVer", d->mVer ); - config->writeEntry( "LdapTimeLimit", d->mTimeLimit ); - config->writeEntry( "LdapSizeLimit", d->mSizeLimit ); - config->writeEntry( "LdapRDNPrefix", d->mRDNPrefix ); - config->writeEntry( "LdapRealm", d->mRealm ); - config->writeEntry( "LdapBindDN", d->mBindDN ); - config->writeEntry( "LdapCachePolicy", d->mCachePolicy ); - config->writeEntry( "LdapAutoCache", d->mAutoCache ); - - TQStringList attributes; - TQMap<TQString, TQString>::Iterator it; - for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) - attributes << it.key() << it.data(); - - config->writeEntry( "LdapAttributes", attributes ); -} - -Ticket *ResourceLDAPTDEIO::requestSaveTicket() -{ - if ( !addressBook() ) { - kdDebug(7125) << "no addressbook" << endl; - return 0; - } - - return createTicket( this ); -} - -void ResourceLDAPTDEIO::releaseSaveTicket( Ticket *ticket ) -{ - delete ticket; -} - -bool ResourceLDAPTDEIO::doOpen() -{ - return true; -} - -void ResourceLDAPTDEIO::doClose() -{ -} - -void ResourceLDAPTDEIO::createCache() -{ - d->mTmp = NULL; - if ( d->mCachePolicy == Cache_NoConnection && d->mAutoCache ) { - d->mTmp = new KTempFile( d->mCacheDst, "tmp" ); - d->mTmp->setAutoDelete( true ); - } -} - -void ResourceLDAPTDEIO::activateCache() -{ - if ( d->mTmp && d->mError == 0 ) { - d->mTmp->close(); - rename( TQFile::encodeName( d->mTmp->name() ), TQFile::encodeName( d->mCacheDst ) ); - } - if ( d->mTmp ) { - delete d->mTmp; - d->mTmp = 0; - } -} - -TDEIO::Job *ResourceLDAPTDEIO::loadFromCache() -{ - TDEIO::Job *job = NULL; - if ( d->mCachePolicy == Cache_Always || - ( d->mCachePolicy == Cache_NoConnection && - d->mError == TDEIO::ERR_COULD_NOT_CONNECT ) ) { - - d->mAddr = Addressee(); - d->mAd = Address( Address::Home ); - //initialize ldif parser - d->mLdif.startParsing(); - - Resource::setReadOnly( true ); - - KURL url( d->mCacheDst ); - job = TDEIO::get( url, true, false ); - connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), - this, TQT_SLOT( data( TDEIO::Job*, const TQByteArray& ) ) ); - } - return job; -} - -bool ResourceLDAPTDEIO::load() -{ - kdDebug(7125) << "ResourceLDAPTDEIO::load()" << endl; - TDEIO::Job *job; - - clear(); - //clear the addressee - d->mAddr = Addressee(); - d->mAd = Address( Address::Home ); - //initialize ldif parser - d->mLdif.startParsing(); - - //set to original settings, offline use will disable writing - Resource::setReadOnly( d->mReadOnly ); - - createCache(); - if ( d->mCachePolicy != Cache_Always ) { - job = TDEIO::get( d->mLDAPUrl, true, false ); - connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), - this, TQT_SLOT( data( TDEIO::Job*, const TQByteArray& ) ) ); - connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) ); - enter_loop(); - } - - job = loadFromCache(); - if ( job ) { - connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) ); - enter_loop(); - } - if ( mErrorMsg.isEmpty() ) { - kdDebug(7125) << "ResourceLDAPTDEIO load ok!" << endl; - return true; - } else { - kdDebug(7125) << "ResourceLDAPTDEIO load finished with error: " << mErrorMsg << endl; - addressBook()->error( mErrorMsg ); - return false; - } -} - -bool ResourceLDAPTDEIO::asyncLoad() -{ - clear(); - //clear the addressee - d->mAddr = Addressee(); - d->mAd = Address( Address::Home ); - //initialize ldif parser - d->mLdif.startParsing(); - - Resource::setReadOnly( d->mReadOnly ); - - createCache(); - if ( d->mCachePolicy != Cache_Always ) { - TDEIO::Job *job = TDEIO::get( d->mLDAPUrl, true, false ); - connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), - this, TQT_SLOT( data( TDEIO::Job*, const TQByteArray& ) ) ); - connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( result( TDEIO::Job* ) ) ); - } else { - result( NULL ); - } - return true; -} - -void ResourceLDAPTDEIO::data( TDEIO::Job *, const TQByteArray &data ) -{ - if ( data.size() ) { - d->mLdif.setLDIF( data ); - if ( d->mTmp ) { - d->mTmp->file()->writeBlock( data ); - } - } else { - d->mLdif.endLDIF(); - } - - LDIF::ParseVal ret; - TQString name; - TQByteArray value; - do { - ret = d->mLdif.nextItem(); - switch ( ret ) { - case LDIF::NewEntry: - kdDebug(7125) << "new entry: " << d->mLdif.dn() << endl; - break; - case LDIF::Item: - name = d->mLdif.attr().lower(); - value = d->mLdif.val(); - if ( name == mAttributes[ "commonName" ].lower() ) { - if ( !d->mAddr.formattedName().isEmpty() ) { - TQString fn = d->mAddr.formattedName(); - d->mAddr.setNameFromString( TQString::fromUtf8( value, value.size() ) ); - d->mAddr.setFormattedName( fn ); - } else - d->mAddr.setNameFromString( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "formattedName" ].lower() ) { - d->mAddr.setFormattedName( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "givenName" ].lower() ) { - d->mAddr.setGivenName( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "mail" ].lower() ) { - d->mAddr.insertEmail( TQString::fromUtf8( value, value.size() ), true ); - } else if ( name == mAttributes[ "mailAlias" ].lower() ) { - d->mAddr.insertEmail( TQString::fromUtf8( value, value.size() ), false ); - } else if ( name == mAttributes[ "phoneNumber" ].lower() ) { - PhoneNumber phone; - phone.setNumber( TQString::fromUtf8( value, value.size() ) ); - d->mAddr.insertPhoneNumber( phone ); - } else if ( name == mAttributes[ "telephoneNumber" ].lower() ) { - PhoneNumber phone( TQString::fromUtf8( value, value.size() ), - PhoneNumber::Work ); - d->mAddr.insertPhoneNumber( phone ); - } else if ( name == mAttributes[ "facsimileTelephoneNumber" ].lower() ) { - PhoneNumber phone( TQString::fromUtf8( value, value.size() ), - PhoneNumber::Fax ); - d->mAddr.insertPhoneNumber( phone ); - } else if ( name == mAttributes[ "mobile" ].lower() ) { - PhoneNumber phone( TQString::fromUtf8( value, value.size() ), - PhoneNumber::Cell ); - d->mAddr.insertPhoneNumber( phone ); - } else if ( name == mAttributes[ "pager" ].lower() ) { - PhoneNumber phone( TQString::fromUtf8( value, value.size() ), - PhoneNumber::Pager ); - d->mAddr.insertPhoneNumber( phone ); - } else if ( name == mAttributes[ "description" ].lower() ) { - d->mAddr.setNote( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "title" ].lower() ) { - d->mAddr.setTitle( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "street" ].lower() ) { - d->mAd.setStreet( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "state" ].lower() ) { - d->mAd.setRegion( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "city" ].lower() ) { - d->mAd.setLocality( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "postalcode" ].lower() ) { - d->mAd.setPostalCode( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "organization" ].lower() ) { - d->mAddr.setOrganization( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "familyName" ].lower() ) { - d->mAddr.setFamilyName( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "uid" ].lower() ) { - d->mAddr.setUid( TQString::fromUtf8( value, value.size() ) ); - } else if ( name == mAttributes[ "jpegPhoto" ].lower() ) { - KABC::Picture photo; - TQImage img( value ); - if ( !img.isNull() ) { - photo.setData( img ); - photo.setType( "image/jpeg" ); - d->mAddr.setPhoto( photo ); - } - } - - break; - case LDIF::EndEntry: { - d->mAddr.setResource( this ); - d->mAddr.insertAddress( d->mAd ); - d->mAddr.setChanged( false ); - insertAddressee( d->mAddr ); - //clear the addressee - d->mAddr = Addressee(); - d->mAd = Address( Address::Home ); - } - break; - default: - break; - } - } while ( ret != LDIF::MoreData ); -} - -void ResourceLDAPTDEIO::loadCacheResult( TDEIO::Job *job ) -{ - mErrorMsg = ""; - d->mError = job->error(); - if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) { - mErrorMsg = job->errorString(); - } - if ( !mErrorMsg.isEmpty() ) - emit loadingError( this, mErrorMsg ); - else - emit loadingFinished( this ); -} - -void ResourceLDAPTDEIO::result( TDEIO::Job *job ) -{ - mErrorMsg = ""; - if ( job ) { - d->mError = job->error(); - if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) { - mErrorMsg = job->errorString(); - } - } else { - d->mError = 0; - } - activateCache(); - - TDEIO::Job *cjob; - cjob = loadFromCache(); - if ( cjob ) { - connect( cjob, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( loadCacheResult( TDEIO::Job* ) ) ); - } else { - if ( !mErrorMsg.isEmpty() ) - emit loadingError( this, mErrorMsg ); - else - emit loadingFinished( this ); - } -} - -bool ResourceLDAPTDEIO::save( Ticket* ) -{ - kdDebug(7125) << "ResourceLDAPTDEIO save" << endl; - - d->mSaveIt = begin(); - TDEIO::Job *job = TDEIO::put( d->mLDAPUrl, -1, true, false, false ); - connect( job, TQT_SIGNAL( dataReq( TDEIO::Job*, TQByteArray& ) ), - this, TQT_SLOT( saveData( TDEIO::Job*, TQByteArray& ) ) ); - connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) ); - enter_loop(); - if ( mErrorMsg.isEmpty() ) { - kdDebug(7125) << "ResourceLDAPTDEIO save ok!" << endl; - return true; - } else { - kdDebug(7125) << "ResourceLDAPTDEIO finished with error: " << mErrorMsg << endl; - addressBook()->error( mErrorMsg ); - return false; - } -} - -bool ResourceLDAPTDEIO::asyncSave( Ticket* ) -{ - kdDebug(7125) << "ResourceLDAPTDEIO asyncSave" << endl; - d->mSaveIt = begin(); - TDEIO::Job *job = TDEIO::put( d->mLDAPUrl, -1, true, false, false ); - connect( job, TQT_SIGNAL( dataReq( TDEIO::Job*, TQByteArray& ) ), - this, TQT_SLOT( saveData( TDEIO::Job*, TQByteArray& ) ) ); - connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( saveResult( TDEIO::Job* ) ) ); - return true; -} - -void ResourceLDAPTDEIO::syncLoadSaveResult( TDEIO::Job *job ) -{ - d->mError = job->error(); - if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) - mErrorMsg = job->errorString(); - else - mErrorMsg = ""; - activateCache(); - - tqApp->exit_loop(); -} - -void ResourceLDAPTDEIO::saveResult( TDEIO::Job *job ) -{ - d->mError = job->error(); - if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) - emit savingError( this, job->errorString() ); - else - emit savingFinished( this ); -} - -void ResourceLDAPTDEIO::saveData( TDEIO::Job*, TQByteArray& data ) -{ - while ( d->mSaveIt != end() && - !(*d->mSaveIt).changed() ) d->mSaveIt++; - - if ( d->mSaveIt == end() ) { - kdDebug(7125) << "ResourceLDAPTDEIO endData" << endl; - data.resize(0); - return; - } - - kdDebug(7125) << "ResourceLDAPTDEIO saveData: " << (*d->mSaveIt).assembledName() << endl; - - AddresseeToLDIF( data, *d->mSaveIt, findUid( (*d->mSaveIt).uid() ) ); -// kdDebug(7125) << "ResourceLDAPTDEIO save LDIF: " << TQString::fromUtf8(data) << endl; - // mark as unchanged - (*d->mSaveIt).setChanged( false ); - - d->mSaveIt++; -} - -void ResourceLDAPTDEIO::removeAddressee( const Addressee& addr ) -{ - TQString dn = findUid( addr.uid() ); - - kdDebug(7125) << "ResourceLDAPTDEIO: removeAddressee: " << dn << endl; - - if ( !mErrorMsg.isEmpty() ) { - addressBook()->error( mErrorMsg ); - return; - } - if ( !dn.isEmpty() ) { - kdDebug(7125) << "ResourceLDAPTDEIO: found uid: " << dn << endl; - LDAPUrl url( d->mLDAPUrl ); - url.setPath( "/" + dn ); - url.setExtension( "x-dir", "base" ); - url.setScope( LDAPUrl::Base ); - if ( TDEIO::NetAccess::del( url, NULL ) ) mAddrMap.erase( addr.uid() ); - } else { - //maybe it's not saved yet - mAddrMap.erase( addr.uid() ); - } -} - - -void ResourceLDAPTDEIO::setUser( const TQString &user ) -{ - mUser = user; -} - -TQString ResourceLDAPTDEIO::user() const -{ - return mUser; -} - -void ResourceLDAPTDEIO::setPassword( const TQString &password ) -{ - mPassword = password; -} - -TQString ResourceLDAPTDEIO::password() const -{ - return mPassword; -} - -void ResourceLDAPTDEIO::setDn( const TQString &dn ) -{ - mDn = dn; -} - -TQString ResourceLDAPTDEIO::dn() const -{ - return mDn; -} - -void ResourceLDAPTDEIO::setHost( const TQString &host ) -{ - mHost = host; -} - -TQString ResourceLDAPTDEIO::host() const -{ - return mHost; -} - -void ResourceLDAPTDEIO::setPort( int port ) -{ - mPort = port; -} - -int ResourceLDAPTDEIO::port() const -{ - return mPort; -} - -void ResourceLDAPTDEIO::setVer( int ver ) -{ - d->mVer = ver; -} - -int ResourceLDAPTDEIO::ver() const -{ - return d->mVer; -} - -void ResourceLDAPTDEIO::setSizeLimit( int sizelimit ) -{ - d->mSizeLimit = sizelimit; -} - -int ResourceLDAPTDEIO::sizeLimit() -{ - return d->mSizeLimit; -} - -void ResourceLDAPTDEIO::setTimeLimit( int timelimit ) -{ - d->mTimeLimit = timelimit; -} - -int ResourceLDAPTDEIO::timeLimit() -{ - return d->mTimeLimit; -} - -void ResourceLDAPTDEIO::setFilter( const TQString &filter ) -{ - mFilter = filter; -} - -TQString ResourceLDAPTDEIO::filter() const -{ - return mFilter; -} - -void ResourceLDAPTDEIO::setIsAnonymous( bool value ) -{ - mAnonymous = value; -} - -bool ResourceLDAPTDEIO::isAnonymous() const -{ - return mAnonymous; -} - -void ResourceLDAPTDEIO::setIsTLS( bool value ) -{ - d->mTLS = value; -} - -bool ResourceLDAPTDEIO::isTLS() const -{ - return d->mTLS; -} -void ResourceLDAPTDEIO::setIsSSL( bool value ) -{ - d->mSSL = value; -} - -bool ResourceLDAPTDEIO::isSSL() const -{ - return d->mSSL; -} - -void ResourceLDAPTDEIO::setIsSubTree( bool value ) -{ - d->mSubTree = value; -} - -bool ResourceLDAPTDEIO::isSubTree() const -{ - return d->mSubTree; -} - -void ResourceLDAPTDEIO::setAttributes( const TQMap<TQString, TQString> &attributes ) -{ - mAttributes = attributes; -} - -TQMap<TQString, TQString> ResourceLDAPTDEIO::attributes() const -{ - return mAttributes; -} - -void ResourceLDAPTDEIO::setRDNPrefix( int value ) -{ - d->mRDNPrefix = value; -} - -int ResourceLDAPTDEIO::RDNPrefix() const -{ - return d->mRDNPrefix; -} - -void ResourceLDAPTDEIO::setIsSASL( bool value ) -{ - d->mSASL = value; -} - -bool ResourceLDAPTDEIO::isSASL() const -{ - return d->mSASL; -} - -void ResourceLDAPTDEIO::setMech( const TQString &mech ) -{ - d->mMech = mech; -} - -TQString ResourceLDAPTDEIO::mech() const -{ - return d->mMech; -} - -void ResourceLDAPTDEIO::setRealm( const TQString &realm ) -{ - d->mRealm = realm; -} - -TQString ResourceLDAPTDEIO::realm() const -{ - return d->mRealm; -} - -void ResourceLDAPTDEIO::setBindDN( const TQString &binddn ) -{ - d->mBindDN = binddn; -} - -TQString ResourceLDAPTDEIO::bindDN() const -{ - return d->mBindDN; -} - -void ResourceLDAPTDEIO::setCachePolicy( int pol ) -{ - d->mCachePolicy = pol; -} - -int ResourceLDAPTDEIO::cachePolicy() const -{ - return d->mCachePolicy; -} - -void ResourceLDAPTDEIO::setAutoCache( bool value ) -{ - d->mAutoCache = value; -} - -bool ResourceLDAPTDEIO::autoCache() -{ - return d->mAutoCache; -} - -TQString ResourceLDAPTDEIO::cacheDst() const -{ - return d->mCacheDst; -} - - -#include "resourceldaptdeio.moc" diff --git a/kabc/plugins/ldaptdeio/resourceldaptdeio.h b/kabc/plugins/ldaptdeio/resourceldaptdeio.h deleted file mode 100644 index 5c9282b9c..000000000 --- a/kabc/plugins/ldaptdeio/resourceldaptdeio.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> - Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> - - 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 KABC_RESOURCELDAP_H -#define KABC_RESOURCELDAP_H - -#include <kabc/resource.h> -#include <kabc/ldif.h> -#include <tdeio/job.h> - -class TDEConfig; - -namespace KABC { - -class KABC_EXPORT ResourceLDAPTDEIO : public Resource -{ - Q_OBJECT - - public: - enum CachePolicy{ Cache_No, Cache_NoConnection, Cache_Always }; - - ResourceLDAPTDEIO( const TDEConfig* ); - virtual ~ResourceLDAPTDEIO(); - /** - * Call this after you used one of the set... methods - */ - virtual void init(); - - virtual void writeConfig( TDEConfig* ); - - virtual bool doOpen(); - virtual void doClose(); - - virtual Ticket *requestSaveTicket(); - virtual void releaseSaveTicket( Ticket* ); - - virtual bool readOnly() const { return Resource::readOnly(); } - virtual void setReadOnly( bool value ); - - virtual bool load(); - virtual bool asyncLoad(); - virtual bool save( Ticket * ticket ); - virtual bool asyncSave( Ticket * ticket ); - - virtual void removeAddressee( const Addressee& addr ); - - void setUser( const TQString &user ); - TQString user() const; - - void setPassword( const TQString &password ); - TQString password() const; - - void setRealm( const TQString &realm ); - TQString realm() const; - - void setBindDN( const TQString &binddn ); - TQString bindDN() const; - - void setDn( const TQString &dn ); - TQString dn() const; - - void setHost( const TQString &host ); - TQString host() const; - - void setPort( int port ); - int port() const; - - void setVer( int ver ); - int ver() const; - - void setSizeLimit( int sizelimit ); - int sizeLimit(); - - void setTimeLimit( int timelimit ); - int timeLimit(); - - void setFilter( const TQString &filter ); - TQString filter() const; - - void setIsAnonymous( bool value ); - bool isAnonymous() const; - - void setAttributes( const TQMap<TQString, TQString> &attributes ); - TQMap<TQString, TQString> attributes() const; - - void setRDNPrefix( int value ); - int RDNPrefix() const; - - void setIsTLS( bool value ); - bool isTLS() const ; - - void setIsSSL( bool value ); - bool isSSL() const; - - void setIsSubTree( bool value ); - bool isSubTree() const ; - - void setIsSASL( bool value ); - bool isSASL() const ; - - void setMech( const TQString &mech ); - TQString mech() const; - - void setCachePolicy( int pol ); - int cachePolicy() const; - - void setAutoCache( bool value ); - bool autoCache(); - - TQString cacheDst() const; - -protected slots: - void entries( TDEIO::Job*, const TDEIO::UDSEntryList& ); - void data( TDEIO::Job*, const TQByteArray& ); - void result( TDEIO::Job* ); - void listResult( TDEIO::Job* ); - void syncLoadSaveResult( TDEIO::Job* ); - void saveResult( TDEIO::Job* ); - void saveData( TDEIO::Job*, TQByteArray& ); - void loadCacheResult( TDEIO::Job* ); - - private: - TQString mUser; - TQString mPassword; - TQString mDn; - TQString mHost; - TQString mFilter; - int mPort; - bool mAnonymous; - TQMap<TQString, TQString> mAttributes; - - KURL mLDAPUrl; - int mGetCounter; //KDE 4: remove - bool mErrorOccured; //KDE 4: remove - TQString mErrorMsg; - TQMap<TDEIO::Job*, TQByteArray> mJobMap; //KDE 4: remove - - TDEIO::Job *loadFromCache(); - void createCache(); - void activateCache(); - void enter_loop(); - TQCString addEntry( const TQString &attr, const TQString &value, bool mod ); - TQString findUid( const TQString &uid ); - bool AddresseeToLDIF( TQByteArray &ldif, const Addressee &addr, - const TQString &olddn ); - - class ResourceLDAPTDEIOPrivate; - ResourceLDAPTDEIOPrivate *d; -}; - -} - -#endif diff --git a/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp b/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp deleted file mode 100644 index f53ee7d30..000000000 --- a/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp +++ /dev/null @@ -1,388 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 <tqapplication.h> - -#include <tqcheckbox.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqpushbutton.h> -#include <tqspinbox.h> -#include <tqvbox.h> -#include <tqvgroupbox.h> -#include <tqhbuttongroup.h> -#include <tqradiobutton.h> - -#include <tdeaccelmanager.h> -#include <kcombobox.h> -#include <kdebug.h> -#include <kdialogbase.h> -#include <klocale.h> -#include <klineedit.h> -#include <kmessagebox.h> -#include <tdeio/netaccess.h> - -#include "resourceldaptdeio.h" - -#include "resourceldaptdeioconfig.h" -#include "resourceldaptdeioconfig.moc" - -using namespace KABC; - -ResourceLDAPTDEIOConfig::ResourceLDAPTDEIOConfig( TQWidget* parent, const char* name ) - : KRES::ConfigWidget( parent, name ) -{ - TQBoxLayout *mainLayout = new TQVBoxLayout( this ); - mainLayout->setAutoAdd( true ); - cfg = new LdapConfigWidget( LdapConfigWidget::W_ALL, this ); - - mSubTree = new TQCheckBox( i18n( "Sub-tree query" ), this ); - TQHBox *box = new TQHBox( this ); - box->setSpacing( KDialog::spacingHint() ); - mEditButton = new TQPushButton( i18n( "Edit Attributes..." ), box ); - mCacheButton = new TQPushButton( i18n( "Offline Use..." ), box ); - - connect( mEditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editAttributes() ) ); - connect( mCacheButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editCache() ) ); -} - -void ResourceLDAPTDEIOConfig::loadSettings( KRES::Resource *res ) -{ - ResourceLDAPTDEIO *resource = dynamic_cast<ResourceLDAPTDEIO*>( res ); - - if ( !resource ) { - kdDebug(5700) << "ResourceLDAPTDEIOConfig::loadSettings(): cast failed" << endl; - return; - } - - cfg->setUser( resource->user() ); - cfg->setPassword( resource->password() ); - cfg->setRealm( resource->realm() ); - cfg->setBindDN( resource->bindDN() ); - cfg->setHost( resource->host() ); - cfg->setPort( resource->port() ); - cfg->setVer( resource->ver() ); - cfg->setTimeLimit( resource->timeLimit() ); - cfg->setSizeLimit( resource->sizeLimit() ); - cfg->setDn( resource->dn() ); - cfg->setFilter( resource->filter() ); - cfg->setMech( resource->mech() ); - if ( resource->isTLS() ) cfg->setSecTLS(); - else if ( resource->isSSL() ) cfg->setSecSSL(); - else cfg->setSecNO(); - if ( resource->isAnonymous() ) cfg->setAuthAnon(); - else if ( resource->isSASL() ) cfg->setAuthSASL(); - else cfg->setAuthSimple(); - - mSubTree->setChecked( resource->isSubTree() ); - mAttributes = resource->attributes(); - mRDNPrefix = resource->RDNPrefix(); - mCachePolicy = resource->cachePolicy(); - mCacheDst = resource->cacheDst(); - mAutoCache = resource->autoCache(); -} - -void ResourceLDAPTDEIOConfig::saveSettings( KRES::Resource *res ) -{ - ResourceLDAPTDEIO *resource = dynamic_cast<ResourceLDAPTDEIO*>( res ); - - if ( !resource ) { - kdDebug(5700) << "ResourceLDAPTDEIOConfig::saveSettings(): cast failed" << endl; - return; - } - - resource->setUser( cfg->user() ); - resource->setPassword( cfg->password() ); - resource->setRealm( cfg->realm() ); - resource->setBindDN( cfg->bindDN() ); - resource->setHost( cfg->host() ); - resource->setPort( cfg->port() ); - resource->setVer( cfg->ver() ); - resource->setTimeLimit( cfg->timeLimit() ); - resource->setSizeLimit( cfg->sizeLimit() ); - resource->setDn( cfg->dn() ); - resource->setFilter( cfg->filter() ); - resource->setIsAnonymous( cfg->isAuthAnon() ); - resource->setIsSASL( cfg->isAuthSASL() ); - resource->setMech( cfg->mech() ); - resource->setIsTLS( cfg->isSecTLS() ); - resource->setIsSSL( cfg->isSecSSL() ); - resource->setIsSubTree( mSubTree->isChecked() ); - resource->setAttributes( mAttributes ); - resource->setRDNPrefix( mRDNPrefix ); - resource->setCachePolicy( mCachePolicy ); - resource->init(); - -} - -void ResourceLDAPTDEIOConfig::editAttributes() -{ - AttributesDialog dlg( mAttributes, mRDNPrefix, this ); - if ( dlg.exec() ) { - mAttributes = dlg.attributes(); - mRDNPrefix = dlg.rdnprefix(); - } -} - -void ResourceLDAPTDEIOConfig::editCache() -{ - LDAPUrl src; - TQStringList attr; - - src = cfg->url(); - src.setScope( mSubTree->isChecked() ? LDAPUrl::Sub : LDAPUrl::One ); - if (!mAttributes.empty()) { - TQMap<TQString,TQString>::Iterator it; - TQStringList attr; - for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) { - if ( !it.data().isEmpty() && it.key() != "objectClass" ) - attr.append( it.data() ); - } - src.setAttributes( attr ); - } - src.setExtension( "x-dir", "base" ); - OfflineDialog dlg( mAutoCache, mCachePolicy, src, mCacheDst, this ); - if ( dlg.exec() ) { - mCachePolicy = dlg.cachePolicy(); - mAutoCache = dlg.autoCache(); - } - -} - -AttributesDialog::AttributesDialog( const TQMap<TQString, TQString> &attributes, - int rdnprefix, - TQWidget *parent, const char *name ) - : KDialogBase( Plain, i18n( "Attributes Configuration" ), Ok | Cancel, - Ok, parent, name, true, true ) -{ - mNameDict.setAutoDelete( true ); - mNameDict.insert( "objectClass", new TQString( i18n( "Object classes" ) ) ); - mNameDict.insert( "commonName", new TQString( i18n( "Common name" ) ) ); - mNameDict.insert( "formattedName", new TQString( i18n( "Formatted name" ) ) ); - mNameDict.insert( "familyName", new TQString( i18n( "Family name" ) ) ); - mNameDict.insert( "givenName", new TQString( i18n( "Given name" ) ) ); - mNameDict.insert( "organization", new TQString( i18n( "Organization" ) ) ); - mNameDict.insert( "title", new TQString( i18n( "Title" ) ) ); - mNameDict.insert( "street", new TQString( i18n( "Street" ) ) ); - mNameDict.insert( "state", new TQString( i18n( "State" ) ) ); - mNameDict.insert( "city", new TQString( i18n( "City" ) ) ); - mNameDict.insert( "postalcode", new TQString( i18n( "Postal code" ) ) ); - mNameDict.insert( "mail", new TQString( i18n( "Email" ) ) ); - mNameDict.insert( "mailAlias", new TQString( i18n( "Email alias" ) ) ); - mNameDict.insert( "phoneNumber", new TQString( i18n( "Telephone number" ) ) ); - mNameDict.insert( "telephoneNumber", new TQString( i18n( "Work telephone number" ) ) ); - mNameDict.insert( "facsimileTelephoneNumber", new TQString( i18n( "Fax number" ) ) ); - mNameDict.insert( "mobile", new TQString( i18n( "Cell phone number" ) ) ); - mNameDict.insert( "pager", new TQString( i18n( "Pager" ) ) ); - mNameDict.insert( "description", new TQString( i18n( "Note" ) ) ); - mNameDict.insert( "uid", new TQString( i18n( "UID" ) ) ); - mNameDict.insert( "jpegPhoto", new TQString( i18n( "Photo" ) ) ); - - // default map - mDefaultMap.insert( "objectClass", "inetOrgPerson" ); - mDefaultMap.insert( "commonName", "cn" ); - mDefaultMap.insert( "formattedName", "displayName" ); - mDefaultMap.insert( "familyName", "sn" ); - mDefaultMap.insert( "givenName", "givenName" ); - mDefaultMap.insert( "title", "title" ); - mDefaultMap.insert( "street", "street" ); - mDefaultMap.insert( "state", "st" ); - mDefaultMap.insert( "city", "l" ); - mDefaultMap.insert( "organization", "o" ); - mDefaultMap.insert( "postalcode", "postalCode" ); - mDefaultMap.insert( "mail", "mail" ); - mDefaultMap.insert( "mailAlias", "" ); - mDefaultMap.insert( "phoneNumber", "homePhone" ); - mDefaultMap.insert( "telephoneNumber", "telephoneNumber" ); - mDefaultMap.insert( "facsimileTelephoneNumber", "facsimileTelephoneNumber" ); - mDefaultMap.insert( "mobile", "mobile" ); - mDefaultMap.insert( "pager", "pager" ); - mDefaultMap.insert( "description", "description" ); - mDefaultMap.insert( "uid", "uid" ); - mDefaultMap.insert( "jpegPhoto", "jpegPhoto" ); - - // overwrite the default values here - TQMap<TQString, TQString> kolabMap, netscapeMap, evolutionMap, outlookMap; - - // kolab - kolabMap.insert( "formattedName", "display-name" ); - kolabMap.insert( "mailAlias", "mailalias" ); - - // evolution - evolutionMap.insert( "formattedName", "fileAs" ); - - mMapList.append( attributes ); - mMapList.append( kolabMap ); - mMapList.append( netscapeMap ); - mMapList.append( evolutionMap ); - mMapList.append( outlookMap ); - - TQFrame *page = plainPage(); - TQGridLayout *layout = new TQGridLayout( page, 4, ( attributes.count() + 4 ) >> 1, - 0, spacingHint() ); - - TQLabel *label = new TQLabel( i18n( "Template:" ), page ); - layout->addWidget( label, 0, 0 ); - mMapCombo = new KComboBox( page ); - layout->addWidget( mMapCombo, 0, 1 ); - - mMapCombo->insertItem( i18n( "User Defined" ) ); - mMapCombo->insertItem( i18n( "Kolab" ) ); - mMapCombo->insertItem( i18n( "Netscape" ) ); - mMapCombo->insertItem( i18n( "Evolution" ) ); - mMapCombo->insertItem( i18n( "Outlook" ) ); - connect( mMapCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( mapChanged( int ) ) ); - - label = new TQLabel( i18n( "RDN prefix attribute:" ), page ); - layout->addWidget( label, 1, 0 ); - mRDNCombo = new KComboBox( page ); - layout->addWidget( mRDNCombo, 1, 1 ); - mRDNCombo->insertItem( i18n( "commonName" ) ); - mRDNCombo->insertItem( i18n( "UID" ) ); - mRDNCombo->setCurrentItem( rdnprefix ); - - TQMap<TQString, TQString>::ConstIterator it; - int i, j = 0; - for ( i = 2, it = attributes.begin(); it != attributes.end(); ++it, ++i ) { - if ( mNameDict[ it.key() ] == 0 ) { - i--; - continue; - } - if ( (uint)(i - 2) == ( mNameDict.count() >> 1 ) ) { - i = 0; - j = 2; - } - kdDebug(7125) << "itkey: " << it.key() << " i: " << i << endl; - label = new TQLabel( *mNameDict[ it.key() ] + ":", page ); - KLineEdit *lineedit = new KLineEdit( page ); - mLineEditDict.insert( it.key(), lineedit ); - lineedit->setText( it.data() ); - label->setBuddy( lineedit ); - layout->addWidget( label, i, j ); - layout->addWidget( lineedit, i, j+1 ); - } - - for ( i = 1; i < mMapCombo->count(); i++ ) { - TQDictIterator<KLineEdit> it2( mLineEditDict ); - for ( ; it2.current(); ++it2 ) { - if ( mMapList[ i ].contains( it2.currentKey() ) ) { - if ( mMapList[ i ][ it2.currentKey() ] != it2.current()->text() ) break; - } else { - if ( mDefaultMap[ it2.currentKey() ] != it2.current()->text() ) break; - } - } - if ( !it2.current() ) { - mMapCombo->setCurrentItem( i ); - break; - } - } - - TDEAcceleratorManager::manage( this ); -} - -AttributesDialog::~AttributesDialog() -{ -} - -TQMap<TQString, TQString> AttributesDialog::attributes() const -{ - TQMap<TQString, TQString> map; - - TQDictIterator<KLineEdit> it( mLineEditDict ); - for ( ; it.current(); ++it ) - map.insert( it.currentKey(), it.current()->text() ); - - return map; -} - -int AttributesDialog::rdnprefix() const -{ - return mRDNCombo->currentItem(); -} - -void AttributesDialog::mapChanged( int pos ) -{ - - // apply first the default and than the spezific changes - TQMap<TQString, TQString>::Iterator it; - for ( it = mDefaultMap.begin(); it != mDefaultMap.end(); ++it ) - mLineEditDict[ it.key() ]->setText( it.data() ); - - for ( it = mMapList[ pos ].begin(); it != mMapList[ pos ].end(); ++it ) { - if ( !it.data().isEmpty() ) { - KLineEdit *le = mLineEditDict[ it.key() ]; - if ( le ) le->setText( it.data() ); - } - } -} - -OfflineDialog::OfflineDialog( bool autoCache, int cachePolicy, const KURL &src, - const TQString &dst, TQWidget *parent, const char *name ) - : KDialogBase( Plain, i18n( "Offline Configuration" ), Ok | Cancel, - Ok, parent, name, true, true ) -{ - TQFrame *page = plainPage(); - TQVBoxLayout *layout = new TQVBoxLayout( page ); - layout->setAutoAdd( true ); - - mSrc = src; mDst = dst; - mCacheGroup = new TQButtonGroup( 1, Qt::Horizontal, - i18n("Offline Cache Policy"), page ); - - TQRadioButton *bt; - new TQRadioButton( i18n("Do not use offline cache"), mCacheGroup ); - bt = new TQRadioButton( i18n("Use local copy if no connection"), mCacheGroup ); - new TQRadioButton( i18n("Always use local copy"), mCacheGroup ); - mCacheGroup->setButton( cachePolicy ); - - mAutoCache = new TQCheckBox( i18n("Refresh offline cache automatically"), - page ); - mAutoCache->setChecked( autoCache ); - mAutoCache->setEnabled( bt->isChecked() ); - - connect( bt, TQT_SIGNAL(toggled(bool)), mAutoCache, TQT_SLOT(setEnabled(bool)) ); - - TQPushButton *lcache = new TQPushButton( i18n("Load into Cache"), page ); - connect( lcache, TQT_SIGNAL( clicked() ), TQT_SLOT( loadCache() ) ); -} - -OfflineDialog::~OfflineDialog() -{ -} - -bool OfflineDialog::autoCache() const -{ - return mAutoCache->isChecked(); -} - -int OfflineDialog::cachePolicy() const -{ - return mCacheGroup->selectedId(); -} - -void OfflineDialog::loadCache() -{ - if ( TDEIO::NetAccess::download( mSrc, mDst, this ) ) { - KMessageBox::information( this, - i18n("Successfully downloaded directory server contents!") ); - } else { - KMessageBox::error( this, - i18n("An error occurred downloading directory server contents into file %1.").arg(mDst) ); - } -} diff --git a/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.h b/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.h deleted file mode 100644 index 0fde41d64..000000000 --- a/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 RESOURCELDAPCONFIG_H -#define RESOURCELDAPCONFIG_H - -#include <tqmap.h> -#include <tqradiobutton.h> -#include <tqcombobox.h> -#include <tqdict.h> - -#include <kdialogbase.h> -#include <tderesources/configwidget.h> -#include <kabc/ldif.h> -#include <kabc/ldapconfigwidget.h> - - -class TQCheckBox; -class TQPushButton; -class TQSpinBox; -class TQString; - -class KComboBox; -class KLineEdit; - -namespace KABC { - -class KABC_EXPORT ResourceLDAPTDEIOConfig : public KRES::ConfigWidget -{ - Q_OBJECT - - public: - ResourceLDAPTDEIOConfig( TQWidget* parent = 0, const char* name = 0 ); - - public slots: - void loadSettings( KRES::Resource* ); - void saveSettings( KRES::Resource* ); - - private slots: - void editAttributes(); - void editCache(); - private: - TQPushButton *mEditButton, *mCacheButton; - LdapConfigWidget *cfg; - TQCheckBox *mSubTree; - TQMap<TQString, TQString> mAttributes; - int mRDNPrefix, mCachePolicy; - bool mAutoCache; - TQString mCacheDst; -}; - -class AttributesDialog : public KDialogBase -{ - Q_OBJECT - - public: - AttributesDialog( const TQMap<TQString, TQString> &attributes, int rdnprefix, - TQWidget *parent, const char *name = 0 ); - ~AttributesDialog(); - - TQMap<TQString, TQString> attributes() const; - int rdnprefix() const; - - private slots: - void mapChanged( int pos ); - - private: - enum { UserMap, KolabMap, NetscapeMap, EvolutionMap, OutlookMap }; - - KComboBox *mMapCombo, *mRDNCombo; - TQValueList< TQMap<TQString, TQString> > mMapList; - TQMap<TQString, TQString> mDefaultMap; - TQDict<KLineEdit> mLineEditDict; - TQDict<TQString> mNameDict; -}; - -class OfflineDialog : public KDialogBase -{ - Q_OBJECT - - public: - OfflineDialog( bool autoCache, int cachePolicy, const KURL &src, - const TQString &dst, TQWidget *parent, const char *name = 0 ); - ~OfflineDialog(); - - int cachePolicy() const; - bool autoCache() const; - - private slots: - void loadCache(); - - private: - KURL mSrc; - TQString mDst; - TQButtonGroup *mCacheGroup; - TQCheckBox *mAutoCache; -}; - -} - -#endif diff --git a/kabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp b/kabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp deleted file mode 100644 index ac08e8e2b..000000000 --- a/kabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 "resourceldaptdeio.h" -#include "resourceldaptdeioconfig.h" - -#include <kglobal.h> -#include <klocale.h> - -using namespace KABC; - -extern "C" -{ - KDE_EXPORT void *init_kabc_ldaptdeio() - { - TDEGlobal::locale()->insertCatalogue("kabc_ldaptdeio"); - return new KRES::PluginFactory<ResourceLDAPTDEIO, ResourceLDAPTDEIOConfig>(); - } -} diff --git a/kabc/plugins/net/CMakeLists.txt b/kabc/plugins/net/CMakeLists.txt deleted file mode 100644 index e92fbfc32..000000000 --- a/kabc/plugins/net/CMakeLists.txt +++ /dev/null @@ -1,73 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR}/kabc - ${CMAKE_SOURCE_DIR}/kabc - - ${TQT_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR} - ${CMAKE_SOURCE_DIR}/dcop - ${CMAKE_SOURCE_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdeui - ${CMAKE_SOURCE_DIR}/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdeio - ${CMAKE_SOURCE_DIR}/tdeio/tdefile -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - resourcenet.h - DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) - - -##### other data ################################ - -install( FILES net.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) - - -##### kabc_net (library) ######################## - -set( target kabc_net ) - -set( ${target}_SRCS - resourcenet.cpp resourcenetconfig.cpp -) - -tde_add_library( ${target} SHARED AUTOMOC - SOURCES ${${target}_SRCS} - VERSION 1.0.0 - LINK kabc-shared - DESTINATION ${LIB_INSTALL_DIR} -) - - -##### kabc_net (module) ######################### - -set( target kabc_net ) - -set( ${target}_SRCS - resourcenetplugin.cpp -) - -tde_add_kpart( ${target} AUTOMOC - SOURCES ${${target}_SRCS} - LINK kabc_net-shared - DESTINATION ${PLUGIN_INSTALL_DIR} -) diff --git a/kabc/plugins/net/Makefile.am b/kabc/plugins/net/Makefile.am deleted file mode 100644 index ca0ece015..000000000 --- a/kabc/plugins/net/Makefile.am +++ /dev/null @@ -1,28 +0,0 @@ -INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) - -# these are the headers for your project -noinst_HEADERS = resourcenetconfig.h - -lib_LTLIBRARIES = libkabc_net.la -libkabc_net_la_SOURCES = resourcenet.cpp resourcenetconfig.cpp -libkabc_net_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined -libkabc_net_la_LIBADD = $(top_builddir)/kabc/libkabc.la $(LIB_KIO) -libkabc_net_la_COMPILE_FIRST = $(top_builddir)/kabc/addressee.h - -kde_module_LTLIBRARIES = kabc_net.la -kabc_net_la_SOURCES = resourcenetplugin.cpp -kabc_net_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -L../../../tdecore/.libs/ -ltdecore -kabc_net_la_LIBADD = libkabc_net.la - -METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kabc_net.pot - -kabcincludedir = $(includedir)/kabc -kabcinclude_HEADERS = resourcenet.h - -servicedir = $(kde_servicesdir)/tderesources/kabc -service_DATA = net.desktop - -resourcenetplugin.lo: ../../addressee.h diff --git a/kabc/plugins/net/net.desktop b/kabc/plugins/net/net.desktop deleted file mode 100644 index 2c72c202d..000000000 --- a/kabc/plugins/net/net.desktop +++ /dev/null @@ -1,90 +0,0 @@ -[Desktop Entry] -Name=Network -Name[af]=Netwerk -Name[ar]=الشبكة -Name[az]=ŞəbÉ™kÉ™ -Name[be]=Сетка -Name[bn]=নেটওয়ারà§à¦• -Name[br]=Rouedad -Name[bs]=Mreža -Name[ca]=Xarxa -Name[cs]=Síť -Name[csb]=Sec -Name[cy]=Rhydwaith -Name[da]=Netværk -Name[de]=Netzwerk -Name[el]=Δίκτυο -Name[eo]=Reto -Name[es]=Red -Name[et]=Võrk -Name[eu]=Sarea -Name[fa]=شبکه -Name[fi]=Verkko -Name[fr]=Réseau -Name[fy]=Netwurk -Name[ga]=Líonra -Name[gl]=Rede -Name[he]=רשת -Name[hi]=नेटवरà¥à¤• -Name[hr]=Mreža -Name[hsb]=Syć -Name[hu]=Hálózat -Name[id]=Jaringan -Name[is]=Net -Name[it]=Rete -Name[ja]=ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ -Name[ka]=ქსელი -Name[kk]=Желі -Name[km]=បណ្ážáž¶áž‰ -Name[ko]=ë„¤íŠ¸ì›Œí¬ -Name[ku]=Tor -Name[lb]=Netzwierk -Name[lt]=Tinklas -Name[lv]=TÄ«kls -Name[mi]=Hao -Name[mk]=Мрежа -Name[mn]=СүлжÑÑ -Name[ms]=Jaringan -Name[nds]=Nettwark -Name[ne]=सञà¥à¤œà¤¾à¤² -Name[nl]=Netwerk -Name[nn]=Nettverk -Name[nso]=Kgokagano -Name[oc]=Resèu -Name[pa]=ਨੈੱਟਵਰਕ -Name[pl]=Sieć -Name[pt]=Rede -Name[pt_BR]=Rede -Name[ro]=ReÅ£ea -Name[ru]=Сеть -Name[rw]=Urusobe -Name[se]=Fierbmi -Name[sk]=SieÅ¥ -Name[sl]=Omrežje -Name[sq]=Rrjeta -Name[sr]=Мрежа -Name[sr@Latn]=Mreža -Name[ss]=Luchungechunge -Name[sv]=Nätverk -Name[ta]=பிணையம௠-Name[te]=కలన జాలం -Name[tg]=Шабака -Name[th]=ระบบเครือข่าย -Name[tr]=AÄŸ -Name[tt]=Çeltär -Name[uk]=Мережа -Name[uz]=Tarmoq -Name[uz@cyrillic]=Tarмоқ -Name[ven]=Vhukwamani -Name[vi]=mạng -Name[wa]=Rantoele -Name[xh]=Umsebenzi womnatha -Name[zh_CN]=网络 -Name[zh_HK]=網絡 -Name[zh_TW]=網路 -Name[zu]=Umsebenzi wokuxhumana okusakazekile -X-TDE-Library=kabc_net -Type=Service -ServiceTypes=KResources/Plugin -X-TDE-ResourceFamily=contact -X-TDE-ResourceType=net diff --git a/kabc/plugins/net/resourcenet.cpp b/kabc/plugins/net/resourcenet.cpp deleted file mode 100644 index 9ef909904..000000000 --- a/kabc/plugins/net/resourcenet.cpp +++ /dev/null @@ -1,393 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 <tqfile.h> - -#include <kdebug.h> -#include <tdeio/netaccess.h> -#include <tdeio/scheduler.h> -#include <klocale.h> -#include <ksavefile.h> -#include <ktempfile.h> -#include <kurlrequester.h> - -#include "addressbook.h" -#include "formatfactory.h" -#include "resourcenetconfig.h" -#include "stdaddressbook.h" - -#include "resourcenet.h" - -using namespace KABC; - -class ResourceNet::ResourceNetPrivate -{ - public: - TDEIO::Job *mLoadJob; - bool mIsLoading; - - TDEIO::Job *mSaveJob; - bool mIsSaving; - - TQString mLastErrorString; -}; - -ResourceNet::ResourceNet( const TDEConfig *config ) - : Resource( config ), mFormat( 0 ), - mTempFile( 0 ), - d( new ResourceNetPrivate ) -{ - if ( config ) { - init( KURL( config->readPathEntry( "NetUrl" ) ), config->readEntry( "NetFormat" ) ); - } else { - init( KURL(), TQString("vcard").latin1() ); - } -} - -ResourceNet::ResourceNet( const KURL &url, const TQString &format ) - : Resource( 0 ), mFormat( 0 ), - mTempFile( 0 ), - d( new ResourceNetPrivate ) -{ - init( url, format ); -} - -void ResourceNet::init( const KURL &url, const TQString &format ) -{ - d->mLoadJob = 0; - d->mIsLoading = false; - d->mSaveJob = 0; - d->mIsSaving = false; - - mFormatName = format; - - FormatFactory *factory = FormatFactory::self(); - mFormat = factory->format( mFormatName ); - if ( !mFormat ) { - mFormatName = TQString("vcard").latin1(); - mFormat = factory->format( mFormatName ); - } - - setUrl( url ); -} - -ResourceNet::~ResourceNet() -{ - if ( d->mIsLoading ) - d->mLoadJob->kill(); - if ( d->mIsSaving ) - d->mSaveJob->kill(); - - delete d; - d = 0; - - delete mFormat; - mFormat = 0; - - deleteLocalTempFile(); -} - -void ResourceNet::writeConfig( TDEConfig *config ) -{ - Resource::writeConfig( config ); - - config->writePathEntry( "NetUrl", mUrl.url() ); - config->writeEntry( "NetFormat", mFormatName ); -} - -Ticket *ResourceNet::requestSaveTicket() -{ - kdDebug(5700) << "ResourceNet::requestSaveTicket()" << endl; - - return createTicket( this ); -} - -void ResourceNet::releaseSaveTicket( Ticket *ticket ) -{ - delete ticket; -} - -bool ResourceNet::doOpen() -{ - return true; -} - -void ResourceNet::doClose() -{ -} - -bool ResourceNet::load() -{ - TQString tempFile; - - if ( !TDEIO::NetAccess::download( mUrl, tempFile, 0 ) ) { - addressBook()->error( i18n( "Unable to download file '%1'." ).arg( mUrl.prettyURL() ) ); - return false; - } - - TQFile file( tempFile ); - if ( !file.open( IO_ReadOnly ) ) { - addressBook()->error( i18n( "Unable to open file '%1'." ).arg( tempFile ) ); - TDEIO::NetAccess::removeTempFile( tempFile ); - return false; - } - - bool result = clearAndLoad( &file ); - if ( !result ) - addressBook()->error( i18n( "Problems during parsing file '%1'." ).arg( tempFile ) ); - - TDEIO::NetAccess::removeTempFile( tempFile ); - - return result; -} - -bool ResourceNet::clearAndLoad( TQFile *file ) -{ - clear(); - return mFormat->loadAll( addressBook(), this, file ); -} - -bool ResourceNet::asyncLoad() -{ - if ( d->mIsLoading ) { - abortAsyncLoading(); - } - - if (d->mIsSaving) { - kdWarning(5700) << "Aborted asyncLoad() because we're still asyncSave()ing!" << endl; - return false; - } - - bool ok = createLocalTempFile(); - if ( ok ) - mTempFile->sync(); - ok = mTempFile->close(); - - if ( !ok ) { - emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) ); - deleteLocalTempFile(); - return false; - } - - KURL dest; - dest.setPath( mTempFile->name() ); - - TDEIO::Scheduler::checkSlaveOnHold( true ); - d->mLoadJob = TDEIO::file_copy( mUrl, dest, -1, true, false, false ); - d->mIsLoading = true; - connect( d->mLoadJob, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( downloadFinished( TDEIO::Job* ) ) ); - - return true; -} - -void ResourceNet::abortAsyncLoading() -{ - kdDebug(5700) << "ResourceNet::abortAsyncLoading()" << endl; - - if ( d->mLoadJob ) { - d->mLoadJob->kill(); // result not emitted - d->mLoadJob = 0; - } - - deleteLocalTempFile(); - d->mIsLoading = false; -} - -void ResourceNet::abortAsyncSaving() -{ - kdDebug(5700) << "ResourceNet::abortAsyncSaving()" << endl; - - if ( d->mSaveJob ) { - d->mSaveJob->kill(); // result not emitted - d->mSaveJob = 0; - } - - deleteLocalTempFile(); - d->mIsSaving = false; -} - -bool ResourceNet::save( Ticket* ) -{ - kdDebug(5700) << "ResourceNet::save()" << endl; - - if (d->mIsSaving) { - abortAsyncSaving(); - } - - KTempFile tempFile; - tempFile.setAutoDelete( true ); - bool ok = false; - - if ( tempFile.status() == 0 && tempFile.file() ) { - saveToFile( tempFile.file() ); - tempFile.sync(); - ok = tempFile.close(); - } - - if ( !ok ) { - addressBook()->error( i18n( "Unable to save file '%1'." ).arg( tempFile.name() ) ); - return false; - } - - ok = TDEIO::NetAccess::upload( tempFile.name(), mUrl, 0 ); - if ( !ok ) - addressBook()->error( i18n( "Unable to upload to '%1'." ).arg( mUrl.prettyURL() ) ); - - return ok; -} - -bool ResourceNet::asyncSave( Ticket* ) -{ - kdDebug(5700) << "ResourceNet::asyncSave()" << endl; - - if (d->mIsSaving) { - abortAsyncSaving(); - } - - if (d->mIsLoading) { - kdWarning(5700) << "Aborted asyncSave() because we're still asyncLoad()ing!" << endl; - return false; - } - - bool ok = createLocalTempFile(); - if ( ok ) { - saveToFile( mTempFile->file() ); - mTempFile->sync(); - ok = mTempFile->close(); - } - - if ( !ok ) { - emit savingError( this, i18n( "Unable to save file '%1'." ).arg( mTempFile->name() ) ); - deleteLocalTempFile(); - return false; - } - - KURL src; - src.setPath( mTempFile->name() ); - - TDEIO::Scheduler::checkSlaveOnHold( true ); - d->mIsSaving = true; - d->mSaveJob = TDEIO::file_copy( src, mUrl, -1, true, false, false ); - connect( d->mSaveJob, TQT_SIGNAL( result( TDEIO::Job* ) ), - this, TQT_SLOT( uploadFinished( TDEIO::Job* ) ) ); - - return true; -} - -bool ResourceNet::createLocalTempFile() -{ - deleteStaleTempFile(); - mTempFile = new KTempFile(); - mTempFile->setAutoDelete( true ); - return mTempFile->status() == 0; -} - -void ResourceNet::deleteStaleTempFile() -{ - if ( hasTempFile() ) { - kdDebug(5700) << "stale temp file detected " << mTempFile->name() << endl; - deleteLocalTempFile(); - } -} - -void ResourceNet::deleteLocalTempFile() -{ - delete mTempFile; - mTempFile = 0; -} - -void ResourceNet::saveToFile( TQFile *file ) -{ - mFormat->saveAll( addressBook(), this, file ); -} - -void ResourceNet::setUrl( const KURL &url ) -{ - mUrl = url; -} - -KURL ResourceNet::url() const -{ - return mUrl; -} - -void ResourceNet::setFormat( const TQString &name ) -{ - mFormatName = name; - if ( mFormat ) - delete mFormat; - - FormatFactory *factory = FormatFactory::self(); - mFormat = factory->format( mFormatName ); -} - -TQString ResourceNet::format() const -{ - return mFormatName; -} - -void ResourceNet::downloadFinished( TDEIO::Job* ) -{ - kdDebug(5700) << "ResourceNet::downloadFinished()" << endl; - - d->mIsLoading = false; - - if ( !hasTempFile() || mTempFile->status() != 0 ) { - d->mLastErrorString = i18n( "Download failed: Unable to create temporary file" ); - TQTimer::singleShot( 0, this, TQT_SLOT( signalError() ) ); - return; - } - - TQFile file( mTempFile->name() ); - if ( file.open( IO_ReadOnly ) ) { - if ( clearAndLoad( &file ) ) - emit loadingFinished( this ); - else - emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mTempFile->name() ) ); - } - else { - emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) ); - } - - deleteLocalTempFile(); -} - -void ResourceNet::uploadFinished( TDEIO::Job *job ) -{ - kdDebug(5700) << "ResourceFile::uploadFinished()" << endl; - - d->mIsSaving = false; - - if ( job->error() ) - emit savingError( this, job->errorString() ); - else - emit savingFinished( this ); - - deleteLocalTempFile(); -} - -void ResourceNet::signalError() -{ - emit loadingError( this, d->mLastErrorString ); - d->mLastErrorString.truncate( 0 ); -} - -#include "resourcenet.moc" diff --git a/kabc/plugins/net/resourcenet.h b/kabc/plugins/net/resourcenet.h deleted file mode 100644 index 940627ecb..000000000 --- a/kabc/plugins/net/resourcenet.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 KABC_RESOURCENET_H -#define KABC_RESOURCENET_H - -#include <tdeconfig.h> - -#include <sys/types.h> - -#include <kabc/resource.h> - -class TQFile; -class TQTimer; -class KTempFile; - -namespace TDEIO { -class Job; -} - -namespace KABC { - -class FormatPlugin; - -/** - @internal -*/ -class KABC_EXPORT ResourceNet : public Resource -{ - Q_OBJECT - - public: - ResourceNet( const TDEConfig* ); - ResourceNet( const KURL &url, const TQString &format ); - ~ResourceNet(); - - virtual void writeConfig( TDEConfig* ); - - virtual bool doOpen(); - virtual void doClose(); - - virtual Ticket *requestSaveTicket(); - virtual void releaseSaveTicket( Ticket* ); - - virtual bool load(); - virtual bool asyncLoad(); - virtual bool save( Ticket* ticket ); - virtual bool asyncSave( Ticket* ticket ); - - /** - Set url of directory to be used for saving. - */ - void setUrl( const KURL & ); - - /** - Return url of directory used for loading and saving the address book. - */ - KURL url() const; - - /** - Sets a new format by name. - */ - void setFormat( const TQString &name ); - - /** - Returns the format name. - */ - TQString format() const; - - protected: - void init( const KURL &url, const TQString &format ); - - private slots: - void downloadFinished( TDEIO::Job* ); - void uploadFinished( TDEIO::Job* ); - void signalError(); - - private: - bool clearAndLoad( TQFile *file ); - void saveToFile( TQFile *file ); - bool hasTempFile() const { return mTempFile != 0; } - void abortAsyncLoading(); - void abortAsyncSaving(); - bool createLocalTempFile(); - void deleteLocalTempFile(); - void deleteStaleTempFile(); - - FormatPlugin *mFormat; - TQString mFormatName; - - KURL mUrl; - KTempFile *mTempFile; - - class ResourceNetPrivate; - ResourceNetPrivate *d; -}; - -} - -#endif diff --git a/kabc/plugins/net/resourcenetconfig.cpp b/kabc/plugins/net/resourcenetconfig.cpp deleted file mode 100644 index b441fbd98..000000000 --- a/kabc/plugins/net/resourcenetconfig.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 <tqlabel.h> -#include <tqlayout.h> - -#include <kdebug.h> -#include <klocale.h> -#include <kdialog.h> - -#include "formatfactory.h" -#include "resourcenet.h" -#include "stdaddressbook.h" - -#include "resourcenetconfig.h" - -using namespace KABC; - -ResourceNetConfig::ResourceNetConfig( TQWidget* parent, const char* name ) - : ConfigWidget( parent, name ), mInEditMode( false ) -{ - TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2, 0, - KDialog::spacingHint() ); - - TQLabel *label = new TQLabel( i18n( "Format:" ), this ); - mFormatBox = new KComboBox( this ); - - mainLayout->addWidget( label, 0, 0 ); - mainLayout->addWidget( mFormatBox, 0, 1 ); - - label = new TQLabel( i18n( "Location:" ), this ); - mUrlEdit = new KURLRequester( this ); - mUrlEdit->setMode( KFile::File ); - - mainLayout->addWidget( label, 1, 0 ); - mainLayout->addWidget( mUrlEdit, 1, 1 ); - - FormatFactory *factory = FormatFactory::self(); - TQStringList formats = factory->formats(); - TQStringList::Iterator it; - for ( it = formats.begin(); it != formats.end(); ++it ) { - FormatInfo *info = factory->info( *it ); - if ( info ) { - mFormatTypes << (*it); - mFormatBox->insertItem( info->nameLabel ); - } - } -} - -void ResourceNetConfig::setEditMode( bool value ) -{ - mFormatBox->setEnabled( !value ); - mInEditMode = value; -} - -void ResourceNetConfig::loadSettings( KRES::Resource *res ) -{ - ResourceNet *resource = dynamic_cast<ResourceNet*>( res ); - - if ( !resource ) { - kdDebug(5700) << "ResourceNetConfig::loadSettings(): cast failed" << endl; - return; - } - - mFormatBox->setCurrentItem( mFormatTypes.findIndex( resource->format() ) ); - - mUrlEdit->setURL( resource->url().url() ); -} - -void ResourceNetConfig::saveSettings( KRES::Resource *res ) -{ - ResourceNet *resource = dynamic_cast<ResourceNet*>( res ); - - if ( !resource ) { - kdDebug(5700) << "ResourceNetConfig::saveSettings(): cast failed" << endl; - return; - } - - if ( !mInEditMode ) - resource->setFormat( mFormatTypes[ mFormatBox->currentItem() ] ); - - resource->setUrl( KURL( mUrlEdit->url() ) ); -} - -#include "resourcenetconfig.moc" diff --git a/kabc/plugins/net/resourcenetconfig.h b/kabc/plugins/net/resourcenetconfig.h deleted file mode 100644 index 3c8986122..000000000 --- a/kabc/plugins/net/resourcenetconfig.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 RESOURCENETCONFIG_H -#define RESOURCENETCONFIG_H - -#include <kcombobox.h> -#include <kurlrequester.h> - -#include <tderesources/configwidget.h> - -namespace KABC { - -class KABC_EXPORT ResourceNetConfig : public KRES::ConfigWidget -{ - Q_OBJECT - - public: - ResourceNetConfig( TQWidget* parent = 0, const char* name = 0 ); - - void setEditMode( bool value ); - - public slots: - void loadSettings( KRES::Resource *resource ); - void saveSettings( KRES::Resource *resource ); - - private: - KComboBox* mFormatBox; - KURLRequester* mUrlEdit; - - TQStringList mFormatTypes; - bool mInEditMode; -}; - -} -#endif diff --git a/kabc/plugins/net/resourcenetplugin.cpp b/kabc/plugins/net/resourcenetplugin.cpp deleted file mode 100644 index 189bab051..000000000 --- a/kabc/plugins/net/resourcenetplugin.cpp +++ /dev/null @@ -1,32 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 "resourcenet.h" -#include "resourcenetconfig.h" - -using namespace KABC; - -extern "C" -{ - KDE_EXPORT void *init_kabc_net() - { - return new KRES::PluginFactory<ResourceNet, ResourceNetConfig>(); - } -} diff --git a/kabc/plugins/sql/Makefile.am b/kabc/plugins/sql/Makefile.am deleted file mode 100644 index 3fa3986ce..000000000 --- a/kabc/plugins/sql/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) - -# these are the headers for your project -noinst_HEADERS = resourcesql.h resourcesqlconfig.h - -kde_module_LTLIBRARIES = kabc_sql.la - -kabc_sql_la_SOURCES = resourcesql.cpp resourcesqlconfig.cpp - -kabc_sql_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) -kabc_sql_la_LIBADD = ../../libkabc.la ../../../tdeui/libtdeui.la - -METASOURCES = AUTO - -messages: rc.cpp - $(XGETTEXT) *.cpp -o $(podir)/kabc_sql.pot - -linkdir = $(kde_datadir)/tderesources/contact -link_DATA = sql.desktop -EXTRA_DIST = $(link_DATA) diff --git a/kabc/plugins/sql/resourcesql.cpp b/kabc/plugins/sql/resourcesql.cpp deleted file mode 100644 index 150fe54eb..000000000 --- a/kabc/plugins/sql/resourcesql.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqsqldatabase.h> -#include <tqsqlcursor.h> - -#include <kdebug.h> -#include <kglobal.h> -#include <klineedit.h> -#include <klocale.h> - -#include "resourcesql.h" -#include "resourcesqlconfig.h" - -using namespace KABC; - -extern "C" -{ - KDE_EXPORT void *init_kabc_sql() - { - return new KRES::PluginFactory<ResourceSql,ResourceSqlConfig>(); - } -} - -ResourceSql::ResourceSql( AddressBook *ab, const TDEConfig *config ) - : Resource( ab ), mDb( 0 ) -{ - TQString user, password, db, host; - - user = config->readEntry( "SqlUser" ); - password = cryptStr( config->readEntry( "SqlPassword " ) ); - db = config->readEntry( "SqlName" ); - host = config->readEntry( "SqlHost" ); - - init( user, password, db, host ); -} - -ResourceSql::ResourceSql( AddressBook *ab, const TQString &user, - const TQString &password, const TQString &db, const TQString &host ) - : Resource( ab ), mDb( 0 ) -{ - init( user, password, db, host ); -} - -void ResourceSql::init( const TQString &user, const TQString &password, - const TQString &db, const TQString &host ) -{ - mUser = user; - mPassword = password; - mDbName = db; - mHost = host; -} - -Ticket *ResourceSql::requestSaveTicket() -{ - if ( !addressBook() ) { - kdDebug(5700) << "no addressbook" << endl; - return 0; - } - - return createTicket( this ); -} - -bool ResourceSql::open() -{ - TQStringList drivers = TQSqlDatabase::drivers(); - for ( TQStringList::Iterator it = drivers.begin(); it != drivers.end(); ++it ) { - kdDebug(5700) << "Driver: " << (*it) << endl; - } - - mDb = TQSqlDatabase::addDatabase( "QMYSQL3" ); - - if ( !mDb ) { - kdDebug(5700) << "Error. Unable to connect to database." << endl; - return false; - } - - mDb->setDatabaseName( mDbName ); - mDb->setUserName( mUser ); - mDb->setPassword( mPassword ); - mDb->setHostName( mHost ); - - if ( !mDb->open() ) { - kdDebug(5700) << "Error. Unable to open database '" << mDbName << "'." << endl; - return false; - } - - return true; -} - -void ResourceSql::close() -{ - mDb->close(); -} - -bool ResourceSql::load() -{ - TQSqlQuery query( "select addressId, name, familyName, givenName, " - "additionalName, prefix, suffix, nickname, birthday, " - "mailer, timezone, geo_latitude, geo_longitude, title, " - "role, organization, note, productId, revision, " - "sortString, url from kaddressbook_main_" + mUser ); - - while ( query.next() ) { - TQString addrId = query.value(0).toString(); - - Addressee addr; - addr.setResource( this ); - addr.setUid( addrId ); - addr.setName( query.value(1).toString() ); - addr.setFamilyName( query.value(2).toString() ); - addr.setGivenName( query.value(3).toString() ); - addr.setAdditionalName( query.value(4).toString() ); - addr.setPrefix( query.value(5).toString() ); - addr.setSuffix( query.value(6).toString() ); - addr.setNickName( query.value(7).toString() ); - addr.setBirthday( query.value(8).toDateTime() ); - addr.setMailer( query.value(9).toString() ); - addr.setTimeZone( TimeZone( query.value(10).toInt() ) ); - addr.setGeo( Geo( query.value(11).toDouble(), query.value(12).toDouble() ) ); - addr.setTitle( query.value(13).toString() ); - addr.setRole( query.value(14).toString() ); - addr.setOrganization( query.value(15).toString() ); - addr.setNote( query.value(16).toString() ); - addr.setProductId( query.value(17).toString() ); - addr.setRevision( query.value(18).toDateTime() ); - addr.setSortString( query.value(19).toString() ); - addr.setUrl( query.value(20).toString() ); - - // emails - { - TQSqlQuery emailsQuery( "select email, preferred from kaddressbook_emails " - "where addressId = '" + addrId + "'" ); - while ( emailsQuery.next() ) - addr.insertEmail( emailsQuery.value( 0 ).toString(), - emailsQuery.value( 1 ).toInt() ); - } - - // phones - { - TQSqlQuery phonesQuery( "select number, type from kaddressbook_phones " - "where addressId = '" + addrId + "'" ); - while ( phonesQuery.next() ) - addr.insertPhoneNumber( PhoneNumber( phonesQuery.value( 0 ).toString(), - phonesQuery.value( 1 ).toInt() ) ); - } - - // addresses - { - TQSqlQuery addressesQuery( "select postOfficeBox, extended, street, " - "locality, region, postalCode, country, label, type " - "from kaddressbook_addresses where addressId = '" + addrId + "'" ); - while ( addressesQuery.next() ) { - Address a; - a.setPostOfficeBox( addressesQuery.value(0).toString() ); - a.setExtended( addressesQuery.value(1).toString() ); - a.setStreet( addressesQuery.value(2).toString() ); - a.setLocality( addressesQuery.value(3).toString() ); - a.setRegion( addressesQuery.value(4).toString() ); - a.setPostalCode( addressesQuery.value(5).toString() ); - a.setCountry( addressesQuery.value(6).toString() ); - a.setLabel( addressesQuery.value(7).toString() ); - a.setType( addressesQuery.value(8).toInt() ); - - addr.insertAddress( a ); - } - } - - // categories - { - TQSqlQuery categoriesQuery( "select category from kaddressbook_categories " - "where addressId = '" + addrId + "'" ); - while ( categoriesQuery.next() ) - addr.insertCategory( categoriesQuery.value( 0 ).toString() ); - } - - // customs - { - TQSqlQuery customsQuery( "select app, name, value from kaddressbook_customs " - "where addressId = '" + addrId + "'" ); - while ( customsQuery.next() ) - addr.insertCustom( customsQuery.value( 0 ).toString(), - customsQuery.value( 1 ).toString(), - customsQuery.value( 2 ).toString()); - } - - addressBook()->insertAddressee( addr ); - } - - return true; -} - -bool ResourceSql::save( Ticket * ) -{ - // we have to delete all entries for this user and reinsert them - TQSqlQuery query( "select addressId from kaddressbook_main_" + mUser ); - - while ( query.next() ) { - TQString addrId = query.value( 0 ).toString(); - TQSqlQuery q; - - q.exec( "DELETE FROM kaddressbook_emails WHERE addressId = '" + addrId + "'" ); - q.exec( "DELETE FROM kaddressbook_phones WHERE addressId = '" + addrId + "'" ); - q.exec( "DELETE FROM kaddressbook_addresses WHERE addressId = '" + addrId + "'" ); - q.exec( "DELETE FROM kaddressbook_categories WHERE addressId = '" + addrId + "'" ); - q.exec( "DELETE FROM kaddressbook_customs WHERE addressId = '" + addrId + "'" ); - - q.exec( "DELETE FROM kaddressbook_main_" + mUser + " WHERE addressId = '" + addrId + "'" ); - } - - // let's start... - AddressBook::Iterator it; - for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { - if ( (*it).resource() != this && (*it).resource() != 0 ) // save only my and new entries - continue; - - TQString uid = (*it).uid(); - - query.exec( "INSERT INTO kaddressbook_main_" + mUser + " VALUES ('" + - (*it).uid() + "','" + - (*it).name() + "','" + - (*it).familyName() + "','" + - (*it).givenName() + "','" + - (*it).additionalName() + "','" + - (*it).prefix() + "','" + - (*it).suffix() + "','" + - (*it).nickName() + "','" + - (*it).birthday().toString( Qt::ISODate ) + "','" + - (*it).mailer() + "','" + - TQString::number( (*it).timeZone().offset() ) + "','" + - TQString::number( (*it).geo().latitude() ) + "','" + - TQString::number( (*it).geo().longitude() ) + "','" + - (*it).title() + "','" + - (*it).role() + "','" + - (*it).organization() + "','" + - (*it).note() + "','" + - (*it).productId() + "','" + - (*it).revision().toString( Qt::ISODate ) + "','" + - (*it).sortString() + "','" + - (*it).url().url() + "')" - ); - - // emails - { - TQStringList emails = (*it).emails(); - TQStringList::ConstIterator it; - bool preferred = true; - for( it = emails.begin(); it != emails.end(); ++it ) { - query.exec("INSERT INTO kaddressbook_emails VALUES ('" + - uid + "','" + - (*it) + "','" + - TQString::number(preferred) + "')"); - preferred = false; - } - } - - // phonenumbers - { - PhoneNumber::List phoneNumberList = (*it).phoneNumbers(); - PhoneNumber::List::ConstIterator it; - for( it = phoneNumberList.begin(); it != phoneNumberList.end(); ++it ) { - query.exec("INSERT INTO kaddressbook_phones VALUES ('" + - uid + "','" + - (*it).number() + "','" + - TQString::number( (*it).type() ) + "')"); - } - } - - // postal addresses - { - Address::List addressList = (*it).addresses(); - Address::List::ConstIterator it; - for( it = addressList.begin(); it != addressList.end(); ++it ) { - query.exec("INSERT INTO kaddressbook_addresses VALUES ('" + - uid + "','" + - (*it).postOfficeBox() + "','" + - (*it).extended() + "','" + - (*it).street() + "','" + - (*it).locality() + "','" + - (*it).region() + "','" + - (*it).postalCode() + "','" + - (*it).country() + "','" + - (*it).label() + "','" + - TQString::number( (*it).type() ) + "')"); - } - } - - // categories - { - TQStringList categories = (*it).categories(); - TQStringList::ConstIterator it; - for( it = categories.begin(); it != categories.end(); ++it ) - query.exec("INSERT INTO kaddressbook_categories VALUES ('" + - uid + "','" + - (*it) + "')"); - } - - // customs - { - TQStringList list = (*it).customs(); - TQStringList::ConstIterator it; - for( it = list.begin(); it != list.end(); ++it ) { - int dashPos = (*it).find( '-' ); - int colonPos = (*it).find( ':' ); - TQString app = (*it).left( dashPos ); - TQString name = (*it).mid( dashPos + 1, colonPos - dashPos - 1 ); - TQString value = (*it).right( (*it).length() - colonPos - 1 ); - - query.exec("INSERT INTO kaddressbook_categories VALUES ('" + - uid + "','" + app + "','" + name + "','" + value + "')"); - } - } - } - - return true; -} - -TQString ResourceSql::identifier() const -{ - return mHost + "_" + mDbName; -} diff --git a/kabc/plugins/sql/resourcesql.h b/kabc/plugins/sql/resourcesql.h deleted file mode 100644 index 770e5b73b..000000000 --- a/kabc/plugins/sql/resourcesql.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_RESOURCESQL_H -#define KABC_RESOURCESQL_H - -#include <tdeconfig.h> - -#include "addressbook.h" -#include "resource.h" - -class TQSqlDatabase; - -namespace KABC { - -class ResourceSql : public Resource -{ -public: - ResourceSql( AddressBook *ab, const TQString &user, const TQString &password, - const TQString &db, const TQString &host ); - ResourceSql( AddressBook *ab, const TDEConfig * ); - - bool open(); - void close(); - - Ticket *requestSaveTicket(); - - bool load(); - bool save( Ticket * ticket ); - - TQString identifier() const; - -private: - void init(const TQString &user, const TQString &password, - const TQString &db, const TQString &host ); - - TQString mUser; - TQString mPassword; - TQString mDbName; - TQString mHost; - - TQSqlDatabase *mDb; -}; - -} -#endif diff --git a/kabc/plugins/sql/resourcesqlconfig.cpp b/kabc/plugins/sql/resourcesqlconfig.cpp deleted file mode 100644 index f62890c3d..000000000 --- a/kabc/plugins/sql/resourcesqlconfig.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqlabel.h> -#include <tqlayout.h> -#include <tqspinbox.h> -#include <tqvbox.h> - -#include <klineedit.h> -#include <klocale.h> - -#include "resource.h" -#include "resourcesqlconfig.h" - -using namespace KABC; - -ResourceSqlConfig::ResourceSqlConfig( TQWidget* parent, const char* name ) - : ResourceConfigWidget( parent, name ) -{ - resize( 290, 170 ); - - TQGridLayout *mainLayout = new TQGridLayout( this, 4, 2 ); - - TQLabel *label = new TQLabel( i18n( "Username:" ), this ); - mUser = new KLineEdit( this ); - - mainLayout->addWidget( label, 0, 0 ); - mainLayout->addWidget( mUser, 0, 1 ); - - label = new TQLabel( i18n( "Password:" ), this ); - mPassword = new KLineEdit( this ); - mPassword->setEchoMode( KLineEdit::Password ); - - mainLayout->addWidget( label, 1, 0 ); - mainLayout->addWidget( mPassword, 1, 1 ); - - label = new TQLabel( i18n( "Host:" ), this ); - mHost = new KLineEdit( this ); - - mainLayout->addWidget( label, 2, 0 ); - mainLayout->addWidget( mHost, 2, 1 ); - - label = new TQLabel( i18n( "Port:" ), this ); - TQVBox *box = new TQVBox(this); - mPort = new TQSpinBox(0, 65535, 1, box ); - mPort->setSizePolicy(TQSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Preferred)); - mPort->setValue(389); - new TQWidget(box, "dummy"); - - mainLayout->addWidget( label, 3, 0 ); - mainLayout->addWidget( box, 3, 1 ); - - label = new TQLabel( i18n( "Database:" ), this ); - mDbName = new KLineEdit( this ); - - mainLayout->addWidget( label, 4, 0 ); - mainLayout->addWidget( mDbName, 4, 1 ); -} - -void ResourceSqlConfig::loadSettings( TDEConfig *config ) -{ - mUser->setText( config->readEntry( "SqlUser" ) ); - mPassword->setText( KABC::Resource::cryptStr( config->readEntry( "SqlPassword" ) ) ); - mDbName->setText( config->readEntry( "SqlName" ) ); - mHost->setText( config->readEntry( "SqlHost" ) ); - mPort->setValue( config->readNumEntry( "SqlPort" ) ); -} - -void ResourceSqlConfig::saveSettings( TDEConfig *config ) -{ - config->writeEntry( "SqlUser", mUser->text() ); - config->writeEntry( "SqlPassword", KABC::Resource::cryptStr( mPassword->text() ) ); - config->writeEntry( "SqlName", mDbName->text() ); - config->writeEntry( "SqlHost", mHost->text() ); - config->writeEntry( "SqlPort", mPort->value() ); -} - -#include "resourcesqlconfig.moc" diff --git a/kabc/plugins/sql/resourcesqlconfig.h b/kabc/plugins/sql/resourcesqlconfig.h deleted file mode 100644 index ae2de7d6d..000000000 --- a/kabc/plugins/sql/resourcesqlconfig.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 RESOURCESQLCONFIG_H -#define RESOURCESQLCONFIG_H - -#include "resourceconfigwidget.h" - -class KLineEdit; -class TQSpinBox; - -namespace KABC { - -class ResourceSqlConfig : public ResourceConfigWidget -{ - Q_OBJECT - -public: - ResourceSqlConfig( TQWidget* parent = 0, const char* name = 0 ); - -public slots: - void loadSettings( TDEConfig *config ); - void saveSettings( TDEConfig *config ); - -private: - KLineEdit* mUser; - KLineEdit* mPassword; - KLineEdit* mDbName; - KLineEdit* mHost; - TQSpinBox* mPort; -}; - -} -#endif diff --git a/kabc/plugins/sql/sql.desktop b/kabc/plugins/sql/sql.desktop deleted file mode 100644 index 4ac553008..000000000 --- a/kabc/plugins/sql/sql.desktop +++ /dev/null @@ -1,10 +0,0 @@ -[Misc] -Name=SQL -Name[bn]=à¦à¦¸-কিউ-à¦à¦² (SQL) -Name[hi]=à¤à¤¸à¤•à¥à¤¯à¥‚à¤à¤² (SQL) -Name[ss]=I-SQL -Name[te]=à°à°¸à±à°•à±à°¯à±à°Žà°²à± - -[Plugin] -Type=sql -X-TDE-Library=kabc_sql diff --git a/kabc/resource.cpp b/kabc/resource.cpp deleted file mode 100644 index 57c8588e8..000000000 --- a/kabc/resource.cpp +++ /dev/null @@ -1,351 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <kdebug.h> -#include <klocale.h> - -#include "resource.h" - -using namespace KABC; - -Ticket::Ticket( Resource *resource ) - : mResource( resource ) -{ -} - -Ticket::~Ticket() -{ -/* FIXME: avoid cycle deletion - if ( mResource ) - mResource->releaseSaveTicket( this ); -*/ -} - -Resource *Ticket::resource() -{ - return mResource; -} - -struct Resource::Iterator::IteratorData -{ - Addressee::Map::Iterator mIt; -}; - -struct Resource::ConstIterator::ConstIteratorData -{ - Addressee::Map::ConstIterator mIt; -}; - -Resource::Iterator::Iterator() -{ - d = new IteratorData; -} - -Resource::Iterator::Iterator( const Resource::Iterator &i ) -{ - d = new IteratorData; - d->mIt = i.d->mIt; -} - -Resource::Iterator &Resource::Iterator::operator=( const Resource::Iterator &i ) -{ - if ( this == &i ) - return *this; - delete d; - - d = new IteratorData; - d->mIt = i.d->mIt; - return *this; -} - -Resource::Iterator::~Iterator() -{ - delete d; -} - -const Addressee &Resource::Iterator::operator*() const -{ - return d->mIt.data(); -} - -Addressee &Resource::Iterator::operator*() -{ - return d->mIt.data(); -} - -Resource::Iterator &Resource::Iterator::operator++() -{ - (d->mIt)++; - return *this; -} - -Resource::Iterator &Resource::Iterator::operator++( int ) -{ - (d->mIt)++; - return *this; -} - -Resource::Iterator &Resource::Iterator::operator--() -{ - (d->mIt)--; - return *this; -} - -Resource::Iterator &Resource::Iterator::operator--( int ) -{ - (d->mIt)--; - return *this; -} - -bool Resource::Iterator::operator==( const Iterator &it ) -{ - return ( d->mIt == it.d->mIt ); -} - -bool Resource::Iterator::operator!=( const Iterator &it ) -{ - return ( d->mIt != it.d->mIt ); -} - -Resource::ConstIterator::ConstIterator() -{ - d = new ConstIteratorData; -} - -Resource::ConstIterator::ConstIterator( const Resource::ConstIterator &i ) -{ - d = new ConstIteratorData; - d->mIt = i.d->mIt; -} - -Resource::ConstIterator::ConstIterator( const Resource::Iterator &i ) -{ - d = new ConstIteratorData; - d->mIt = i.d->mIt; -} - -Resource::ConstIterator &Resource::ConstIterator::operator=( const Resource::ConstIterator &i ) -{ - if ( this == &i ) - return *this; - delete d; - - d = new ConstIteratorData; - d->mIt = i.d->mIt; - return *this; -} - -Resource::ConstIterator::~ConstIterator() -{ - delete d; -} - -const Addressee &Resource::ConstIterator::operator*() const -{ - return *(d->mIt); -} - -Resource::ConstIterator &Resource::ConstIterator::operator++() -{ - (d->mIt)++; - return *this; -} - -Resource::ConstIterator &Resource::ConstIterator::operator++( int ) -{ - (d->mIt)++; - return *this; -} - -Resource::ConstIterator &Resource::ConstIterator::operator--() -{ - (d->mIt)--; - return *this; -} - -Resource::ConstIterator &Resource::ConstIterator::operator--( int ) -{ - (d->mIt)--; - return *this; -} - -bool Resource::ConstIterator::operator==( const ConstIterator &it ) -{ - return ( d->mIt == it.d->mIt ); -} - -bool Resource::ConstIterator::operator!=( const ConstIterator &it ) -{ - return ( d->mIt != it.d->mIt ); -} - - -Resource::Resource( const TDEConfig *config ) - : KRES::Resource( config ), mAddressBook( 0 ) -{ -} - -Resource::~Resource() -{ -} - -Resource::Iterator Resource::begin() -{ - Iterator it; - it.d->mIt = mAddrMap.begin(); - - return it; -} - -Resource::ConstIterator Resource::begin() const -{ - ConstIterator it; - it.d->mIt = mAddrMap.constBegin(); - return it; -} - -Resource::Iterator Resource::end() -{ - Iterator it; - it.d->mIt = mAddrMap.end(); - - return it; -} - -Resource::ConstIterator Resource::end() const -{ - ConstIterator it; - it.d->mIt = mAddrMap.constEnd(); - return it; -} - -void Resource::writeConfig( TDEConfig *config ) -{ - KRES::Resource::writeConfig( config ); -} - -void Resource::setAddressBook( AddressBook *ab ) -{ - mAddressBook = ab; -} - -AddressBook *Resource::addressBook() -{ - return mAddressBook; -} - -Ticket *Resource::createTicket( Resource *resource ) -{ - return new Ticket( resource ); -} - -void Resource::insertAddressee( const Addressee &addr ) -{ - mAddrMap.insert( addr.uid(), addr ); -} - -void Resource::removeAddressee( const Addressee &addr ) -{ - mAddrMap.erase( addr.uid() ); -} - -Addressee Resource::findByUid( const TQString &uid ) -{ - Addressee::Map::ConstIterator it = mAddrMap.find( uid ); - - if ( it != mAddrMap.end() ) - return it.data(); - - return Addressee(); -} - -Addressee::List Resource::findByName( const TQString &name ) -{ - Addressee::List results; - - ConstIterator it; - for ( it = begin(); it != end(); ++it ) { - if ( name == (*it).name() ) - results.append( *it ); - } - - return results; -} - -Addressee::List Resource::findByEmail( const TQString &email ) -{ - Addressee::List results; - const TQString lowerEmail = email.lower(); - - ConstIterator it; - for ( it = begin(); it != end(); ++it ) { - const TQStringList mailList = (*it).emails(); - for ( TQStringList::ConstIterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { - if ( lowerEmail == (*ite).lower() ) - results.append( *it ); - } - } - - return results; -} - -Addressee::List Resource::findByCategory( const TQString &category ) -{ - Addressee::List results; - - ConstIterator it; - for ( it = begin(); it != end(); ++it ) { - if ( (*it).hasCategory( category) ) { - results.append( *it ); - } - } - - return results; -} - -void Resource::clear() -{ - mAddrMap.clear(); -} - -bool Resource::asyncLoad() -{ - bool ok = load(); - if ( !ok ) - emit loadingError( this, i18n( "Loading resource '%1' failed!" ) - .arg( resourceName() ) ); - else - emit loadingFinished( this ); - - return ok; -} - -bool Resource::asyncSave( Ticket *ticket ) { - bool ok = save( ticket ); - if ( !ok ) - emit savingError( this, i18n( "Saving resource '%1' failed!" ) - .arg( resourceName() ) ); - else - emit savingFinished( this ); - - return ok; -} - -#include "resource.moc" diff --git a/kabc/resource.h b/kabc/resource.h deleted file mode 100644 index 0f5167e7b..000000000 --- a/kabc/resource.h +++ /dev/null @@ -1,319 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_RESOURCE_H -#define KABC_RESOURCE_H - -#include <tderesources/resource.h> - -#include "addressbook.h" -#include "plugin.h" - -namespace KABC { - -/** - * @short Helper class for handling coordinated save of address books. - * - * This class is used as helper class for saving address book. - * @see requestSaveTicket(), save(). - */ -class KABC_EXPORT Ticket -{ - friend class Resource; - - public: - ~Ticket(); - - Resource *resource(); - - private: - Ticket( Resource *resource ); - - Resource *mResource; -}; - -/** - * @internal - */ -class KABC_EXPORT Resource : public KRES::Resource -{ - Q_OBJECT - - public: - - /** - @short Resource Iterator - - This class provides an iterator for resource entries. - By default it points to a TQValueList<Addressee>::Iterator, - but you can reimplement this class to fit your own needs. - */ - class KABC_EXPORT Iterator - { - public: - Iterator(); - Iterator( const Iterator & ); - virtual ~Iterator(); - - virtual Iterator &operator=( const Iterator & ); - virtual const Addressee &operator*() const; - virtual Addressee &operator*(); - virtual Iterator &operator++(); - virtual Iterator &operator++( int ); - virtual Iterator &operator--(); - virtual Iterator &operator--( int ); - virtual bool operator==( const Iterator &it ); - virtual bool operator!=( const Iterator &it ); - - struct IteratorData; - IteratorData *d; - }; - - /** - @short Resource Const Iterator - - This class provides a const iterator for resource entries. - */ - class KABC_EXPORT ConstIterator - { - public: - ConstIterator(); - ConstIterator( const ConstIterator & ); - ConstIterator( const Iterator & ); - virtual ~ConstIterator(); - - virtual ConstIterator &operator=( const ConstIterator & ); - virtual const Addressee &operator*() const ; - virtual ConstIterator &operator++(); - virtual ConstIterator &operator++( int ); - virtual ConstIterator &operator--(); - virtual ConstIterator &operator--( int ); - virtual bool operator==( const ConstIterator &it ); - virtual bool operator!=( const ConstIterator &it ); - - struct ConstIteratorData; - ConstIteratorData *d; - }; - - /** - Constructor. - - @param config The config object where the derived classes can - read out their settings. - */ - Resource( const TDEConfig *config ); - - /** - Destructor. - */ - virtual ~Resource(); - - /** - Returns an iterator pointing to the first addressee in the resource. - This iterator equals end() if the resource is empty. - */ - virtual ConstIterator begin() const; - - /** - This is an overloaded member function, provided for convenience. It - behaves essentially like the above function. - */ - virtual Iterator begin(); - - /** - Returns an iterator pointing to the last addressee in the resource. - This iterator equals begin() if the resource is empty. - */ - virtual ConstIterator end() const; - - /** - This is an overloaded member function, provided for convenience. It - behaves essentially like the above function. - */ - virtual Iterator end(); - - /** - Returns a pointer to the addressbook. - */ - AddressBook *addressBook(); - - /** - Writes the resource specific config to file. - */ - virtual void writeConfig( TDEConfig *config ); - - /** - Request a ticket, you have to pass through save() to - allow locking. The resource has to create its locks - in this function. - */ - virtual Ticket *requestSaveTicket() = 0; - - /** - Releases the ticket previousely requested with requestSaveTicket(). - The resource has to remove its locks in this function. - This function is also responsible for deleting the ticket. - */ - virtual void releaseSaveTicket( Ticket* ) = 0; - - /** - Loads all addressees synchronously. - - @returns Whether the loading was successfully. - */ - virtual bool load() = 0; - - /** - Loads all addressees asyncronously. You have to make sure that either - the loadingFinished() or loadingError() signal is emitted from within - this function. - - The default implementation simply calls the synchronous load. - - @return Whether the synchronous part of loading was successfully. - */ - virtual bool asyncLoad(); - - /** - Insert an addressee into the resource. - */ - virtual void insertAddressee( const Addressee& ); - - /** - Removes an addressee from resource. - */ - virtual void removeAddressee( const Addressee& addr ); - - /** - Saves all addressees synchronously. - - @param ticket You have to release the ticket later with - releaseSaveTicket() explicitely. - @return Whether the saving was successfully. - */ - virtual bool save( Ticket *ticket ) = 0; - - /** - Saves all addressees asynchronously. You have to make sure that either - the savingFinished() or savingError() signal is emitted from within - this function. - - The default implementation simply calls the synchronous save. - - @param ticket You have to release the ticket later with - releaseSaveTicket() explicitely. - @return Whether the saving was successfully. - */ - virtual bool asyncSave( Ticket *ticket ); - - /** - Searches an addressee with the specified unique identifier. - - @param uid The unique identifier you are looking for. - @return The addressee with the specified unique identifier or an - empty addressee. - */ - virtual Addressee findByUid( const TQString &uid ); - - /** - Searches all addressees which match the specified name. - - @param name The name you are looking for. - @return A list of all matching addressees. - */ - virtual Addressee::List findByName( const TQString &name ); - - /** - Searches all addressees which match the specified email address. - - @param email The email address you are looking for. - @return A list of all matching addressees. - */ - virtual Addressee::List findByEmail( const TQString &email ); - - /** - Searches all addressees which belongs to the specified category. - - @param category The category you are looking for. - @return A list of all matching addressees. - */ - virtual Addressee::List findByCategory( const TQString &category ); - - /** - Removes all addressees from the resource. - */ - virtual void clear(); - - /** - @internal - - Sets the address book of the resource. - */ - void setAddressBook( AddressBook* ); - - signals: - /** - This signal is emitted when the resource has finished the loading of all - addressees from the backend to the internal cache. - - @param resource The pointer to the resource which emitted this signal. - */ - void loadingFinished( Resource *resource ); - - /** - This signal is emitted when an error occured during loading the - addressees from the backend to the internal cache. - - @param resource The pointer to the resource which emitted this signal. - @param msg A translated error message. - */ - void loadingError( Resource *resource, const TQString &msg ); - - /** - This signal is emitted when the resource has finished the saving of all - addressees from the internal cache to the backend. - - @param resource The pointer to the resource which emitted this signal. - */ - void savingFinished( Resource *resource ); - - /** - This signal is emitted when an error occured during saving the - addressees from the internal cache to the backend. - - @param resource The pointer to the resource which emitted this signal. - @param msg A translated error message. - */ - void savingError( Resource *resource, const TQString &msg ); - - protected: - Ticket *createTicket( Resource * ); - Addressee::Map mAddrMap; - - private: - AddressBook *mAddressBook; - - class ResourcePrivate; - ResourcePrivate *d; -}; - -} - -#endif diff --git a/kabc/resourceselectdialog.cpp b/kabc/resourceselectdialog.cpp deleted file mode 100644 index 3b6e25752..000000000 --- a/kabc/resourceselectdialog.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <klocale.h> -#include <kbuttonbox.h> -#include <tdelistbox.h> -#include <kstdguiitem.h> - -#include <tqgroupbox.h> -#include <tqlayout.h> - -#include "resource.h" -#include "addressbook.h" - -#include "resourceselectdialog.h" - -using namespace KABC; - -ResourceSelectDialog::ResourceSelectDialog( AddressBook *ab, TQWidget *parent, const char *name ) - : KDialog( parent, name, true ) -{ - setCaption( i18n( "Resource Selection" ) ); - resize( 300, 200 ); - - TQVBoxLayout *mainLayout = new TQVBoxLayout( this ); - mainLayout->setMargin( marginHint() ); - - TQGroupBox *groupBox = new TQGroupBox( 2, Qt::Horizontal, this ); - groupBox->setTitle( i18n( "Resources" ) ); - - mResourceId = new TDEListBox( groupBox ); - - mainLayout->addWidget( groupBox ); - - mainLayout->addSpacing( 10 ); - - KButtonBox *buttonBox = new KButtonBox( this ); - - buttonBox->addStretch(); - buttonBox->addButton( KStdGuiItem::ok(), TQT_TQOBJECT(this), TQT_SLOT( accept() ) ); - buttonBox->addButton( KStdGuiItem::cancel(), TQT_TQOBJECT(this), TQT_SLOT( reject() ) ); - buttonBox->layout(); - - mainLayout->addWidget( buttonBox ); - - // setup listbox - uint counter = 0; - TQPtrList<Resource> list = ab->resources(); - for ( uint i = 0; i < list.count(); ++i ) { - Resource *resource = list.at( i ); - if ( resource && !resource->readOnly() ) { - mResourceMap.insert( counter, resource ); - mResourceId->insertItem( resource->resourceName() ); - counter++; - } - } - - mResourceId->setCurrentItem( 0 ); -} - -Resource *ResourceSelectDialog::resource() -{ - if ( mResourceId->currentItem() != -1 ) - return mResourceMap[ mResourceId->currentItem() ]; - else - return 0; -} - -Resource *ResourceSelectDialog::getResource( AddressBook *ab, TQWidget *parent ) -{ - TQPtrList<Resource> resources = ab->resources(); - if ( resources.count() == 1 ) return resources.first(); - - Resource *found = 0; - Resource *r = resources.first(); - while( r ) { - if ( !r->readOnly() ) { - if ( found ) { - found = 0; - break; - } else { - found = r; - } - } - r = resources.next(); - } - if ( found ) return found; - - ResourceSelectDialog dlg( ab, parent ); - if ( dlg.exec() == KDialog::Accepted ) return dlg.resource(); - else return 0; -} - -#include "resourceselectdialog.moc" diff --git a/kabc/resourceselectdialog.h b/kabc/resourceselectdialog.h deleted file mode 100644 index f5f2d6984..000000000 --- a/kabc/resourceselectdialog.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_RESOURCESELECTDIALOG_H -#define KABC_RESOURCESELECTDIALOG_H - -#include <tqmap.h> - -#include <kdialog.h> -#include <kdemacros.h> - -class TDEListBox; - -namespace KABC { - -class AddressBook; -class Resource; - -/** - This class is @deprecated, use KRES::SelectDialog instead. - */ -class KABC_EXPORT_DEPRECATED ResourceSelectDialog : KDialog -{ - Q_OBJECT - - public: - ResourceSelectDialog( AddressBook *ab, TQWidget *parent = 0, - const char *name = 0); - Resource *resource(); - - static Resource *getResource( AddressBook *ab, TQWidget *parent = 0 ); - - private: - TDEListBox *mResourceId; - TQMap<int, Resource*> mResourceMap; -}; - -} - -#endif diff --git a/kabc/scripts/Makefile.am b/kabc/scripts/Makefile.am deleted file mode 100644 index 7715fba5c..000000000 --- a/kabc/scripts/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -EXTRA_DIST = $(srcdir)/makeaddressee \ - $(srcdir)/addressee.src.cpp \ - $(srcdir)/addressee.src.h \ - $(srcdir)/entrylist \ - $(srcdir)/field.src.cpp - diff --git a/kabc/scripts/addressee.src.cpp b/kabc/scripts/addressee.src.cpp deleted file mode 100644 index 9aff3a708..000000000 --- a/kabc/scripts/addressee.src.cpp +++ /dev/null @@ -1,1127 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> - Copyright (c) 2003 Carsten Pfeiffer <pfeiffer@kde.org> - Copyright (c) 2005 Ingo Kloecker <kloecker@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 <tqregexp.h> - -#include <ksharedptr.h> -#include <kdebug.h> -#include <tdeapplication.h> -#include <klocale.h> - -#include "addresseehelper.h" -#include "field.h" -#include "resource.h" -#include "sortmode.h" - -#include "addressee.h" - -using namespace KABC; - -static bool matchBinaryPattern( int value, int pattern ); - -template <class L> -static bool listEquals( const TQValueList<L>&, const TQValueList<L>& ); -static bool emailsEquals( const TQStringList&, const TQStringList& ); - -KABC::SortMode *Addressee::mSortMode = 0; - -struct Addressee::AddresseeData : public TDEShared -{ - TQString uid; - TQString uri; - --VARIABLES-- - - PhoneNumber::List phoneNumbers; - Address::List addresses; - Key::List keys; - TQStringList emails; - TQStringList categories; - TQStringList custom; - - Resource *resource; - - bool empty :1; - bool changed :1; -}; - -Addressee::AddresseeData* Addressee::shared_null = 0; - -Addressee::AddresseeData* Addressee::makeSharedNull() -{ - Addressee::shared_null = new AddresseeData; - shared_null->_TDEShared_ref(); //just in case (we should add KSD) - shared_null->empty = true; - shared_null->changed = false; - shared_null->resource = 0; - return shared_null; -} - -Addressee::Addressee() -{ - mData = shared_null ? shared_null : makeSharedNull(); -} - -Addressee::~Addressee() -{ -} - -Addressee::Addressee( const Addressee &a ) -{ - mData = a.mData; -} - -Addressee &Addressee::operator=( const Addressee &a ) -{ - if ( this == &a ) - return (*this); - - mData = a.mData; - return (*this); -} - -void Addressee::detach() -{ - if ( mData.data() == shared_null ) { - mData = new AddresseeData; - mData->empty = true; - mData->changed = false; - mData->resource = 0; - mData->uid = TDEApplication::randomString( 10 ); - return; - } else if ( mData.count() == 1 ) return; - - AddresseeData data = *mData; - mData = new AddresseeData( data ); -} - -bool Addressee::operator==( const Addressee &a ) const -{ - if ( uid() != a.uid() ) { - kdDebug(5700) << "uid differs" << endl; - return false; - } - --EQUALSTEST-- - if ( ( mData->url.isValid() || a.mData->url.isValid() ) && - ( mData->url != a.mData->url ) ) { - kdDebug(5700) << "url differs" << endl; - return false; - } - if ( !listEquals( mData->phoneNumbers, a.mData->phoneNumbers ) ) { - kdDebug(5700) << "phoneNumbers differs" << endl; - return false; - } - if ( !listEquals( mData->addresses, a.mData->addresses ) ) { - kdDebug(5700) << "addresses differs" << endl; - return false; - } - if ( !listEquals( mData->keys, a.mData->keys ) ) { - kdDebug(5700) << "keys differs" << endl; - return false; - } - if ( !emailsEquals( mData->emails, a.mData->emails ) ) { - kdDebug(5700) << "emails differs" << endl; - return false; - } - if ( !listEquals( mData->categories, a.mData->categories ) ) { - kdDebug(5700) << "categories differs" << endl; - return false; - } - if ( !listEquals( mData->custom, a.mData->custom ) ) { - kdDebug(5700) << "custom differs" << endl; - return false; - } - - return true; -} - -bool Addressee::operator!=( const Addressee &a ) const -{ - return !( a == *this ); -} - -bool Addressee::isEmpty() const -{ - return mData->empty; -} - -void Addressee::setUid( const TQString &id ) -{ - if ( id == mData->uid ) return; - detach(); - mData->empty = false; - mData->uid = id; -} - -TQString Addressee::uid() const -{ - return mData->uid; -} - -TQString Addressee::uidLabel() -{ - return i18n("Unique Identifier"); -} - -void Addressee::setUri( const TQString &id ) -{ - if ( id == mData->uri ) return; - detach(); - mData->empty = false; - mData->uri = id; -} - -TQString Addressee::uri() const -{ - return mData->uri; -} - -TQString Addressee::uriLabel() -{ - return i18n("Unique Resource Identifier"); -} - ---DEFINITIONS-- - -void Addressee::setNameFromString( const TQString &s ) -{ - TQString str = s; - //remove enclosing quotes from string - if ( str.length() > 1 && s[ 0 ] == '"' && s[ s.length() - 1 ] == '"' ) - str = s.mid( 1, s.length() - 2 ); - - setFormattedName( str ); - setName( str ); - - // clear all name parts - setPrefix( TQString() ); - setGivenName( TQString() ); - setAdditionalName( TQString() ); - setFamilyName( TQString() ); - setSuffix( TQString() ); - - if ( str.isEmpty() ) - return; - - TQString spaceStr = " "; - TQString emptyStr = ""; - AddresseeHelper *helper = AddresseeHelper::self(); - - int i = str.find( ',' ); - if( i < 0 ) { - TQStringList parts = TQStringList::split( spaceStr, str ); - int leftOffset = 0; - int rightOffset = parts.count() - 1; - - TQString suffix; - while ( rightOffset >= 0 ) { - if ( helper->containsSuffix( parts[ rightOffset ] ) ) { - suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? emptyStr : spaceStr)); - rightOffset--; - } else - break; - } - setSuffix( suffix ); - - if ( rightOffset < 0 ) - return; - - TQStringList inclusionList; - for ( int n = 1; (rightOffset - n >= 0) && (n < 4); ++n ) { - if ( helper->containsPrefix( parts[ rightOffset - n ].lower() ) ) { - inclusionList.prepend( parts[ rightOffset - n ] ); - } else - break; - } - - if ( !inclusionList.isEmpty() ) { - setFamilyName( inclusionList.join( " " ) + spaceStr + parts[ rightOffset ] ); - rightOffset -= inclusionList.count(); - } else { - if ( helper->tradeAsFamilyName() ) - setFamilyName( parts[ rightOffset ] ); - else - setGivenName( parts[ rightOffset ] ); - } - - TQString prefix; - while ( leftOffset < rightOffset ) { - if ( helper->containsTitle( parts[ leftOffset ] ) ) { - prefix.append( ( prefix.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); - leftOffset++; - } else - break; - } - setPrefix( prefix ); - - if ( leftOffset < rightOffset ) { - setGivenName( parts[ leftOffset ] ); - leftOffset++; - } - - TQString additionalName; - while ( leftOffset < rightOffset ) { - additionalName.append( ( additionalName.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); - leftOffset++; - } - setAdditionalName( additionalName ); - } else { - TQString part1 = str.left( i ); - TQString part2 = str.mid( i + 1 ); - - TQStringList parts = TQStringList::split( spaceStr, part1 ); - int leftOffset = 0; - int rightOffset = parts.count() - 1; - - if ( parts.count() > 0 ) { - - TQString suffix; - while ( rightOffset >= 0 ) { - if ( helper->containsSuffix( parts[ rightOffset ] ) ) { - suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? emptyStr : spaceStr)); - rightOffset--; - } else - break; - } - setSuffix( suffix ); - - if ( rightOffset - 1 >= 0 && helper->containsPrefix( parts[ rightOffset - 1 ].lower() ) ) { - setFamilyName( parts[ rightOffset - 1 ] + spaceStr + parts[ rightOffset ] ); - rightOffset--; - } else - setFamilyName( parts[ rightOffset ] ); - - TQString prefix; - while ( leftOffset < rightOffset ) { - if ( helper->containsTitle( parts[ leftOffset ] ) ) { - prefix.append( ( prefix.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); - leftOffset++; - } else - break; - } - } else { - setPrefix( "" ); - setFamilyName( "" ); - setSuffix( "" ); - } - - parts = TQStringList::split( spaceStr, part2 ); - - leftOffset = 0; - rightOffset = parts.count(); - - if ( parts.count() > 0 ) { - - TQString prefix; - while ( leftOffset < rightOffset ) { - if ( helper->containsTitle( parts[ leftOffset ] ) ) { - prefix.append( ( prefix.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); - leftOffset++; - } else - break; - } - setPrefix( prefix ); - - if ( leftOffset < rightOffset ) { - setGivenName( parts[ leftOffset ] ); - leftOffset++; - } - - TQString additionalName; - while ( leftOffset < rightOffset ) { - additionalName.append( ( additionalName.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); - leftOffset++; - } - setAdditionalName( additionalName ); - } else { - setGivenName( "" ); - setAdditionalName( "" ); - } - } -} - -TQString Addressee::realName() const -{ - TQString n( formattedName() ); - if ( !n.isEmpty() ) - return n; - - n = assembledName(); - if ( !n.isEmpty() ) - return n; - - n = name(); - if ( !n.isEmpty() ) - return n; - - return organization(); -} - -TQString Addressee::assembledName() const -{ - TQString name = prefix() + " " + givenName() + " " + additionalName() + " " + - familyName() + " " + suffix(); - - return name.simplifyWhiteSpace(); -} - -TQString Addressee::fullEmail( const TQString &email ) const -{ - TQString e; - if ( email.isNull() ) { - e = preferredEmail(); - } else { - e = email; - } - if ( e.isEmpty() ) return TQString(); - - TQString text; - if ( realName().isEmpty() ) - text = e; - else { - TQRegExp needQuotes( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ); - if ( realName().find( needQuotes ) != -1 ) { - TQString name = realName(); - name.replace( "\"", "\\\"" ); - text = "\"" + name + "\" <" + e + ">"; - } else - text = realName() + " <" + e + ">"; - } - - return text; -} - -void Addressee::insertEmail( const TQString &email, bool preferred ) -{ - if ( email.simplifyWhiteSpace().isEmpty() ) - return; - - detach(); - mData->empty = false; - - TQStringList::Iterator it = mData->emails.find( email ); - - if ( it != mData->emails.end() ) { - if ( !preferred || it == mData->emails.begin() ) return; - mData->emails.remove( it ); - mData->emails.prepend( email ); - } else { - if ( preferred ) { - mData->emails.prepend( email ); - } else { - mData->emails.append( email ); - } - } -} - -void Addressee::removeEmail( const TQString &email ) -{ - detach(); - - TQStringList::Iterator it = mData->emails.find( email ); - if ( it == mData->emails.end() ) return; - - mData->emails.remove( it ); -} - -TQString Addressee::preferredEmail() const -{ - if ( mData->emails.count() == 0 ) return TQString(); - else return mData->emails.first(); -} - -TQStringList Addressee::emails() const -{ - return mData->emails; -} -void Addressee::setEmails( const TQStringList& emails ) { - detach(); - - mData->emails = emails; -} -void Addressee::insertPhoneNumber( const PhoneNumber &phoneNumber ) -{ - detach(); - mData->empty = false; - - PhoneNumber::List::Iterator it; - for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { - if ( (*it).id() == phoneNumber.id() ) { - *it = phoneNumber; - return; - } - } - if ( !phoneNumber.number().simplifyWhiteSpace().isEmpty() ) - mData->phoneNumbers.append( phoneNumber ); -} - -void Addressee::removePhoneNumber( const PhoneNumber &phoneNumber ) -{ - detach(); - - PhoneNumber::List::Iterator it; - for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { - if ( (*it).id() == phoneNumber.id() ) { - mData->phoneNumbers.remove( it ); - return; - } - } -} - -PhoneNumber Addressee::phoneNumber( int type ) const -{ - PhoneNumber phoneNumber( "", type ); - PhoneNumber::List::ConstIterator it; - for( it = mData->phoneNumbers.constBegin(); it != mData->phoneNumbers.constEnd(); ++it ) { - if ( matchBinaryPattern( (*it).type(), type ) ) { - if ( (*it).type() & PhoneNumber::Pref ) - return (*it); - else if ( phoneNumber.number().isEmpty() ) - phoneNumber = (*it); - } - } - - return phoneNumber; -} - -PhoneNumber::List Addressee::phoneNumbers() const -{ - return mData->phoneNumbers; -} - -PhoneNumber::List Addressee::phoneNumbers( int type ) const -{ - PhoneNumber::List list; - - PhoneNumber::List::ConstIterator it; - for( it = mData->phoneNumbers.constBegin(); it != mData->phoneNumbers.constEnd(); ++it ) { - if ( matchBinaryPattern( (*it).type(), type ) ) { - list.append( *it ); - } - } - return list; -} - -PhoneNumber Addressee::findPhoneNumber( const TQString &id ) const -{ - PhoneNumber::List::ConstIterator it; - for( it = mData->phoneNumbers.constBegin(); it != mData->phoneNumbers.constEnd(); ++it ) { - if ( (*it).id() == id ) { - return *it; - } - } - return PhoneNumber(); -} - -void Addressee::insertKey( const Key &key ) -{ - detach(); - mData->empty = false; - - Key::List::Iterator it; - for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { - if ( (*it).id() == key.id() ) { - *it = key; - return; - } - } - mData->keys.append( key ); -} - -void Addressee::removeKey( const Key &key ) -{ - detach(); - - Key::List::Iterator it; - for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { - if ( (*it).id() == key.id() ) { - mData->keys.remove( key ); - return; - } - } -} - -Key Addressee::key( int type, TQString customTypeString ) const -{ - Key::List::ConstIterator it; - for( it = mData->keys.constBegin(); it != mData->keys.constEnd(); ++it ) { - if ( (*it).type() == type ) { - if ( type == Key::Custom ) { - if ( customTypeString.isEmpty() ) { - return *it; - } else { - if ( (*it).customTypeString() == customTypeString ) - return (*it); - } - } else { - return *it; - } - } - } - return Key( TQString(), type ); -} - -void Addressee::setKeys( const Key::List& list ) -{ - detach(); - mData->keys = list; -} - -Key::List Addressee::keys() const -{ - return mData->keys; -} - -Key::List Addressee::keys( int type, TQString customTypeString ) const -{ - Key::List list; - - Key::List::ConstIterator it; - for( it = mData->keys.constBegin(); it != mData->keys.constEnd(); ++it ) { - if ( (*it).type() == type ) { - if ( type == Key::Custom ) { - if ( customTypeString.isEmpty() ) { - list.append( *it ); - } else { - if ( (*it).customTypeString() == customTypeString ) - list.append( *it ); - } - } else { - list.append( *it ); - } - } - } - return list; -} - -Key Addressee::findKey( const TQString &id ) const -{ - Key::List::ConstIterator it; - for( it = mData->keys.constBegin(); it != mData->keys.constEnd(); ++it ) { - if ( (*it).id() == id ) { - return *it; - } - } - return Key(); -} - -TQString Addressee::asString() const -{ - return "Smith, agent Smith..."; -} - -void Addressee::dump() const -{ - kdDebug(5700) << "Addressee {" << endl; - - kdDebug(5700) << " Uid: '" << uid() << "'" << endl; - - --DEBUG-- - - kdDebug(5700) << " Emails {" << endl; - const TQStringList e = emails(); - TQStringList::ConstIterator it; - for( it = e.begin(); it != e.end(); ++it ) { - kdDebug(5700) << " " << (*it) << endl; - } - kdDebug(5700) << " }" << endl; - - kdDebug(5700) << " PhoneNumbers {" << endl; - const PhoneNumber::List p = phoneNumbers(); - PhoneNumber::List::ConstIterator it2; - for( it2 = p.begin(); it2 != p.end(); ++it2 ) { - kdDebug(5700) << " Type: " << int((*it2).type()) << " Number: " << (*it2).number() << endl; - } - kdDebug(5700) << " }" << endl; - - const Address::List a = addresses(); - Address::List::ConstIterator it3; - for( it3 = a.begin(); it3 != a.end(); ++it3 ) { - (*it3).dump(); - } - - kdDebug(5700) << " Keys {" << endl; - const Key::List k = keys(); - Key::List::ConstIterator it4; - for( it4 = k.begin(); it4 != k.end(); ++it4 ) { - kdDebug(5700) << " Type: " << int((*it4).type()) << - " Key: " << (*it4).textData() << - " CustomString: " << (*it4).customTypeString() << endl; - } - kdDebug(5700) << " }" << endl; - - kdDebug(5700) << "}" << endl; -} - - -void Addressee::insertAddress( const Address &address ) -{ - if ( address.isEmpty() ) - return; - - detach(); - mData->empty = false; - - Address::List::Iterator it; - for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { - if ( (*it).id() == address.id() ) { - *it = address; - return; - } - } - - mData->addresses.append( address ); -} - -void Addressee::removeAddress( const Address &address ) -{ - detach(); - - Address::List::Iterator it; - for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { - if ( (*it).id() == address.id() ) { - mData->addresses.remove( it ); - return; - } - } -} - -Address Addressee::address( int type ) const -{ - Address address( type ); - Address::List::ConstIterator it; - for( it = mData->addresses.constBegin(); it != mData->addresses.constEnd(); ++it ) { - if ( matchBinaryPattern( (*it).type(), type ) ) { - if ( (*it).type() & Address::Pref ) - return (*it); - else if ( address.isEmpty() ) - address = (*it); - } - } - - return address; -} - -Address::List Addressee::addresses() const -{ - return mData->addresses; -} - -Address::List Addressee::addresses( int type ) const -{ - Address::List list; - - Address::List::ConstIterator it; - for( it = mData->addresses.constBegin(); it != mData->addresses.constEnd(); ++it ) { - if ( matchBinaryPattern( (*it).type(), type ) ) { - list.append( *it ); - } - } - - return list; -} - -Address Addressee::findAddress( const TQString &id ) const -{ - Address::List::ConstIterator it; - for( it = mData->addresses.constBegin(); it != mData->addresses.constEnd(); ++it ) { - if ( (*it).id() == id ) { - return *it; - } - } - return Address(); -} - -void Addressee::insertCategory( const TQString &c ) -{ - detach(); - mData->empty = false; - - if ( mData->categories.findIndex( c ) != -1 ) return; - - mData->categories.append( c ); -} - -void Addressee::removeCategory( const TQString &c ) -{ - detach(); - - TQStringList::Iterator it = mData->categories.find( c ); - if ( it == mData->categories.end() ) return; - - mData->categories.remove( it ); -} - -bool Addressee::hasCategory( const TQString &c ) const -{ - return ( mData->categories.findIndex( c ) != -1 ); -} - -void Addressee::setCategories( const TQStringList &c ) -{ - detach(); - mData->empty = false; - - mData->categories = c; -} - -TQStringList Addressee::categories() const -{ - return mData->categories; -} - -void Addressee::insertCustom( const TQString &app, const TQString &name, - const TQString &value ) -{ - if ( value.isEmpty() || name.isEmpty() || app.isEmpty() ) return; - - detach(); - mData->empty = false; - - TQString qualifiedName = app + "-" + name + ":"; - - TQStringList::Iterator it; - for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { - if ( (*it).startsWith( qualifiedName ) ) { - (*it) = qualifiedName + value; - return; - } - } - - mData->custom.append( qualifiedName + value ); -} - -void Addressee::removeCustom( const TQString &app, const TQString &name) -{ - detach(); - - TQString qualifiedName = app + "-" + name + ":"; - - TQStringList::Iterator it; - for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { - if ( (*it).startsWith( qualifiedName ) ) { - mData->custom.remove( it ); - return; - } - } -} - -TQString Addressee::custom( const TQString &app, const TQString &name ) const -{ - TQString qualifiedName = app + "-" + name + ":"; - TQString value; - - TQStringList::ConstIterator it; - for( it = mData->custom.constBegin(); it != mData->custom.constEnd(); ++it ) { - if ( (*it).startsWith( qualifiedName ) ) { - value = (*it).mid( (*it).find( ":" ) + 1 ); - break; - } - } - - return value; -} - -void Addressee::setCustoms( const TQStringList &l ) -{ - detach(); - mData->empty = false; - - mData->custom = l; -} - -TQStringList Addressee::customs() const -{ - return mData->custom; -} - -void Addressee::parseEmailAddress( const TQString &rawEmail, TQString &fullName, - TQString &email) -{ - // This is a simplified version of KPIM::splitAddress(). - - fullName = ""; - email = ""; - if ( rawEmail.isEmpty() ) - return; // KPIM::AddressEmpty; - - // The code works on 8-bit strings, so convert the input to UTF-8. - TQCString address = rawEmail.utf8(); - - TQCString displayName; - TQCString addrSpec; - TQCString comment; - - // The following is a primitive parser for a mailbox-list (cf. RFC 2822). - // The purpose is to extract a displayable string from the mailboxes. - // Comments in the addr-spec are not handled. No error checking is done. - - enum { TopLevel, InComment, InAngleAddress } context = TopLevel; - bool inQuotedString = false; - int commentLevel = 0; - bool stop = false; - - for ( char* p = address.data(); *p && !stop; ++p ) { - switch ( context ) { - case TopLevel : { - switch ( *p ) { - case '"' : inQuotedString = !inQuotedString; - displayName += *p; - break; - case '(' : if ( !inQuotedString ) { - context = InComment; - commentLevel = 1; - } - else - displayName += *p; - break; - case '<' : if ( !inQuotedString ) { - context = InAngleAddress; - } - else - displayName += *p; - break; - case '\\' : // quoted character - displayName += *p; - ++p; // skip the '\' - if ( *p ) - displayName += *p; - else - //return KPIM::UnexpectedEnd; - goto ABORT_PARSING; - break; - case ',' : if ( !inQuotedString ) { - //if ( allowMultipleAddresses ) - // stop = true; - //else - // return KPIM::UnexpectedComma; - goto ABORT_PARSING; - } - else - displayName += *p; - break; - default : displayName += *p; - } - break; - } - case InComment : { - switch ( *p ) { - case '(' : ++commentLevel; - comment += *p; - break; - case ')' : --commentLevel; - if ( commentLevel == 0 ) { - context = TopLevel; - comment += ' '; // separate the text of several comments - } - else - comment += *p; - break; - case '\\' : // quoted character - comment += *p; - ++p; // skip the '\' - if ( *p ) - comment += *p; - else - //return KPIM::UnexpectedEnd; - goto ABORT_PARSING; - break; - default : comment += *p; - } - break; - } - case InAngleAddress : { - switch ( *p ) { - case '"' : inQuotedString = !inQuotedString; - addrSpec += *p; - break; - case '>' : if ( !inQuotedString ) { - context = TopLevel; - } - else - addrSpec += *p; - break; - case '\\' : // quoted character - addrSpec += *p; - ++p; // skip the '\' - if ( *p ) - addrSpec += *p; - else - //return KPIM::UnexpectedEnd; - goto ABORT_PARSING; - break; - default : addrSpec += *p; - } - break; - } - } // switch ( context ) - } - -ABORT_PARSING: - displayName = displayName.stripWhiteSpace(); - comment = comment.stripWhiteSpace(); - addrSpec = addrSpec.stripWhiteSpace(); - - fullName = TQString::fromUtf8( displayName ); - email = TQString::fromUtf8( addrSpec ); - - // check for errors - if ( inQuotedString ) - return; // KPIM::UnbalancedQuote; - if ( context == InComment ) - return; // KPIM::UnbalancedParens; - if ( context == InAngleAddress ) - return; // KPIM::UnclosedAngleAddr; - - if ( addrSpec.isEmpty() ) { - if ( displayName.isEmpty() ) - return; // KPIM::NoAddressSpec; - else { - //addrSpec = displayName; - //displayName.truncate( 0 ); - // Address of the form "foo@bar" or "foo@bar (Name)". - email = fullName; - fullName = TQString::fromUtf8( comment ); - } - } - - // Check that we do not have any extra characters on the end of the - // strings - unsigned int len = fullName.length(); - if ( fullName[ 0 ] == '"' && fullName[ len - 1 ] == '"' ) - fullName = fullName.mid( 1, len - 2 ); -} - -void Addressee::setResource( Resource *resource ) -{ - detach(); - mData->resource = resource; -} - -Resource *Addressee::resource() const -{ - return mData->resource; -} - -void Addressee::setChanged( bool value ) -{ - detach(); - mData->changed = value; -} - -bool Addressee::changed() const -{ - return mData->changed; -} - -void Addressee::setSortMode( KABC::SortMode *mode ) -{ - mSortMode = mode; -} - -bool Addressee::operator< ( const Addressee &addr ) -{ - if ( !mSortMode ) - return false; - else - return mSortMode->lesser( *this, addr ); -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Addressee &a ) -{ - if (!a.mData) return s; - - s << a.uid(); - - --STREAMOUT-- - s << a.mData->phoneNumbers; - s << a.mData->addresses; - s << a.mData->emails; - s << a.mData->categories; - s << a.mData->custom; - s << a.mData->keys; - return s; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Addressee &a ) -{ - if (!a.mData) - return s; - - a.detach(); - - s >> a.mData->uid; - - --STREAMIN-- - s >> a.mData->phoneNumbers; - s >> a.mData->addresses; - s >> a.mData->emails; - s >> a.mData->categories; - s >> a.mData->custom; - s >> a.mData->keys; - - a.mData->empty = false; - - return s; -} - -bool matchBinaryPattern( int value, int pattern ) -{ - /** - We want to match all telephonnumbers/addresses which have the bits in the - pattern set. More are allowed. - if pattern == 0 we have a special handling, then we want only those with - exactly no bit set. - */ - if ( pattern == 0 ) - return ( value == 0 ); - else - return ( pattern == ( pattern & value ) ); -} - -template <class L> -bool listEquals( const TQValueList<L> &list, const TQValueList<L> &pattern ) -{ - if ( list.count() != pattern.count() ) - return false; - - for ( uint i = 0; i < list.count(); ++i ) - if ( pattern.find( list[ i ] ) == pattern.end() ) - return false; - - return true; -} - -bool emailsEquals( const TQStringList &list, const TQStringList &pattern ) -{ - if ( list.count() != pattern.count() ) - return false; - - if ( list.first() != pattern.first() ) - return false; - - TQStringList::ConstIterator it; - for ( it = list.begin(); it != list.end(); ++it ) - if ( pattern.find( *it ) == pattern.end() ) - return false; - - return true; -} diff --git a/kabc/scripts/addressee.src.h b/kabc/scripts/addressee.src.h deleted file mode 100644 index 9cadfd41e..000000000 --- a/kabc/scripts/addressee.src.h +++ /dev/null @@ -1,407 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_ADDRESSEE_H -#define KABC_ADDRESSEE_H - -#include <tqdatetime.h> -#include <tqstring.h> -#include <tqstringlist.h> -#include <tqvaluelist.h> - -#include <ksharedptr.h> -#include <kurl.h> - -#include "address.h" -#include "agent.h" -#include "geo.h" -#include "key.h" -#include "phonenumber.h" -#include "picture.h" -#include "secrecy.h" -#include "sound.h" -#include "timezone.h" - -namespace KABC { - -class Resource; -class Field; -class SortMode; - -/** - @short address book entry - - This class represents an entry in the address book. - - The data of this class is implicitly shared. You can pass this class by value. - - If you need the name of a field for presenting it to the user you should use - the functions ending in Label(). They return a translated string which can be - used as label for the corresponding field. - - About the name fields: - - givenName() is the first name and familyName() the last name. In some - countries the family name comes first, that's the reason for the - naming. formattedName() is the full name with the correct formatting. - It is used as an override, when the correct formatting can't be generated - from the other name fields automatically. - - realName() returns a fully formatted name(). It uses formattedName, if set, - otherwise it constucts the name from the name fields. As fallback, if - nothing else is set it uses name(). - - name() is the NAME type of RFC2426. It can be used as internal name for the - data enty, but shouldn't be used for displaying the data to the user. - */ -class KABC_EXPORT Addressee -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Addressee & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Addressee & ); - - public: - typedef TQValueList<Addressee> List; - typedef TQMap<TQString, Addressee> Map; - - /** - Construct an empty address book entry. - */ - Addressee(); - ~Addressee(); - - Addressee( const Addressee & ); - Addressee &operator=( const Addressee & ); - - bool operator==( const Addressee & ) const; - bool operator!=( const Addressee & ) const; - - /** - Return, if the address book entry is empty. - */ - bool isEmpty() const; - - /** - Set unique identifier. - */ - void setUid( const TQString &uid ); - /** - Return unique identifier. - */ - TQString uid() const; - /** - Return translated label for uid field. - */ - static TQString uidLabel(); - - /** - Set unique resource identifier. - */ - void setUri( const TQString &uid ); - /** - Return unique resource identifier. - */ - TQString uri() const; - /** - Return translated label for uri field. - */ - static TQString uriLabel(); - - --DECLARATIONS-- - /** - Set name fields by parsing the given string and trying to associate the - parts of the string with according fields. This function should probably - be a bit more clever. - */ - void setNameFromString( const TQString & ); - - /** - Return the name of the addressee. This is calculated from all the name - fields. - */ - TQString realName() const; - - /** - Return the name that consists of all name parts. - */ - TQString assembledName() const; - - /** - Return email address including real name. - - @param email Email address to be used to construct the full email string. - If this is TQString::null the preferred email address is used. - */ - TQString fullEmail( const TQString &email=TQString::null ) const; - - /** - Insert an email address. If the email address already exists in this - addressee it is not duplicated. - - @param email Email address - @param preferred Set to true, if this is the preferred email address of - the addressee. - */ - void insertEmail( const TQString &email, bool preferred=false ); - - /** - Remove email address. If the email address doesn't exist, nothing happens. - */ - void removeEmail( const TQString &email ); - - /** - Return preferred email address. This is the first email address or the - last one added with insertEmail() with a set preferred parameter. - */ - TQString preferredEmail() const; - - /** - Return list of all email addresses. - */ - TQStringList emails() const; - - /** - Set the emails to @p list. - The first email address gets the preferred one! - @param list The list of email addresses. - */ - void setEmails( const TQStringList& list); - - /** - Insert a phone number. If a phone number with the same id already exists - in this addressee it is not duplicated. - */ - void insertPhoneNumber( const PhoneNumber &phoneNumber ); - - /** - Remove phone number. If no phone number with the given id exists for this - addresse nothing happens. - */ - void removePhoneNumber( const PhoneNumber &phoneNumber ); - - /** - Return phone number, which matches the given type. - */ - PhoneNumber phoneNumber( int type ) const; - - /** - Return list of all phone numbers. - */ - PhoneNumber::List phoneNumbers() const; - - /** - Return list of phone numbers with a special type. - */ - PhoneNumber::List phoneNumbers( int type ) const; - - /** - Return phone number with the given id. - */ - PhoneNumber findPhoneNumber( const TQString &id ) const; - - /** - Insert a key. If a key with the same id already exists - in this addressee it is not duplicated. - */ - void insertKey( const Key &key ); - - /** - Remove a key. If no key with the given id exists for this - addresse nothing happens. - */ - void removeKey( const Key &key ); - - /** - Return key, which matches the given type. - If @p type == Key::Custom you can specify a string - that should match. If you leave the string empty, the first - key with a custom value is returned. - */ - Key key( int type, TQString customTypeString = TQString::null ) const; - - /** - Return list of all keys. - */ - Key::List keys() const; - - /** - Set the list of keys - @param keys The keys to be set. - */ - void setKeys( const Key::List& keys); - - /** - Return list of keys with a special type. - If @p type == Key::Custom you can specify a string - that should match. If you leave the string empty, all custom - keys will be returned. - */ - Key::List keys( int type, TQString customTypeString = TQString::null ) const; - - /** - Return key with the given id. - */ - Key findKey( const TQString &id ) const; - - /** - Insert an address. If an address with the same id already exists - in this addressee it is not duplicated. - */ - void insertAddress( const Address &address ); - - /** - Remove address. If no address with the given id exists for this - addresse nothing happens. - */ - void removeAddress( const Address &address ); - - /** - Return address, which matches the given type. - */ - Address address( int type ) const; - - /** - Return list of all addresses. - */ - Address::List addresses() const; - - /** - Return list of addresses with a special type. - */ - Address::List addresses( int type ) const; - - /** - Return address with the given id. - */ - Address findAddress( const TQString &id ) const; - - /** - Insert category. If the category already exists it is not duplicated. - */ - void insertCategory( const TQString & ); - - /** - Remove category. - */ - void removeCategory( const TQString & ); - - /** - Return, if addressee has the given category. - */ - bool hasCategory( const TQString & ) const; - - /** - Set categories to given value. - */ - void setCategories( const TQStringList & ); - - /** - Return list of all set categories. - */ - TQStringList categories() const; - - /** - Insert custom entry. The entry is identified by the name of the inserting - application and a unique name. If an entry with the given app and name - already exists its value is replaced with the new given value. - - An empty value isn't allowed (nothing happens if this is called with - any of the three arguments being empty) - */ - void insertCustom( const TQString &app, const TQString &name, - const TQString &value ); - - /** - Remove custom entry. - */ - void removeCustom( const TQString &app, const TQString &name ); - - /** - Return value of custom entry, identified by app and entry name. - */ - TQString custom( const TQString &app, const TQString &name ) const; - - /** - Set all custom entries. - */ - void setCustoms( const TQStringList & ); - - /** - Return list of all custom entries. - */ - TQStringList customs() const; - - /** - Parse full email address. The result is given back in fullName and email. - */ - static void parseEmailAddress( const TQString &rawEmail, TQString &fullName, - TQString &email ); - - /** - Debug output. - */ - void dump() const; - - /** - Returns string representation of the addressee. - */ - TQString asString() const; - - /** - Set resource where the addressee is from. - */ - void setResource( Resource *resource ); - - /** - Return pointer to resource. - */ - Resource *resource() const; - - /** - Mark addressee as changed. - */ - void setChanged( bool value ); - - /** - Return whether the addressee is changed. - */ - bool changed() const; - - static void setSortMode( KABC::SortMode *mode ); - - bool operator< ( const Addressee &addr ); - - private: - void detach(); - - struct AddresseeData; - mutable TDESharedPtr<AddresseeData> mData; - - private: - static AddresseeData* shared_null; - static AddresseeData* makeSharedNull(); - static KABC::SortMode *mSortMode; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Addressee & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Addressee & ); - -} - -#endif diff --git a/kabc/scripts/createisomap.pl b/kabc/scripts/createisomap.pl deleted file mode 100755 index 897cd4896..000000000 --- a/kabc/scripts/createisomap.pl +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/perl -# -# Create a translation table countryname->iso-code from the entry.desktop -# files in tdebase/l10n/*/ -# -# USAGE EXAMPLE: -# ./createisomap.pl $TDEDIR/share/locale/l10n > countrytransl.map -# -# Don't laugh at me. I put this together with an old perl book, perl -# being a language I've never used before. - -@entries = <$ARGV[0]/*/entry.desktop>; -chomp @entries; -foreach $entry (@entries) { - local ( $entryiso, @entryfile, @mappings ); - # print "--> $entry\n"; - $entryiso = $entry; - $entryiso =~ s/$ARGV[0]\///; - $entryiso =~ s/\/entry\.desktop//; - # print " $entryiso\n"; - open (IN, $entry); - @entryfile = <IN>; - close IN; - chomp @entryfile; - foreach $entryfileline (@entryfile) { - if ( $entryfileline =~ /^Name.*=(.*)$/ ) { - # push (@mappings, $1 . "\t" . $entryiso ); - print "$1\t$entryiso\n"; - } - } -} - -# add some convenience entries which aren't part of the entry.desktop files - -print "Czech Republic\tcz\n"; diff --git a/kabc/scripts/entrylist b/kabc/scripts/entrylist deleted file mode 100644 index 87c342a06..000000000 --- a/kabc/scripts/entrylist +++ /dev/null @@ -1,82 +0,0 @@ -# This file describes the fields of an address book entry. -# -# The following comma-separated fields are used: -# -# Control: A generates accessor functions. -# L generates a static function for returning a tranlsated label -# F generates a Field id and object for generic field handling -# E generate an equality test in Addressee::operator==(). -# Field Name : A descriptive name which is shown to the user. -# Comment : A comment helping translators to understand the field name -# Type : C++ type of field. -# Identifier : A string used in code as variable name etc. -# Field Category : Categories the field belongs to (see Field::FieldCategory). -# Output function: Function used to convert type to string for debug output (optional) - -ALE,name,,TQString,name - -ALFE,formatted name,,TQString,formattedName,Frequent - -ALFE,family name,,TQString,familyName,Frequent -ALFE,given name,,TQString,givenName,Frequent -ALFE,additional names,,TQString,additionalName -ALFE,honorific prefixes,,TQString,prefix -ALFE,honorific suffixes,,TQString,suffix - -ALFE,nick name,,TQString,nickName,Personal - -ALFE,birthday,,TQDateTime,birthday,Personal,.toString() - -#Address address -LF,home address street,,TQString,homeAddressStreet,Address|Personal -LF,home address city,,TQString,homeAddressLocality,Address|Personal -LF,home address state,,TQString,homeAddressRegion,Address|Personal -LF,home address zip code,,TQString,homeAddressPostalCode,Address|Personal -LF,home address country,,TQString,homeAddressCountry,Address|Personal -LF,home address label,,TQString,homeAddressLabel,Address|Personal - -LF,business address street,,TQString,businessAddressStreet,Address|Organization -LF,business address city,,TQString,businessAddressLocality,Address|Organization -LF,business address state,,TQString,businessAddressRegion,Address|Organization -LF,business address zip code,,TQString,businessAddressPostalCode,Address|Organization -LF,business address country,,TQString,businessAddressCountry,Address|Organization -LF,business address label,,TQString,businessAddressLabel,Address|Organization - -#phoneNumbers -LF,home phone,,TQString,homePhone,Personal|Frequent -LF,business phone,,TQString,businessPhone,Organization|Frequent -LF,mobile phone,,TQString,mobilePhone,Frequent -LF,home fax,,TQString,homeFax -LF,business fax,,TQString,businessFax -LF,car phone,,TQString,carPhone -LF,ISDN,,TQString,isdn -LF,pager,,TQString,pager - -#emails -LF,email address,,TQString,email,Email|Frequent - -ALFE,mail client,,TQString,mailer,Email - -ALE,time zone,,TimeZone,timeZone,,.asString() -ALE,geographic position,,Geo,geo,,.asString() - -ALFE,title,person,TQString,title,Organization -ALFE,role,person in organization,TQString,role,Organization -ALFE,organization,,TQString,organization,Organization -ALFE,department,,TQString,department,Organization - -ALFE,note,,TQString,note - -ALE,product identifier,,TQString,productId -ALE,revision date,,TQDateTime,revision,,.toString() - -ALE,sort string,,TQString,sortString - -ALF,homepage,,KURL,url,,.url() - -ALE,security class,,Secrecy,secrecy,,.asString() - -ALE,logo,,Picture,logo,,.asString() -ALE,photo,,Picture,photo,,.asString() -ALE,sound,,Sound,sound,,.asString() -ALE,agent,,Agent,agent,,.asString() diff --git a/kabc/scripts/field.src.cpp b/kabc/scripts/field.src.cpp deleted file mode 100644 index 2c80810b7..000000000 --- a/kabc/scripts/field.src.cpp +++ /dev/null @@ -1,512 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Cornelius Schumacher <schumacher@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 <klocale.h> -#include <tdeconfig.h> -#include <kglobal.h> - -#include "field.h" -#include "address.h" - -using namespace KABC; - -class Field::FieldImpl -{ - public: - FieldImpl( int fieldId, int category = 0, - const TQString &label = TQString::null, - const TQString &key = TQString::null, - const TQString &app = TQString::null ) - : mFieldId( fieldId ), mCategory( category ), mLabel( label ), - mKey( key ), mApp( app ) {} - - enum FieldId - { - CustomField, - --ENUMS-- - }; - - int fieldId() { return mFieldId; } - int category() { return mCategory; } - - TQString label() { return mLabel; } - TQString key() { return mKey; } - TQString app() { return mApp; } - - private: - int mFieldId; - int mCategory; - - TQString mLabel; - TQString mKey; - TQString mApp; -}; - - -Field::List Field::mAllFields; -Field::List Field::mDefaultFields; -Field::List Field::mCustomFields; - - -Field::Field( FieldImpl *impl ) -{ - mImpl = impl; -} - -Field::~Field() -{ - delete mImpl; -} - -TQString Field::label() -{ - switch ( mImpl->fieldId() ) { - --CASELABEL-- - case FieldImpl::CustomField: - return mImpl->label(); - default: - return i18n("Unknown Field"); - } -} - -int Field::category() -{ - return mImpl->category(); -} - -TQString Field::categoryLabel( int category ) -{ - switch ( category ) { - case All: - return i18n("All"); - case Frequent: - return i18n("Frequent"); - case Address: - return i18n("street/postal","Address"); - case Email: - return i18n("Email"); - case Personal: - return i18n("Personal"); - case Organization: - return i18n("Organization"); - case CustomCategory: - return i18n("Custom"); - default: - return i18n("Undefined"); - } -} - -TQString Field::value( const KABC::Addressee &a ) -{ - switch ( mImpl->fieldId() ) { - --CASEVALUE-- - case FieldImpl::Email: - return a.preferredEmail(); - case FieldImpl::Birthday: - if ( a.birthday().isValid() ) - return a.birthday().date().toString( Qt::ISODate ); - else - return TQString::null; - case FieldImpl::Url: - return a.url().prettyURL(); - case FieldImpl::HomePhone: - { - PhoneNumber::List::ConstIterator it; - - { - // check for preferred number - const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Home | PhoneNumber::Pref ); - for ( it = list.begin(); it != list.end(); ++it ) - if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home ) - return (*it).number(); - } - - { - // check for normal home number - const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Home ); - for ( it = list.begin(); it != list.end(); ++it ) - if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home ) - return (*it).number(); - } - - return TQString::null; - } - case FieldImpl::BusinessPhone: - { - PhoneNumber::List::ConstIterator it; - - { - // check for preferred number - const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Work | PhoneNumber::Pref ); - for ( it = list.begin(); it != list.end(); ++it ) - if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work ) - return (*it).number(); - } - - { - // check for normal work number - const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Work ); - for ( it = list.begin(); it != list.end(); ++it ) - if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work ) - return (*it).number(); - } - - return TQString::null; - } - case FieldImpl::MobilePhone: - return a.phoneNumber( PhoneNumber::Cell ).number(); - case FieldImpl::HomeFax: - return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number(); - case FieldImpl::BusinessFax: - return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number(); - case FieldImpl::CarPhone: - return a.phoneNumber( PhoneNumber::Car ).number(); - case FieldImpl::Isdn: - return a.phoneNumber( PhoneNumber::Isdn ).number(); - case FieldImpl::Pager: - return a.phoneNumber( PhoneNumber::Pager ).number(); - case FieldImpl::HomeAddressStreet: - return a.address( Address::Home ).street(); - case FieldImpl::HomeAddressLocality: - return a.address( Address::Home ).locality(); - case FieldImpl::HomeAddressRegion: - return a.address( Address::Home ).region(); - case FieldImpl::HomeAddressPostalCode: - return a.address( Address::Home ).postalCode(); - case FieldImpl::HomeAddressCountry: - return a.address( Address::Home ).country(); - case FieldImpl::HomeAddressLabel: - return a.address( Address::Home ).label(); - case FieldImpl::BusinessAddressStreet: - return a.address( Address::Work ).street(); - case FieldImpl::BusinessAddressLocality: - return a.address( Address::Work ).locality(); - case FieldImpl::BusinessAddressRegion: - return a.address( Address::Work ).region(); - case FieldImpl::BusinessAddressPostalCode: - return a.address( Address::Work ).postalCode(); - case FieldImpl::BusinessAddressCountry: - return a.address( Address::Work ).country(); - case FieldImpl::BusinessAddressLabel: - return a.address( Address::Work ).label(); - case FieldImpl::CustomField: - return a.custom( mImpl->app(), mImpl->key() ); - default: - return TQString::null; - } -} - -bool Field::setValue( KABC::Addressee &a, const TQString &value ) -{ - switch ( mImpl->fieldId() ) { - --CASESETVALUE-- - case FieldImpl::MobilePhone: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Cell ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::HomeFax: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::BusinessFax: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::CarPhone: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Car ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::Isdn: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Isdn ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::Pager: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Pager ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::HomeAddressStreet: - { - KABC::Address address = a.address( Address::Home ); - address.setStreet( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressLocality: - { - KABC::Address address = a.address( Address::Home ); - address.setLocality( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressRegion: - { - KABC::Address address = a.address( Address::Home ); - address.setRegion( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressPostalCode: - { - KABC::Address address = a.address( Address::Home ); - address.setPostalCode( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressCountry: - { - KABC::Address address = a.address( Address::Home ); - address.setCountry( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressLabel: - { - KABC::Address address = a.address( Address::Home ); - address.setLabel( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressStreet: - { - KABC::Address address = a.address( Address::Work ); - address.setStreet( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressLocality: - { - KABC::Address address = a.address( Address::Work ); - address.setLocality( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressRegion: - { - KABC::Address address = a.address( Address::Work ); - address.setRegion( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressPostalCode: - { - KABC::Address address = a.address( Address::Work ); - address.setPostalCode( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressCountry: - { - KABC::Address address = a.address( Address::Work ); - address.setCountry( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressLabel: - { - KABC::Address address = a.address( Address::Work ); - address.setLabel( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::Birthday: - a.setBirthday( TQT_TQDATE_OBJECT(TQDate::fromString( value, Qt::ISODate )) ); - return true; - case FieldImpl::CustomField: - a.insertCustom( mImpl->app(), mImpl->key(), value ); - return true; - default: - return false; - } -} - -TQString Field::sortKey( const KABC::Addressee &a ) -{ - switch ( mImpl->fieldId() ) { - --CASEVALUE-- - case FieldImpl::Birthday: - if ( a.birthday().isValid() ) { - TQDate date = TQT_TQDATE_OBJECT(a.birthday().date()); - TQString key; - key.sprintf( "%02d-%02d", date.month(), date.day() ); - return key; - } else - return TQString( "00-00" ); - default: - return value( a ).lower(); - } -} - -bool Field::isCustom() -{ - return mImpl->fieldId() == FieldImpl::CustomField; -} - -Field::List Field::allFields() -{ - if ( mAllFields.isEmpty() ) { - --CREATEFIELDS-- - } - - return mAllFields; -} - -Field::List Field::defaultFields() -{ - if ( mDefaultFields.isEmpty() ) { - createDefaultField( FieldImpl::FormattedName ); - createDefaultField( FieldImpl::Email ); - } - - return mDefaultFields; -} - -void Field::createField( int id, int category ) -{ - mAllFields.append( new Field( new FieldImpl( id, category ) ) ); -} - -void Field::createDefaultField( int id, int category ) -{ - mDefaultFields.append( new Field( new FieldImpl( id, category ) ) ); -} - -void Field::deleteFields() -{ - Field::List::ConstIterator it; - - for ( it = mAllFields.constBegin(); it != mAllFields.constEnd(); ++it ) { - delete (*it); - } - mAllFields.clear(); - - for ( it = mDefaultFields.constBegin(); it != mDefaultFields.constEnd(); ++it ) { - delete (*it); - } - mDefaultFields.clear(); - - for ( it = mCustomFields.constBegin(); it != mCustomFields.constEnd(); ++it ) { - delete (*it); - } - mCustomFields.clear(); -} - -void Field::saveFields( const TQString &identifier, - const Field::List &fields ) -{ - TDEConfig *cfg = TDEGlobal::config(); - TDEConfigGroupSaver( cfg, "KABCFields" ); - - saveFields( cfg, identifier, fields ); -} - -void Field::saveFields( TDEConfig *cfg, const TQString &identifier, - const Field::List &fields ) -{ - TQValueList<int> fieldIds; - - int custom = 0; - Field::List::ConstIterator it; - for( it = fields.begin(); it != fields.end(); ++it ) { - fieldIds.append( (*it)->mImpl->fieldId() ); - if( (*it)->isCustom() ) { - TQStringList customEntry; - customEntry << (*it)->mImpl->label(); - customEntry << (*it)->mImpl->key(); - customEntry << (*it)->mImpl->app(); - cfg->writeEntry( "KABC_CustomEntry_" + identifier + "_" + - TQString::number( custom++ ), customEntry ); - } - } - - cfg->writeEntry( identifier, fieldIds ); -} - -Field::List Field::restoreFields( const TQString &identifier ) -{ - TDEConfig *cfg = TDEGlobal::config(); - TDEConfigGroupSaver( cfg, "KABCFields" ); - - return restoreFields( cfg, identifier ); -} - -Field::List Field::restoreFields( TDEConfig *cfg, const TQString &identifier ) -{ - const TQValueList<int> fieldIds = cfg->readIntListEntry( identifier ); - - Field::List fields; - - int custom = 0; - TQValueList<int>::ConstIterator it; - for( it = fieldIds.begin(); it != fieldIds.end(); ++it ) { - FieldImpl *f = 0; - if ( (*it) == FieldImpl::CustomField ) { - TQStringList customEntry = cfg->readListEntry( "KABC_CustomEntry_" + - identifier + "_" + - TQString::number( custom++ ) ); - f = new FieldImpl( *it, CustomCategory, customEntry[ 0 ], - customEntry[ 1 ], customEntry[ 2 ] ); - } else { - f = new FieldImpl( *it ); - } - fields.append( new Field( f ) ); - } - - return fields; -} - -bool Field::equals( Field *field ) -{ - bool sameId = ( mImpl->fieldId() == field->mImpl->fieldId() ); - - if ( !sameId ) return false; - - if ( mImpl->fieldId() != FieldImpl::CustomField ) return true; - - return mImpl->key() == field->mImpl->key(); -} - -Field *Field::createCustomField( const TQString &label, int category, - const TQString &key, const TQString &app ) -{ - Field *field = new Field( new FieldImpl( FieldImpl::CustomField, - category | CustomCategory, - label, key, app ) ); - mCustomFields.append( field ); - - return field; -} diff --git a/kabc/scripts/makeaddressee b/kabc/scripts/makeaddressee deleted file mode 100755 index fa955b0bf..000000000 --- a/kabc/scripts/makeaddressee +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/perl - -my $srcdir; -$srcdir = `dirname $0` || die "Can't determine \$srcdir."; -chomp $srcdir; - -if (!open( ENTRIES, "$srcdir/entrylist" ) ) { - print "Can't open $srcdir/entrylist\n"; - exit 1; -} - - while(<ENTRIES>) { - if (/^#/) { next; } - chop; - @entries = split /,/; - if (!/^.+,(\w+),(\w+)/) { next; } - push @entryCtrl, @entries[0]; - push @entryRealNames, @entries[1]; - push @entryComments, @entries[2]; - push @entryTypes, @entries[3]; - push @entryNames, @entries[4]; - push @entryCategory, @entries[5]; - push @entryDebug, @entries[6]; - } - -close ENTRIES; - -if (!open( H_IN, "$srcdir/addressee.src.h" ) ) { - print "Can't open $srcdir/addressee.src.h\n"; - exit 1; -} -if (!open( H_OUT, ">../addressee.h" ) ) { - print "Can't open addressee.h\n"; - exit 1; -} - print H_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; - - while( <H_IN> ) { - if (/--DECLARATIONS--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /A/ ) { - print H_OUT " /**\n"; - print H_OUT " Set $entryRealNames[$i].\n"; - print H_OUT " */\n"; - print H_OUT " void set" . ucfirst($entryNames[$i]); - print H_OUT "( const $entryTypes[$i] &$entryNames[$i] );\n"; - - print H_OUT " /**\n"; - print H_OUT " Return $entryRealNames[$i].\n"; - print H_OUT " */\n"; - print H_OUT " $entryTypes[$i] $entryNames[$i]() const;\n"; - } - - if ( $entryCtrl[$i] !~ /L/ ) { next; } - print H_OUT " /**\n"; - print H_OUT " Return translated label for $entryNames[$i] field.\n"; - print H_OUT " */\n"; - print H_OUT " static TQString $entryNames[$i]Label();\n\n"; - } - } else { - print H_OUT; - } - } - -close H_OUT; -close H_IN; - -if (!open( CPP_IN, "$srcdir/addressee.src.cpp" ) ) { - print "Can't open $srcdir/addressee.src.cpp\n"; - exit 1; -} -if (!open( CPP_OUT, ">../addressee.cpp" ) ) { - print "Can't open addressee.cpp\n"; - exit 1; -} - print CPP_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; - - while( <CPP_IN> ) { - if (/--VARIABLES--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /A/ ) { next; } - print CPP_OUT " $entryTypes[$i] $entryNames[$i];\n"; - } - } elsif (/--DEFINITIONS--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /A/ ) { - print CPP_OUT "void Addressee::set" . ucfirst($entryNames[$i]); - print CPP_OUT "( const $entryTypes[$i] &$entryNames[$i] )\n{\n"; - print CPP_OUT " if ( $entryNames[$i] == mData->$entryNames[$i] ) return;\n"; - print CPP_OUT " detach();\n mData->empty = false;\n"; - print CPP_OUT " mData->$entryNames[$i] = $entryNames[$i];\n}\n\n"; - - print CPP_OUT "$entryTypes[$i] Addressee::$entryNames[$i]() const\n{\n"; - print CPP_OUT " return mData->$entryNames[$i];\n}\n\n"; - } - - if ( $entryCtrl[$i] !~ /L/ ) { next; } - @labelwords = split ' ', $entryRealNames[$i]; - for( $j=0; $j < @labelwords; ++$j ) { - $labelwords[$j] = ucfirst $labelwords[$j]; - } - $label = join ' ', @labelwords; - print CPP_OUT "TQString Addressee::$entryNames[$i]Label()\n{\n"; - if ( $entryComments[$i] ) { - print CPP_OUT " return i18n(\"$entryComments[$i]\",\"$label\");\n"; - } else { - print CPP_OUT " return i18n(\"$label\");\n"; - } - print CPP_OUT "}\n\n\n"; - } - } elsif (/--EQUALSTEST--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /E/ ) { - if ( $entryNames[$i] !~ "revision" ) { - if ( $entryTypes[$i] =~ "TQString" ) { - print CPP_OUT " if ( mData->$entryNames[$i] != a.mData->$entryNames[$i] &&\n"; - print CPP_OUT " !( mData->$entryNames[$i].isEmpty() && a.mData->$entryNames[$i].isEmpty() ) ) {\n"; - print CPP_OUT " kdDebug(5700) << \"$entryNames[$i] differs\" << endl;\n"; - print CPP_OUT " return false;\n"; - print CPP_OUT " }\n"; - } else { - print CPP_OUT " if ( mData->$entryNames[$i] != a.mData->$entryNames[$i] ) {\n"; - print CPP_OUT " kdDebug(5700) << \"$entryNames[$i] differs\" << endl;\n"; - print CPP_OUT " return false;\n"; - print CPP_OUT " }\n"; - } - } - } - } - } elsif (/--STREAMOUT--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /A/ ) { - print CPP_OUT " s << a.mData->$entryNames[$i];\n"; - } - } - } elsif (/--STREAMIN--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /A/ ) { - print CPP_OUT " s >> a.mData->$entryNames[$i];\n"; - } - } - } elsif (/--DEBUG--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /A/ ) { next; } - print CPP_OUT " kdDebug(5700) << \" " . ucfirst($entryNames[$i]); - print CPP_OUT ": '\" << $entryNames[$i]()$entryDebug[$i] << \"'\" << endl;\n"; - } - } else { - print CPP_OUT; - } - } - -close CPP_OUT; -close CPP_IN; - -if (!open( CPP_IN, "$srcdir/field.src.cpp" ) ) { - print "Can't open $srcdir/field.src.cpp\n"; - exit 1; -} -if (!open( CPP_OUT, ">../field.cpp" ) ) { - print "Can't open field.cpp\n"; - exit 1; -} - print CPP_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; - - while( <CPP_IN> ) { - if (/--ENUMS--/) { - $first = 1; - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /F/ ) { next; } - if ( $first ) { $first = 0; } - else { print CPP_OUT ",\n"; } - print CPP_OUT " " . ucfirst($entryNames[$i]); - } - print CPP_OUT "\n"; - } elsif (/--CASELABEL--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /F/ ) { next; } - if ( $entryCtrl[$i] !~ /L/ ) { next; } - print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; - print CPP_OUT " return Addressee::$entryNames[$i]Label();\n"; - } - } elsif (/--CASEVALUE--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /A/ ) { next; } - if ( $entryCtrl[$i] !~ /F/ ) { next; } - if ( $entryTypes[$i] ne "TQString" ) { next; } - print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; - print CPP_OUT " return a.$entryNames[$i]();\n"; - } - } elsif (/--CASESETVALUE--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /A/ ) { next; } - if ( $entryCtrl[$i] !~ /F/ ) { next; } - if ( $entryTypes[$i] ne "TQString" ) { next; } - print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; - print CPP_OUT " a.set" . ucfirst($entryNames[$i]) . "( value );\n"; - print CPP_OUT " return true;\n"; - } - } elsif (/--CREATEFIELDS--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /F/ ) { next; } - print CPP_OUT " createField( FieldImpl::" . ucfirst($entryNames[$i]); - if ( $entryCategory[$i] ) { - print CPP_OUT ", $entryCategory[$i]"; - } - print CPP_OUT " );\n"; - } - } else { - print CPP_OUT; - } - } - -close CPP_OUT; -close CPP_IN; diff --git a/kabc/secrecy.cpp b/kabc/secrecy.cpp deleted file mode 100644 index 7ec439b0c..000000000 --- a/kabc/secrecy.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <klocale.h> - -#include "secrecy.h" - -using namespace KABC; - -Secrecy::Secrecy( int type ) - : mType( type ) -{ -} - -bool Secrecy::operator==( const Secrecy &s ) const -{ - return ( mType == s.mType ); -} - -bool Secrecy::operator!=( const Secrecy &s ) const -{ - return !( *this == s ); -} - -bool Secrecy::isValid() const -{ - return mType != Invalid; -} - -void Secrecy::setType( int type ) -{ - mType = type; -} - -int Secrecy::type() const -{ - return mType; -} - -Secrecy::TypeList Secrecy::typeList() -{ - static TypeList list; - - if ( list.isEmpty() ) - list << Public << Private << Confidential; - - return list; -} - -TQString Secrecy::typeLabel( int type ) -{ - switch ( type ) { - case Public: - return i18n( "Public" ); - break; - case Private: - return i18n( "Private" ); - break; - case Confidential: - return i18n( "Confidential" ); - break; - default: - return i18n( "Unknown type" ); - break; - } -} - -TQString Secrecy::asString() const -{ - return typeLabel( mType ); -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Secrecy &secrecy ) -{ - return s << secrecy.mType; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Secrecy &secrecy ) -{ - s >> secrecy.mType; - - return s; -} diff --git a/kabc/secrecy.h b/kabc/secrecy.h deleted file mode 100644 index 5cc60b11d..000000000 --- a/kabc/secrecy.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_SECRECY_H -#define KABC_SECRECY_H - -#include <tqvaluelist.h> - -#include <tdelibs_export.h> - -namespace KABC { - -class KABC_EXPORT Secrecy -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Secrecy & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Secrecy & ); - -public: - typedef TQValueList<int> TypeList; - - /** - * Secrecy types - * - * @li Public - for public access - * @li Private - only private access - * @li Confidential - access for confidential persons - */ - enum Types { - Public, - Private, - Confidential, - Invalid - }; - - /** - * Constructor. - * - * @param type The secrecy type, see Types. - */ - Secrecy( int type = Invalid ); - - bool operator==( const Secrecy & ) const; - bool operator!=( const Secrecy & ) const; - - /** - Returns if the Secrecy object has a valid value. - */ - bool isValid() const; - - /** - * Sets the type, see Types. - */ - void setType( int type ); - - /** - * Returns the type, see Types. - */ - int type() const; - - /** - * Returns a list of all available secrecy types. - */ - static TypeList typeList(); - - /** - * Returns a translated label for a given secrecy type. - */ - static TQString typeLabel( int type ); - - /** - * For debug. - */ - TQString asString() const; - -private: - int mType; -}; - -KABC_EXPORT TQDataStream& operator<<( TQDataStream &s, const Secrecy &secrecy ); -KABC_EXPORT TQDataStream& operator>>( TQDataStream &s, Secrecy &secrecy ); - -} -#endif diff --git a/kabc/sortmode.cpp b/kabc/sortmode.cpp deleted file mode 100644 index ee9a6f82d..000000000 --- a/kabc/sortmode.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Tobias Koenig <tokoe@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 <kabc/field.h> - -#include "sortmode.h" - -using namespace KABC; - -NameSortMode::NameSortMode() - : mNameType( FormattedName ), mAscendingOrder( true ), d( 0 ) -{ - mNameType = FormattedName; -} - -NameSortMode::NameSortMode( NameType type, bool ascending ) - : mNameType( type ), mAscendingOrder( ascending ), d( 0 ) -{ -} - -bool NameSortMode::lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const -{ - bool lesser = false; - - switch ( mNameType ) { - case FormattedName: - lesser = TQString::localeAwareCompare( first.formattedName(), second.formattedName() ) < 0; - break; - case FamilyName: - lesser = TQString::localeAwareCompare( first.familyName(), second.familyName() ) < 0; - break; - case GivenName: - lesser = TQString::localeAwareCompare( first.givenName(), second.givenName() ) < 0; - break; - default: - lesser = false; - break; - } - - if ( !mAscendingOrder ) - lesser = !lesser; - - return lesser; -} - -FieldSortMode::FieldSortMode( KABC::Field *field, bool ascending ) - : mField( field ), mAscendingOrder( ascending ), d( 0 ) -{ -} - -bool FieldSortMode::lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const -{ - if ( !mField ) - return false; - else { - bool lesser = TQString::localeAwareCompare( mField->value( first ), mField->value( second ) ) < 0; - if ( !mAscendingOrder ) - lesser = !lesser; - - return lesser; - } -} diff --git a/kabc/sortmode.h b/kabc/sortmode.h deleted file mode 100644 index 9768fc8c5..000000000 --- a/kabc/sortmode.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Tobias Koenig <tokoe@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 KABC_SORTMODE_H -#define KABC_SORTMODE_H - -#include <tdelibs_export.h> - -#include <kabc/addressee.h> - -namespace KABC { - -/** - @short Sort method for sorting an addressee list. - - This interface should be reimplemented by classes which shall act as - SortModes for KABC::AddresseeList. -*/ -class KABC_EXPORT SortMode -{ - public: - /** - Reimplement this method and return whether the first contact is 'smaller' - than the second. - */ - virtual bool lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const = 0; -}; - -class KABC_EXPORT NameSortMode : public SortMode -{ - public: - enum NameType - { - FormattedName, - FamilyName, - GivenName - }; - - /** - Constructor. - - Creates a NameSortMethod with FormattedName as name type set. - */ - NameSortMode(); - - /** - Constructor. - - Creates a NameSortMethod with the specified name type. - - @param type The name type. - @param ascending true for ascending sort, false for descending. - */ - NameSortMode( NameType type, bool ascending = true ); - - /** - Returns whether the first contact is 'smaller' then the second. - */ - virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const; - - private: - NameType mNameType; - bool mAscendingOrder; - - class NameSortModePrivate; - NameSortModePrivate *d; -}; - -class KABC_EXPORT FieldSortMode : public SortMode -{ - public: - /** - Constructor. - - Creates a FieldSortMethod with the specified field. - - @param field The field. - @param ascending true for ascending sort, false for descending. - */ - FieldSortMode( KABC::Field *field, bool ascending = true ); - - /** - Returns whether the first contact is 'smaller' then the second. - */ - virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const; - - private: - KABC::Field *mField; - bool mAscendingOrder; - - class FieldSortModePrivate; - FieldSortModePrivate *d; -}; - -} - -#endif diff --git a/kabc/sound.cpp b/kabc/sound.cpp deleted file mode 100644 index cf645be83..000000000 --- a/kabc/sound.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 "sound.h" - -#include <tqdatastream.h> - -using namespace KABC; - -Sound::Sound() - : mIntern( false ) -{ -} - -Sound::Sound( const TQString &url ) - : mUrl( url ), mIntern( false ) -{ -} - -Sound::Sound( const TQByteArray &data ) - : mData( data ), mIntern( true ) -{ -} - -Sound::~Sound() -{ -} - -bool Sound::operator==( const Sound &s ) const -{ - if ( mIntern != s.mIntern ) return false; - - if ( mIntern ) { - if ( mData != s.mData ) - return false; - } else { - if ( mUrl != s.mUrl ) - return false; - } - - return true; -} - -bool Sound::operator!=( const Sound &s ) const -{ - return !( s == *this ); -} - -void Sound::setUrl( const TQString &url ) -{ - mUrl = url; - mIntern = false; -} - -void Sound::setData( const TQByteArray &data ) -{ - mData = data; - mIntern = true; -} - -bool Sound::isIntern() const -{ - return mIntern; -} - -bool Sound::isEmpty() const -{ - return (!mIntern) && mUrl.isEmpty(); - -} - -TQString Sound::url() const -{ - return mUrl; -} - -TQByteArray Sound::data() const -{ - return mData; -} - -TQString Sound::asString() const -{ - if ( mIntern ) - return "intern sound"; - else - return mUrl; -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Sound &sound ) -{ - return s << sound.mIntern << sound.mUrl; -// return s << sound.mIntern << sound.mUrl << sound.mData; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Sound &sound ) -{ - s >> sound.mIntern >> sound.mUrl; -// s >> sound.mIntern >> sound.mUrl >> sound.mData; - return s; -} diff --git a/kabc/sound.h b/kabc/sound.h deleted file mode 100644 index 98dcf320b..000000000 --- a/kabc/sound.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_SOUND_H -#define KABC_SOUND_H - -#include <tqcstring.h> -#include <tqstring.h> - -#include <tdelibs_export.h> - -namespace KABC { - -/** @short Class that holds a Sound clip for a contact. - * - * The sound can be played doing something like this: - * - * \code - * KTempFile tmp; - * if(sound.isIntern()) { - * tmp.file()->tqwriteBlock( sound.data() ); - * tmp.close(); - * KAudioPlayer::play( tmp.name() ); - * } else if(!sound.url().isEmpty()) { - * TQString tmpFile; - * if(!TDEIO::NetAccess::download(KURL(themeURL.url()), tmpFile, NULL)) - * { - * KMessageBox::error(0L, - * TDEIO::NetAccess::lastErrorString(), - * i18n("Failed to download sound file"), - * KMessageBox::Notify - * ); - * return; - * } - * KAudioPlayer::play( tmpFile ); - * } - * \endcode - * - * Unfortunetly KAudioPlayer::play is ASync, so to delete the temporary file, the best you can really do is set a timer. - * - */ -class KABC_EXPORT Sound -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Sound & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Sound & ); - -public: - - /** - * Consturctor. Creates an empty object. - */ - Sound(); - - /** - * Consturctor. - * - * @param url A URL that describes the position of the sound file. - */ - Sound( const TQString &url ); - - /** - * Consturctor. - * - * @param data The raw data of the sound. - */ - Sound( const TQByteArray &data ); - - /** - * Destructor. - */ - ~Sound(); - - - bool operator==( const Sound & ) const; - bool operator!=( const Sound & ) const; - - /** - * Sets a URL for the location of the sound file. When using this - * function, isIntern() will return 'false' until you use - * setData(). - * - * @param url The location URL of the sound file. - */ - void setUrl( const TQString &url ); - - /** - * Test if this sound file has been set. - * Just does: !isIntern() && url.isEmpty() - * @since 3.4 - */ - bool isEmpty() const; - - /** - * Sets the raw data of the sound. When using this function, - * isIntern() will return 'true' until you use setUrl(). - * - * @param data The raw data of the sound. - */ - void setData( const TQByteArray &data ); - - /** - * Returns whether the sound is described by a URL (extern) or - * by the raw data (intern). - * When this method returns 'true' you can use data() to - * get the raw data. Otherwise you can request the URL of this - * sound by url() and load the raw data from that location. - */ - bool isIntern() const; - - /** - * Returns the location URL of this sound. - */ - TQString url() const; - - /** - * Returns the raw data of this sound. - */ - TQByteArray data() const; - - /** - * Returns string representation of the sound. - */ - TQString asString() const; - -private: - TQString mUrl; - TQByteArray mData; - - int mIntern; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Sound & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Sound & ); - -} -#endif diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp deleted file mode 100644 index c887fcb83..000000000 --- a/kabc/stdaddressbook.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <stdlib.h> - -#include <tdeapplication.h> -#include <kcrash.h> -#include <kdebug.h> -#include <klocale.h> -#include <tderesources/manager.h> -#include <ksimpleconfig.h> -#include <kstandarddirs.h> -#include <kstaticdeleter.h> - -#include "resource.h" - -#include "stdaddressbook.h" - -using namespace KABC; - -StdAddressBook *StdAddressBook::mSelf = 0; -bool StdAddressBook::mAutomaticSave = true; - -static KStaticDeleter<StdAddressBook> addressBookDeleter; - -TQString StdAddressBook::fileName() -{ - return locateLocal( "data", "kabc/std.vcf" ); -} - -TQString StdAddressBook::directoryName() -{ - return locateLocal( "data", "kabc/stdvcf" ); -} - -void StdAddressBook::handleCrash() -{ -} - -StdAddressBook *StdAddressBook::self() -{ - if ( !mSelf ) - addressBookDeleter.setObject( mSelf, new StdAddressBook ); - - return mSelf; -} - -StdAddressBook *StdAddressBook::self( bool asynchronous ) -{ - if ( !mSelf ) - addressBookDeleter.setObject( mSelf, new StdAddressBook( asynchronous ) ); - - return mSelf; -} - -StdAddressBook::StdAddressBook() - : AddressBook( "" ) -{ - kdDebug(5700) << "StdAddressBook::StdAddressBook()" << endl; - - init( false ); -} - -StdAddressBook::StdAddressBook( bool asynchronous ) - : AddressBook( "" ) -{ - kdDebug(5700) << "StdAddressBook::StdAddressBook( bool )" << endl; - - init( asynchronous ); -} - -StdAddressBook::~StdAddressBook() -{ - if ( mAutomaticSave ) - saveAll(); -} - -void StdAddressBook::init( bool asynchronous ) -{ - KRES::Manager<Resource> *manager = resourceManager(); - - KRES::Manager<Resource>::ActiveIterator it; - for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { - (*it)->setAddressBook( this ); - if ( !(*it)->open() ) { - error( TQString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); - continue; - } - connect( *it, TQT_SIGNAL( loadingFinished( Resource* ) ), - this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); - connect( *it, TQT_SIGNAL( savingFinished( Resource* ) ), - this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); - - connect( *it, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), - this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); - connect( *it, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), - this, TQT_SLOT( resourceSavingError( Resource*, const TQString& ) ) ); - } - - Resource *res = standardResource(); - if ( !res ) { - res = manager->createResource( "file" ); - if ( res ) - addResource( res ); - else - kdDebug(5700) << "No resource available!!!" << endl; - } - - setStandardResource( res ); - manager->writeConfig(); - - if ( asynchronous ) - asyncLoad(); - else - load(); -} - -bool StdAddressBook::saveAll() -{ - kdDebug(5700) << "StdAddressBook::saveAll()" << endl; - bool ok = true; - - deleteRemovedAddressees(); - - KRES::Manager<Resource>::ActiveIterator it; - KRES::Manager<Resource> *manager = resourceManager(); - for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { - if ( !(*it)->readOnly() && (*it)->isOpen() ) { - Ticket *ticket = requestSaveTicket( *it ); - if ( !ticket ) { - error( i18n( "Unable to save to resource '%1'. It is locked." ) - .arg( (*it)->resourceName() ) ); - return false; - } - - if ( !AddressBook::save( ticket ) ) { - ok = false; - releaseSaveTicket( ticket ); - } - } - } - - return ok; -} - -bool StdAddressBook::save() -{ - kdDebug(5700) << "StdAddressBook::save()" << endl; - - if ( mSelf ) - return mSelf->saveAll(); - else - return true; -} - -void StdAddressBook::close() -{ - addressBookDeleter.destructObject(); -} - -void StdAddressBook::setAutomaticSave( bool enable ) -{ - mAutomaticSave = enable; -} - -bool StdAddressBook::automaticSave() -{ - return mAutomaticSave; -} - -// should get const for 4.X -Addressee StdAddressBook::whoAmI() -{ - TDEConfig config( "kabcrc" ); - config.setGroup( "General" ); - - return findByUid( config.readEntry( "WhoAmI" ) ); -} - -void StdAddressBook::setWhoAmI( const Addressee &addr ) -{ - TDEConfig config( "kabcrc" ); - config.setGroup( "General" ); - - config.writeEntry( "WhoAmI", addr.uid() ); -} diff --git a/kabc/stdaddressbook.h b/kabc/stdaddressbook.h deleted file mode 100644 index 935b2bad1..000000000 --- a/kabc/stdaddressbook.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_STDADDRESSBOOK_H -#define KABC_STDADDRESSBOOK_H - -#include "addressbook.h" - -namespace KABC { - -/** - Standard KDE address book - - This class provides access to the standard KDE address book shared by all - applications. - - It's implemented as a singleton. Use self() to get the address book - object. On the first self() call the address book also gets loaded. - - Example: - - \code - KABC::AddressBook *ab = KABC::StdAddressBook::self(); - - AddressBook::Ticket *ticket = ab->requestSaveTicket(); - - if ( ticket ) { - KABC::AddressBook::Iterator it; - for ( it = ab->begin(); it != ab->end(); ++it ) { - kdDebug() << "UID=" << (*it).uid() << endl; - - // do some other stuff - } - - KABC::StdAddressBook::save( ticket ); - } - \endcode -*/ -class KABC_EXPORT StdAddressBook : public AddressBook -{ - public: - - /** - Destructor. - */ - ~StdAddressBook(); - - /** - Returns the standard addressbook object. It also loads all resources of - the users standard address book synchronously. - */ - static StdAddressBook *self(); - - /** - This is the same as above, but with specified behaviour of resource loading. - - @param asynchronous When true, the resources are loaded asynchronous, that - means you have the data foremost the addressBookChanged() - signal has been emitted. So connect to this signal when - using this method! - */ - static StdAddressBook *self( bool asynchronous ); - - /** - Saves the standard address book to disk. - - @deprecated Use AddressBook::save( Ticket* ) instead - */ - static bool save() KDE_DEPRECATED; - - /** - @deprecated There is no need to call this function anymore. - */ - static void handleCrash() KDE_DEPRECATED; - - /** - Returns the default file name for vcard-based addressbook - */ - static TQString fileName(); - - /** - Returns the default directory name for vcard-based addressbook - */ - static TQString directoryName(); - - /** - Sets the automatic save property of the address book. - - @param state If true, the address book is saved automatically - at destruction time, otherwise you have to call - AddressBook::save( Ticket* ). - */ - static void setAutomaticSave( bool state ); - - /** - Closes the address book. Depending on automaticSave() it will - save the address book first. - */ - static void close(); - - /** - Returns whether the address book is saved at destruction time. - See also setAutomaticSave(). - */ - static bool automaticSave(); - - /** - Returns the contact, that is associated with the owner of the - address book. This contact should be used by other programs - to access user specific data. - */ - Addressee whoAmI(); - - /** - Sets the users contact. See whoAmI() for more information. - - @param addr The users contact. - */ - void setWhoAmI( const Addressee &addr ); - - protected: - StdAddressBook(); - StdAddressBook( bool asynchronous ); - - void init( bool asynchronous ); - bool saveAll(); - - private: - static StdAddressBook *mSelf; - static bool mAutomaticSave; -}; - -} - -#endif - diff --git a/kabc/tdeab2tdeabc.cpp b/kabc/tdeab2tdeabc.cpp deleted file mode 100644 index f03a80f45..000000000 --- a/kabc/tdeab2tdeabc.cpp +++ /dev/null @@ -1,476 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> -#include <tqtextstream.h> - -#include <kabapi.h> -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <tdecmdlineargs.h> -#include <tdeconfig.h> -#include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> -#include <kmessagebox.h> -#include <kstandarddirs.h> - -#include "addressbook.h" -#include "stdaddressbook.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - { "disable-autostart", I18N_NOOP( "Disable automatic startup on login" ), 0 }, - { "quiet", "", 0 }, - { "o", 0, 0 }, - { "override", I18N_NOOP( "Override existing entries" ), "1" }, - TDECmdLineLastOption -}; - -void readKMailEntry( const TQString &kmailEntry, KABC::AddressBook *ab ) -{ - kdDebug() << "KMAILENTRY: " << kmailEntry << endl; - - TQString entry = kmailEntry.simplifyWhiteSpace(); - if ( entry.isEmpty() ) return; - - TQString email; - TQString name; - TQString comment; - - if ( entry.at( entry.length() -1 ) == ')' ) { - int br = entry.findRev( '(' ); - if ( br >= 0 ) { - comment = entry.mid( br + 1, entry.length() - br - 2 ); - entry.truncate( br ); - if ( entry.at( entry.length() - 1 ).isSpace() ) { - entry.truncate( br - 1 ); - } - } - } - - int posSpace = entry.findRev( ' ' ); - if ( posSpace < 0 ) { - email = entry; - if ( !comment.isEmpty() ) { - name = comment; - comment = ""; - } - } else { - email = entry.mid( posSpace + 1 ); - name = entry.left( posSpace ); - } - - if ( email.at( 0 ) == '<' && email.at( email.length() - 1) == '>' ) { - email = email.mid( 1, email.length() - 2 ); - } - if ( name.at( 0 ) == '"' && name.at( name.length() - 1) == '"' ) { - name = name.mid( 1, name.length() - 2 ); - } - if ( name.at( 0 ) == '\'' && name.at( name.length() - 1) == '\'' ) { - name = name.mid( 1, name.length() - 2 ); - } - - if ( name.at( name.length() -1 ) == ')' ) { - int br = name.findRev( '(' ); - if ( br >= 0 ) { - comment = name.mid( br + 1, name.length() - br - 2 ) + " " + comment; - name.truncate( br ); - if ( name.at( name.length() - 1 ).isSpace() ) { - name.truncate( br - 1 ); - } - } - } - - kdDebug() << " EMAIL : " << email << endl; - kdDebug() << " NAME : " << name << endl; - kdDebug() << " COMMENT : " << comment << endl; - - KABC::Addressee::List al = ab->findByEmail( email ); - if ( al.isEmpty() ) { - KABC::Addressee a; - a.setNameFromString( name ); - a.insertEmail( email ); - a.setNote( comment ); - - ab->insertAddressee( a ); - - kdDebug() << "--INSERTED: " << a.realName() << endl; - } -} - -void importKMailAddressBook( KABC::AddressBook *ab ) -{ - TQString fileName = locateLocal( "data", "kmail/addressbook" ); - TQString kmailConfigName = locate( "config", "kmailrc" ); - if ( !kmailConfigName.isEmpty() ) { - TDEConfig cfg( kmailConfigName ); - cfg.setGroup( "Addressbook" ); - fileName = cfg.readPathEntry( "default", fileName ); - } - if ( !TDEStandardDirs::exists( fileName ) ) { - kdDebug(5700) << "Couldn't find KMail addressbook." << endl; - return; - } - - TQFile f( fileName ); - if ( !f.open(IO_ReadOnly) ) { - kdDebug(5700) << "Couldn't open file '" << fileName << "'" << endl; - return; - } - - TQStringList kmailEntries; - - TQTextStream t( &f ); - while ( !t.eof() ) { - kmailEntries.append( t.readLine() ); - } - f.close(); - - TQStringList::ConstIterator it; - for ( it = kmailEntries.begin(); it != kmailEntries.end(); ++it ) { - if ( (*it).at( 0 ) == '#' ) continue; - bool insideQuote = false; - int end = (*it).length() - 1; - for ( int i = end; i; i-- ) { - if ( (*it).at( i ) == '"' ) { - if ( insideQuote ) - insideQuote = false; - else - insideQuote = true; - } else if ( (*it).at( i ) == ',' && !insideQuote ) { - readKMailEntry( (*it).mid( i + 1, end - i ), ab ); - end = i - 1; - } - } - - readKMailEntry( (*it).mid( 0, end + 1 ), ab ); - } -} - -void readKAddressBookEntries( const TQString &dataString, Addressee &a ) -{ - // Strip "KMail:1.0" prefix and "[EOS]" suffix. - TQString str = dataString.mid( 11, dataString.length() - 24 ); - - TQStringList entries = TQStringList::split( "\n[EOR]\n ", str ); - - Address homeAddress( Address::Home ); - Address businessAddress( Address::Work ); - Address otherAddress; - - TQStringList::ConstIterator it; - for ( it = entries.begin(); it != entries.end(); ++it ) { - int pos = (*it).find( "\n" ); - TQString fieldName = (*it).left( pos ); - TQString fieldValue = (*it).mid( pos + 2 ); - - if ( fieldName == "X-HomeFax" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home | - PhoneNumber::Fax ) ); - } else if ( fieldName == "X-OtherPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, 0 ) ); - } else if ( fieldName == "X-PrimaryPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pref ) ); - } else if ( fieldName == "X-BusinessFax" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work | - PhoneNumber::Fax ) ); - } else if ( fieldName == "X-CarPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Car ) ); - } else if ( fieldName == "X-MobilePhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Cell ) ); - } else if ( fieldName == "X-ISDN" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Isdn ) ); - } else if ( fieldName == "X-OtherFax" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Fax ) ); - } else if ( fieldName == "X-Pager" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pager ) ); - } else if ( fieldName == "X-BusinessPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work ) ); - } else if ( fieldName == "X-HomePhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home ) ); - } else if ( fieldName == "X-HomeAddress" ) { - homeAddress.setLabel( fieldValue ); - } else if ( fieldName == "X-HomeAddressStreet" ) { - homeAddress.setStreet( fieldValue ); - } else if ( fieldName == "X-HomeAddressCity" ) { - homeAddress.setLocality( fieldValue ); - } else if ( fieldName == "X-HomeAddressPostalCode" ) { - homeAddress.setPostalCode( fieldValue ); - } else if ( fieldName == "X-HomeAddressState" ) { - homeAddress.setRegion( fieldValue ); - } else if ( fieldName == "X-HomeAddressCountry" ) { - homeAddress.setCountry( fieldValue ); - } else if ( fieldName == "X-BusinessAddress" ) { - businessAddress.setLabel( fieldValue ); - } else if ( fieldName == "X-BusinessAddressStreet" ) { - businessAddress.setStreet( fieldValue ); - } else if ( fieldName == "X-BusinessAddressCity" ) { - businessAddress.setLocality( fieldValue ); - } else if ( fieldName == "X-BusinessAddressPostalCode" ) { - businessAddress.setPostalCode( fieldValue ); - } else if ( fieldName == "X-BusinessAddressState" ) { - businessAddress.setRegion( fieldValue ); - } else if ( fieldName == "X-BusinessAddressCountry" ) { - businessAddress.setCountry( fieldValue ); - } else if ( fieldName == "X-OtherAddress" ) { - otherAddress.setLabel( fieldValue ); - } else if ( fieldName == "X-OtherAddressStreet" ) { - otherAddress.setStreet( fieldValue ); - } else if ( fieldName == "X-OtherAddressCity" ) { - otherAddress.setLocality( fieldValue ); - } else if ( fieldName == "X-OtherAddressPostalCode" ) { - otherAddress.setPostalCode( fieldValue ); - } else if ( fieldName == "X-OtherAddressState" ) { - otherAddress.setRegion( fieldValue ); - } else if ( fieldName == "X-OtherAddressCountry" ) { - otherAddress.setCountry( fieldValue ); - } else if ( fieldName == "NICKNAME" ) { - a.setNickName( fieldValue ); - } else if ( fieldName == "ORG" ) { - a.setOrganization( fieldValue ); - } else if ( fieldName == "ROLE" ) { - a.setRole( fieldValue ); - } else if ( fieldName == "BDAY" ) { - a.setBirthday( TDEGlobal::locale()->readDate( fieldValue ) ); - } else if ( fieldName == "WEBPAGE" ) { - a.setUrl( KURL( fieldValue ) ); - } else if ( fieldName == "N" ) { - } else if ( fieldName == "X-FirstName" ) { - } else if ( fieldName == "X-MiddleName" ) { - } else if ( fieldName == "X-LastName" ) { - } else if ( fieldName == "X-Title" ) { - } else if ( fieldName == "X-Suffix" ) { - } else if ( fieldName == "X-FileAs" ) { - } else if ( fieldName == "EMAIL" ) { - a.insertEmail( fieldValue, true ); - } else if ( fieldName == "X-E-mail2" ) { - a.insertEmail( fieldValue ); - } else if ( fieldName == "X-E-mail3" ) { - a.insertEmail( fieldValue ); - } else if ( fieldName == "X-Notes" ) { - } else { - a.insertCustom( "KADDRESSBOOK", fieldName, fieldValue ); - } - } - - if ( !homeAddress.isEmpty() ) a.insertAddress( homeAddress ); - if ( !businessAddress.isEmpty() ) a.insertAddress( businessAddress ); - if ( !otherAddress.isEmpty() ) a.insertAddress( otherAddress ); -} - -void importKab( KABC::AddressBook *ab, bool override, bool quiet ) -{ - TQString fileName = TDEGlobal::dirs()->saveLocation( "data", "kab/" ); - fileName += "addressbook.kab"; - if ( !TQFile::exists( fileName ) ) { - if ( !quiet ) { - KMessageBox::error( 0, "<qt>" + i18n( "Address book file <b>%1</b> not found! Make sure the old address book is located there and you have read permission for this file." ) - .arg( fileName ) + "</qt>" ); - } - kdDebug(5700) << "No KDE 2 addressbook found." << endl; - return; - } - - kdDebug(5700) << "Converting old-style kab addressbook to " - "new-style kabc addressbook." << endl; - - KabAPI kab( 0 ); - if ( kab.init() != ::AddressBook::NoError ) { - kdDebug(5700) << "Error initing kab" << endl; - exit( 1 ); - } - - KabKey key; - ::AddressBook::Entry entry; - - int num = kab.addressbook()->noOfEntries(); - - kdDebug(5700) << "kab Addressbook has " << num << " entries." << endl; - - for ( int i = 0; i < num; ++i ) { - if ( ::AddressBook::NoError != kab.addressbook()->getKey( i, key ) ) { - kdDebug(5700) << "Error getting key for index " << i << " from kab." << endl; - continue; - } - if ( ::AddressBook::NoError != kab.addressbook()->getEntry( key, entry ) ) { - kdDebug(5700) << "Error getting entry for index " << i << " from kab." << endl; - continue; - } - - Addressee a; - - // Convert custom entries - int count = 0; - bool idFound = false; - TQStringList::ConstIterator customIt; - for ( customIt = entry.custom.begin(); customIt != entry.custom.end(); ++customIt ) { - if ( (*customIt).startsWith( "X-KABC-UID:" ) ) { - a.setUid( (*customIt).mid( (*customIt).find( ":" ) + 1 ) ); - idFound = true; - } else if ( (*customIt).startsWith( "KMail:1.0\n" ) ) { - readKAddressBookEntries( *customIt, a ); - } else { - a.insertCustom( "tdeab2tdeabc", TQString::number( count++ ), *customIt ); - } - } - if ( idFound ) { - if ( !override ) continue; - } else { - entry.custom << "X-KABC-UID:" + a.uid(); - ::AddressBook::ErrorCode error = kab.addressbook()->change( key, entry ); - if ( error != ::AddressBook::NoError ) { - kdDebug(5700) << "kab.change returned with error " << error << endl; - } else { - kdDebug(5700) << "Wrote back to kab uid " << a.uid() << endl; - } - } - - a.setTitle( entry.title ); - a.setFormattedName( entry.fn ); - a.setPrefix( entry.nameprefix ); - a.setGivenName( entry.firstname ); - a.setAdditionalName( entry.middlename ); - a.setFamilyName( entry.lastname ); - a.setBirthday( entry.birthday ); - - TQStringList::ConstIterator emailIt; - for ( emailIt = entry.emails.begin(); emailIt != entry.emails.end(); ++emailIt ) - a.insertEmail( *emailIt ); - - TQStringList::ConstIterator phoneIt; - for ( phoneIt = entry.telephone.begin(); phoneIt != entry.telephone.end(); ++phoneIt ) { - int kabType = (*phoneIt++).toInt(); - if ( phoneIt == entry.telephone.end() ) break; - TQString number = *phoneIt; - int type = 0; - if ( kabType == ::AddressBook::Fixed ) type = PhoneNumber::Voice; - else if ( kabType == ::AddressBook::Mobile ) type = PhoneNumber::Cell | PhoneNumber::Voice; - else if ( kabType == ::AddressBook::Fax ) type = PhoneNumber::Fax; - else if ( kabType == ::AddressBook::Modem ) type = PhoneNumber::Modem; - a.insertPhoneNumber( PhoneNumber( number, type ) ); - } - - if ( entry.URLs.count() > 0 ) { - a.setUrl( KURL( entry.URLs.first() ) ); - if ( entry.URLs.count() > 1 ) { - kdWarning() << "More than one URL. Ignoring all but the first." << endl; - } - } - - int noAdr = entry.noOfAddresses(); - for ( int j = 0; j < noAdr; ++j ) { - ::AddressBook::Entry::Address kabAddress; - entry.getAddress( j, kabAddress ); - - Address adr; - - adr.setStreet( kabAddress.address ); - adr.setPostalCode( kabAddress.zip ); - adr.setLocality( kabAddress.town ); - adr.setCountry( kabAddress.country ); - adr.setRegion( kabAddress.state ); - - TQString label; - if ( !kabAddress.headline.isEmpty() ) label += kabAddress.headline + "\n"; - if ( !kabAddress.position.isEmpty() ) label += kabAddress.position + "\n"; - if ( !kabAddress.org.isEmpty() ) label += kabAddress.org + "\n"; - if ( !kabAddress.orgUnit.isEmpty() ) label += kabAddress.orgUnit + "\n"; - if ( !kabAddress.orgSubUnit.isEmpty() ) label += kabAddress.orgSubUnit + "\n"; - if ( !kabAddress.deliveryLabel.isEmpty() ) label += kabAddress.deliveryLabel + "\n"; - adr.setLabel( label ); - - a.insertAddress( adr ); - } - - TQString note = entry.comment; - - if ( !entry.user1.isEmpty() ) note += "\nUser1: " + entry.user1; - if ( !entry.user2.isEmpty() ) note += "\nUser2: " + entry.user2; - if ( !entry.user3.isEmpty() ) note += "\nUser3: " + entry.user3; - if ( !entry.user4.isEmpty() ) note += "\nUser4: " + entry.user4; - - if ( !entry.keywords.count() == 0 ) note += "\nKeywords: " + entry.keywords.join( ", " ); - - TQStringList::ConstIterator talkIt; - for ( talkIt = entry.talk.begin(); talkIt != entry.talk.end(); ++talkIt ) { - note += "\nTalk: " + (*talkIt); - } - - a.setNote( note ); - - a.setPrefix( entry.rank + a.prefix() ); // Add rank to prefix - - a.setCategories( entry.categories ); - - kdDebug(5700) << "Addressee: " << a.familyName() << endl; - - ab->insertAddressee( a ); - } - - kab.save( true ); -} - -int main( int argc, char **argv ) -{ - TDEAboutData aboutData( "tdeab2tdeabc", I18N_NOOP( "Kab to Kabc Converter" ), "0.1" ); - aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); - - TDECmdLineArgs::init( argc, argv, &aboutData ); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app; - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - bool override = false; - - if ( args->isSet( "override" ) ) { - kdDebug() << "Override existing entries." << endl; - - override = true; - } - - bool quiet = false; - - if ( args->isSet( "quiet" ) ) - quiet = true; - - if ( args->isSet( "disable-autostart" ) ) { - kdDebug() << "Disable autostart." << endl; - - TDEConfig *config = app.config(); - config->setGroup( "Startup" ); - config->writeEntry( "EnableAutostart", false ); - } - - KABC::AddressBook *kabcBook = StdAddressBook::self(); - - importKMailAddressBook( kabcBook ); - - importKab( kabcBook, override, quiet ); - - StdAddressBook::save(); - - kdDebug(5700) << "Saved kabc addressbook to '" << kabcBook->identifier() << "'" << endl; -} - diff --git a/kabc/tdeab2tdeabc.desktop b/kabc/tdeab2tdeabc.desktop deleted file mode 100644 index 945f044d4..000000000 --- a/kabc/tdeab2tdeabc.desktop +++ /dev/null @@ -1,105 +0,0 @@ -[Desktop Entry] -Name=tdeab2tdeabc -Name[af]=kab-na-kabc -Name[csb]=Kònwersëjô adresowi knéżczi -Name[eo]=Konvertilo de "kab" al "kabc" -Name[fr]=KAB2KABC -Name[fy]=Kab2kabc -Name[hu]=Kab2kabc -Name[it]=Kab2Kabc -Name[nl]=Kab2kabc -Name[pl]=Konwersja książki adresowej -Name[pt_BR]=Conversão de kab para kabc -Name[ro]=Kab2kabc -Name[sv]=Kab2kabc -Name[te]=కెఎబి2కెఎబిసి -Name[zu]=i-tdeab2tdeabc -Exec=tdeab2tdeabc --disable-autostart --quiet -Icon=misc -Type=Application -Comment=libkab to libkabc conversion tool. -Comment[af]=libkab na libkabc omskakeling program. -Comment[ar]=أداة تحويل libkab إلى libkabc. -Comment[az]=libkab - libkabc dönüşdürmÉ™ vasitÉ™si. -Comment[be]=ІнÑтрумент пераўтварÑÐ½Ð½Ñ libkab у libkabc. -Comment[bg]=Програма за конвертиране на libkab до libkabc. -Comment[bn]=libkab থেকে libkabc-তে পরিবরà§à¦¤à¦¨ করার পà§à¦°à§‹à¦—à§à¦°à¦¾à¦®à¥¤ -Comment[bs]=alat za pretvaranje libkab u libkabc. -Comment[ca]=Eina de conversió de libkab a libkabc. -Comment[cs]=PÅ™evod dat z libkab do libkabc. -Comment[csb]=Nôrzãdze do kònwersëji z libkab do libkabc. -Comment[cy]=erfyn trosi libkab i libkabc -Comment[da]=libkab-til-libkabc-konverteringsværktøj. -Comment[de]=Konvertierung von libkab in libkabc -Comment[el]=ΕÏγαλείο μετατÏοπής από το libkab στο libkabc. -Comment[eo]=Konvertilo de "libkab" al "libkabc" -Comment[es]=Conversor libkab a libkabc. -Comment[et]=libkab -> libkabc teisendamine -Comment[eu]=libkab-etik libkabc-era bihurtzeko tresna. -Comment[fa]=ابزار تبدیل libkab به libcabc. -Comment[fi]=libkab-libkabc -muunnin -Comment[fr]=Outil de conversion de libkab vers libkabc. -Comment[fy]=Konversjeprogramma fan libkab nei libkabc. -Comment[ga]=Uirlis tiontaithe ó libkab go libkabc. -Comment[gl]=Ferramenta de conversión de libkab a libkabc. -Comment[he]=כלי המרה מ־libkab ל־libkabc -Comment[hi]=libkab से libkabc बदलने वाला औजार -Comment[hr]=Alat za pretvaranje iz libkab u libkabc -Comment[hsb]=libkab -> libkabc konwerter -Comment[hu]=libkab -> libkabc konvertáló. -Comment[id]=konverter libkab ke libkabc. -Comment[is]=libkab í libkabc breytingatól. -Comment[it]=Strumento di conversione da libkab a libkabc. -Comment[ja]=libkab ã‹ã‚‰ libkabc ã¸ã®å¤‰æ›ãƒ„ール -Comment[ka]=libkab => libkabc გáƒáƒ áƒ“áƒáƒ¥áƒ›áƒœáƒ˜áƒ¡ ხელსáƒáƒ¬áƒ§áƒ. -Comment[kk]=libkab дегеннен libkabc дегенге айналдыру құралы. -Comment[km]=ឧបករណáŸâ€‹áž”ម្លែង​ពី libkab ទៅ libkabc -Comment[ko]=libkabì„ libkabc로 바꿔주는 연장. -Comment[lb]=libkab op libkabc Konvertéierungs-Hëllefsmëttel. -Comment[lt]=libkab į libkabc konvertavimo įrankis. -Comment[lv]=libkab uz libkabc kovertēšanas rÄ«ks. -Comment[mk]=алатка за претворање од libkab во libkabc. -Comment[mn]=libkab-Ð°Ð°Ñ libkabc-руу хөрвүүлÑгч -Comment[ms]=perkakasan penukaran libkab to libkabc. -Comment[mt]=Għodda għall-konverżjoni libkab għal libkabc -Comment[nb]=libkab til libkabc konverteringsverktøy. -Comment[nds]=Warktüüch för't Ümwanneln vun libkab na libkabc. -Comment[ne]=libkab to libkabc रूपानà¥à¤¤à¤°à¤£ उपकरण । -Comment[nl]=Conversieprogramma van libkab naar libkabc. -Comment[nn]=Konverterer libkab til libkabc -Comment[nso]=Sebereka sa phetosetso ya libkab go libkabc -Comment[pa]=libkab ਤੋ libkabc ਤਬਦੀਲੀ ਸੰਦ। -Comment[pl]=NarzÄ™dzie do konwersji z libkab do libkabc. -Comment[pt]=Ferramenta de conversão de libkab para libkabc. -Comment[pt_BR]=Ferramenta de conversão de libkab para libkabc. -Comment[ro]=Utilitar de conversie de la "libkab" la "libkabc". -Comment[ru]=утилита Ð¿Ñ€ÐµÐ¾Ð±Ñ€Ð°Ð·Ð¾Ð²Ð°Ð½Ð¸Ñ libkab в libkabc. -Comment[rw]=Igikoresho cy'ihindura libkab muri libkabc. -Comment[se]=konverterenreaidu libkab:as libkabc:ai -Comment[sk]=Prevod dát z libkab do libkabc. -Comment[sl]=Orodje za pretvorbo iz libkab v libkabc -Comment[sq]=Vegla për shëndrimin e libkab në libkabc. -Comment[sr]=Ðлат за конверзију из libkab-а у libkabc. -Comment[sr@Latn]=Alat za konverziju iz libkab-a u libkabc. -Comment[ss]=Lithulusi lekutjintja le-libkab kuya ku-libkabc. -Comment[sv]=Konverteringsverktyg frÃ¥n libkab till libkabc -Comment[ta]=libkab இலிரà¯à®¨à¯à®¤à¯ libkabc கà¯à®•௠மாறà¯à®±à¯à®®à¯ கரà¯à®µà®¿. -Comment[te]=libkab à°¨à±à°‚à°šà°¿ libkabc కౠమారà±à°šà± పనిమà±à°Ÿà±à°Ÿà± -Comment[tg]=аÑбоби дигаргунÑози libkab ба libkabc -Comment[th]=เครื่องมือเปลี่ยน libkab เป็น libkabc -Comment[tr]=libkab' tan libkabc' ye dönüştürme aracı -Comment[tt]=libkab-›libkabc äyländerü qoralı. -Comment[uk]=ЗаÑіб Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ libkab до libkabc. -Comment[uz]=libkab'ni libkabc'ga aylantiradigan vosita. -Comment[uz@cyrillic]=libkab'ни libkabc'га айлантирадиган воÑита. -Comment[ven]=Tshishumiswa tsha u shandukisa libkab itshi ya kha libkabc -Comment[vi]=Công cụ chuyển đổi libkab sang libkabc. -Comment[xh]=libkab kwi libkabc isixhobo sokuguqulela. -Comment[zh_CN]=libkab 到 libkabc 的转æ¢å·¥å…·ã€‚ -Comment[zh_HK]=libkab 至 libkabc 的轉æ›å·¥å…· -Comment[zh_TW]=libkab 至 libkabc 轉æ›å·¥å…· -Comment[zu]=Ithuluzi lokuguqula le-libkab kuyaku-libkabc -Terminal=false -NoDisplay=true -X-TDE-autostart-condition=tdeab2tdeabcrc:Startup:EnableAutostart:true -OnlyShowIn=TDE; diff --git a/kabc/tests/Makefile.am b/kabc/tests/Makefile.am deleted file mode 100644 index 961d12bd4..000000000 --- a/kabc/tests/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -# Make sure $(all_includes) remains last! -INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_srcdir)/kab \ - -I$(srcdir)/../vcardparser/ -I$(srcdir)/../vcard/include \ - -I$(srcdir)/../vcard/include/generated \ - -I$(srcdir)/../vcardparser $(all_includes) -LDADD = ../libkabc.la - -METASOURCES = AUTO - -check_PROGRAMS = testlock testldapclient - -testlock_LDFLAGS = $(all_libraries) -testlock_SOURCES = testlock.cpp - -testldapclient_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testldapclient_SOURCES = testldapclient.cpp - -EXTRA_PROGRAMS = testkabc testkabcdlg testdistlist bigread bigwrite testdb \ - testaddressee testaddresseelist testaddressfmt kabcargl testaddresslineedit - -testkabc_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testkabc_SOURCES = testkabc.cpp - -testaddressee_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testaddressee_SOURCES = testaddressee.cpp - -testaddresseelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testaddresseelist_SOURCES = testaddresseelist.cpp - -testaddressfmt_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testaddressfmt_SOURCES = testaddressfmt.cpp - -testkabcdlg_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testkabcdlg_SOURCES = testkabcdlg.cpp - -testdistlist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testdistlist_SOURCES = testdistlist.cpp - -testaddresslineedit_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testaddresslineedit_SOURCES = testaddresslineedit.cpp - -bigread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -bigread_LDADD = ../libkabc.la $(top_builddir)/kabc/plugins/file/libkabc_file.la -bigread_SOURCES = bigread.cpp - -bigwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -bigwrite_LDADD = ../libkabc.la $(top_builddir)/kabc/plugins/file/libkabc_file.la -bigwrite_SOURCES = bigwrite.cpp - -testdb_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testdb_SOURCES = testdb.cpp - -kabcargl_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kabcargl_SOURCES = kabcargl.cpp - diff --git a/kabc/tests/bigread.cpp b/kabc/tests/bigread.cpp deleted file mode 100644 index 5ea2393dc..000000000 --- a/kabc/tests/bigread.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include <sys/times.h> - -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> - -#include "addressbook.h" -#include "vcardformat.h" -#include "plugins/file/resourcefile.h" -#if 0 -#include "resourcesql.h" -#endif - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("bigread","BigReadKabc","0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - - TDEApplication app( false, false ); - - AddressBook ab; - - ResourceFile r( "my.kabc", "vcard2" ); - ab.addResource( &r ); - -#if 0 - ResourceSql rsql( &ab, "root", "kde4ever", "localhost" ); - ab.addResource( &rsql ); -#endif - - struct tms start; - - times( &start ); - -#if 0 - kdDebug() << "utime : " << int( start.tms_utime ) << endl; - kdDebug() << "stime : " << int( start.tms_stime ) << endl; - kdDebug() << "cutime: " << int( start.tms_cutime ) << endl; - kdDebug() << "cstime: " << int( start.tms_cstime ) << endl; -#endif - - kdDebug() << "Start load" << endl; - ab.load(); - kdDebug() << "Finished load" << endl; - - struct tms end; - - times( &end ); - -#if 0 - kdDebug() << "utime : " << int( end.tms_utime ) << endl; - kdDebug() << "stime : " << int( end.tms_stime ) << endl; - kdDebug() << "cutime: " << int( end.tms_cutime ) << endl; - kdDebug() << "cstime: " << int( end.tms_cstime ) << endl; -#endif - - kdDebug() << "UTime: " << int( end.tms_utime ) - int( start.tms_utime ) << endl; - kdDebug() << "STime: " << int( end.tms_stime ) - int( start.tms_stime ) << endl; - -// ab.dump(); -} diff --git a/kabc/tests/bigwrite.cpp b/kabc/tests/bigwrite.cpp deleted file mode 100644 index 167f5d44d..000000000 --- a/kabc/tests/bigwrite.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include <sys/times.h> - -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> - -#include "addressbook.h" -#include "vcardformat.h" -#include "plugins/file/resourcefile.h" - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("bigwrite","BigWriteKabc","0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - - TDEApplication app( false, false ); - - AddressBook ab; - ResourceFile r( "my.kabc", "vcard" ); - ab.addResource( &r ); - - for( int i = 0; i < 5000; ++i ) { - Addressee a; - a.setGivenName( "number" + TQString::number( i ) ); - a.setFamilyName( "Name" ); - a.insertEmail( TQString::number( i ) + "@domain" ); - - ab.insertAddressee( a ); - } - printf( "\n" ); - - Ticket *t = ab.requestSaveTicket( &r ); - if ( t ) { - struct tms start; - - times( &start ); - -#if 0 - kdDebug() << "utime : " << int( start.tms_utime ) << endl; - kdDebug() << "stime : " << int( start.tms_stime ) << endl; - kdDebug() << "cutime: " << int( start.tms_cutime ) << endl; - kdDebug() << "cstime: " << int( start.tms_cstime ) << endl; -#endif - - if ( !ab.save( t ) ) { - kdDebug() << "Can't save." << endl; - } - - struct tms end; - - times( &end ); - -#if 0 - kdDebug() << "utime : " << int( end.tms_utime ) << endl; - kdDebug() << "stime : " << int( end.tms_stime ) << endl; - kdDebug() << "cutime: " << int( end.tms_cutime ) << endl; - kdDebug() << "cstime: " << int( end.tms_cstime ) << endl; -#endif - - kdDebug() << "UTime: " << int( end.tms_utime ) - int( start.tms_utime ) << endl; - kdDebug() << "STime: " << int( end.tms_stime ) - int( start.tms_stime ) << endl; - - } else { - kdDebug() << "No ticket for save." << endl; - } -} diff --git a/kabc/tests/kabcargl.cpp b/kabc/tests/kabcargl.cpp deleted file mode 100644 index 589c973f2..000000000 --- a/kabc/tests/kabcargl.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> -#include <tqtextstream.h> -#include <tqregexp.h> - -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <tdecmdlineargs.h> -#include <kglobal.h> -#include <kstandarddirs.h> - -#include "stdaddressbook.h" - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("kabcargl","Fix broken pre3.0rc3 format","0.1"); - aboutData.addAuthor("Cornelius Schumacher", 0, "schumacher@kde.org"); - - TDECmdLineArgs::init(argc,argv,&aboutData); - - TDEApplication app; - - TQString filename = StdAddressBook::fileName(); - - TQFile f( filename ); - if ( !f.open( IO_ReadOnly ) ) { - kdDebug() << "Error opening file '" << filename << "' for reading." << endl; - return 1; - } - - TQTextStream t( &f ); - t.setEncoding(TQTextStream::UnicodeUTF8); - TQString text = t.read(); - f.close(); - - text = TQString::fromUtf8( text.local8Bit() ); - text.replace( "\n", "\r\n" ); - - if ( !f.open( IO_WriteOnly ) ) { - kdDebug() << "Error opening file '" << filename << "' for writing." << endl; - return 1; - } - - TQTextStream t2( &f ); - t2.setEncoding(TQTextStream::UnicodeUTF8); - t2 << text; - f.close(); -} diff --git a/kabc/tests/testaddressee.cpp b/kabc/tests/testaddressee.cpp deleted file mode 100644 index 09f95d29b..000000000 --- a/kabc/tests/testaddressee.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> -#include <kstandarddirs.h> - -#include "addressbook.h" -#include "plugins/file/resourcefile.h" -#include "formats/binaryformat.h" -#include "vcardformat.h" -#include "phonenumber.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - { "save", "", 0 }, - { "number", "", 0 }, - TDECmdLineLastOption -}; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testaddressee","TestAddressee","0.1"); - TDECmdLineArgs::init(argc, argv, &aboutData); - TDECmdLineArgs::addCmdLineOptions(options); - - TDEApplication app; - TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); - - kdDebug() << "Creating a" << endl; - Addressee a; - - kdDebug() << "tick1" << endl; - a.setGivenName("Hans"); - kdDebug() << "tick2" << endl; - a.setPrefix("Dr."); - - kdDebug() << "Creating b" << endl; - Addressee b( a ); - - kdDebug() << "tack1" << endl; - a.setFamilyName("Wurst"); - kdDebug() << "tack2" << endl; - a.setNickName("hansi"); - - kdDebug() << "Creating c" << endl; - Addressee c = a; - - kdDebug() << "tock1" << endl; - c.setGivenName("Eberhard"); - - a.dump(); - b.dump(); - c.dump(); -} diff --git a/kabc/tests/testaddresseelist.cpp b/kabc/tests/testaddresseelist.cpp deleted file mode 100644 index 10fa4aaef..000000000 --- a/kabc/tests/testaddresseelist.cpp +++ /dev/null @@ -1,196 +0,0 @@ -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> -#include <kstandarddirs.h> - -#include "addressbook.h" -#include "addresseelist.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - { "save", "", 0 }, - { "number", "", 0 }, - TDECmdLineLastOption -}; - -int main(int /*argc*/,char /* **argv*/) -{ -/* TDEAboutData aboutData("testaddresseelist","TestAddresseeList","0.1"); - TDECmdLineArgs::init(argc, argv, &aboutData); - TDECmdLineArgs::addCmdLineOptions(options); - - TDEApplication app; - TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); */ - - kdDebug() << "Creating addressees" << endl; - Addressee a, b, c, d, e, f; - a.setGivenName ("Peter"); - a.setFamilyName("Pan"); - a.setFormattedName("Pan, Peter"); - a.setUid("Asdf"); - b.setGivenName ("Phileas"); - b.setFamilyName("Fogg"); - b.setFormattedName("Fogg, Phileas"); - b.setUid("Rsdf"); - c.setGivenName ("Jim"); - c.setFamilyName("Hawkins"); - c.setFormattedName("Hawkins, Jim"); - c.setUid("Fhwn"); - d.setGivenName ("John"); - d.setFamilyName("Silver"); - d.setPrefix ("Long"); - d.setFormattedName("Long John Silver"); - d.setUid("Z2hk"); - e.setGivenName ("Alice"); - e.setFamilyName("Liddel"); - e.setFormattedName("Liddel, Alice"); - e.setUid("kk45"); - f.setGivenName ("Edmond"); - f.setFamilyName("Dantes"); - f.setFormattedName("Dantes, Edmond"); - f.setUid("78ze"); - - kdDebug() << "Adding to list" << endl; - AddresseeList list; - list.append(a); - list.append(b); - list.append(c); - list.append(d); - list.append(e); - list.append(f); - - list.sortBy(FamilyName); - if ( !( (*list.at(0)).uid()=="78ze" - && (*list.at(1)).uid()=="Rsdf" - && (*list.at(2)).uid()=="Fhwn" - && (*list.at(3)).uid()=="kk45" - && (*list.at(4)).uid()=="Asdf" - && (*list.at(5)).uid()=="Z2hk" - ) ) { - kdError() << "SORTING BY FAMILY NAME NOT CORRECT!" << endl; - kdDebug() << "list sorted by family name:" << endl; - list.dump(); - } else { - kdDebug() << "Sorting by family name correct." << endl; - } - list.setReverseSorting(true); - list.sort(); - if ( !( (*list.at(5)).uid()=="78ze" - && (*list.at(4)).uid()=="Rsdf" - && (*list.at(3)).uid()=="Fhwn" - && (*list.at(2)).uid()=="kk45" - && (*list.at(1)).uid()=="Asdf" - && (*list.at(0)).uid()=="Z2hk" - ) ) { - kdError() << "REVERSE SORTING BY FAMILY NAME NOT CORRECT!" << endl; - kdDebug() << "list reverse sorted by family name:" << endl; - list.dump(); - } else { - kdDebug() << "Reverse sorting by family name correct." << endl; - } - - list.setReverseSorting(false); - list.sortBy(FormattedName); - if ( !( (*list.at(0)).uid()=="78ze" - && (*list.at(1)).uid()=="Rsdf" - && (*list.at(2)).uid()=="Fhwn" - && (*list.at(3)).uid()=="kk45" - && (*list.at(4)).uid()=="Z2hk" - && (*list.at(5)).uid()=="Asdf" - ) ) { - kdError() << "SORTING BY FORMATTED NAME NOT CORRECT!" << endl; - kdDebug() << "list sorted by formatted name:" << endl; - list.dump(); - } else { - kdDebug() << "Sorting by formatted name correct." << endl; - } - list.setReverseSorting(true); - list.sort(); - if ( !( (*list.at(5)).uid()=="78ze" - && (*list.at(4)).uid()=="Rsdf" - && (*list.at(3)).uid()=="Fhwn" - && (*list.at(2)).uid()=="kk45" - && (*list.at(1)).uid()=="Z2hk" - && (*list.at(0)).uid()=="Asdf" - ) ) { - kdError() << "REVERSE SORTING BY FORMATTED NAME NOT CORRECT!" << endl; - kdDebug() << "list reverse sorted by formatted name:" << endl; - list.dump(); - } else { - kdDebug() << "Reverse sorting by formatted name correct." << endl; - } - - - list.setReverseSorting(false); - list.sortBy(Uid); - if ( !( (*list.at(0)).uid()=="78ze" - && (*list.at(1)).uid()=="Asdf" - && (*list.at(2)).uid()=="Fhwn" - && (*list.at(3)).uid()=="Rsdf" - && (*list.at(4)).uid()=="Z2hk" - && (*list.at(5)).uid()=="kk45" - ) ) { - kdError() << "SORTING BY UID NOT CORRECT!" << endl; - kdDebug() << "list sorted by Uid:" << endl; - list.dump(); - } else { - kdDebug() << "Sorting by Uid correct." << endl; - } - list.setReverseSorting(true); - list.sortBy(Uid); - if ( !( (*list.at(5)).uid()=="78ze" - && (*list.at(4)).uid()=="Asdf" - && (*list.at(3)).uid()=="Fhwn" - && (*list.at(2)).uid()=="Rsdf" - && (*list.at(1)).uid()=="Z2hk" - && (*list.at(0)).uid()=="kk45" - ) ) { - kdError() << "REVERSE SORTING BY UID NOT CORRECT!" << endl; - kdDebug() << "list sorted by Uid:" << endl; - list.dump(); - } else { - kdDebug() << "Reverse sorting by Uid correct." << endl; - } - - // zero, one or two entries might give errors in a poor sorting - // implementation - kdDebug() << "sorting empty list" << endl; - AddresseeList list2; - list2.sort(); - - kdDebug() << "sorting one entry list" << endl; - list2.append(a); - list2.sort(); - - kdDebug() << "sorting two entry list" << endl; - list2.append(f); - list2.setReverseSorting(false); - list2.sort(); - if ( !( (*list2.at(0)).uid()=="78ze" - && (*list2.at(1)).uid()=="Asdf" - ) ) { - kdError() << "SORTING BY FORMATTED NAME IN A TWO ENTRY LIST NOT CORRECT!" << endl; - kdDebug() << "list sorted by formatted name, two entries:" << endl; - list2.dump(); - } else { - kdDebug() << "Sorting by FormattedName in a two entry list correct." << endl; - } - list2.setReverseSorting(true); - list2.sort(); - if ( !( (*list2.at(1)).uid()=="78ze" - && (*list2.at(0)).uid()=="Asdf" - ) ) { - kdError() << "REVERSE SORTING BY FORMATTED NAME IN A TWO ENTRY LIST NOT CORRECT!" << endl; - kdDebug() << "list reverse sorted by formatted name, two entries:" << endl; - list2.dump(); - } else { - kdDebug() << "Reverse sorting by FormattedName in a two entry list correct." << endl; - } - -} - - diff --git a/kabc/tests/testaddressfmt.cpp b/kabc/tests/testaddressfmt.cpp deleted file mode 100644 index ca13a116c..000000000 --- a/kabc/tests/testaddressfmt.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> -#include <kstandarddirs.h> - -#include "addressbook.h" -#include "address.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - { "save", "", 0 }, - { "number", "", 0 }, - TDECmdLineLastOption -}; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testaddressfmt","TestAddressFormat","0.1"); - TDECmdLineArgs::init(argc, argv, &aboutData); - TDECmdLineArgs::addCmdLineOptions(options); - - TDEApplication app; - - Address a; - a.setStreet("Lummerlandstr. 1"); - a.setPostalCode("12345"); - a.setLocality("Lummerstadt"); - a.setCountry ("Germany"); - - Address b; - b.setStreet("457 Foobar Ave"); - b.setPostalCode("1A2B3C"); - b.setLocality("Nervousbreaktown"); - b.setRegion("DC"); - b.setCountry("United States of America"); - - Address c; - c.setStreet("Lummerlandstr. 1"); - c.setPostalCode("12345"); - c.setLocality("Lummerstadt"); - c.setCountry ("Deutschland"); - - Address d; - d.setStreet("Lummerlandstr. 1"); - d.setPostalCode("12345"); - d.setLocality("Lummerstadt"); - d.setCountry (""); - - tqDebug( "-------------------------------------\nShould have german address formatting, local country formatting\n" ); - tqDebug( a.formattedAddress("Jim Knopf").latin1() ); - tqDebug( "-------------------------------------\nShould have US address formatting, local country formatting\n" ); - tqDebug( b.formattedAddress("Huck Finn").latin1() ); - tqDebug( "-------------------------------------\nShould have german address formatting, local country formatting\n" ); - tqDebug( c.formattedAddress("Jim Knopf").latin1() ); - tqDebug( "-------------------------------------\nShould have local address formatting, local country formatting\n" ); - tqDebug( d.formattedAddress("Jim Knopf").latin1() ); -} - - diff --git a/kabc/tests/testaddresslineedit.cpp b/kabc/tests/testaddresslineedit.cpp deleted file mode 100644 index 7315aef7e..000000000 --- a/kabc/tests/testaddresslineedit.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> - -#include "addresslineedit.h" - -using namespace KABC; - -int main( int argc,char **argv ) -{ - TDEAboutData aboutData( "testaddresslineedit", - I18N_NOOP( "Test Address LineEdit" ), "0.1" ); - TDECmdLineArgs::init( argc, argv, &aboutData ); - - TDEApplication app; - - AddressLineEdit *lineEdit = new AddressLineEdit( 0 ); - - lineEdit->show(); - app.setMainWidget( lineEdit ); - - TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) ); - - app.exec(); - - delete lineEdit; -} diff --git a/kabc/tests/testdb.cpp b/kabc/tests/testdb.cpp deleted file mode 100644 index fd4e4f6c1..000000000 --- a/kabc/tests/testdb.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> - -#include "addressbook.h" -#include "vcardformat.h" -#include "resourcesql.h" - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testdb","TestKabcDB","0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - -// TDEApplication app( false, false ); - TDEApplication app; - - AddressBook ab; - - ResourceSql r( &ab, "root", "kde4ever", "localhost" ); - if ( ! r.open() ) { - kdDebug() << "Failed to open resource." << endl; - } - - r.load( &ab ); - - r.close(); - - ab.dump(); -} diff --git a/kabc/tests/testdistlist.cpp b/kabc/tests/testdistlist.cpp deleted file mode 100644 index 0f0e90f90..000000000 --- a/kabc/tests/testdistlist.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include <tqwidget.h> - -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> - -#include "stdaddressbook.h" - -#include "distributionlisteditor.h" -#include "distributionlist.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - {"list <listname>", I18N_NOOP("Show distribution list with name <listname>"), 0}, - TDECmdLineLastOption -}; - - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testdistlist",I18N_NOOP("Test Distribution Lists"),"0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app; - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - if (args->isSet("list")) { - TQString name = args->getOption("list"); - - DistributionListManager *manager = - new DistributionListManager( StdAddressBook::self() ); - manager->load(); - DistributionList *list = manager->list( name ); - if ( !list ) { - kdDebug() << "No list with name '" << name << "'" << endl; - return 1; - } else { - kdDebug() << "RESULT: " << list->emails().join(", ") << endl; - return 0; - } - } - - DistributionListEditor *editor = - new DistributionListEditor( StdAddressBook::self(), 0 ); - - editor->show(); - app.setMainWidget(editor); - - TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) ); - - app.exec(); - - delete editor; -} diff --git a/kabc/tests/testkabc.cpp b/kabc/tests/testkabc.cpp deleted file mode 100644 index 3caea88f1..000000000 --- a/kabc/tests/testkabc.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> -#include <kstandarddirs.h> - -#include <tqfile.h> -#include <tqimage.h> - -#include "geo.h" -#include "secrecy.h" -#include "stdaddressbook.h" -#include "timezone.h" -#include "key.h" -#include "agent.h" -#include "vcardconverter.h" - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testkabc",I18N_NOOP("TestKabc"),"0.1"); - TDECmdLineArgs::init(argc, argv, &aboutData); - - TDEApplication app( false, false ); - AddressBook *ab = StdAddressBook::self(); - -#define READ - -#ifdef READ - AddressBook::Iterator it; - for ( it = ab->begin(); it != ab->end(); ++it ) { - TQString vcard; - VCardConverter converter; - converter.addresseeToVCard( *it, vcard ); - kdDebug() << "card=" << vcard << endl; - } -#else - Addressee addr; - - addr.setGivenName("Tobias"); - addr.setFamilyName("Koenig"); - - - Picture pic; - TQImage img; - img.load("/home/tobias/test.png"); -/* - pic.setData(img); - pic.setType(TQImage::imageFormat("/home/tobias/test.png")); -*/ - pic.setUrl("http://www.mypict.de"); - addr.setLogo( pic ); - - ab->insertAddressee( addr ); - - StdAddressBook::save(); -#endif - - return 0; -} diff --git a/kabc/tests/testkabcdlg.cpp b/kabc/tests/testkabcdlg.cpp deleted file mode 100644 index 24225cc1b..000000000 --- a/kabc/tests/testkabcdlg.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include <tqwidget.h> - -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> - -#include "addresseedialog.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - {"multiple", I18N_NOOP("Allow selection of multiple addressees"), 0}, - TDECmdLineLastOption -}; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testkabcdlg",I18N_NOOP("TestKabc"),"0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app; - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - if (args->isSet("multiple")) { - Addressee::List al = AddresseeDialog::getAddressees( 0 ); - Addressee::List::ConstIterator it; - kdDebug() << "Selected Addressees:" << endl; - for( it = al.begin(); it != al.end(); ++it ) { - kdDebug() << " " << (*it).fullEmail() << endl; - } - } else { - Addressee a = AddresseeDialog::getAddressee( 0 ); - - if ( !a.isEmpty() ) { - kdDebug() << "Selected Addressee:" << endl; - a.dump(); - } else { - kdDebug() << "No Addressee selected." << endl; - } - } -} diff --git a/kabc/tests/testldapclient.cpp b/kabc/tests/testldapclient.cpp deleted file mode 100644 index df9fd6226..000000000 --- a/kabc/tests/testldapclient.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2005 David Faure <faure@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 version 2 as published by the Free Software Foundation. - - 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 "testldapclient.h" - -#include <tdeapplication.h> -#include <kdebug.h> -#include <tdecmdlineargs.h> - -#include <tqeventloop.h> - -#include <assert.h> -#include <stdlib.h> - -int main(int argc, char *argv[]) -{ - TDEApplication::disableAutoDcopRegistration(); - TDECmdLineArgs::init(argc,argv,"testldapclient", 0, 0, 0, 0); - TDEApplication app; - - TestLDAPClient test; - test.setup(); - test.runAll(); - test.cleanup(); - kdDebug() << "All tests OK." << endl; - return 0; -} - -void TestLDAPClient::setup() -{ -} - -void TestLDAPClient::runAll() -{ - testIntevation(); -} - -bool TestLDAPClient::check(const TQString& txt, TQString a, TQString b) -{ - if (a.isEmpty()) - a = TQString::null; - if (b.isEmpty()) - b = TQString::null; - if (a == b) { - kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; - } - else { - kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "KO !" << endl; - cleanup(); - exit(1); - } - return true; -} - -void TestLDAPClient::cleanup() -{ - mClient = 0; -} - -void TestLDAPClient::testIntevation() -{ - kdDebug() << k_funcinfo << endl; - mClient = new LdapClient( this ); - - mClient->setHost( "ca.intevation.de" ); - mClient->setPort( "389" ); - mClient->setBase( "o=Intevation GmbH,c=de" ); - - // Same list as in kaddressbook's ldapsearchdialog - TQStringList attrs; - attrs << "l" << "Company" << "co" << "department" << "description" << "mail" << "facsimileTelephoneNumber" << "cn" << "homePhone" << "mobile" << "o" << "pager" << "postalAddress" << "st" << "street" << "title" << "uid" << "telephoneNumber" << "postalCode" << "objectClass"; - // the list from ldapclient.cpp - //attrs << "cn" << "mail" << "givenname" << "sn" << "objectClass"; - mClient->setAttrs( attrs ); - - // Taken from LdapSearch - //TQString mSearchText = TQString::fromUtf8( "Till" ); - //TQString filter = TQString( "&(|(objectclass=person)(objectclass=groupOfNames)(mail=*))(|(cn=%1*)(mail=%2*)(givenName=%3*)(sn=%4*))" ) - // .arg( mSearchText ).arg( mSearchText ).arg( mSearchText ).arg( mSearchText ); - - // For some reason a fromUtf8 broke the search for me (no results). - // But this certainly looks fishy, it might break on non-utf8 systems. - TQString filter = "&(|(objectclass=person)(objectclass=groupofnames)(mail=*))(|(cn=*Ägypten MDK*)(sn=*Ägypten MDK*))"; - - connect( mClient, TQT_SIGNAL( result( const KABC::LdapObject& ) ), - this, TQT_SLOT( slotLDAPResult( const KABC::LdapObject& ) ) ); - connect( mClient, TQT_SIGNAL( done() ), - this, TQT_SLOT( slotLDAPDone() ) ); - connect( mClient, TQT_SIGNAL( error( const TQString& ) ), - this, TQT_SLOT( slotLDAPError( const TQString& ) ) ); - mClient->startQuery( filter ); - kapp->eventLoop()->enterLoop(); - delete mClient; mClient = 0; -} - -// from kaddressbook... ugly though... -static TQString asUtf8( const TQByteArray &val ) -{ - if ( val.isEmpty() ) - return TQString::null; - - const char *data = val.data(); - - //TQString::fromUtf8() bug workaround - if ( data[ val.size() - 1 ] == '\0' ) - return TQString::fromUtf8( data, val.size() - 1 ); - else - return TQString::fromUtf8( data, val.size() ); -} - -static TQString join( const KABC::LdapAttrValue& lst, const TQString& sep ) -{ - TQString res; - bool already = false; - for ( KABC::LdapAttrValue::ConstIterator it = lst.begin(); it != lst.end(); ++it ) { - if ( already ) - res += sep; - already = TRUE; - res += asUtf8( *it ); - } - return res; -} - -void TestLDAPClient::slotLDAPResult( const KABC::LdapObject& obj ) -{ - TQString cn = join( obj.attrs[ "cn" ], ", " ); - kdDebug() << " cn:" << cn << endl; - assert( !obj.attrs[ "mail" ].isEmpty() ); - TQString mail = join( obj.attrs[ "mail" ], ", " ); - kdDebug() << " mail:" << mail << endl; - assert( mail.contains( '@' ) ); -} - -void TestLDAPClient::slotLDAPError( const TQString& err ) -{ - kdDebug() << k_funcinfo << err << endl; - ::exit( 1 ); -} - -void TestLDAPClient::slotLDAPDone() -{ - kdDebug() << k_funcinfo << endl; - kapp->eventLoop()->exitLoop(); -} - -#include "testldapclient.moc" diff --git a/kabc/tests/testldapclient.h b/kabc/tests/testldapclient.h deleted file mode 100644 index 1995914c3..000000000 --- a/kabc/tests/testldapclient.h +++ /dev/null @@ -1,51 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2005 David Faure <faure@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 version 2 as published by the Free Software Foundation. - - 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 TESTLDAPCLIENT_H -#define TESTLDAPCLIENT_H - -#include <tqobject.h> - -#include "../ldapclient.h" -typedef KABC::LdapClient LdapClient; - -class TestLDAPClient : public TQObject -{ - Q_OBJECT - -public: - TestLDAPClient() {} - void setup(); - void runAll(); - void cleanup(); - - // tests - void testIntevation(); - -private slots: - void slotLDAPResult( const KABC::LdapObject& ); - void slotLDAPError( const TQString& ); - void slotLDAPDone(); - -private: - bool check(const TQString& txt, TQString a, TQString b); - - LdapClient* mClient; -}; - -#endif diff --git a/kabc/tests/testlock.cpp b/kabc/tests/testlock.cpp deleted file mode 100644 index 632c690a6..000000000 --- a/kabc/tests/testlock.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2003 Cornelius Schumacher <schumacher@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 "testlock.h" - -#include "stdaddressbook.h" - -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> -#include <kdirwatch.h> - -#include <kmessagebox.h> -#include <kdialog.h> - -#include <tqwidget.h> -#include <tqlabel.h> -#include <tqlayout.h> -#include <tqpushbutton.h> -#include <tqlistview.h> -#include <tqdir.h> - -#include <iostream> - -#include <sys/types.h> -#include <unistd.h> - -using namespace KABC; - -LockWidget::LockWidget( const TQString &identifier ) -{ - TQVBoxLayout *topLayout = new TQVBoxLayout( this ); - topLayout->setMargin( KDialog::marginHint() ); - topLayout->setSpacing( KDialog::spacingHint() ); - - if ( identifier.isEmpty() ) { - mLock = 0; - } else { - mLock = new Lock( identifier ); - - int pid = getpid(); - - TQLabel *pidLabel = new TQLabel( "Process ID: " + TQString::number( pid ), - this ); - topLayout->addWidget( pidLabel ); - - TQHBoxLayout *identifierLayout = new TQHBoxLayout( topLayout ); - - TQLabel *resourceLabel = new TQLabel( "Identifier:", this ); - identifierLayout->addWidget( resourceLabel ); - - TQLabel *resourceIdentifier = new TQLabel( identifier, this ); - identifierLayout->addWidget( resourceIdentifier ); - - mStatus = new TQLabel( "Status: Unlocked", this ); - topLayout->addWidget( mStatus ); - - TQPushButton *button = new TQPushButton( "Lock", this ); - topLayout->addWidget( button ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( lock() ) ); - - button = new TQPushButton( "Unlock", this ); - topLayout->addWidget( button ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( unlock() ) ); - } - - mLockView = new TQListView( this ); - topLayout->addWidget( mLockView ); - mLockView->addColumn( "Lock File" ); - mLockView->addColumn( "PID" ); - mLockView->addColumn( "Locking App" ); - - updateLockView(); - - TQPushButton *quitButton = new TQPushButton( "Quit", this ); - topLayout->addWidget( quitButton ); - connect( quitButton, TQT_SIGNAL( clicked() ), TQT_SLOT( close() ) ); - - KDirWatch *watch = KDirWatch::self(); - connect( watch, TQT_SIGNAL( dirty( const TQString & ) ), - TQT_SLOT( updateLockView() ) ); - connect( watch, TQT_SIGNAL( created( const TQString & ) ), - TQT_SLOT( updateLockView() ) ); - connect( watch, TQT_SIGNAL( deleted( const TQString & ) ), - TQT_SLOT( updateLockView() ) ); - watch->addDir( Lock::locksDir() ); - watch->startScan(); -} - -LockWidget::~LockWidget() -{ - delete mLock; -} - -void LockWidget::updateLockView() -{ - mLockView->clear(); - - TQDir dir( Lock::locksDir() ); - - TQStringList files = dir.entryList( "*.lock" ); - - TQStringList::ConstIterator it; - for( it = files.begin(); it != files.end(); ++it ) { - if ( *it == "." || *it == ".." ) continue; - - TQString app; - int pid; - if ( !Lock::readLockFile( dir.filePath( *it ), pid, app ) ) { - kdWarning() << "Unable to open lock file '" << *it << "'" << endl; - } else { - new TQListViewItem( mLockView, *it, TQString::number( pid ), app ); - } - } -} - -void LockWidget::lock() -{ - if ( !mLock->lock() ) { - KMessageBox::sorry( this, mLock->error() ); - } else { - mStatus->setText( "Status: Locked" ); - } -} - -void LockWidget::unlock() -{ - if ( !mLock->unlock() ) { - KMessageBox::sorry( this, mLock->error() ); - } else { - mStatus->setText( "Status: Unlocked" ); - } -} - - -static const TDECmdLineOptions options[] = -{ - { "a", 0, 0 }, - { "addressbook", "Standard address book", 0 }, - { "d", 0, 0 }, - { "diraddressbook", "Standard address book directory resource", 0 }, - { "+identifier", "Identifier of resource to be locked, e.g. filename", 0 }, - TDECmdLineLastOption -}; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testlock",I18N_NOOP("Test libkabc Lock"),"0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app; - - TQString identifier; - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - if ( args->count() == 1 ) { - identifier = args->arg( 0 ); - } else if ( args->count() != 0 ) { - std::cerr << "Usage: testlock <identifier>" << std::endl; - return 1; - } - - if ( args->isSet( "addressbook" ) ) { - if ( args->count() == 1 ) { - std::cerr << "Ignoring resource identifier" << std::endl; - } - identifier = StdAddressBook::fileName(); - } - - if ( args->isSet( "diraddressbook" ) ) { - if ( args->count() == 1 ) { - std::cerr << "Ignoring resource identifier" << std::endl; - } - identifier = StdAddressBook::directoryName(); - } - - LockWidget mainWidget( identifier ); - - kapp->setMainWidget( &mainWidget ); - mainWidget.show(); - - return app.exec(); -} - -#include "testlock.moc" diff --git a/kabc/tests/testlock.h b/kabc/tests/testlock.h deleted file mode 100644 index a94d4e8c6..000000000 --- a/kabc/tests/testlock.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2003 Cornelius Schumacher <schumacher@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 KABC_TESTLOCK_H -#define KABC_TESTLOCK_H - -#include "lock.h" - -#include <tqwidget.h> - -class TQLabel; -class TQListView; - -class KABC_EXPORT LockWidget : public TQWidget -{ - Q_OBJECT - public: - LockWidget( const TQString &identifier ); - ~LockWidget(); - - protected slots: - void lock(); - void unlock(); - - void updateLockView(); - - private: - KABC::Lock *mLock; - - TQLabel *mStatus; - TQListView *mLockView; -}; - -#endif diff --git a/kabc/timezone.cpp b/kabc/timezone.cpp deleted file mode 100644 index 59a184c6d..000000000 --- a/kabc/timezone.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqdatastream.h> - -#include "timezone.h" - -using namespace KABC; - -TimeZone::TimeZone() : - mOffset( 0 ), mValid( false ) -{ -} - -TimeZone::TimeZone( int offset ) : - mOffset( offset ), mValid( true ) -{ -} - -void TimeZone::setOffset( int offset ) -{ - mOffset = offset; - mValid = true; -} - -int TimeZone::offset() const -{ - return mOffset; -} - -bool TimeZone::isValid() const -{ - return mValid; -} - -bool TimeZone::operator==( const TimeZone &t ) const -{ - if ( !t.isValid() && !isValid() ) return true; - if ( !t.isValid() || !isValid() ) return false; - if ( t.mOffset == mOffset ) return true; - return false; -} - -bool TimeZone::operator!=( const TimeZone &t ) const -{ - if ( !t.isValid() && !isValid() ) return false; - if ( !t.isValid() || !isValid() ) return true; - if ( t.mOffset != mOffset ) return true; - return false; -} - -TQString TimeZone::asString() const -{ - return TQString::number( mOffset ); -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const TimeZone &zone ) -{ - return s << zone.mOffset; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, TimeZone &zone ) -{ - s >> zone.mOffset; - zone.mValid = true; - - return s; -} diff --git a/kabc/timezone.h b/kabc/timezone.h deleted file mode 100644 index 8705797fb..000000000 --- a/kabc/timezone.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_TIMEZONE_H -#define KABC_TIMEZONE_H - -#include <tqstring.h> - -#include <tdelibs_export.h> - -namespace KABC { - -/** - * @short Time zone information. - * - * This class stores information about a time zone. - */ -class KABC_EXPORT TimeZone -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const TimeZone & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, TimeZone & ); - -public: - - /** - * Construct invalid time zone. - */ - TimeZone(); - - /** - * Construct time zone. - * - * @param offset Offset in minutes relative to UTC. - */ - TimeZone( int offset ); - - /** - * Set time zone offset relative to UTC. - * - * @param offset Offset in minutes. - */ - void setOffset( int offset ); - - /** - * Return offset in minutes relative to UTC. - */ - int offset() const; - - /** - * Return, if this time zone object is valid. - */ - bool isValid() const; - - bool operator==( const TimeZone & ) const; - bool operator!=( const TimeZone & ) const; - - /** - * Return string representation of time zone offset. - */ - TQString asString() const; - -private: - int mOffset; // Offset in minutes - - bool mValid; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const TimeZone & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, TimeZone & ); - -} -#endif diff --git a/kabc/vcard/AdrParam.cpp b/kabc/vcard/AdrParam.cpp deleted file mode 100644 index 5ad56f4fb..000000000 --- a/kabc/vcard/AdrParam.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardRToken.h> -#include <VCardAdrParam.h> -#include <VCardParam.h> - -using namespace VCARD; - -AdrParam::AdrParam() - : Param() -{ -} - -AdrParam::AdrParam(const AdrParam & x) - : Param(x), - adrTypeList_ (x.adrTypeList_) -{ -} - -AdrParam::AdrParam(const TQCString & s) - : Param(s) -{ -} - - AdrParam & -AdrParam::operator = (AdrParam & x) -{ - if (*this == x) return *this; - - adrTypeList_ = x.adrTypeList(); - textParam_ = x.textParam(); - - Param::operator = (x); - return *this; -} - - AdrParam & -AdrParam::operator = (const TQCString & s) -{ - Param::operator = (s); - - adrTypeList_.clear(); - textParam_.truncate(0); - - return *this; -} - - bool -AdrParam::operator == (AdrParam & x) -{ - parse(); - - if (!x.textParam().isEmpty()) - return (x.textParam_ == textParam_); - - if (x.adrTypeList().count() != adrTypeList_.count()) - return false; - - TQStrListIterator it(x.adrTypeList_); - - for (; it.current(); ++it) - if (!adrTypeList_.find(it.current())) - return false; - - return true; -} - -AdrParam::~AdrParam() -{ -} - - void -AdrParam::_parse() -{ - adrTypeList_.clear(); - - if (strRep_.left(4) != "TYPE") { - textParam_ = strRep_; - return; - } - - if (!strRep_.contains('=')) - return; - - RTokenise(strRep_, ",", adrTypeList_); -} - - void -AdrParam::_assemble() -{ - if (!textParam_.isEmpty()) { - strRep_ = textParam_; - return; - } - - TQStrListIterator it(adrTypeList_); - - for (; it.current(); ++it) { - - strRep_ += it.current(); - - if (it.current() != adrTypeList_.last()) - strRep_ += ','; - } -} diff --git a/kabc/vcard/AdrValue.cpp b/kabc/vcard/AdrValue.cpp deleted file mode 100644 index 535ba6980..000000000 --- a/kabc/vcard/AdrValue.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardRToken.h> -#include <VCardAdrValue.h> -#include <VCardValue.h> -#include <VCardDefines.h> - -using namespace VCARD; - -AdrValue::AdrValue() - : Value() -{ -} - -AdrValue::AdrValue(const AdrValue & x) - : Value(x), - poBox_ (x.poBox_), - extAddress_ (x.extAddress_), - street_ (x.street_), - locality_ (x.locality_), - region_ (x.region_), - postCode_ (x.postCode_), - countryName_ (x.countryName_) -{ -} - -AdrValue::AdrValue(const TQCString & s) - : Value(s) -{ -} - - AdrValue & -AdrValue::operator = (AdrValue & x) -{ - if (*this == x) return *this; - - poBox_ = x.poBox_; - extAddress_ = x.extAddress_; - street_ = x.street_; - locality_ = x.locality_; - region_ = x.region_; - postCode_ = x.postCode_; - countryName_ = x.countryName_; - - Value::operator = (x); - return *this; -} - - AdrValue & -AdrValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -AdrValue::operator == (AdrValue & x) -{ - parse(); - x.parse(); - - return ( - poBox_ == x.poBox_ && - extAddress_ == x.extAddress_ && - street_ == x.street_ && - locality_ == x.locality_ && - region_ == x.region_ && - postCode_ == x.postCode_ && - countryName_ == x.countryName_); -} - -AdrValue::~AdrValue() -{ -} - - AdrValue * -AdrValue::clone() -{ - return new AdrValue( *this ); -} - - void -AdrValue::_parse() -{ - vDebug("AdrValue::_parse()"); - - TQStrList l; - RTokenise(strRep_, ";", l); - - for (unsigned int i = 0; i < l.count(); i++) { - - switch (i) { - - case 0: poBox_ = l.at(0); break; - case 1: extAddress_ = l.at(1); break; - case 2: street_ = l.at(2); break; - case 3: locality_ = l.at(3); break; - case 4: region_ = l.at(4); break; - case 5: postCode_ = l.at(5); break; - case 6: countryName_ = l.at(6); break; - default: break; - } - } -} - - void -AdrValue::_assemble() -{ - vDebug("AdrValue::_assemble"); - - strRep_ = poBox_; - strRep_ += ";" + extAddress_; - strRep_ += ";" + street_; - strRep_ += ";" + locality_; - strRep_ += ";" + region_; - strRep_ += ";" + postCode_; - strRep_ += ";" + countryName_; -} - diff --git a/kabc/vcard/AgentParam.cpp b/kabc/vcard/AgentParam.cpp deleted file mode 100644 index 9e4531b02..000000000 --- a/kabc/vcard/AgentParam.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardAgentParam.h> - -#include <VCardParam.h> - -using namespace VCARD; - -AgentParam::AgentParam() - : Param() -{ -} - -AgentParam::AgentParam(const AgentParam & x) - : Param(x), - refer_ (x.refer_), - uri_ (x.uri_) -{ -} - -AgentParam::AgentParam(const TQCString & s) - : Param(s) -{ -} - - AgentParam & -AgentParam::operator = (AgentParam & x) -{ - if (*this == x) return *this; - - refer_ = x.refer_; - uri_ = x.uri_; - - Param::operator = (x); - return *this; -} - - AgentParam & -AgentParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -AgentParam::operator == (AgentParam & x) -{ - parse(); - - if (refer_) - return (x.refer() && uri_ == x.uri_); - - return !x.refer(); -} - -AgentParam::~AgentParam() -{ -} - - void -AgentParam::_parse() -{ - if (strRep_.isEmpty()) { - refer_ = false; - return; - } - - refer_ = true; - uri_ = strRep_; -} - - void -AgentParam::_assemble() -{ - if (!refer_) { - strRep_.truncate(0); - return; - } - - strRep_ = uri_.asString(); - return; -} diff --git a/kabc/vcard/AgentValue.cpp b/kabc/vcard/AgentValue.cpp deleted file mode 100644 index 7d356f8d7..000000000 --- a/kabc/vcard/AgentValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardAgentValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -AgentValue::AgentValue() - : Value() -{ -} - -AgentValue::AgentValue(const AgentValue & x) - : Value(x) -{ -} - -AgentValue::AgentValue(const TQCString & s) - : Value(s) -{ -} - - AgentValue & -AgentValue::operator = (AgentValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - AgentValue & -AgentValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -AgentValue::operator == (AgentValue & x) -{ - x.parse(); - return false; -} - -AgentValue::~AgentValue() -{ -} - - void -AgentValue::_parse() -{ -} - - void -AgentValue::_assemble() -{ -} - diff --git a/kabc/vcard/CMakeLists.txt b/kabc/vcard/CMakeLists.txt deleted file mode 100644 index 8ad988434..000000000 --- a/kabc/vcard/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/generated - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdecore -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### vcard ##################################### - -set( target vcard ) - -set( ${target}_SRCS - vCard-all.cpp -) - -tde_add_library( ${target} SHARED - SOURCES ${${target}_SRCS} - VERSION 0.0.0 - LINK tdecore-shared - DESTINATION ${LIB_INSTALL_DIR} -) diff --git a/kabc/vcard/ClassValue.cpp b/kabc/vcard/ClassValue.cpp deleted file mode 100644 index 21417f87b..000000000 --- a/kabc/vcard/ClassValue.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardClassValue.h> - -#include <VCardValue.h> - -#include <kdebug.h> - -using namespace VCARD; - -ClassValue::ClassValue() - : Value() -{ -} - -ClassValue::ClassValue(const ClassValue & x) - : Value(x), - classType_(x.classType_) -{ -} - -ClassValue::ClassValue(const TQCString & s) - : Value(s) -{ -} - - ClassValue & -ClassValue::operator = (ClassValue & x) -{ - if (*this == x) return *this; - x.parse(); - - classType_ = x.classType_; - - Value::operator = (x); - return *this; -} - - ClassValue & -ClassValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -ClassValue::operator == (ClassValue & x) -{ - x.parse(); - return ( classType_ == x.classType_ ); -} - -ClassValue::~ClassValue() -{ -} - - ClassValue * -ClassValue::clone() -{ - return new ClassValue( *this ); -} - - void -ClassValue::_parse() -{ - if (tqstricmp(strRep_, "PUBLIC") == 0) - classType_ = Public; - - else if (tqstricmp(strRep_, "PRIVATE") == 0) - classType_ = Private; - - else if (tqstricmp(strRep_, "CONFIDENTIAL") == 0) - classType_ = Confidential; - - else classType_ = Other; -} - - void -ClassValue::_assemble() -{ - switch (classType_) { - - case Public: - strRep_ = "PUBLIC"; - break; - - case Private: - strRep_ = "PRIVATE"; - break; - - case Confidential: - strRep_ = "CONFIDENTIAL"; - break; - - default: - break; - } -} - diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp deleted file mode 100644 index 52bcdf4f5..000000000 --- a/kabc/vcard/ContentLine.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <tqcstring.h> -#include <tqstrlist.h> -#include <tqregexp.h> - -#include <kdebug.h> - -#include <VCardAdrParam.h> -#include <VCardAgentParam.h> -#include <VCardDateParam.h> -#include <VCardEmailParam.h> -#include <VCardImageParam.h> -#include <VCardSourceParam.h> -#include <VCardTelParam.h> -#include <VCardTextBinParam.h> -#include <VCardTextParam.h> - -#include <VCardAdrValue.h> -#include <VCardAgentValue.h> -#include <VCardDateValue.h> -#include <VCardImageValue.h> -#include <VCardTextValue.h> -#include <VCardTextBinValue.h> -#include <VCardLangValue.h> -#include <VCardNValue.h> -#include <VCardURIValue.h> -#include <VCardSoundValue.h> -#include <VCardClassValue.h> -#include <VCardFloatValue.h> -#include <VCardOrgValue.h> -#include <VCardTelValue.h> -#include <VCardTextListValue.h> -#include <VCardUTCValue.h> -#include <VCardGeoValue.h> - -#include <VCardRToken.h> -#include <VCardContentLine.h> - -#include <VCardEntity.h> -#include <VCardEnum.h> -#include <VCardDefines.h> - -using namespace VCARD; - -ContentLine::ContentLine() - : Entity(), - value_(0), - paramType_( ParamUnknown ), - valueType_( ValueUnknown ), - entityType_( EntityUnknown ) -{ -} - -ContentLine::ContentLine(const ContentLine & x) - : Entity(x), - group_ (x.group_), - name_ (x.name_), - paramList_(x.paramList_), - value_(x.value_->clone()), - paramType_( x.paramType_ ), - valueType_( x.valueType_ ), - entityType_( x.entityType_ ) -{ -} - -ContentLine::ContentLine(const TQCString & s) - : Entity(s), - value_(0), - paramType_( ParamUnknown ), - valueType_( ValueUnknown ), - entityType_( EntityUnknown ) -{ -} - - ContentLine & -ContentLine::operator = (ContentLine & x) -{ - if (*this == x) return *this; - - paramList_ = x.paramList(); - value_ = x.value_->clone(); - - Entity::operator = (x); - return *this; -} - - ContentLine & -ContentLine::operator = (const TQCString & s) -{ - Entity::operator = (s); - delete value_; - value_ = 0; - return *this; -} - - bool -ContentLine::operator == (ContentLine & x) -{ - x.parse(); - - TQPtrListIterator<Param> it(x.paramList()); - - if (!paramList_.find(it.current())) - return false; - - return true; -} - -ContentLine::~ContentLine() -{ - delete value_; - value_ = 0; -} - - void -ContentLine::_parse() -{ - vDebug("parse"); - - // Unqote newlines - strRep_ = strRep_.replace( TQRegExp( "\\\\n" ), "\n" ); - - int split = strRep_.find(':'); - - if (split == -1) { // invalid content line - vDebug("No ':'"); - return; - } - - TQCString firstPart(strRep_.left(split)); - TQCString valuePart(strRep_.mid(split + 1)); - - split = firstPart.find('.'); - - if (split != -1) { - group_ = firstPart.left(split); - firstPart = firstPart.mid(split + 1); - } - - vDebug("Group == " + group_); - vDebug("firstPart == " + firstPart); - vDebug("valuePart == " + valuePart); - - // Now we have the group, the name and param list together and the value. - - TQStrList l; - - RTokenise(firstPart, ";", l); - - if (l.count() == 0) {// invalid - no name ! - vDebug("No name for this content line !"); - return; - } - - name_ = l.at(0); - - // Now we have the name, so the rest of 'l' is the params. - // Remove the name part. - l.remove(0u); - - entityType_ = EntityNameToEntityType(name_); - paramType_ = EntityTypeToParamType(entityType_); - - unsigned int i = 0; - - // For each parameter, create a new parameter of the correct type. - - TQStrListIterator it(l); - - for (; it.current(); ++it, i++) { - - TQCString str = *it; - - split = str.find("="); - if (split < 0 ) { - vDebug("No '=' in parameter."); - continue; - } - - TQCString paraName = str.left(split); - TQCString paraValue = str.mid(split + 1); - - TQStrList paraValues; - RTokenise(paraValue, ",", paraValues); - - TQStrListIterator it2( paraValues ); - - for(; it2.current(); ++it2) { - - Param *p = new Param; - p->setName( paraName ); - p->setValue( *it2 ); - - paramList_.append(p); - } - } - - // Create a new value of the correct type. - - valueType_ = EntityTypeToValueType(entityType_); - -// kdDebug(5710) << "valueType: " << valueType_ << endl; - - switch (valueType_) { - - case ValueSound: value_ = new SoundValue; break; - case ValueAgent: value_ = new AgentValue; break; - case ValueAddress: value_ = new AdrValue; break; - case ValueTel: value_ = new TelValue; break; - case ValueTextBin: value_ = new TextBinValue; break; - case ValueOrg: value_ = new OrgValue; break; - case ValueN: value_ = new NValue; break; - case ValueUTC: value_ = new UTCValue; break; - case ValueURI: value_ = new URIValue; break; - case ValueClass: value_ = new ClassValue; break; - case ValueFloat: value_ = new FloatValue; break; - case ValueImage: value_ = new ImageValue; break; - case ValueDate: value_ = new DateValue; break; - case ValueTextList: value_ = new TextListValue; break; - case ValueGeo: value_ = new GeoValue; break; - case ValueText: - case ValueUnknown: - default: value_ = new TextValue; break; - } - - *value_ = valuePart; -} - - void -ContentLine::_assemble() -{ - vDebug("Assemble (argl) - my name is \"" + name_ + "\""); - strRep_.truncate(0); - - TQCString line; - - if (!group_.isEmpty()) - line += group_ + '.'; - - line += name_; - - vDebug("Adding parameters"); - ParamListIterator it(paramList_); - - for (; it.current(); ++it) - line += ";" + it.current()->asString(); - - vDebug("Adding value"); - if (value_ != 0) - line += ":" + value_->asString(); - else { - vDebug("No value"); - } - - // Quote newlines - line = line.replace( TQRegExp( "\n" ), "\\n" ); - - // Fold lines longer than 72 chars - const int maxLen = 72; - uint cursor = 0; - while( line.length() > ( cursor + 1 ) * maxLen ) { - strRep_ += line.mid( cursor * maxLen, maxLen ); - strRep_ += "\r\n "; - ++cursor; - } - strRep_ += line.mid( cursor * maxLen ); -} - - void -ContentLine::clear() -{ - group_.truncate(0); - name_.truncate(0); - paramList_.clear(); - delete value_; - value_ = 0; - paramType_ = ParamUnknown; - valueType_ = ValueUnknown; - entityType_ = EntityUnknown; -} diff --git a/kabc/vcard/DateParam.cpp b/kabc/vcard/DateParam.cpp deleted file mode 100644 index ffaf4b3f6..000000000 --- a/kabc/vcard/DateParam.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardDateParam.h> - -#include <VCardParam.h> - -using namespace VCARD; - -DateParam::DateParam() - : Param() -{ -} - -DateParam::DateParam(const DateParam & x) - : Param(x) -{ -} - -DateParam::DateParam(const TQCString & s) - : Param(s) -{ -} - - DateParam & -DateParam::operator = (DateParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - DateParam & -DateParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -DateParam::operator == (DateParam & x) -{ - x.parse(); - - return false; -} - -DateParam::~DateParam() -{ -} - - void -DateParam::_parse() -{ -} - - void -DateParam::_assemble() -{ -} - diff --git a/kabc/vcard/DateValue.cpp b/kabc/vcard/DateValue.cpp deleted file mode 100644 index 9f578a158..000000000 --- a/kabc/vcard/DateValue.cpp +++ /dev/null @@ -1,434 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <tqregexp.h> - -#include <kdebug.h> - -#include <VCardDefines.h> -#include <VCardDateValue.h> -#include <VCardValue.h> - -using namespace VCARD; - -DateValue::DateValue() - : Value() -{ - vDebug("DateValue::DateValue()"); -} - -DateValue::DateValue( - unsigned int year, - unsigned int month, - unsigned int day, - unsigned int hour, - unsigned int minute, - unsigned int second, - double secFrac, - bool zonePositive, - unsigned int zoneHour, - unsigned int zoneMinute) - : Value (), - year_ (year), - month_ (month), - day_ (day), - hour_ (hour), - minute_ (minute), - second_ (second), - zoneHour_ (zoneHour), - zoneMinute_ (zoneMinute), - secFrac_ (secFrac), - zonePositive_ (zonePositive), - hasTime_(true) -{ - parsed_ = true; - assembled_ = false; -} - -DateValue::DateValue(const TQDate & d) - : Value (), - year_ (d.year()), - month_ (d.month()), - day_ (d.day()), - hasTime_(false) -{ - parsed_ = true; - assembled_ = false; -} - -DateValue::DateValue(const TQDateTime & d) - : Value (), - year_ (d.date().year()), - month_ (d.date().month()), - day_ (d.date().day()), - hour_ (d.time().hour()), - minute_ (d.time().minute()), - second_ (d.time().second()), - hasTime_(true) -{ - parsed_ = true; - assembled_ = false; -} - -DateValue::DateValue(const DateValue & x) - : Value(x) -{ - year_ = x.year_; - month_ = x.month_; - day_ = x.day_; - hour_ = x.hour_; - minute_ = x.minute_; - second_ = x.second_; - zoneHour_ = x.zoneHour_; - zoneMinute_ = x.zoneMinute_; - secFrac_ = x.secFrac_; - hasTime_ = x.hasTime_; -} - -DateValue::DateValue(const TQCString & s) - : Value(s) -{ -} - - DateValue & -DateValue::operator = (DateValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - DateValue & -DateValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -DateValue::operator == (DateValue & x) -{ - x.parse(); - return false; -} - -DateValue::~DateValue() -{ -} - - DateValue * -DateValue::clone() -{ - return new DateValue( *this ); -} - - void -DateValue::_parse() -{ - vDebug("DateValue::_parse()"); - - // date = date-full-year ["-"] date-month ["-"] date-mday - // time = time-hour [":"] time-minute [":"] time-second [":"] - // [time-secfrac] [time-zone] - - int timeSep = strRep_.find('T'); - - TQCString dateStr; - TQCString timeStr; - - if (timeSep == -1) { - - dateStr = strRep_; - vDebug("Has date string \"" + dateStr + "\""); - - } else { - - dateStr = strRep_.left(timeSep); - vDebug("Has date string \"" + dateStr + "\""); - - timeStr = strRep_.mid(timeSep + 1); - vDebug("Has time string \"" + timeStr + "\""); - } - - /////////////////////////////////////////////////////////////// DATE - - dateStr.replace(TQRegExp("-"), ""); - - kdDebug(5710) << "dateStr: " << dateStr << endl; - - year_ = dateStr.left(4).toInt(); - month_ = dateStr.mid(4, 2).toInt(); - day_ = dateStr.right(2).toInt(); - - if (timeSep == -1) { - hasTime_ = false; - return; // No time, done. - } - else - hasTime_ = true; - - /////////////////////////////////////////////////////////////// TIME - - /////////////////////////////////////////////////////////////// ZONE - - int zoneSep = timeStr.find('Z'); - - if (zoneSep != -1 && timeStr.length() - zoneSep > 3) { - - TQCString zoneStr(timeStr.mid(zoneSep + 1)); - vDebug("zoneStr == " + zoneStr); - - zonePositive_ = (zoneStr[0] == '+'); - zoneHour_ = zoneStr.mid(1, 2).toInt(); - zoneMinute_ = zoneStr.right(2).toInt(); - - timeStr.remove(zoneSep, timeStr.length() - zoneSep); - } - - //////////////////////////////////////////////////// SECOND FRACTION - - int secFracSep = timeStr.findRev(','); - - if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors. - TQCString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep); - secFrac_ = quirkafleeg.toDouble(); - } - - /////////////////////////////////////////////////////////////// HMS - - timeStr.replace(TQRegExp(":"), ""); - - hour_ = timeStr.left(2).toInt(); - minute_ = timeStr.mid(2, 2).toInt(); - second_ = timeStr.mid(4, 2).toInt(); -} - - void -DateValue::_assemble() -{ - vDebug("DateValue::_assemble"); - - TQCString year; - TQCString month; - TQCString day; - - year.setNum( year_ ); - month.setNum( month_ ); - day.setNum( day_ ); - - if ( month.length() < 2 ) month.prepend( "0" ); - if ( day.length() < 2 ) day.prepend( "0" ); - - strRep_ = year + '-' + month + '-' + day; - - if ( hasTime_ ) { - TQCString hour; - TQCString minute; - TQCString second; - - hour.setNum( hour_ ); - minute.setNum( minute_ ); - second.setNum( second_ ); - - if ( hour.length() < 2 ) hour.prepend( "0" ); - if ( minute.length() < 2 ) minute.prepend( "0" ); - if ( second.length() < 2 ) second.prepend( "0" ); - - strRep_ += 'T' + hour + ':' + minute + ':' + second + 'Z'; - } -} - - unsigned int -DateValue::year() -{ - parse(); - return year_; -} - - unsigned int -DateValue::month() -{ - parse(); - return month_; -} - - unsigned int -DateValue::day() -{ - parse(); - return day_; -} - unsigned int -DateValue::hour() -{ - parse(); - return hour_; -} - - unsigned int -DateValue::minute() -{ - parse(); - return minute_; -} - - unsigned int -DateValue::second() -{ - parse(); - return second_; -} - - double -DateValue::secondFraction() -{ - parse(); - return secFrac_; -} - - bool -DateValue::zonePositive() -{ - parse(); - return zonePositive_; -} - - unsigned int -DateValue::zoneHour() -{ - parse(); - return zoneHour_; -} - - unsigned int -DateValue::zoneMinute() -{ - parse(); - return zoneMinute_; -} - - void -DateValue::setYear(unsigned int i) -{ - year_ = i; - assembled_ = false; -} - - void -DateValue::setMonth(unsigned int i) -{ - month_ = i; - assembled_ = false; -} - - void -DateValue::setDay(unsigned int i) -{ - day_ = i; - assembled_ = false; -} - - void -DateValue::setHour(unsigned int i) -{ - hour_ = i; - assembled_ = false; -} - - void -DateValue::setMinute(unsigned int i) -{ - minute_ = i; - assembled_ = false; -} - - void -DateValue::setSecond(unsigned int i) -{ - second_ = i; - assembled_ = false; -} - - void -DateValue::setSecondFraction(double d) -{ - secFrac_ = d; - assembled_ = false; -} - - void -DateValue::setZonePositive(bool b) -{ - zonePositive_ = b; - assembled_ = false; -} - - void -DateValue::setZoneHour(unsigned int i) -{ - zoneHour_ = i; - assembled_ = false; -} - - void -DateValue::setZoneMinute(unsigned int i) -{ - zoneMinute_ = i; - assembled_ = false; -} - - TQDate -DateValue::qdate() -{ - parse(); - TQDate d(year_, month_, day_); - return d; -} - - TQTime -DateValue::qtime() -{ - parse(); - TQTime t(hour_, minute_, second_); -// t.setMs(1 / secFrac_); - return t; -} - - TQDateTime -DateValue::qdt() -{ - parse(); - TQDateTime dt; - dt.setDate(qdate()); - dt.setTime(qtime()); - return dt; -} - - bool -DateValue::hasTime() -{ - parse(); - return hasTime_; -} - diff --git a/kabc/vcard/EmailParam.cpp b/kabc/vcard/EmailParam.cpp deleted file mode 100644 index 7daf19ccc..000000000 --- a/kabc/vcard/EmailParam.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardEmailParam.h> -#include <VCardParam.h> -#include <VCardDefines.h> - -using namespace VCARD; - -EmailParam::EmailParam() - : Param() -{ - vDebug("ctor"); -} - -EmailParam::EmailParam(const EmailParam & x) - : Param(x), - emailType_ (x.emailType_), - pref_ (x.pref_) -{ -} - -EmailParam::EmailParam(const TQCString & s) - : Param(s) -{ -} - - EmailParam & -EmailParam::operator = (EmailParam & x) -{ - if (*this == x) return *this; - - emailType_ = x.emailType(); - pref_ = x.pref_; - - Param::operator = (x); - return *this; -} - - EmailParam & -EmailParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -EmailParam::operator == (EmailParam & x) -{ - parse(); - - if (pref_) - return (x.pref_ && x.emailType() == emailType_); - - return !x.pref(); -} - -EmailParam::~EmailParam() -{ -} - - void -EmailParam::_parse() -{ -#if 0 - Param::parseToList(); - - SubParamListIterator it(subParamList_); - - pref_ = true; - emailType_ = ""; - - for (; it.current(); ++it) { - - if (tqstricmp(it.current()->name(), "TYPE") == 0) { - emailType_ = it.current()->value(); - continue; - } - - if (tqstricmp(it.current()->name(), "PREF") == 0) { - pref_ = true; - } - } -#endif -} - - void -EmailParam::_assemble() -{ - strRep_ = "TYPE="; - strRep_ += emailType_; - - if (pref_) - strRep_ += ",PREF"; -} - diff --git a/kabc/vcard/Entity.cpp b/kabc/vcard/Entity.cpp deleted file mode 100644 index 5eaf6a1d0..000000000 --- a/kabc/vcard/Entity.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardEntity.h> - -using namespace VCARD; - -Entity::Entity() - : parsed_ (false), - assembled_ (true) -{ - // empty -} - -Entity::Entity(const Entity & e) - : strRep_ (e.strRep_), - parsed_ (e.parsed_), - assembled_ (e.assembled_) -{ - // empty -} - -Entity::Entity(const TQCString & s) - : strRep_ (s), - parsed_ (false), - assembled_ (true) -{ - // empty -} - - Entity & -Entity::operator = (const Entity & e) -{ - if (this == &e) return *this; - - strRep_ = e.strRep_; - parsed_ = e.parsed_; - assembled_ = e.assembled_; - - return *this; -} - - Entity & -Entity::operator = (const TQCString & s) -{ - strRep_ = s; - parsed_ = false; - assembled_ = true; - - return *this; -} - - bool -Entity::operator == (Entity & e) -{ - return asString() == e.asString(); -} - - bool -Entity::operator != (Entity & e) -{ - return !(*this == e); -} - - bool -Entity::operator == (const TQCString & s) -{ - return asString() == s; -} - - bool -Entity::operator != (const TQCString & s) -{ - return !(*this == s); -} - -Entity::~Entity() -{ - // empty -} - - TQCString -Entity::asString() -{ -// vDebug("Entity::asString()"); - assemble(); - - return strRep_; -} - - void -Entity::parse() -{ -// vDebug( "Entity::parse()" ); - - if (!parsed_) _parse(); - - parsed_ = true; - assembled_ = false; -} - - void -Entity::assemble() -{ -// vDebug( "Entity::assemble()" ); - - if (assembled_) return; - - parse(); - _assemble(); - - assembled_ = true; -} - diff --git a/kabc/vcard/Enum.cpp b/kabc/vcard/Enum.cpp deleted file mode 100644 index bcb48f98a..000000000 --- a/kabc/vcard/Enum.cpp +++ /dev/null @@ -1,490 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <tqcstring.h> -#include <ctype.h> - -#include <VCardEnum.h> - -using namespace VCARD; - -// There are 31 possible types, not including extensions. -// URI is a custom field designed to store the upstream URI for each contact -// in order to handle certain limited CardDAV systems such as Zimbra - const TQCString -VCARD::paramNames [] = -{ - "NAME", - "PROFILE", - "SOURCE", - "FN", - "N", - "NICKNAME", - "PHOTO", - "BDAY", - "ADR", - "LABEL", - "TEL", - "EMAIL", - "MAILER", - "TZ", - "GEO", - "TITLE", - "ROLE", - "LOGO", - "AGENT", - "ORG", - "CATEGORIES", - "NOTE", - "PRODID", - "REV", - "SORT-STRING", - "SOUND", - "UID", - "URL", - "VERSION", - "CLASS", - "KEY", - "URI" -}; - - const ParamType -VCARD::paramTypesTable[] = { - ParamNone, // NAME - ParamNone, // PROFILE - ParamSource, // SOURCE - ParamText, // FN - ParamText, // N - ParamText, // NICKNAME - ParamImage, // PHOTO (inline/refer) - ParamDate, // BDAY ("VALUE = "date-time/date) - ParamAddrText, // ADR (adr-param/text-param) - ParamAddrText, // LABEL (adr-param/text-param) - ParamTel, // TEL - ParamEmail, // EMAIL - ParamText, // MAILER - ParamNone, // TZ - ParamNone, // GEO - ParamText, // TITLE - ParamText, // ROLE - ParamImage, // LOGO - ParamAgent, // AGENT - ParamText, // ORG - ParamText, // CATEGORIES - ParamText, // NOTE - ParamNone, // PRODID - ParamDate, // REV - ParamText, // SORT-STRING - ParamSound, // SOUND - ParamNone, // UID - ParamNone, // URL - ParamNone, // VERSION - ParamNone, // CLASS - ParamTextBin, // KEY - ParamTextNS, // X - ParamNone // URI -}; - - ParamType -VCARD::EntityTypeToParamType(EntityType e) -{ - ParamType t(ParamUnknown); - - switch (e) { - - //---------------------------------------------------------------// - case EntityAgent: t = ParamAgent; break; - //---------------------------------------------------------------// - case EntitySound: t = ParamSound; break; - //---------------------------------------------------------------// - case EntitySource: t = ParamSource; break; - //---------------------------------------------------------------// - case EntityTelephone: t = ParamTel; break; - //---------------------------------------------------------------// - case EntityEmail: t = ParamEmail; break; - //---------------------------------------------------------------// - case EntityKey: t = ParamTextBin; break; - //---------------------------------------------------------------// - case EntityExtension: t = ParamTextNS; break; - //---------------------------------------------------------------// - case EntityAddress: - case EntityLabel: t = ParamAddrText; break; - //---------------------------------------------------------------// - case EntityBirthday: - case EntityRevision: t = ParamDate; break; - //---------------------------------------------------------------// - case EntityPhoto: - case EntityLogo: t = ParamImage; break; - //---------------------------------------------------------------// - case EntityOrganisation: - case EntityTitle: - case EntityRole: - case EntityFullName: - case EntityMailer: - case EntityN: - case EntitySortString: - case EntityNickname: - case EntityCategories: - case EntityNote: t = ParamText; break; - //---------------------------------------------------------------// - case EntityProductID: - case EntityTimeZone: - case EntityUID: - case EntityURL: - case EntityClass: - case EntityGeo: - case EntityName: - case EntityVersion: - case EntityProfile: - case EntityURI: - default: t = ParamNone; break; - //---------------------------------------------------------------// - - } - - return t; -} - - ValueType -VCARD::EntityTypeToValueType(EntityType e) -{ - ValueType t(ValueUnknown); - - switch (e) { - - //---------------------------------------------------------------// - case EntitySound: t = ValueSound; break; - //---------------------------------------------------------------// - case EntityAgent: t = ValueAgent; break; - //---------------------------------------------------------------// - case EntityAddress: t = ValueAddress; break; - //---------------------------------------------------------------// - case EntityTelephone: t = ValueTel; break; - //---------------------------------------------------------------// - case EntityKey: t = ValueTextBin; break; - //---------------------------------------------------------------// - case EntityOrganisation: t = ValueOrg; break; - //---------------------------------------------------------------// - case EntityN: t = ValueN; break; - //---------------------------------------------------------------// - case EntityTimeZone: t = ValueUTC; break; - //---------------------------------------------------------------// - case EntityClass: t = ValueClass; break; - //---------------------------------------------------------------// - case EntityGeo: t = ValueGeo; break; - //---------------------------------------------------------------// - case EntitySource: - case EntityURL: t = ValueURI; break; - //---------------------------------------------------------------// - case EntityPhoto: - case EntityLogo: t = ValueImage; break; - //---------------------------------------------------------------// - case EntityBirthday: - case EntityRevision: t = ValueDate; break; - //---------------------------------------------------------------// - case EntityCategories: - case EntityNickname: t = ValueTextList; break; - //---------------------------------------------------------------// - case EntityLabel: - case EntityExtension: - case EntityEmail: - case EntityTitle: - case EntityRole: - case EntityFullName: - case EntityMailer: - case EntityProductID: - case EntityName: - case EntitySortString: - case EntityVersion: - case EntityProfile: - case EntityUID: - case EntityNote: - case EntityURI: - default: t = ValueText; break; - //---------------------------------------------------------------// - - } - - return t; -} - - TQCString -VCARD::EntityTypeToParamName(EntityType e) -{ - if ( e > EntityUnknown ) e = EntityUnknown; - return paramNames[ int( e ) ]; -} - - EntityType -VCARD::EntityNameToEntityType(const TQCString & s) -{ - if (s.isEmpty()) return EntityUnknown; - - EntityType t(EntityUnknown); - - switch (s[0]) { - - case 'A': - if (s == "ADR") - t = EntityAddress; - else if (s == "AGENT") - t = EntityAgent; - break; - - case 'B': - if (s == "BDAY") - t = EntityBirthday; - break; - - case 'C': - if (s == "CATEGORIES") - t = EntityCategories; - else if (s == "CLASS") - t = EntityClass; - break; - - case 'E': - if (s == "EMAIL") - t = EntityEmail; - break; - - case 'F': - if (s == "FN") - t = EntityFullName; - break; - - case 'G': - if (s == "GEO") - t = EntityGeo; - break; - - case 'K': - if (s == "KEY") - t = EntityKey; - break; - - case 'L': - if (s == "LABEL") - t = EntityLabel; - else if (s == "LOGO") - t = EntityLogo; - break; - - case 'M': - if (s == "MAILER") - t = EntityMailer; - break; - - case 'N': - if (s == "N") - t = EntityN; - else if (s == "NAME") - t = EntityName; - else if (s == "NICKNAME") - t = EntityNickname; - else if (s == "NOTE") - t = EntityNote; - break; - - case 'O': - if (s == "ORG") - t = EntityOrganisation; - break; - - case 'P': - if (s == "PHOTO") - t = EntityPhoto; - else if (s == "PRODID") - t = EntityProductID; - else if (s == "PROFILE") - t = EntityProfile; - break; - - case 'R': - if (s == "REV") - t = EntityRevision; - else if (s == "ROLE") - t = EntityRole; - break; - - case 'S': - if (s == "SORT-STRING") - t = EntitySortString; - else if (s == "SOUND") - t = EntitySound; - else if (s == "SOURCE") - t = EntitySource; - break; - - case 'T': - if (s == "TEL") - t = EntityTelephone; - else if (s == "TITLE") - t = EntityTitle; - else if (s == "TZ") - t = EntityTimeZone; - break; - - case 'U': - if (s == "UID") - t = EntityUID; - else if (s == "URL") - t = EntityURL; - else if (s == "URI") - t = EntityURI; - case 'V': - if (s == "VERSION") - t = EntityVersion; - break; - - case 'X': - if (s.left(2) == "X-") - t = EntityExtension; - break; - - default: - - t = EntityUnknown; - } - - return t; -} - -// The copyright notice below refers to the base64 codec functions used below, -// which are modified from the original sources. - -/* - * Original version Copyright 1988 by The Leland Stanford Junior University - * Copyright 1998 by the University of Washington - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notices appear in all copies and that both the - * above copyright notices and this permission notice appear in supporting - * documentation, and that the name of the University of Washington or The - * Leland Stanford Junior University not be used in advertising or publicity - * pertaining to distribution of the software without specific, written prior - * permission. This software is made available "as is", and - * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY - * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE, - * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF - * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -static char B64[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -// the mime base64 disctionary used for decoding -static signed char b64dec[] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 30 - -1, -1, -1,-19, -1, -1, -1,-16, -4, -4, // 40 -19 == '+' -16 == '/' - -4, -4, -4, -4, -4, -4, -4, -4, -1, -1, // 50 -4 == '0' - -1, 0, -1, -1, -1, 65, 65, 65, 65, 65, // 60 0 == '=' 65 == 'A' - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 70 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 80 - 65, -1, -1, -1, -1, -1, -1, 71, 71, 71, // 90 71 == 'a' - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 100 - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 110 - 71, 71, 71, -1, -1, -1, -1, -1, -1, -1, // 120 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 130 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 140 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 150 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 160 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 170 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 180 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 190 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 200 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 210 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 220 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 230 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 240 - -1, -1, -1, -1, -1, -1, -1 // 250 -}; - - char * -VCARD::decodeBase64(const char * s, unsigned long srcl, unsigned long & len) -{ - register unsigned char c; - register unsigned long e(0); - len = 0; - unsigned const char * src = (unsigned const char *)s; - char * ret = new char[srcl + (srcl / 4 + 1)]; - register char *d = ret; - while (srcl--) { // Critical loop - c = *src++; - int dec = b64dec[c]; - if (dec == -1) continue; - if (c == '=') { - switch (e++) { - case 3: e = 0; break; - case 2: if (*src == '=') break; - default: delete [] ret; ret = 0; return 0; break; - } - continue; - } - c -= dec; - if (e == 0) { *d = c << 2; ++e; continue; } - switch (e) { - case 1: *d |= c >> 4; *++d = c << 4; break; - case 2: *d |= c >> 2; *++d = c << 6; break; - case 3: *d++ |= c; e = 0; continue; break; - } - ++e; - } - len = d - (char *)ret; - return ret; -} - - - char * -VCARD::encodeBase64(const char * src, unsigned long srcl, unsigned long & destl) -{ - register const unsigned char *s = (unsigned char *)src; - register unsigned long i = ((srcl + 2) / 3) * 4; - destl = i += 2 * ((i / 60) + 1); - i = 0; - char * ret = new char[destl]; - register unsigned char *d((unsigned char *)ret); - while (srcl != 0) { // Critical loop - *d++ = B64[s[0] >> 2]; - *d++ = B64[((s[0] << 4) + (--srcl == 0 ? 0 : s[1] >> 4)) & 0x3f]; - *d++ = srcl == 0 ? '=' : - B64[((s[1] << 2) + (--srcl == 0 ? 0 : s[2] >> 6)) & 0x3f]; - *d++ = srcl == 0 ? '=' : B64[s[2] & 0x3f]; - if (srcl != 0) srcl--; - if (++i == 15) { i = 0; *d++ = '\r'; *d++ = '\n'; } - s += 3; - } - *d = '\r'; *++d = '\n'; *++d = '\0'; - return ret; -} - diff --git a/kabc/vcard/FloatValue.cpp b/kabc/vcard/FloatValue.cpp deleted file mode 100644 index ac1f2c6b5..000000000 --- a/kabc/vcard/FloatValue.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardFloatValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -FloatValue::FloatValue() - : Value() -{ -} - -FloatValue::FloatValue(float f) - : Value (), - value_ (f) -{ - parsed_ = true; -} - -FloatValue::FloatValue(const FloatValue & x) - : Value(x) -{ - value_ = x.value_; -} - -FloatValue::FloatValue(const TQCString & s) - : Value(s) -{ -} - - FloatValue & -FloatValue::operator = (FloatValue & x) -{ - if (*this == x) return *this; - - x.parse(); - value_ = x.value_; - - Value::operator = (x); - return *this; -} - - FloatValue & -FloatValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -FloatValue::operator == (FloatValue & x) -{ - x.parse(); - return (value_ == x.value_); -} - -FloatValue::~FloatValue() -{ -} - - void -FloatValue::_parse() -{ - bool negative(false); - - if (strRep_[0] == '-' || strRep_[1] == '+') { - - if (strRep_[0] == '-') - negative = true; - - strRep_.remove(0, 1); - } - - value_ = strRep_.toFloat(); - if (negative) - value_ = -value_; -} - - void -FloatValue::_assemble() -{ - strRep_ = TQCString().setNum(value_); -} - - float -FloatValue::value() -{ - parse(); - return value_; -} - - void -FloatValue::setValue(float f) -{ - parsed_ = true; - value_ = f; -} - diff --git a/kabc/vcard/GeoValue.cpp b/kabc/vcard/GeoValue.cpp deleted file mode 100644 index 2bac28c1e..000000000 --- a/kabc/vcard/GeoValue.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - This file is part of libvcard. - Copyright (c) 2002 Tobias Koenig <tokoe@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 <VCardGeoValue.h> - -#include <VCardValue.h> - -#include <kdebug.h> - -using namespace VCARD; - -GeoValue::GeoValue() - : Value() -{ -} - -GeoValue::GeoValue(const GeoValue & x) - : Value(x), latitude_(x.latitude_), longitude_(x.longitude_) -{ -} - -GeoValue::GeoValue(const TQCString & s) - : Value(s) -{ -} - - GeoValue & -GeoValue::operator = (GeoValue & x) -{ - if (*this == x) return *this; - - latitude_ = x.latitude_; - longitude_ = x.longitude_; - - Value::operator = (x); - return *this; -} - - GeoValue & -GeoValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -GeoValue::operator == (GeoValue & x) -{ - x.parse(); - - if ( latitude_ != x.latitude_ ) return false; - if ( longitude_ != x.longitude_ ) return false; - - return true; -} - -GeoValue::~GeoValue() -{ -} - - GeoValue * -GeoValue::clone() -{ - return new GeoValue( *this ); -} - - void -GeoValue::_parse() -{ - int semiColon = strRep_.find( ";" ); - - if ( semiColon == -1 ) // invalid - return; - - latitude_ = strRep_.left( semiColon ).toFloat(); - longitude_ = strRep_.mid( semiColon + 1, strRep_.length() - semiColon ).toFloat(); -} - - void -GeoValue::_assemble() -{ - strRep_.sprintf( "%.6f;%.6f", latitude_, longitude_ ); -} diff --git a/kabc/vcard/ImageParam.cpp b/kabc/vcard/ImageParam.cpp deleted file mode 100644 index 69611eeab..000000000 --- a/kabc/vcard/ImageParam.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardImageParam.h> - -#include <VCardParam.h> - -using namespace VCARD; - -ImageParam::ImageParam() - : Param() -{ -} - -ImageParam::ImageParam(const ImageParam & x) - : Param(x) -{ -} - -ImageParam::ImageParam(const TQCString & s) - : Param(s) -{ -} - - ImageParam & -ImageParam::operator = (ImageParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - ImageParam & -ImageParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -ImageParam::operator == (ImageParam & x) -{ - x.parse(); - return false; -} - -ImageParam::~ImageParam() -{ -} - - void -ImageParam::_parse() -{ -} - - void -ImageParam::_assemble() -{ -} - diff --git a/kabc/vcard/ImageValue.cpp b/kabc/vcard/ImageValue.cpp deleted file mode 100644 index 5d8d29bb7..000000000 --- a/kabc/vcard/ImageValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardImageValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -ImageValue::ImageValue() - : Value() -{ -} - -ImageValue::ImageValue(const ImageValue & x) - : Value(x) -{ -} - -ImageValue::ImageValue(const TQCString & s) - : Value(s) -{ -} - - ImageValue & -ImageValue::operator = (ImageValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - ImageValue & -ImageValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -ImageValue::operator == (ImageValue & x) -{ - x.parse(); - return false; -} - -ImageValue::~ImageValue() -{ -} - - void -ImageValue::_parse() -{ -} - - void -ImageValue::_assemble() -{ -} - diff --git a/kabc/vcard/ImgValue.cpp b/kabc/vcard/ImgValue.cpp deleted file mode 100644 index 42889acd8..000000000 --- a/kabc/vcard/ImgValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardImgValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -ImgValue::ImgValue() - : Value() -{ -} - -ImgValue::ImgValue(const ImgValue & x) - : Value(x) -{ -} - -ImgValue::ImgValue(const TQCString & s) - : Value(s) -{ -} - - ImgValue & -ImgValue::operator = (ImgValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - ImgValue & -ImgValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -ImgValue::operator == (ImgValue & x) -{ - x.parse(); - return false; -} - -ImgValue::~ImgValue() -{ -} - - void -ImgValue::_parse() -{ -} - - void -ImgValue::_assemble() -{ -} - diff --git a/kabc/vcard/LangValue.cpp b/kabc/vcard/LangValue.cpp deleted file mode 100644 index f7e5a759e..000000000 --- a/kabc/vcard/LangValue.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardRToken.h> - -#include <VCardLangValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -LangValue::LangValue() - : Value() -{ -} - -LangValue::LangValue(const LangValue & x) - : Value(x) -{ -} - -LangValue::LangValue(const TQCString & s) - : Value(s) -{ -} - - LangValue & -LangValue::operator = (LangValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - LangValue & -LangValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -LangValue::operator == (LangValue & x) -{ - x.parse(); - return false; -} - -LangValue::~LangValue() -{ -} - - void -LangValue::_parse() -{ - TQStrList l; - RTokenise(strRep_, "-", l); - - if (l.count() == 0) return; - - primary_ = l.at(0); - - l.remove(0u); - - subtags_ = l; -} - - void -LangValue::_assemble() -{ - strRep_ = primary_; - - TQStrListIterator it(subtags_); - - for (; it.current(); ++it) - strRep_ += TQCString('-') + it.current(); -} - - TQCString -LangValue::primary() -{ - parse(); - return primary_; -} - - TQStrList -LangValue::subtags() -{ - parse(); - return subtags_; -} - - void -LangValue::setPrimary(const TQCString & s) -{ - parse(); - primary_ = s; -} - - void -LangValue::setSubTags(const TQStrList & l) -{ - parse(); - subtags_ = l; -} - diff --git a/kabc/vcard/Makefile.am b/kabc/vcard/Makefile.am deleted file mode 100644 index e8a33c3a9..000000000 --- a/kabc/vcard/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -INCLUDES = \ - -I$(srcdir)/include \ - -I$(srcdir)/include/generated \ - $(all_includes) - -### KDE 4.0: either make noinst or rename to something like libkvcard -lib_LTLIBRARIES = libvcard.la - -libvcard_la_SOURCES = vCard-all.cpp -libvcard_la_LDFLAGS = $(all_libraries) -libvcard_la_LIBADD = $(LIB_TDECORE) $(LIB_QT) - -check_PROGRAMS = testwrite testread - -testwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testwrite_LDADD = libvcard.la -testwrite_SOURCES = testwrite.cpp - -testread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testread_LDADD = libvcard.la -testread_SOURCES = testread.cpp diff --git a/kabc/vcard/NValue.cpp b/kabc/vcard/NValue.cpp deleted file mode 100644 index e63268134..000000000 --- a/kabc/vcard/NValue.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <tqstrlist.h> - -#include <VCardRToken.h> -#include <VCardNValue.h> -#include <VCardValue.h> -#include <VCardDefines.h> - -using namespace VCARD; - -NValue::NValue() - : Value() -{ - vDebug("ctor"); -} - -NValue::NValue(const NValue & x) - : Value(x), - family_ (x.family_), - given_ (x.given_), - middle_ (x.middle_), - prefix_ (x.prefix_), - suffix_ (x.suffix_) -{ -} - -NValue::NValue(const TQCString & s) - : Value(s) -{ - vDebug("ctor"); -} - - NValue & -NValue::operator = (NValue & x) -{ - if (*this == x) return *this; - - family_ = x.family_; - given_ = x.given_; - middle_ = x.middle_; - prefix_ = x.prefix_; - suffix_ = x.suffix_; - - Value::operator = (x); - return *this; -} - - NValue & -NValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -NValue::operator == (NValue & x) -{ - x.parse(); - - return ( - family_ == x.family_ && - given_ == x.given_ && - middle_ == x.middle_ && - prefix_ == x.prefix_ && - suffix_ == x.suffix_); -} - -NValue::~NValue() -{ -} - - NValue * -NValue::clone() -{ - return new NValue( *this ); -} - - void -NValue::_parse() -{ - TQStrList l; - RTokenise(strRep_, ";", l); - - for (unsigned int i = 0; i < l.count(); i++) { - - switch (i) { - case 0: family_ = l.at(0); break; - case 1: given_ = l.at(1); break; - case 2: middle_ = l.at(2); break; - case 3: prefix_ = l.at(3); break; - case 4: suffix_ = l.at(4); break; - default: break; - } - } -} - - void -NValue::_assemble() -{ - strRep_ = family_; - strRep_ += ";" + given_; - strRep_ += ";" + middle_; - strRep_ += ";" + prefix_; - strRep_ += ";" + suffix_; -} - diff --git a/kabc/vcard/OrgValue.cpp b/kabc/vcard/OrgValue.cpp deleted file mode 100644 index 94ca18243..000000000 --- a/kabc/vcard/OrgValue.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardRToken.h> - -#include <VCardOrgValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -OrgValue::OrgValue() - : Value() -{ -} - -OrgValue::OrgValue(const OrgValue & x) - : Value(x) -{ -} - -OrgValue::OrgValue(const TQCString & s) - : Value(s) -{ -} - - OrgValue & -OrgValue::operator = (OrgValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - OrgValue & -OrgValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -OrgValue::operator == (OrgValue & x) -{ - x.parse(); - return false; -} - -OrgValue::~OrgValue() -{ -} - - void -OrgValue::_parse() -{ - RTokenise(strRep_, ";", valueList_); -} - - void -OrgValue::_assemble() -{ - bool first(true); - - TQStrListIterator it(valueList_); - - for (; it.current(); ++it) { - if (!first) strRep_ += ';'; - strRep_ += it.current(); - first = false; - } -} - - unsigned int -OrgValue::numValues() -{ - parse(); - return valueList_.count(); -} - - TQCString -OrgValue::value(unsigned int i) -{ - parse(); - return valueList_.at(i); -} - diff --git a/kabc/vcard/Param.cpp b/kabc/vcard/Param.cpp deleted file mode 100644 index 8c5ad9e2c..000000000 --- a/kabc/vcard/Param.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardParam.h> - -#include <VCardEntity.h> - -#include <VCardRToken.h> - -using namespace VCARD; - -Param::Param() - : Entity(), - name_(""), - value_("") -{ -} - -Param::Param(const Param & x) - : Entity(x), - name_(x.name_), - value_(x.value_) -{ -} - -Param::Param(const TQCString & s) - : Entity(s), - name_(""), - value_("") -{ -} - - Param & -Param::operator = (Param & x) -{ - if (*this == x) return *this; - - Entity::operator = (x); - name_ = x.name_; - value_ = x.value_; - - return *this; -} - - Param & -Param::operator = (const TQCString & s) -{ - Entity::operator = (s); - return *this; -} - - bool -Param::operator == (Param & x) -{ - x.parse(); - return false; -} - -Param::~Param() -{ -} - - void -Param::_parse() -{ -} - - void -Param::_assemble() -{ - strRep_ = name_ + "=" + value_; -} - -Param::Param(const TQCString &name, const TQCString &value) - : Entity(), - name_(name), - value_(value) -{ - parsed_ = true; - assembled_ = false; -} - - void -Param::setName(const TQCString & name) -{ - name_ = name; - - assembled_ = false; -} - - void -Param::setValue(const TQCString & value) -{ - value_ = value; - - assembled_ = false; -} - - TQCString -Param::name() -{ - return name_; -} - - TQCString -Param::value() -{ - return value_; -} diff --git a/kabc/vcard/PhoneNumberValue.cpp b/kabc/vcard/PhoneNumberValue.cpp deleted file mode 100644 index 02a1266fe..000000000 --- a/kabc/vcard/PhoneNumberValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardPhoneNumberValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -PhoneNumberValue::PhoneNumberValue() - : Value() -{ -} - -PhoneNumberValue::PhoneNumberValue(const PhoneNumberValue & x) - : Value(x) -{ -} - -PhoneNumberValue::PhoneNumberValue(const TQCString & s) - : Value(s) -{ -} - - PhoneNumberValue & -PhoneNumberValue::operator = (PhoneNumberValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - PhoneNumberValue & -PhoneNumberValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -PhoneNumberValue::operator == (PhoneNumberValue & x) -{ - x.parse(); - return false; -} - -PhoneNumberValue::~PhoneNumberValue() -{ -} - - void -PhoneNumberValue::_parse() -{ -} - - void -PhoneNumberValue::_assemble() -{ -} - diff --git a/kabc/vcard/README b/kabc/vcard/README deleted file mode 100644 index 18a9daf4a..000000000 --- a/kabc/vcard/README +++ /dev/null @@ -1,15 +0,0 @@ -libvcard (C) 1999 Rik Hemsley <rik@kde.org> -Written for the KDE project. - -This software is licensed under the MIT license. - -A vCard 3.0 parser based on the same principles that librmm (from Empath) uses. - -It's small and very fast due to parsing and assembly of object being lazy. - -There is a base64 codec declared in Enum.h - -Feedback welcome. - -Rik <rik@kde.org> - diff --git a/kabc/vcard/RToken.cpp b/kabc/vcard/RToken.cpp deleted file mode 100644 index 582a9e1c7..000000000 --- a/kabc/vcard/RToken.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <string.h> -#include <stddef.h> -#include <tqcstring.h> -#include <tqstrlist.h> - -namespace VCARD -{ - - TQ_UINT32 -RTokenise(const char * str, const char * delim, TQStrList & l) -{ - // FIXME no stderr ! - l.clear(); - - if (!delim || !str || strlen(delim) == 0 || strlen(str) == 0) return 0; - - char * len = (char *)(str + strlen(str)); // End of string. - - register char * rstart = new char[strlen(str) + 1]; - register char * r = rstart; - - - register const char * i = str; // Cursor. - - while (i <= len) { - - if (*i == '\\') { // Escaped chars go straight through. - *r++ = *i++; - if (i <= len) - *r++ = *i++; - continue; - } - - if (strchr(delim, *i) != 0) { - // We hit a delimiter. If we have some text, make a new token. - // This has the effect that multiple delimiters are collapsed. - // cs: We mustn't collapse multiple delimiters, otherwise we - // lose empty fields. - *r = '\0'; -// if (r != rstart) { - l.append(rstart); -// } - r = rstart; - ++i; - continue; - } - - *r++ = *i++; - } - - // Catch last token -// if (r != rstart) { - *r = '\0'; - l.append(rstart); -// } - - r = 0; - - delete [] rstart; - - return l.count(); -} - -} diff --git a/kabc/vcard/SoundValue.cpp b/kabc/vcard/SoundValue.cpp deleted file mode 100644 index 5be75d358..000000000 --- a/kabc/vcard/SoundValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardSoundValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -SoundValue::SoundValue() - : Value() -{ -} - -SoundValue::SoundValue(const SoundValue & x) - : Value(x) -{ -} - -SoundValue::SoundValue(const TQCString & s) - : Value(s) -{ -} - - SoundValue & -SoundValue::operator = (SoundValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - SoundValue & -SoundValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -SoundValue::operator == (SoundValue & x) -{ - x.parse(); - return false; -} - -SoundValue::~SoundValue() -{ -} - - void -SoundValue::_parse() -{ -} - - void -SoundValue::_assemble() -{ -} - diff --git a/kabc/vcard/SourceParam.cpp b/kabc/vcard/SourceParam.cpp deleted file mode 100644 index 6a0e772ac..000000000 --- a/kabc/vcard/SourceParam.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardSourceParam.h> - -#include <VCardParam.h> - -using namespace VCARD; - -SourceParam::SourceParam() - : Param(), - type_(SourceParam::TypeUnknown) -{ -} - -SourceParam::SourceParam(const SourceParam & x) - : Param(x), - type_ (x.type_), - par_ (x.par_), - val_ (x.val_) -{ -} - -SourceParam::SourceParam(const TQCString & s) - : Param(s), - type_(SourceParam::TypeUnknown) -{ -} - - SourceParam & -SourceParam::operator = (SourceParam & x) -{ - if (*this == x) return *this; - type_ = x.type(); - par_ = x.par(); - val_ = x.val(); - - Param::operator = (x); - return *this; -} - - SourceParam & -SourceParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -SourceParam::operator == (SourceParam & x) -{ - x.parse(); - return false; -} - -SourceParam::~SourceParam() -{ -} - - void -SourceParam::_parse() -{ - int i = strRep_.find('='); - if (i == -1) // Invalid - return; - - par_ = strRep_.left(i); - val_ = strRep_.right(strRep_.length() - i - 1); - - if (tqstricmp(par_, "VALUE") == 0 && tqstricmp(val_, "uri") == 0) - type_ = TypeValue; - else if (tqstricmp(par_, "CONTEXT") == 0 && tqstricmp(val_, "word") == 0) - type_ = TypeContext; - else if (tqstrnicmp(par_, "X-", 2) == 0) { - type_ = TypeX; - } - else type_ = TypeUnknown; - -} - - void -SourceParam::_assemble() -{ - if (type_ == TypeValue) - strRep_ = "VALUE=uri"; - else if (type_ == TypeContext) - strRep_ = "CONTEXT=word"; - else if (type_ == TypeX) - strRep_ = par_ + "=" + val_; - else strRep_ = ""; -} - diff --git a/kabc/vcard/TelParam.cpp b/kabc/vcard/TelParam.cpp deleted file mode 100644 index 072b1dc81..000000000 --- a/kabc/vcard/TelParam.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardTelParam.h> - -#include <VCardParam.h> - -using namespace VCARD; - -TelParam::TelParam() - : Param() -{ -} - -TelParam::TelParam(const TelParam & x) - : Param(x) -{ -} - -TelParam::TelParam(const TQCString & s) - : Param(s) -{ -} - - TelParam & -TelParam::operator = (TelParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - TelParam & -TelParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -TelParam::operator == (TelParam & x) -{ - x.parse(); - return false; -} - -TelParam::~TelParam() -{ -} - - void -TelParam::_parse() -{ -} - - void -TelParam::_assemble() -{ -} - diff --git a/kabc/vcard/TelValue.cpp b/kabc/vcard/TelValue.cpp deleted file mode 100644 index c9c1b85aa..000000000 --- a/kabc/vcard/TelValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardTelValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -TelValue::TelValue() - : Value() -{ -} - -TelValue::TelValue(const TelValue & x) - : Value(x) -{ -} - -TelValue::TelValue(const TQCString & s) - : Value(s) -{ -} - - TelValue & -TelValue::operator = (TelValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - TelValue & -TelValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -TelValue::operator == (TelValue & x) -{ - x.parse(); - return false; -} - -TelValue::~TelValue() -{ -} - - void -TelValue::_parse() -{ -} - - void -TelValue::_assemble() -{ -} - diff --git a/kabc/vcard/TextBinParam.cpp b/kabc/vcard/TextBinParam.cpp deleted file mode 100644 index 4e0ebadff..000000000 --- a/kabc/vcard/TextBinParam.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardTextBinParam.h> - -#include <VCardParam.h> - -using namespace VCARD; - -TextBinParam::TextBinParam() - : Param() -{ -} - -TextBinParam::TextBinParam(const TextBinParam & x) - : Param(x) -{ -} - -TextBinParam::TextBinParam(const TQCString & s) - : Param(s) -{ -} - - TextBinParam & -TextBinParam::operator = (TextBinParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - TextBinParam & -TextBinParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -TextBinParam::operator == (TextBinParam & x) -{ - x.parse(); - return false; -} - -TextBinParam::~TextBinParam() -{ -} - - void -TextBinParam::_parse() -{ -} - - void -TextBinParam::_assemble() -{ -} - diff --git a/kabc/vcard/TextBinValue.cpp b/kabc/vcard/TextBinValue.cpp deleted file mode 100644 index e7da0b7c6..000000000 --- a/kabc/vcard/TextBinValue.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <kmdcodec.h> - -#include <VCardTextBinValue.h> -#include <VCardValue.h> - -using namespace VCARD; - -TextBinValue::TextBinValue() - : Value() -{ -} - -TextBinValue::TextBinValue(const TextBinValue & x) - : Value(x) -{ - mIsBinary_ = x.mIsBinary_; - mData_ = x.mData_; - mUrl_ = x.mUrl_; -} - -TextBinValue::TextBinValue(const TQCString & s) - : Value(s) -{ -} - - TextBinValue & -TextBinValue::operator = (TextBinValue & x) -{ - if (*this == x) return *this; - - mIsBinary_ = x.mIsBinary_; - mData_ = x.mData_; - mUrl_ = x.mUrl_; - - Value::operator = (x); - return *this; -} - - TextBinValue & -TextBinValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -TextBinValue::operator == (TextBinValue & x) -{ - x.parse(); - - if ( mIsBinary_ != x.mIsBinary_ ) return false; - if ( mData_ != x.mData_ ) return false; - if ( mUrl_ != x.mUrl_ ) return false; - - return true; -} - -TextBinValue::~TextBinValue() -{ -} - - TextBinValue * -TextBinValue::clone() -{ - return new TextBinValue( *this ); -} - - void -TextBinValue::_parse() -{ -} - - void -TextBinValue::_assemble() -{ - if ( mIsBinary_ ) { - strRep_ = KCodecs::base64Encode( mData_ ); - } else - strRep_ = mUrl_.utf8(); -} - diff --git a/kabc/vcard/TextListValue.cpp b/kabc/vcard/TextListValue.cpp deleted file mode 100644 index 2bec2e181..000000000 --- a/kabc/vcard/TextListValue.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardRToken.h> - -#include <VCardTextListValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -TextListValue::TextListValue() - : Value() -{ -} - -TextListValue::TextListValue(const TextListValue & x) - : Value(x) -{ -} - -TextListValue::TextListValue(const TQCString & s) - : Value(s) -{ -} - - TextListValue & -TextListValue::operator = (TextListValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - TextListValue & -TextListValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -TextListValue::operator == (TextListValue & x) -{ - x.parse(); - return false; -} - -TextListValue::~TextListValue() -{ -} - - void -TextListValue::_parse() -{ - RTokenise(strRep_, ";", valueList_); -} - - void -TextListValue::_assemble() -{ - bool first(true); - - TQStrListIterator it(valueList_); - - for (; it.current(); ++it) { - if (!first) strRep_ += ';'; - strRep_ += it.current(); - first = false; - } -} - - unsigned int -TextListValue::numValues() -{ - parse(); - return valueList_.count(); -} - - TQCString -TextListValue::value(unsigned int i) -{ - parse(); - return valueList_.at(i); -} - diff --git a/kabc/vcard/TextParam.cpp b/kabc/vcard/TextParam.cpp deleted file mode 100644 index b353483ec..000000000 --- a/kabc/vcard/TextParam.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardTextParam.h> - -#include <VCardParam.h> - -using namespace VCARD; - -TextParam::TextParam() - : Param() -{ -} - -TextParam::TextParam(const TextParam & x) - : Param(x) -{ -} - -TextParam::TextParam(const TQCString & s) - : Param(s) -{ -} - - TextParam & -TextParam::operator = (TextParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - TextParam & -TextParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -TextParam::operator == (TextParam & x) -{ - x.parse(); - - return false; -} - -TextParam::~TextParam() -{ -} - - void -TextParam::_parse() -{ -} - - void -TextParam::_assemble() -{ -} - diff --git a/kabc/vcard/TextValue.cpp b/kabc/vcard/TextValue.cpp deleted file mode 100644 index cf8e0673f..000000000 --- a/kabc/vcard/TextValue.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardTextValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -TextValue::TextValue() - : Value() -{ -} - -TextValue::TextValue(const TextValue & x) - : Value(x) -{ -} - -TextValue::TextValue(const TQCString & s) - : Value(s) -{ -} - - TextValue & -TextValue::operator = (TextValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - TextValue & -TextValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -TextValue::operator == (TextValue & x) -{ - return strRep_ == x.strRep_; -} - -TextValue::~TextValue() -{ -} - - TextValue * -TextValue::clone() -{ - return new TextValue( *this ); -} - - void -TextValue::_parse() -{ -} - - void -TextValue::_assemble() -{ -} - diff --git a/kabc/vcard/URIValue.cpp b/kabc/vcard/URIValue.cpp deleted file mode 100644 index bba8db0fa..000000000 --- a/kabc/vcard/URIValue.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardURIValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -URIValue::URIValue() - : Value() -{ -} - -URIValue::URIValue(const TQCString & scheme, const TQCString & schemeSpecificPart) - : Value(), - scheme_ (scheme), - schemeSpecificPart_ (schemeSpecificPart) -{ - parsed_ = true; -} - -URIValue::URIValue(const URIValue & x) - : Value (x), - scheme_ (x.scheme_), - schemeSpecificPart_ (x.schemeSpecificPart_) -{ -} - -URIValue::URIValue(const TQCString & s) - : Value(s) -{ -} - - URIValue & -URIValue::operator = (URIValue & x) -{ - if (*this == x) return *this; - - scheme_ = x.scheme_; - schemeSpecificPart_ = x.schemeSpecificPart_; - - Value::operator = (x); - return *this; -} - - URIValue & -URIValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -URIValue::operator == (URIValue & x) -{ - x.parse(); - return ( - (scheme_ == x.scheme_) && - (schemeSpecificPart_ == x.schemeSpecificPart_)); - - return false; -} - -URIValue::~URIValue() -{ -} - - void -URIValue::_parse() -{ - int split = strRep_.find(':'); - if (split == -1) - return; - - scheme_ = strRep_.left(split); - schemeSpecificPart_ = strRep_.mid(split + 1); -} - - void -URIValue::_assemble() -{ - strRep_ = scheme_ + ':' + schemeSpecificPart_; -} - - TQCString -URIValue::scheme() -{ - parse(); - return scheme_; -} - - TQCString -URIValue::schemeSpecificPart() -{ - parse(); - return schemeSpecificPart_; -} - - void -URIValue::setScheme(const TQCString & s) -{ - parse(); - scheme_ = s; -} - - void -URIValue::setSchemeSpecificPart(const TQCString & s) -{ - parse(); - schemeSpecificPart_ = s; -} - diff --git a/kabc/vcard/UTCValue.cpp b/kabc/vcard/UTCValue.cpp deleted file mode 100644 index 30473661f..000000000 --- a/kabc/vcard/UTCValue.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardUTCValue.h> - -#include <VCardValue.h> - -using namespace VCARD; - -UTCValue::UTCValue() - : Value() -{ -} - -UTCValue::UTCValue(const UTCValue & x) - : Value(x), positive_(x.positive_), hour_(x.hour_), minute_(x.minute_) - -{ -} - -UTCValue::UTCValue(const TQCString & s) - : Value(s) -{ -} - - UTCValue & -UTCValue::operator = (UTCValue & x) -{ - if (*this == x) return *this; - - positive_ = x.positive_; - hour_ = x.hour_; - minute_ = x.minute_; - - Value::operator = (x); - return *this; -} - - UTCValue & -UTCValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -UTCValue::operator == (UTCValue & x) -{ - x.parse(); - - if (positive_ != x.positive_) return false; - if (hour_ != x.hour_) return false; - if (minute_ != x.minute_) return false; - - return true; -} - -UTCValue::~UTCValue() -{ -} - - UTCValue * -UTCValue::clone() -{ - return new UTCValue( *this ); -} - - void -UTCValue::_parse() -{ - if ( strRep_.isEmpty() ) - return; - - positive_ = ( strRep_[0] == '+' ); - - int colon = strRep_.find( ':' ); - - if ( colon == -1 ) // Not valid. - return; - - hour_ = strRep_.mid( 1, 2 ).toInt(); - minute_ = strRep_.right( 2 ).toInt(); -} - - void -UTCValue::_assemble() -{ - strRep_.sprintf( "%c%.2i:%.2i", (positive_ ? '+' : '-'), hour_, minute_ ); -} - diff --git a/kabc/vcard/VCard.cpp b/kabc/vcard/VCard.cpp deleted file mode 100644 index eb3f57f6e..000000000 --- a/kabc/vcard/VCard.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <tqcstring.h> -#include <tqstrlist.h> - -#include <VCardEntity.h> -#include <VCardVCard.h> -#include <VCardContentLine.h> -#include <VCardRToken.h> - -#include <VCardDefines.h> - -using namespace VCARD; - -VCard::VCard() - : Entity() -{ - contentLineList_.setAutoDelete( true ); -} - -VCard::VCard(const VCard & x) - : Entity(x), - group_(x.group_), - contentLineList_(x.contentLineList_) -{ -} - -VCard::VCard(const TQCString & s) - : Entity(s) -{ -} - - VCard & -VCard::operator = (VCard & x) -{ - if (*this == x) return *this; - - group_ = x.group(); - contentLineList_ = x.contentLineList_; - - Entity::operator = (x); - return *this; -} - - VCard & -VCard::operator = (const TQCString & s) -{ - Entity::operator = (s); - return *this; -} - - bool -VCard::operator == (VCard & x) -{ - x.parse(); - return false; -} - -VCard::~VCard() -{ -} - - void -VCard::_parse() -{ - vDebug("parse() called"); - TQStrList l; - - RTokenise(strRep_, "\r\n", l); - - if (l.count() < 3) { // Invalid VCARD ! - vDebug("Invalid vcard"); - return; - } - - // Get the first line - TQCString beginLine = TQCString(l.at(0)).stripWhiteSpace(); - - vDebug("Begin line == \"" + beginLine + "\""); - - // Remove extra blank lines - while (TQCString(l.last()).isEmpty()) - l.remove(l.last()); - - // Now we know this is the last line - TQCString endLine = l.last(); - - // Trash the first and last lines as we have seen them. - l.remove(0u); - l.remove(l.last()); - - /////////////////////////////////////////////////////////////// - // FIRST LINE - - int split = beginLine.find(':'); - - if (split == -1) { // invalid, no BEGIN - vDebug("No split"); - return; - } - - TQCString firstPart(beginLine.left(split)); - TQCString valuePart(beginLine.mid(split + 1)); - - split = firstPart.find('.'); - - if (split != -1) { - group_ = firstPart.left(split); - firstPart = firstPart.right(firstPart.length() - split - 1); - } - - if (tqstrnicmp(firstPart, "BEGIN", 5) != 0) { // No BEGIN ! - vDebug("No BEGIN"); - return; - } - - if (tqstrnicmp(valuePart, "VCARD", 5) != 0) { // Not a vcard ! - vDebug("No VCARD"); - return; - } - - /////////////////////////////////////////////////////////////// - // CONTENT LINES - // - vDebug("Content lines"); - - // Handle folded lines. - - TQStrList refolded; - - TQStrListIterator it(l); - - TQCString cur; - - for (; it.current(); ++it) { - - cur = it.current(); - - ++it; - - while ( - it.current() && - it.current()[0] == ' ' && - strlen(it.current()) != 1) - { - cur += it.current() + 1; - ++it; - } - - --it; - - refolded.append(cur); - } - - TQStrListIterator it2(refolded); - - for (; it2.current(); ++it2) { - - vDebug("New contentline using \"" + TQCString(it2.current()) + "\""); - ContentLine * cl = new ContentLine(it2.current()); - - cl->parse(); - - contentLineList_.append(cl); - } - - /////////////////////////////////////////////////////////////// - // LAST LINE - - split = endLine.find(':'); - - if (split == -1) // invalid, no END - return; - - firstPart = endLine.left(split); - valuePart = endLine.right(firstPart.length() - split - 1); - - split = firstPart.find('.'); - - if (split != -1) { - group_ = firstPart.left(split); - firstPart = firstPart.right(firstPart.length() - split - 1); - } - - if (tqstricmp(firstPart, "END") != 0) // No END ! - return; - - if (tqstricmp(valuePart, "VCARD") != 0) // Not a vcard ! - return; -} - - void -VCard::_assemble() -{ - vDebug("Assembling vcard"); - strRep_ = "BEGIN:VCARD\r\n"; - strRep_ += "VERSION:3.0\r\n"; - - TQPtrListIterator<ContentLine> it(contentLineList_); - - for (; it.current(); ++it) - strRep_ += it.current()->asString() + "\r\n"; - - strRep_ += "END:VCARD\r\n"; -} - - bool -VCard::has(EntityType t) -{ - parse(); - return contentLine(t) == 0 ? false : true; -} - - bool -VCard::has(const TQCString & s) -{ - parse(); - return contentLine(s) == 0 ? false : true; -} - - void -VCard::add(const ContentLine & cl) -{ - parse(); - ContentLine * c = new ContentLine(cl); - contentLineList_.append(c); -} - - void -VCard::add(const TQCString & s) -{ - parse(); - ContentLine * c = new ContentLine(s); - contentLineList_.append(c); -} - - ContentLine * -VCard::contentLine(EntityType t) -{ - parse(); - TQPtrListIterator<ContentLine> it(contentLineList_); - - for (; it.current(); ++it) - if (it.current()->entityType() == t) - return it.current(); - - return 0; -} - - ContentLine * -VCard::contentLine(const TQCString & s) -{ - parse(); - TQPtrListIterator<ContentLine> it(contentLineList_); - - for (; it.current(); ++it) - if (it.current()->entityType() == EntityNameToEntityType(s)) - return it.current(); - - return 0; -} - diff --git a/kabc/vcard/VCardEntity.cpp b/kabc/vcard/VCardEntity.cpp deleted file mode 100644 index 1f8cea5b1..000000000 --- a/kabc/vcard/VCardEntity.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <tqregexp.h> - -#include <VCardDefines.h> -#include <VCardVCardEntity.h> - -using namespace VCARD; - -VCardEntity::VCardEntity() - : Entity() -{ -} - -VCardEntity::VCardEntity(const VCardEntity & x) - : Entity(x) -{ -} - -VCardEntity::VCardEntity(const TQCString & s) - : Entity(s) -{ -} - - VCardEntity & -VCardEntity::operator = (VCardEntity & x) -{ - if (*this == x) return *this; - - Entity::operator = (x); - return *this; -} - - VCardEntity & -VCardEntity::operator = (const TQCString & s) -{ - Entity::operator = (s); - return *this; -} - - bool -VCardEntity::operator == (VCardEntity & x) -{ - x.parse(); - return false; -} - -VCardEntity::~VCardEntity() -{ -} - - void -VCardEntity::_parse() -{ - vDebug("parse"); - TQCString s(strRep_); - - int i = s.find(TQRegExp("BEGIN:VCARD", false)); - - while (i != -1) { - - i = s.find(TQRegExp("BEGIN:VCARD", false), 11); - - TQCString cardStr(s.left(i)); - - VCard * v = new VCard(cardStr); - - cardList_.append(v); - - v->parse(); - - s.remove(0, i); - } -} - - void -VCardEntity::_assemble() -{ - VCardListIterator it(cardList_); - - for (; it.current(); ++it) - strRep_ += it.current()->asString() + "\r\n"; // One CRLF for luck. -} - - VCardList & -VCardEntity::cardList() -{ - parse(); - return cardList_; -} - - void -VCardEntity::setCardList(const VCardList & l) -{ - parse(); - cardList_ = l; -} - diff --git a/kabc/vcard/Value.cpp b/kabc/vcard/Value.cpp deleted file mode 100644 index c95c0712b..000000000 --- a/kabc/vcard/Value.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include <VCardEntity.h> -#include <VCardValue.h> - -using namespace VCARD; - -Value::Value() - : Entity() -{ -} - -Value::Value(const Value & x) - : Entity(x) -{ -} - -Value::Value(const TQCString & s) - : Entity(s) -{ -} - - Value & -Value::operator = (Value & x) -{ - if (*this == x) return *this; - - Entity::operator = (x); - return *this; -} - - Value & -Value::operator = (const TQCString & s) -{ - Entity::operator = (s); - return *this; -} - - bool -Value::operator == (Value & x) -{ - x.parse(); - return false; -} - -Value::~Value() -{ -} - - void -Value::_parse() -{ -} - - void -Value::_assemble() -{ - vDebug("Value::_assemble()"); -} - diff --git a/kabc/vcard/include/VCard.h b/kabc/vcard/include/VCard.h deleted file mode 100644 index 17b50e8f2..000000000 --- a/kabc/vcard/include/VCard.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef VCARD_H -#define VCARD_H - -#include "VCardAdrParam.h" -#include "VCardAdrValue.h" -#include "VCardAgentParam.h" -#include "VCardAgentValue.h" -#include "VCardClassValue.h" -#include "VCardContentLine.h" -#include "VCardDateParam.h" -#include "VCardDateValue.h" -#include "VCardDefines.h" -#include "VCardEmailParam.h" -#include "VCardEntity.h" -#include "VCardEnum.h" -#include "VCardFloatValue.h" -#include "VCardGeoValue.h" -#include "VCardGroup.h" -#include "VCardImageParam.h" -#include "VCardImageValue.h" -#include "VCardImgValue.h" -#include "VCardLangValue.h" -#include "VCardNValue.h" -#include "VCardOrgValue.h" -#include "VCardParam.h" -#include "VCardPhoneNumberValue.h" -#include "VCardRToken.h" -#include "VCardSoundValue.h" -#include "VCardSourceParam.h" -#include "VCardTelParam.h" -#include "VCardTelValue.h" -#include "VCardTextBinParam.h" -#include "VCardTextBinValue.h" -#include "VCardTextListValue.h" -#include "VCardTextParam.h" -#include "VCardTextValue.h" -#include "VCardURIValue.h" -#include "VCardUTCValue.h" -#include "VCardVCard.h" -#include "VCardVCardEntity.h" -#include "VCardValue.h" - -#endif diff --git a/kabc/vcard/include/VCardAdrParam.h b/kabc/vcard/include/VCardAdrParam.h deleted file mode 100644 index d40165f4a..000000000 --- a/kabc/vcard/include/VCardAdrParam.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ADRPARAM_H -#define ADRPARAM_H - -#include <tqcstring.h> -#include <tqstrlist.h> - -#include <VCardParam.h> - -namespace VCARD -{ - -class KVCARD_EXPORT AdrParam : public Param -{ - -#include "AdrParam-generated.h" - - TQStrList adrTypeList() - { parse(); return adrTypeList_; } - - TQCString textParam() - { parse(); return textParam_; } - - void setAdrTypeList(const TQStrList & l) - { adrTypeList_ = l; assembled_ = false; } - - void setTextParam(const TQCString & s) - { textParam_ = s; assembled_ = false; } - - enum AdrType { - AdrDom, AdrIntl, AdrPostal, AdrParcel, AdrHome, AdrWork, AdrPref, - AdrIANA, AdrX - }; - - private: - - TQStrList adrTypeList_; - TQCString textParam_; -}; -} - -#endif diff --git a/kabc/vcard/include/VCardAdrValue.h b/kabc/vcard/include/VCardAdrValue.h deleted file mode 100644 index 94ed93aee..000000000 --- a/kabc/vcard/include/VCardAdrValue.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ADRVALUE_H -#define ADRVALUE_H - -#include <tqstrlist.h> -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT AdrValue : public Value -{ - -#include "AdrValue-generated.h" - - AdrValue *clone(); - - void setPOBox(const TQCString & s) - { poBox_ = s; assembled_ = false; } - - void setExtAddress(const TQCString & s) - { extAddress_ = s; assembled_ = false; } - - void setStreet(const TQCString & s) - { street_ = s; assembled_ = false; } - - void setLocality(const TQCString & s) - { locality_ = s; assembled_ = false; } - - void setRegion(const TQCString & s) - { region_ = s; assembled_ = false; } - - void setPostCode(const TQCString & s) - { postCode_ = s; assembled_ = false; } - - void setCountryName(const TQCString & s) - { countryName_ = s; assembled_ = false; } - - TQCString poBox() { parse(); return poBox_; } - TQCString extAddress() { parse(); return extAddress_; } - TQCString street() { parse(); return street_; } - TQCString locality() { parse(); return locality_; } - TQCString region() { parse(); return region_; } - TQCString postCode() { parse(); return postCode_; } - TQCString countryName() { parse(); return countryName_; } - - private: - - TQCString poBox_; - TQCString extAddress_; - TQCString street_; - TQCString locality_; - TQCString region_; - TQCString postCode_; - TQCString countryName_; -}; - -} - -#endif - diff --git a/kabc/vcard/include/VCardAgentParam.h b/kabc/vcard/include/VCardAgentParam.h deleted file mode 100644 index 90c3bd528..000000000 --- a/kabc/vcard/include/VCardAgentParam.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef AGENTPARAM_H -#define AGENTPARAM_H - -#include <tqcstring.h> - -#include <VCardParam.h> -#include <VCardURIValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT AgentParam : public Param -{ - -#include "AgentParam-generated.h" - - bool refer() - { parse(); return refer_; } - - URIValue uri() - { parse(); return uri_; } - - void setRefer(bool b) - { refer_ = b; assembled_ = false; } - - void setURI(const TQCString & s) - { uri_ = s; assembled_ = false; } - - private: - - bool refer_; - URIValue uri_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardAgentValue.h b/kabc/vcard/include/VCardAgentValue.h deleted file mode 100644 index dd68145c9..000000000 --- a/kabc/vcard/include/VCardAgentValue.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef AGENTVALUE_H -#define AGENTVALUE_H - -#include <tqcstring.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT AgentValue : public Value -{ - -#include "AgentValue-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardClassValue.h b/kabc/vcard/include/VCardClassValue.h deleted file mode 100644 index 5de79167b..000000000 --- a/kabc/vcard/include/VCardClassValue.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef CLASSVALUE_H -#define CLASSVALUE_H - -#include <tqcstring.h> - -#include <VCardValue.h> - -#include <kdebug.h> - -namespace VCARD -{ - -class KVCARD_EXPORT ClassValue : public Value -{ - -#include "ClassValue-generated.h" - - enum ClassType { - Public, Private, Confidential, Other - }; - - ClassValue *clone(); - - void setType( int type ) { classType_ = type; assembled_ = false; parsed_ = true; } - int type() { parse(); return classType_; } - - private: - int classType_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardContentLine.h b/kabc/vcard/include/VCardContentLine.h deleted file mode 100644 index ea59444a0..000000000 --- a/kabc/vcard/include/VCardContentLine.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef CONTENTLINE_H -#define CONTENTLINE_H - -#include <tqptrlist.h> - -#include "VCardEnum.h" -#include "VCardEntity.h" -#include "VCardParam.h" -#include "VCardValue.h" - -namespace VCARD -{ - -class KVCARD_EXPORT ContentLine : public Entity -{ - -#include "ContentLine-generated.h" - - TQCString group() { parse(); return group_; } - TQCString name() { parse(); return name_; } - Value * value() { parse(); return value_; } - ParamList paramList() { parse(); return paramList_; } - ParamType paramType() { parse(); return paramType_; } - ValueType valueType() { parse(); return valueType_; } - EntityType entityType() { parse(); return entityType_; } - - void setGroup (const TQCString & s) - { group_ = s; assembled_ = false; } - - void setName (const TQCString & s) - { name_ = s; assembled_ = false; } - - void setValue (Value *s) - { value_ = s; assembled_ = false; } - - void setParamList (const ParamList & l) - { paramList_ = l; assembled_ = false; } - - void clear (); - - private: - - TQCString group_; - TQCString name_; - TQPtrList<Param> paramList_; - Value * value_; - - ParamType paramType_; - ValueType valueType_; - EntityType entityType_; -}; -} - -#endif diff --git a/kabc/vcard/include/VCardDateParam.h b/kabc/vcard/include/VCardDateParam.h deleted file mode 100644 index 410eae6b7..000000000 --- a/kabc/vcard/include/VCardDateParam.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef DATEPARAM_H -#define DATEPARAM_H - -#include <tqcstring.h> - -#include <VCardParam.h> - -namespace VCARD -{ - -class KVCARD_EXPORT DateParam : public Param -{ - -#include "DateParam-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardDateValue.h b/kabc/vcard/include/VCardDateValue.h deleted file mode 100644 index 4f2e2fe7f..000000000 --- a/kabc/vcard/include/VCardDateValue.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef DATEVALUE_H -#define DATEVALUE_H - -#include <tqcstring.h> -#include <tqdatetime.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT DateValue : public Value -{ -#include "DateValue-generated.h" - - DateValue( - unsigned int year, - unsigned int month, - unsigned int day, - unsigned int hour = 0, - unsigned int minute = 0, - unsigned int second = 0, - double secFrac = 0, - bool zonePositive = true, - unsigned int zoneHour = 0, - unsigned int zoneMinute = 0); - - DateValue(const TQDate &); - DateValue(const TQDateTime &); - - DateValue *clone(); - - bool hasTime(); - - unsigned int year(); - unsigned int month(); - unsigned int day(); - unsigned int hour(); - unsigned int minute(); - unsigned int second(); - double secondFraction(); - bool zonePositive(); - unsigned int zoneHour(); - unsigned int zoneMinute(); - - void setYear (unsigned int); - void setMonth (unsigned int); - void setDay (unsigned int); - void setHour (unsigned int); - void setMinute (unsigned int); - void setSecond (unsigned int); - void setSecondFraction (double); - void setZonePositive (bool); - void setZoneHour (unsigned int); - void setZoneMinute (unsigned int); - - TQDate qdate(); - TQTime qtime(); - TQDateTime qdt(); - - private: - - unsigned int year_, month_, day_, - hour_, minute_, second_, - zoneHour_, zoneMinute_; - - double secFrac_; - - bool zonePositive_; - - bool hasTime_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardDefines.h b/kabc/vcard/include/VCardDefines.h deleted file mode 100644 index e778bc24f..000000000 --- a/kabc/vcard/include/VCardDefines.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef VCARD_DEFINES_H -#define VCARD_DEFINES_H - -#include <kdebug.h> - -#ifdef VCARD_DEBUG -#define vDebug(a) kdDebug(5710) << a << endl; -#else -#define vDebug(a) -#endif - -#if 0 -#ifndef NDEBUG -# include <tqcstring.h> -# include <iostream> -# ifdef __GNUG__ -# define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \ - << __LINE__ << "): " << TQCString((a)).data() << endl; -# else -# define vDebug(a) cerr << className() << ": " \ - << TQCString((a)).data() << endl; -# endif -#else -# define vDebug(a) -#endif -#endif - -#endif // Included this file - diff --git a/kabc/vcard/include/VCardEmailParam.h b/kabc/vcard/include/VCardEmailParam.h deleted file mode 100644 index 1fe558afd..000000000 --- a/kabc/vcard/include/VCardEmailParam.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef EMAILPARAM_H -#define EMAILPARAM_H - -#include <tqcstring.h> - -#include <VCardParam.h> - -namespace VCARD -{ - -class KVCARD_EXPORT EmailParam : public Param -{ - -#include "EmailParam-generated.h" - - TQCString emailType() { parse(); return emailType_; } - bool pref() { parse(); return pref_; } - - void setEmailType(const TQCString & s) - { emailType_ = s; assembled_ = false; } - - void setPref(bool b) - { pref_ = b; assembled_ = false; } - - private: - - TQCString emailType_; - bool pref_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardEntity.h b/kabc/vcard/include/VCardEntity.h deleted file mode 100644 index e87c5f1a6..000000000 --- a/kabc/vcard/include/VCardEntity.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ENTITY_H -#define ENTITY_H - -#include <tqcstring.h> -#include <tdelibs_export.h> - -namespace VCARD -{ - -class KVCARD_EXPORT Entity -{ - public: - - Entity(); - Entity(const Entity & e); - Entity(const TQCString & s); - - virtual Entity & operator = (const Entity & e); - virtual Entity & operator = (const TQCString & s); - - virtual bool operator == (Entity & e); - virtual bool operator != (Entity & e); - virtual bool operator == (const TQCString & s); - virtual bool operator != (const TQCString & s); - - virtual ~Entity(); - - TQCString asString(); - - virtual void parse(); - virtual void assemble(); - - virtual void _parse() = 0; - virtual void _assemble() = 0; - - protected: - - TQCString strRep_; - bool parsed_; - bool assembled_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardEnum.h b/kabc/vcard/include/VCardEnum.h deleted file mode 100644 index 4552ccdbc..000000000 --- a/kabc/vcard/include/VCardEnum.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ENUM_H -#define ENUM_H - -#include <tqcstring.h> - -#include <tdelibs_export.h> - -namespace VCARD -{ - -extern const TQCString paramNames []; - -enum EntityType { - EntityName, - EntityProfile, - EntitySource, - EntityFullName, - EntityN, - EntityNickname, - EntityPhoto, - EntityBirthday, - EntityAddress, - EntityLabel, - EntityTelephone, - EntityEmail, - EntityMailer, - EntityTimeZone, - EntityGeo, - EntityTitle, - EntityRole, - EntityLogo, - EntityAgent, - EntityOrganisation, - EntityCategories, - EntityNote, - EntityProductID, - EntityRevision, - EntitySortString, - EntitySound, - EntityUID, - EntityURI, - EntityURL, - EntityVersion, - EntityClass, - EntityKey, - EntityExtension, - EntityUnknown -}; - -enum ValueType { - ValueSound, - ValueAgent, - ValueAddress, - ValueTel, - ValueTextBin, - ValueOrg, - ValueN, - ValueUTC, - ValueURI, - ValueClass, - ValueFloat, - ValueImage, - ValueDate, - ValueTextList, - ValueText, - ValueGeo, - ValueUnknown -}; - -enum ParamType { - ParamUnknown, - ParamNone, - ParamSource, - ParamText, - ParamImage, - ParamDate, - ParamAddrText, - ParamTel, - ParamEmail, - ParamMailer, - ParamAgent, - ParamTextBin, - ParamTextNS, - ParamSound -}; - -extern const ParamType paramTypesTable[]; - -KVCARD_EXPORT ParamType EntityTypeToParamType(EntityType); -KVCARD_EXPORT ValueType EntityTypeToValueType(EntityType); -KVCARD_EXPORT TQCString EntityTypeToParamName(EntityType); -KVCARD_EXPORT EntityType EntityNameToEntityType(const TQCString &); - -KVCARD_EXPORT char * encodeBase64(const char *, unsigned long, unsigned long &); -KVCARD_EXPORT char * decodeBase64(const char *, unsigned long, unsigned long &); - -} - -#endif - diff --git a/kabc/vcard/include/VCardFloatValue.h b/kabc/vcard/include/VCardFloatValue.h deleted file mode 100644 index 45a6823be..000000000 --- a/kabc/vcard/include/VCardFloatValue.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef FLOATVALUE_H -#define FLOATVALUE_H - -#include <tqcstring.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT FloatValue : public Value -{ - -#include "FloatValue-generated.h" - - FloatValue(float); - - float value(); - void setValue(float); - - private: - - float value_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardGeoValue.h b/kabc/vcard/include/VCardGeoValue.h deleted file mode 100644 index 4228587a4..000000000 --- a/kabc/vcard/include/VCardGeoValue.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of libvcard. - Copyright (c) 2002 Tobias Koenig <tokoe@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 GEOVALUE_H -#define GEOVALUE_H - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT GeoValue : public Value -{ - -#include "GeoValue-generated.h" - - GeoValue *clone(); - - void setLatitude( float lat ) { latitude_ = lat; assembled_ = false; } - void setLongitude( float lon ) { longitude_ = lon; assembled_ = false; } - - float latitude() { parse(); return latitude_; } - float longitude() { parse(); return longitude_; } - - private: - float latitude_; - float longitude_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardGroup.h b/kabc/vcard/include/VCardGroup.h deleted file mode 100644 index ce884f100..000000000 --- a/kabc/vcard/include/VCardGroup.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef GROUP_H -#define GROUP_H - -#include <VCardEntity.h> - -namespace VCARD -{ - -class KVCARD_EXPORT Group : public Entity -{ -#include "Group-generated.h" -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardImageParam.h b/kabc/vcard/include/VCardImageParam.h deleted file mode 100644 index 10ab8a3f5..000000000 --- a/kabc/vcard/include/VCardImageParam.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef IMGPARAM_H -#define IMGPARAM_H - -#include <tqcstring.h> - -#include <VCardParam.h> - -namespace VCARD -{ - -class KVCARD_EXPORT ImageParam : public Param -{ - -#include "ImageParam-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardImageValue.h b/kabc/vcard/include/VCardImageValue.h deleted file mode 100644 index 45fbcad9c..000000000 --- a/kabc/vcard/include/VCardImageValue.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef IMAGEVALUE_H -#define IMAGEVALUE_H - -#include <tqcstring.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT ImageValue : public Value -{ - -#include "ImageValue-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardImgValue.h b/kabc/vcard/include/VCardImgValue.h deleted file mode 100644 index 7d4bbfa2d..000000000 --- a/kabc/vcard/include/VCardImgValue.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef IMGVALUE_H -#define IMGVALUE_H - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT ImgValue : public Value -{ -#include "ImgValue-generated.h" -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardLangValue.h b/kabc/vcard/include/VCardLangValue.h deleted file mode 100644 index 7767d52fa..000000000 --- a/kabc/vcard/include/VCardLangValue.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef LANGVALUE_H -#define LANGVALUE_H - -#include <tqcstring.h> -#include <tqstrlist.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT LangValue : public Value -{ -#include "LangValue-generated.h" - - TQCString primary(); - TQStrList subtags(); - - void setPrimary(const TQCString &); - void setSubTags(const TQStrList &); - - TQCString primary_; - TQStrList subtags_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardNValue.h b/kabc/vcard/include/VCardNValue.h deleted file mode 100644 index 9db37fbbc..000000000 --- a/kabc/vcard/include/VCardNValue.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef NVALUE_H -#define NVALUE_H - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT NValue : public Value -{ -#include "NValue-generated.h" - NValue *clone(); - - TQCString family() { parse(); return family_; } - TQCString given() { parse(); return given_; } - TQCString middle() { parse(); return middle_; } - TQCString prefix() { parse(); return prefix_; } - TQCString suffix() { parse(); return suffix_; } - - void setFamily (const TQCString & s) { family_ = s; assembled_ = false; } - void setGiven (const TQCString & s) { given_ = s; assembled_ = false; } - void setMiddle (const TQCString & s) { middle_ = s; assembled_ = false; } - void setPrefix (const TQCString & s) { prefix_ = s; assembled_ = false; } - void setSuffix (const TQCString & s) { suffix_ = s; assembled_ = false; } - - private: - - TQCString family_, given_, middle_, prefix_, suffix_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardOrgValue.h b/kabc/vcard/include/VCardOrgValue.h deleted file mode 100644 index a2bd803e5..000000000 --- a/kabc/vcard/include/VCardOrgValue.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ORGVALUE_H -#define ORGVALUE_H - -#include <tqcstring.h> -#include <tqstrlist.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT OrgValue : public Value -{ - -#include "OrgValue-generated.h" - - unsigned int numValues(); - TQCString value(unsigned int); - - private: - - TQStrList valueList_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardParam.h b/kabc/vcard/include/VCardParam.h deleted file mode 100644 index 93d70f06b..000000000 --- a/kabc/vcard/include/VCardParam.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef PARAM_H -#define PARAM_H - -#include <tqcstring.h> -#include <tqptrlist.h> - -#include <VCardEntity.h> - -namespace VCARD -{ - -class KVCARD_EXPORT Param : public Entity -{ - -#include "Param-generated.h" - - Param(const TQCString &name, const TQCString &value); - - void setName(const TQCString &); - void setValue(const TQCString &); - - TQCString name(); - TQCString value(); - - private: - - TQCString name_; - TQCString value_; -}; - -typedef TQPtrList<Param> ParamList; -typedef TQPtrListIterator<Param> ParamListIterator; - -} - -#endif diff --git a/kabc/vcard/include/VCardPhoneNumberValue.h b/kabc/vcard/include/VCardPhoneNumberValue.h deleted file mode 100644 index 3f9e106ca..000000000 --- a/kabc/vcard/include/VCardPhoneNumberValue.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef PHONENUMBERVALUE_H -#define PHONENUMBERVALUE_H - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT PhoneNumberValue : public Value -{ -#include "PhoneNumberValue-generated.h" -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardRToken.h b/kabc/vcard/include/VCardRToken.h deleted file mode 100644 index 17a3943d3..000000000 --- a/kabc/vcard/include/VCardRToken.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef RTOKEN_H -#define RTOKEN_H - -#include <tqstrlist.h> - -#include <tdelibs_export.h> - -namespace VCARD -{ - -KVCARD_EXPORT TQ_UINT32 RTokenise(const char * str, const char * delim, TQStrList & l); - -} - -#endif - diff --git a/kabc/vcard/include/VCardSndValue.h b/kabc/vcard/include/VCardSndValue.h deleted file mode 100644 index 09a3a8238..000000000 --- a/kabc/vcard/include/VCardSndValue.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef SNDVALUE_H -#define SNDVALUE_H - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT SndValue : public Value -{ -#include "SndValue-generated.h" -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardSoundValue.h b/kabc/vcard/include/VCardSoundValue.h deleted file mode 100644 index 61858f058..000000000 --- a/kabc/vcard/include/VCardSoundValue.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef SOUNDVALUE_H -#define SOUNDVALUE_H - -#include <tqcstring.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT SoundValue : public Value -{ - -#include "SoundValue-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardSourceParam.h b/kabc/vcard/include/VCardSourceParam.h deleted file mode 100644 index 1d9d03d47..000000000 --- a/kabc/vcard/include/VCardSourceParam.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef SOURCEPARAM_H -#define SOURCEPARAM_H - -#include <tqcstring.h> - -#include <VCardParam.h> - -namespace VCARD -{ - -class KVCARD_EXPORT SourceParam : public Param -{ - -#include "SourceParam-generated.h" - - enum SourceParamType { TypeUnknown, TypeValue, TypeContext, TypeX }; - - SourceParamType type() { parse(); return type_;} - TQCString par() { parse(); return par_; } - TQCString val() { parse(); return val_; } - - void setType(SourceParamType t) { type_ = t; assembled_ = false; } - void setPar(const TQCString & s) { par_ = s; assembled_ = false; } - void setVal(const TQCString & s) { val_ = s; assembled_ = false; } - - private: - - SourceParamType type_; - // May be "VALUE = uri" or "CONTEXT = word" or "x-name = *SAFE-CHAR" - TQCString par_, val_; // Sub-parameter, value -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTelParam.h b/kabc/vcard/include/VCardTelParam.h deleted file mode 100644 index 9eea5da2f..000000000 --- a/kabc/vcard/include/VCardTelParam.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TELPARAM_H -#define TELPARAM_H - -#include <tqcstring.h> - -#include <VCardParam.h> - -namespace VCARD -{ - -class KVCARD_EXPORT TelParam : public Param -{ -#include "TelParam-generated.h" - - enum TelType { - TelHome, TelWork, TelPref, TelVoice, TelFex, TelMsg, TelCell, - TelPager, TelBBS, TelModem, TelCar, TelISDN, TelVideo, TelPCS, - TelIANA, TelX - }; - - private: - - TQPtrList<TelType> types_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTelValue.h b/kabc/vcard/include/VCardTelValue.h deleted file mode 100644 index 043a45aa9..000000000 --- a/kabc/vcard/include/VCardTelValue.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TELVALUE_H -#define TELVALUE_H - -#include <tqcstring.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT TelValue : public Value -{ - -#include "TelValue-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextBinParam.h b/kabc/vcard/include/VCardTextBinParam.h deleted file mode 100644 index 5a681ad48..000000000 --- a/kabc/vcard/include/VCardTextBinParam.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTBINPARAM_H -#define TEXTBINPARAM_H - -#include <tqcstring.h> - -#include <VCardParam.h> - -namespace VCARD -{ - -class KVCARD_EXPORT TextBinParam : public Param -{ - -#include "TextBinParam-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextBinValue.h b/kabc/vcard/include/VCardTextBinValue.h deleted file mode 100644 index 316fa7832..000000000 --- a/kabc/vcard/include/VCardTextBinValue.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTBINVALUE_H -#define TEXTBINVALUE_H - -#include <tqcstring.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT TextBinValue : public Value -{ - -#include "TextBinValue-generated.h" - - TextBinValue *clone(); - - bool isBinary() { parse(); return mIsBinary_; } - TQByteArray data() { parse(); return mData_; } - TQString url() { parse(); return mUrl_; } - - void setData( const TQByteArray &data ) - { - mData_ = data; - mIsBinary_ = true; - assembled_ = false; - } - - void setUrl( const TQString &url ) - { - mUrl_ = url; - mIsBinary_ = false; - assembled_ = false; - } - - private: - int mIsBinary_; - TQByteArray mData_; - TQString mUrl_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextListValue.h b/kabc/vcard/include/VCardTextListValue.h deleted file mode 100644 index 53760c75a..000000000 --- a/kabc/vcard/include/VCardTextListValue.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTLISTVALUE_H -#define TEXTLISTVALUE_H - -#include <tqstrlist.h> - -#include <tqcstring.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT TextListValue : public Value -{ - -#include "TextListValue-generated.h" - - unsigned int numValues(); - TQCString value(unsigned int); - - private: - - TQStrList valueList_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextParam.h b/kabc/vcard/include/VCardTextParam.h deleted file mode 100644 index d593c0578..000000000 --- a/kabc/vcard/include/VCardTextParam.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTPARAM_H -#define TEXTPARAM_H - -#include <tqcstring.h> - -#include <VCardParam.h> - -namespace VCARD -{ - -class KVCARD_EXPORT TextParam : public Param -{ - -#include "TextParam-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextValue.h b/kabc/vcard/include/VCardTextValue.h deleted file mode 100644 index 66eed32a8..000000000 --- a/kabc/vcard/include/VCardTextValue.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTVALUE_H -#define TEXTVALUE_H - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT TextValue : public Value -{ -#include "TextValue-generated.h" - - TextValue *clone(); -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardURIValue.h b/kabc/vcard/include/VCardURIValue.h deleted file mode 100644 index 696887774..000000000 --- a/kabc/vcard/include/VCardURIValue.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef URIVALUE_H -#define URIVALUE_H - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT URIValue : public Value -{ -#include "URIValue-generated.h" - - URIValue(const TQCString & scheme, const TQCString & schemeSpecificPart); - - TQCString scheme(); - TQCString schemeSpecificPart(); - - void setScheme (const TQCString &); - void setSchemeSpecificPart (const TQCString &); - - private: - - TQCString scheme_; - TQCString schemeSpecificPart_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardUTCValue.h b/kabc/vcard/include/VCardUTCValue.h deleted file mode 100644 index cb09ccf00..000000000 --- a/kabc/vcard/include/VCardUTCValue.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef UTCVALUE_H -#define UTCVALUE_H - -#include <tqcstring.h> - -#include <VCardValue.h> - -namespace VCARD -{ - -class KVCARD_EXPORT UTCValue : public Value -{ - -#include "UTCValue-generated.h" - - UTCValue *clone(); - - void setPositive( int p ) { positive_ = p; assembled_ = false; } - void setHour( int h ) { hour_ = h; assembled_ = false; } - void setMinute( int m ) { minute_ = m; assembled_ = false; } - - bool positive() { parse(); return positive_; } - unsigned int hour() { parse(); return hour_; } - unsigned int minute() { parse(); return minute_; } - - private: - - bool positive_; - unsigned int hour_; - unsigned int minute_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardVCard.h b/kabc/vcard/include/VCardVCard.h deleted file mode 100644 index 53563e8c0..000000000 --- a/kabc/vcard/include/VCardVCard.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef VCARD_VCARD_H -#define VCARD_VCARD_H - -#include <tqstring.h> -#include <tqptrlist.h> - -#include <VCardEnum.h> -#include <VCardEntity.h> -#include <VCardContentLine.h> - -namespace VCARD -{ - -class KVCARD_EXPORT VCard : public Entity -{ - -#include "VCard-generated.h" - - bool has(EntityType); - bool has(const TQCString &); - - void add(const ContentLine &); - void add(const TQCString &); - - ContentLine * contentLine(EntityType); - ContentLine * contentLine(const TQCString &); - - TQCString group() { parse(); return group_; } - - TQPtrList<ContentLine> contentLineList() { parse(); return contentLineList_; } - - private: - - TQCString group_; - TQPtrList<ContentLine> contentLineList_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardVCardEntity.h b/kabc/vcard/include/VCardVCardEntity.h deleted file mode 100644 index 422790c22..000000000 --- a/kabc/vcard/include/VCardVCardEntity.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef VCARD_ENTITY_H -#define VCARD_ENTITY_H - -#include <tqstring.h> -#include <tqptrlist.h> - -#include <VCardEnum.h> -#include <VCardVCard.h> -#include <VCardEntity.h> - -namespace VCARD -{ - -typedef TQPtrList<VCard> VCardList; -typedef TQPtrListIterator<VCard> VCardListIterator; - -class KVCARD_EXPORT VCardEntity : public Entity -{ - -#include "VCardEntity-generated.h" - - void setCardList(const VCardList & l); - VCardList & cardList(); - - private: - - VCardList cardList_; - -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardValue.h b/kabc/vcard/include/VCardValue.h deleted file mode 100644 index 3c167d70a..000000000 --- a/kabc/vcard/include/VCardValue.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef VALUE_H -#define VALUE_H - -#include <tqptrlist.h> - -#include <VCardEntity.h> - -namespace VCARD -{ - -class KVCARD_EXPORT Value : public Entity -{ -#include "Value-generated.h" - - virtual Value *clone() { return new Value( *this ); } -}; - -typedef TQPtrList<Value> ValueList; -typedef TQPtrListIterator<Value> ValueListIterator; - -} - -#endif diff --git a/kabc/vcard/include/generated/AdrParam-generated.h b/kabc/vcard/include/generated/AdrParam-generated.h deleted file mode 100644 index 1afdcd36a..000000000 --- a/kabc/vcard/include/generated/AdrParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -AdrParam(); -AdrParam(const AdrParam&); -AdrParam(const TQCString&); -AdrParam & operator = (AdrParam&); -AdrParam & operator = (const TQCString&); -bool operator ==(AdrParam&); -bool operator !=(AdrParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {AdrParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~AdrParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "AdrParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/AdrValue-generated.h b/kabc/vcard/include/generated/AdrValue-generated.h deleted file mode 100644 index 9882d1186..000000000 --- a/kabc/vcard/include/generated/AdrValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -AdrValue(); -AdrValue(const AdrValue&); -AdrValue(const TQCString&); -AdrValue & operator = (AdrValue&); -AdrValue & operator = (const TQCString&); -bool operator ==(AdrValue&); -bool operator !=(AdrValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {AdrValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~AdrValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "AdrValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/AgentParam-generated.h b/kabc/vcard/include/generated/AgentParam-generated.h deleted file mode 100644 index 07b87d106..000000000 --- a/kabc/vcard/include/generated/AgentParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -AgentParam(); -AgentParam(const AgentParam&); -AgentParam(const TQCString&); -AgentParam & operator = (AgentParam&); -AgentParam & operator = (const TQCString&); -bool operator ==(AgentParam&); -bool operator !=(AgentParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {AgentParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~AgentParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "AgentParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/AgentValue-generated.h b/kabc/vcard/include/generated/AgentValue-generated.h deleted file mode 100644 index e2866bb8f..000000000 --- a/kabc/vcard/include/generated/AgentValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -AgentValue(); -AgentValue(const AgentValue&); -AgentValue(const TQCString&); -AgentValue & operator = (AgentValue&); -AgentValue & operator = (const TQCString&); -bool operator ==(AgentValue&); -bool operator !=(AgentValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {AgentValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~AgentValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "AgentValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ClassValue-generated.h b/kabc/vcard/include/generated/ClassValue-generated.h deleted file mode 100644 index e10c65568..000000000 --- a/kabc/vcard/include/generated/ClassValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ClassValue(); -ClassValue(const ClassValue&); -ClassValue(const TQCString&); -ClassValue & operator = (ClassValue&); -ClassValue & operator = (const TQCString&); -bool operator ==(ClassValue&); -bool operator !=(ClassValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ClassValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ClassValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "ClassValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ContentLine-generated.h b/kabc/vcard/include/generated/ContentLine-generated.h deleted file mode 100644 index ad2ac7649..000000000 --- a/kabc/vcard/include/generated/ContentLine-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ContentLine(); -ContentLine(const ContentLine&); -ContentLine(const TQCString&); -ContentLine & operator = (ContentLine&); -ContentLine & operator = (const TQCString&); -bool operator ==(ContentLine&); -bool operator !=(ContentLine& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ContentLine a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ContentLine(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "ContentLine"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/DateParam-generated.h b/kabc/vcard/include/generated/DateParam-generated.h deleted file mode 100644 index 75e7ad72d..000000000 --- a/kabc/vcard/include/generated/DateParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -DateParam(); -DateParam(const DateParam&); -DateParam(const TQCString&); -DateParam & operator = (DateParam&); -DateParam & operator = (const TQCString&); -bool operator ==(DateParam&); -bool operator !=(DateParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {DateParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~DateParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "DateParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/DateValue-generated.h b/kabc/vcard/include/generated/DateValue-generated.h deleted file mode 100644 index cf0eb40d8..000000000 --- a/kabc/vcard/include/generated/DateValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -DateValue(); -DateValue(const DateValue&); -DateValue(const TQCString&); -DateValue & operator = (DateValue&); -DateValue & operator = (const TQCString&); -bool operator ==(DateValue&); -bool operator !=(DateValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {DateValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~DateValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "DateValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/EmailParam-generated.h b/kabc/vcard/include/generated/EmailParam-generated.h deleted file mode 100644 index 46ae1f80f..000000000 --- a/kabc/vcard/include/generated/EmailParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -EmailParam(); -EmailParam(const EmailParam&); -EmailParam(const TQCString&); -EmailParam & operator = (EmailParam&); -EmailParam & operator = (const TQCString&); -bool operator ==(EmailParam&); -bool operator !=(EmailParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {EmailParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~EmailParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "EmailParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/FloatValue-generated.h b/kabc/vcard/include/generated/FloatValue-generated.h deleted file mode 100644 index 155f52ae1..000000000 --- a/kabc/vcard/include/generated/FloatValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -FloatValue(); -FloatValue(const FloatValue&); -FloatValue(const TQCString&); -FloatValue & operator = (FloatValue&); -FloatValue & operator = (const TQCString&); -bool operator ==(FloatValue&); -bool operator !=(FloatValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {FloatValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~FloatValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "FloatValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/GeoValue-generated.h b/kabc/vcard/include/generated/GeoValue-generated.h deleted file mode 100644 index b525e8c21..000000000 --- a/kabc/vcard/include/generated/GeoValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -GeoValue(); -GeoValue(const GeoValue&); -GeoValue(const TQCString&); -GeoValue & operator = (GeoValue&); -GeoValue & operator = (const TQCString&); -bool operator ==(GeoValue&); -bool operator !=(GeoValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {GeoValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~GeoValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "GeoValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/Group-generated.h b/kabc/vcard/include/generated/Group-generated.h deleted file mode 100644 index 38e1c2a3a..000000000 --- a/kabc/vcard/include/generated/Group-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -Group(); -Group(const Group&); -Group(const TQCString&); -Group & operator = (Group&); -Group & operator = (const TQCString&); -bool operator ==(Group&); -bool operator !=(Group& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {Group a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~Group(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "Group"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ImageParam-generated.h b/kabc/vcard/include/generated/ImageParam-generated.h deleted file mode 100644 index 78a5a97cf..000000000 --- a/kabc/vcard/include/generated/ImageParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ImageParam(); -ImageParam(const ImageParam&); -ImageParam(const TQCString&); -ImageParam & operator = (ImageParam&); -ImageParam & operator = (const TQCString&); -bool operator ==(ImageParam&); -bool operator !=(ImageParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ImageParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ImageParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "ImageParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ImageValue-generated.h b/kabc/vcard/include/generated/ImageValue-generated.h deleted file mode 100644 index 882081fbc..000000000 --- a/kabc/vcard/include/generated/ImageValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ImageValue(); -ImageValue(const ImageValue&); -ImageValue(const TQCString&); -ImageValue & operator = (ImageValue&); -ImageValue & operator = (const TQCString&); -bool operator ==(ImageValue&); -bool operator !=(ImageValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ImageValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ImageValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "ImageValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ImgParam-generated.h b/kabc/vcard/include/generated/ImgParam-generated.h deleted file mode 100644 index 04132c857..000000000 --- a/kabc/vcard/include/generated/ImgParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ImgParam(); -ImgParam(const ImgParam&); -ImgParam(const TQCString&); -ImgParam & operator = (ImgParam&); -ImgParam & operator = (const TQCString&); -bool operator ==(ImgParam&); -bool operator !=(ImgParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ImgParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ImgParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -virtual const char * className() const { return "ImgParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ImgValue-generated.h b/kabc/vcard/include/generated/ImgValue-generated.h deleted file mode 100644 index 0774de9bf..000000000 --- a/kabc/vcard/include/generated/ImgValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ImgValue(); -ImgValue(const ImgValue&); -ImgValue(const TQCString&); -ImgValue & operator = (ImgValue&); -ImgValue & operator = (const TQCString&); -bool operator ==(ImgValue&); -bool operator !=(ImgValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ImgValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ImgValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -virtual const char * className() const { return "ImgValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/LangValue-generated.h b/kabc/vcard/include/generated/LangValue-generated.h deleted file mode 100644 index c4930c59e..000000000 --- a/kabc/vcard/include/generated/LangValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -LangValue(); -LangValue(const LangValue&); -LangValue(const TQCString&); -LangValue & operator = (LangValue&); -LangValue & operator = (const TQCString&); -bool operator ==(LangValue&); -bool operator !=(LangValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {LangValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~LangValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "LangValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/NValue-generated.h b/kabc/vcard/include/generated/NValue-generated.h deleted file mode 100644 index d78715ec0..000000000 --- a/kabc/vcard/include/generated/NValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -NValue(); -NValue(const NValue&); -NValue(const TQCString&); -NValue & operator = (NValue&); -NValue & operator = (const TQCString&); -bool operator ==(NValue&); -bool operator !=(NValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {NValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~NValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "NValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/Name-generated.h b/kabc/vcard/include/generated/Name-generated.h deleted file mode 100644 index 17d56e680..000000000 --- a/kabc/vcard/include/generated/Name-generated.h +++ /dev/null @@ -1,22 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -V_Name(); -V_Name(const V_Name&); -V_Name(const TQCString&); -V_Name & operator = (V_Name&); -V_Name & operator = (const TQCString&); -bool operator ==(V_Name&); -bool operator !=(V_Name& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {V_Name a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~V_Name(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/OrgValue-generated.h b/kabc/vcard/include/generated/OrgValue-generated.h deleted file mode 100644 index 661ecf5a3..000000000 --- a/kabc/vcard/include/generated/OrgValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -OrgValue(); -OrgValue(const OrgValue&); -OrgValue(const TQCString&); -OrgValue & operator = (OrgValue&); -OrgValue & operator = (const TQCString&); -bool operator ==(OrgValue&); -bool operator !=(OrgValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {OrgValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~OrgValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "OrgValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/Param-generated.h b/kabc/vcard/include/generated/Param-generated.h deleted file mode 100644 index bf63e7166..000000000 --- a/kabc/vcard/include/generated/Param-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -Param(); -Param(const Param&); -Param(const TQCString&); -Param & operator = (Param&); -Param & operator = (const TQCString&); -bool operator ==(Param&); -bool operator !=(Param& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {Param a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~Param(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "Param"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ParamName-generated.h b/kabc/vcard/include/generated/ParamName-generated.h deleted file mode 100644 index 60b1e12d5..000000000 --- a/kabc/vcard/include/generated/ParamName-generated.h +++ /dev/null @@ -1,22 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -V_ParamName(); -V_ParamName(const V_ParamName&); -V_ParamName(const TQCString&); -V_ParamName & operator = (V_ParamName&); -V_ParamName & operator = (const TQCString&); -bool operator ==(V_ParamName&); -bool operator !=(V_ParamName& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {V_ParamName a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~V_ParamName(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ParamValue-generated.h b/kabc/vcard/include/generated/ParamValue-generated.h deleted file mode 100644 index f31a166c6..000000000 --- a/kabc/vcard/include/generated/ParamValue-generated.h +++ /dev/null @@ -1,22 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -V_ParamValue(); -V_ParamValue(const V_ParamValue&); -V_ParamValue(const TQCString&); -V_ParamValue & operator = (V_ParamValue&); -V_ParamValue & operator = (const TQCString&); -bool operator ==(V_ParamValue&); -bool operator !=(V_ParamValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {V_ParamValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~V_ParamValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/PhoneNumberValue-generated.h b/kabc/vcard/include/generated/PhoneNumberValue-generated.h deleted file mode 100644 index f0eb6b4f4..000000000 --- a/kabc/vcard/include/generated/PhoneNumberValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -PhoneNumberValue(); -PhoneNumberValue(const PhoneNumberValue&); -PhoneNumberValue(const TQCString&); -PhoneNumberValue & operator = (PhoneNumberValue&); -PhoneNumberValue & operator = (const TQCString&); -bool operator ==(PhoneNumberValue&); -bool operator !=(PhoneNumberValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {PhoneNumberValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~PhoneNumberValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "PhoneNumberValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/SoundValue-generated.h b/kabc/vcard/include/generated/SoundValue-generated.h deleted file mode 100644 index 64081be0b..000000000 --- a/kabc/vcard/include/generated/SoundValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -SoundValue(); -SoundValue(const SoundValue&); -SoundValue(const TQCString&); -SoundValue & operator = (SoundValue&); -SoundValue & operator = (const TQCString&); -bool operator ==(SoundValue&); -bool operator !=(SoundValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {SoundValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~SoundValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "SoundValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/SourceParam-generated.h b/kabc/vcard/include/generated/SourceParam-generated.h deleted file mode 100644 index e3b13bca1..000000000 --- a/kabc/vcard/include/generated/SourceParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -SourceParam(); -SourceParam(const SourceParam&); -SourceParam(const TQCString&); -SourceParam & operator = (SourceParam&); -SourceParam & operator = (const TQCString&); -bool operator ==(SourceParam&); -bool operator !=(SourceParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {SourceParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~SourceParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "SourceParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TelParam-generated.h b/kabc/vcard/include/generated/TelParam-generated.h deleted file mode 100644 index 9f8f24270..000000000 --- a/kabc/vcard/include/generated/TelParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TelParam(); -TelParam(const TelParam&); -TelParam(const TQCString&); -TelParam & operator = (TelParam&); -TelParam & operator = (const TQCString&); -bool operator ==(TelParam&); -bool operator !=(TelParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TelParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TelParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TelParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TelValue-generated.h b/kabc/vcard/include/generated/TelValue-generated.h deleted file mode 100644 index 600da7727..000000000 --- a/kabc/vcard/include/generated/TelValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TelValue(); -TelValue(const TelValue&); -TelValue(const TQCString&); -TelValue & operator = (TelValue&); -TelValue & operator = (const TQCString&); -bool operator ==(TelValue&); -bool operator !=(TelValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TelValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TelValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TelValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextBinParam-generated.h b/kabc/vcard/include/generated/TextBinParam-generated.h deleted file mode 100644 index 37dc56e55..000000000 --- a/kabc/vcard/include/generated/TextBinParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextBinParam(); -TextBinParam(const TextBinParam&); -TextBinParam(const TQCString&); -TextBinParam & operator = (TextBinParam&); -TextBinParam & operator = (const TQCString&); -bool operator ==(TextBinParam&); -bool operator !=(TextBinParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextBinParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextBinParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextBinParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextBinValue-generated.h b/kabc/vcard/include/generated/TextBinValue-generated.h deleted file mode 100644 index 4c9580421..000000000 --- a/kabc/vcard/include/generated/TextBinValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextBinValue(); -TextBinValue(const TextBinValue&); -TextBinValue(const TQCString&); -TextBinValue & operator = (TextBinValue&); -TextBinValue & operator = (const TQCString&); -bool operator ==(TextBinValue&); -bool operator !=(TextBinValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextBinValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextBinValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextBinValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextListValue-generated.h b/kabc/vcard/include/generated/TextListValue-generated.h deleted file mode 100644 index 8babb0d9f..000000000 --- a/kabc/vcard/include/generated/TextListValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextListValue(); -TextListValue(const TextListValue&); -TextListValue(const TQCString&); -TextListValue & operator = (TextListValue&); -TextListValue & operator = (const TQCString&); -bool operator ==(TextListValue&); -bool operator !=(TextListValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextListValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextListValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextListValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextNSParam-generated.h b/kabc/vcard/include/generated/TextNSParam-generated.h deleted file mode 100644 index bd8e74b07..000000000 --- a/kabc/vcard/include/generated/TextNSParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextNSParam(); -TextNSParam(const TextNSParam&); -TextNSParam(const TQCString&); -TextNSParam & operator = (TextNSParam&); -TextNSParam & operator = (const TQCString&); -bool operator ==(TextNSParam&); -bool operator !=(TextNSParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextNSParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextNSParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextNSParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextParam-generated.h b/kabc/vcard/include/generated/TextParam-generated.h deleted file mode 100644 index 54ae611a5..000000000 --- a/kabc/vcard/include/generated/TextParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextParam(); -TextParam(const TextParam&); -TextParam(const TQCString&); -TextParam & operator = (TextParam&); -TextParam & operator = (const TQCString&); -bool operator ==(TextParam&); -bool operator !=(TextParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextValue-generated.h b/kabc/vcard/include/generated/TextValue-generated.h deleted file mode 100644 index 5b56b54a7..000000000 --- a/kabc/vcard/include/generated/TextValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextValue(); -TextValue(const TextValue&); -TextValue(const TQCString&); -TextValue & operator = (TextValue&); -TextValue & operator = (const TQCString&); -bool operator ==(TextValue&); -bool operator !=(TextValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/URIValue-generated.h b/kabc/vcard/include/generated/URIValue-generated.h deleted file mode 100644 index 5a691e6d6..000000000 --- a/kabc/vcard/include/generated/URIValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -URIValue(); -URIValue(const URIValue&); -URIValue(const TQCString&); -URIValue & operator = (URIValue&); -URIValue & operator = (const TQCString&); -bool operator ==(URIValue&); -bool operator !=(URIValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {URIValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~URIValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "URIValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/UTCValue-generated.h b/kabc/vcard/include/generated/UTCValue-generated.h deleted file mode 100644 index 0c6edfb46..000000000 --- a/kabc/vcard/include/generated/UTCValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -UTCValue(); -UTCValue(const UTCValue&); -UTCValue(const TQCString&); -UTCValue & operator = (UTCValue&); -UTCValue & operator = (const TQCString&); -bool operator ==(UTCValue&); -bool operator !=(UTCValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {UTCValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~UTCValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "UTCValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/VCard-generated.h b/kabc/vcard/include/generated/VCard-generated.h deleted file mode 100644 index 4f36d11da..000000000 --- a/kabc/vcard/include/generated/VCard-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -VCard(); -VCard(const VCard&); -VCard(const TQCString&); -VCard & operator = (VCard&); -VCard & operator = (const TQCString&); -bool operator ==(VCard&); -bool operator !=(VCard& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {VCard a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~VCard(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "VCard"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/VCardEntity-generated.h b/kabc/vcard/include/generated/VCardEntity-generated.h deleted file mode 100644 index 4e973e62a..000000000 --- a/kabc/vcard/include/generated/VCardEntity-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -VCardEntity(); -VCardEntity(const VCardEntity&); -VCardEntity(const TQCString&); -VCardEntity & operator = (VCardEntity&); -VCardEntity & operator = (const TQCString&); -bool operator ==(VCardEntity&); -bool operator !=(VCardEntity& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {VCardEntity a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~VCardEntity(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "VCardEntity"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/Value-generated.h b/kabc/vcard/include/generated/Value-generated.h deleted file mode 100644 index 935d137b6..000000000 --- a/kabc/vcard/include/generated/Value-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -Value(); -Value(const Value&); -Value(const TQCString&); -Value & operator = (Value&); -Value & operator = (const TQCString&); -bool operator ==(Value&); -bool operator !=(Value& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {Value a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~Value(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "Value"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/generate b/kabc/vcard/include/generated/generate deleted file mode 100755 index 926dbf136..000000000 --- a/kabc/vcard/include/generated/generate +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -cat headerBodies | awk -f generateHeaders.awk diff --git a/kabc/vcard/include/generated/generateHeaders.awk b/kabc/vcard/include/generated/generateHeaders.awk deleted file mode 100755 index 471db11b4..000000000 --- a/kabc/vcard/include/generated/generateHeaders.awk +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/awk -f - -{ - outfile = $1 "-generated.h" - name = $1 - - OFS="" - - print "// XXX Automatically generated. DO NOT EDIT! XXX //\n" > outfile - print "// WARNING! All changes made in this file will be lost!\n" > outfile - - if ($2 == "v") { pre = "virtual " } else { pre = "" } - - print "public:" >> outfile - print name "();" >> outfile - print name "(const " name "&);" >> outfile - print name "(const QCString&);" >> outfile - print pre name " & operator = (" name "&);" >> outfile - print pre name " & operator = (const QCString&);" >> outfile - print pre "bool operator ==(" name "&);" >> outfile - print pre "bool operator !=(" name "& x) {return !(*this==x);}" \ - >> outfile - print pre "bool operator ==(const QCString& s) {" name " a(s);" \ - "return(*this==a);} " >> outfile - print pre "bool operator != (const QCString& s) {return !(*this == s);}\n" \ - >> outfile - print "virtual ~" name "();" >> outfile - print pre "void parse() " \ - "{if(!parsed_) _parse();parsed_=true;assembled_=false;}\n" \ - >> outfile - print pre "void assemble() " \ - "{if(assembled_) return;parse();_assemble();assembled_=true;}\n" \ - >> outfile - print pre "void _parse();" >> outfile - print pre "void _assemble();" >> outfile - print pre "const char * className() const { return \"" name "\"; }" \ - >> outfile - - print "\n// End of automatically generated code //" >> outfile -} - diff --git a/kabc/vcard/include/generated/headerBodies b/kabc/vcard/include/generated/headerBodies deleted file mode 100644 index 5e77b2b5e..000000000 --- a/kabc/vcard/include/generated/headerBodies +++ /dev/null @@ -1,34 +0,0 @@ -AdrParam Param -AdrValue Value -AgentParam Param -ContentLine Entity -DateParam Param -DateValue Value -EmailParam Param -GeoValue Value -Group Entity -ImageParam Param -ImageValue Value -LangValue Value -NValue Value -Param Entity -PhoneNumberValue Value -SourceParam Param -TelParam Param -TextParam Param -TextNSParam Param -TextValue Value -TextBinParam Param -URIValue Value -VCard Entity -VCardEntity Entity -Value Entity -SoundValue Value -AgentValue Value -TelValue Value -TextBinValue Value -OrgValue Value -UTCValue Value -ClassValue Value -FloatValue Value -TextListValue Value diff --git a/kabc/vcard/testread.cpp b/kabc/vcard/testread.cpp deleted file mode 100644 index 3a33c7d54..000000000 --- a/kabc/vcard/testread.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include <iostream> -#include <stdlib.h> -#include <assert.h> - -#include <tqfile.h> -#include <tqtextstream.h> - -#include <VCard.h> - -using namespace std; - -int main(int argc, char * argv[]) -{ - if (argc != 2) { - cerr << "Usage: " << argv[0] << " <filename>" << endl; - exit(1); - } - - TQFile f(argv[1]); - - TQCString str; - - if (!f.open(IO_ReadOnly)) { - cerr << "Couldn't open file \"" << argv[1] << endl; - exit(1); - } - - TQTextStream t(&f); - - while (!t.eof()) - str += t.readLine().utf8() + '\n'; - - using namespace VCARD; - - // Iterate through all vCards in the file. - - cout << "--------- begin ----------" << endl; - cout << str.data(); - cout << "--------- end ----------" << endl; - - VCardEntity e(str); - - VCardListIterator it(e.cardList()); - - for (; it.current(); ++it) { - - cerr << "****************** VCARD ********************" << endl; - - // Create a vcard using the string representation. - VCard & v (*it.current()); - - if (v.has(EntityEmail)) { - cerr << "Email parameter found" << endl; - - TQCString s = v.contentLine(EntityEmail)->value()->asString(); - - cerr << "Email value == " << s << endl; - } - - if (v.has(EntityNickname)) { - cerr << "Nickname parameter found" << endl; - - cerr << "Nickname value == " << - v.contentLine(EntityNickname)->value()->asString() << - endl; - } - - if (v.has(EntityRevision)) { - - cerr << "Revision parameter found" << endl; - - DateValue * d = - (DateValue *) - v.contentLine(EntityRevision)->value(); - - assert(d != 0); - - cerr << "Revision date: " << endl; - cerr << "Day : " << d->day() << endl; - cerr << "Month : " << d->month() << endl; - cerr << "Year : " << d->year() << endl; - - if (d->hasTime()) { - cerr << "Revision date has a time component" << endl; - cerr << "Revision time: " << endl; - cerr << "Hour : " << d->hour() << endl; - cerr << "Minute : " << d->minute() << endl; - cerr << "Second : " << d->second() << endl; - - } - else cerr << "Revision date does NOT have a time component" << endl; - } - - if (v.has(EntityURL)) { - cerr << "URL Parameter found" << endl; - - cerr << "URL Value == " << - v.contentLine(EntityURL)->value()->asString() << - endl; - - URIValue * urlVal = - (URIValue *)v.contentLine(EntityURL)->value(); - - assert(urlVal != 0); - - cerr << "URL scheme == " << - urlVal->scheme() << endl; - - cerr << "URL scheme specific part == " << - urlVal->schemeSpecificPart() << endl; - } - - if (v.has(EntityN)) { - cerr << "N Parameter found" << endl; - - NValue * n = - (NValue *)(v.contentLine(EntityN)->value()); - - cerr << "Family name == " << n->family() << endl; - cerr << "Given name == " << n->given() << endl; - cerr << "Middle name == " << n->middle() << endl; - cerr << "Prefix == " << n->prefix() << endl; - cerr << "Suffix == " << n->suffix() << endl; - } - - cerr << "***************** END VCARD ******************" << endl; - } -} - diff --git a/kabc/vcard/testwrite.cpp b/kabc/vcard/testwrite.cpp deleted file mode 100644 index 67f8eb20a..000000000 --- a/kabc/vcard/testwrite.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <kdebug.h> -#include <klocale.h> -#include <tdecmdlineargs.h> - -#include <VCard.h> - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - - TDEApplication app; - - kdDebug() << "Test Write VCard" << endl; - - using namespace VCARD; - - VCard v; - - ContentLine cl1; - cl1.setName(EntityTypeToParamName(EntityName)); - cl1.setValue(new TextValue("Hans Wurst")); - v.add(cl1); - - ContentLine cl2; - cl2.setName(EntityTypeToParamName(EntityTelephone)); - cl2.setValue(new TelValue("12345")); - ParamList p; - p.append( new TelParam("home") ); - p.append( new TelParam("fax") ); - cl2.setParamList( p ); - v.add(cl2); - - TQCString str = v.asString(); - - kdDebug() << "--- VCard begin ---" << endl - << str - << "--- VCard end ---" << endl; -} diff --git a/kabc/vcard/vCard-all.cpp b/kabc/vcard/vCard-all.cpp deleted file mode 100644 index 07bbcd2bb..000000000 --- a/kabc/vcard/vCard-all.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "AdrParam.cpp" -#include "AdrValue.cpp" -#include "AgentParam.cpp" -#include "AgentValue.cpp" -#include "ClassValue.cpp" -#include "ContentLine.cpp" -#include "DateParam.cpp" -#include "DateValue.cpp" -#include "EmailParam.cpp" -#include "Entity.cpp" -#include "Enum.cpp" -#include "FloatValue.cpp" -#include "GeoValue.cpp" -#include "ImageParam.cpp" -#include "ImageValue.cpp" -#include "ImgValue.cpp" -#include "LangValue.cpp" -#include "NValue.cpp" -#include "OrgValue.cpp" -#include "Param.cpp" -#include "PhoneNumberValue.cpp" -#include "RToken.cpp" -#include "SoundValue.cpp" -#include "SourceParam.cpp" -#include "TelParam.cpp" -#include "TelValue.cpp" -#include "TextBinParam.cpp" -#include "TextBinValue.cpp" -#include "TextListValue.cpp" -#include "TextParam.cpp" -#include "TextValue.cpp" -#include "URIValue.cpp" -#include "UTCValue.cpp" -#include "VCard.cpp" -#include "VCardEntity.cpp" -#include "Value.cpp" - diff --git a/kabc/vcard21parser.cpp b/kabc/vcard21parser.cpp deleted file mode 100644 index 8a3bfcaea..000000000 --- a/kabc/vcard21parser.cpp +++ /dev/null @@ -1,608 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Mark Westcott <mark@houseoffish.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 <tqmap.h> -#include <tqregexp.h> -#include <kmdcodec.h> - -#include "vcard21parser.h" -#include "vcardconverter.h" - -using namespace KABC; - -bool VCardLineX::isValid() const -{ - // Invalid: if it is "begin:vcard" or "end:vcard" - if ( name == VCARD_BEGIN_N || name == VCARD_END_N ) - return false; - - if ( name[0] == 'x' && name[1] == '-' ) // A custom x- line - return true; - - // This is long but it makes it a bit faster (and saves me from using - // a tree which is probably the ideal situation, but a bit memory heavy) - switch( name[0] ) { - case 'a': - if ( name == VCARD_ADR && qualified && - (qualifiers.contains(VCARD_ADR_DOM) || - qualifiers.contains(VCARD_ADR_INTL) || - qualifiers.contains(VCARD_ADR_POSTAL) || - qualifiers.contains(VCARD_ADR_HOME) || - qualifiers.contains(VCARD_ADR_WORK) || - qualifiers.contains(VCARD_ADR_PREF) - ) ) - return true; - - if ( name == VCARD_AGENT ) - return true; - break; - - case 'b': - if ( name == VCARD_BDAY ) - return true; - break; - - case 'c': - if ( name == VCARD_CATEGORIES ) - return true; - if ( name == VCARD_CLASS && qualified && - (qualifiers.contains(VCARD_CLASS_PUBLIC) || - qualifiers.contains(VCARD_CLASS_PRIVATE) || - qualifiers.contains(VCARD_CLASS_CONFIDENTIAL) - ) ) - return true; - break; - - case 'e': - if ( name == VCARD_EMAIL && qualified && - (qualifiers.contains(VCARD_EMAIL_INTERNET) || - qualifiers.contains(VCARD_EMAIL_PREF) || - qualifiers.contains(VCARD_EMAIL_X400) - ) ) - return true; - break; - - case 'f': - if ( name == VCARD_FN ) - return true; - break; - - case 'g': - if ( name == VCARD_GEO ) - return true; - break; - - case 'k': - if ( name == VCARD_KEY && qualified && - (qualifiers.contains(VCARD_KEY_X509) || - qualifiers.contains(VCARD_KEY_PGP) - ) ) - return true; - break; - - case 'l': - if ( name == VCARD_LABEL ) - return true; - if ( name == VCARD_LOGO ) - return true; - break; - - case 'm': - if ( name == VCARD_MAILER ) - return true; - break; - - case 'n': - if ( name == VCARD_N ) - return true; - if ( name == VCARD_NAME ) - return true; - if ( name == VCARD_NICKNAME ) - return true; - if ( name == VCARD_NOTE ) - return true; - break; - - case 'o': - if ( name == VCARD_ORG ) - return true; - break; - - case 'p': - if ( name == VCARD_PHOTO ) - return true; - if ( name == VCARD_PROFILE ) - return true; - if ( name == VCARD_PRODID ) - return true; - break; - - case 'r': - if ( name == VCARD_ROLE ) - return true; - if ( name == VCARD_REV ) - return true; - break; - - case 's': - if ( name == VCARD_SOURCE ) - return true; - if ( name == VCARD_SOUND ) - return true; - break; - - case 't': - if ( name == VCARD_TEL && qualified && - (qualifiers.contains(VCARD_TEL_HOME) || - qualifiers.contains(VCARD_TEL_WORK) || - qualifiers.contains(VCARD_TEL_PREF) || - qualifiers.contains(VCARD_TEL_VOICE) || - qualifiers.contains(VCARD_TEL_FAX) || - qualifiers.contains(VCARD_TEL_MSG) || - qualifiers.contains(VCARD_TEL_CELL) || - qualifiers.contains(VCARD_TEL_PAGER) || - qualifiers.contains(VCARD_TEL_BBS) || - qualifiers.contains(VCARD_TEL_MODEM) || - qualifiers.contains(VCARD_TEL_CAR) || - qualifiers.contains(VCARD_TEL_ISDN) || - qualifiers.contains(VCARD_TEL_VIDEO) || - qualifiers.contains(VCARD_TEL_PCS) - ) ) - return true; - if ( name == VCARD_TZ ) - return true; - if ( name == VCARD_TITLE ) - return true; - break; - - case 'u': - if ( name == VCARD_URL ) - return true; - if ( name == VCARD_UID ) - return true; - break; - - case 'v': - if ( name == VCARD_VERSION ) - return true; - break; - default: - break; - } - - return false; -} - - -VCard21Parser::VCard21Parser() -{ -} - -VCard21Parser::~VCard21Parser() -{ -} - -void VCard21Parser::readFromString(KABC::AddressBook *addressbook, const TQString &data) -{ - KABC::Addressee mAddressee = readFromString(data); - addressbook->insertAddressee(mAddressee); -} - -KABC::Addressee VCard21Parser::readFromString( const TQString &data) -{ - KABC::Addressee addressee; - VCard21ParserImpl *vCard = VCard21ParserImpl::parseVCard(data); - TQString tmpStr; - - // Check if parsing failed - if (vCard == 0) - { - kdDebug() << "Parsing failed" << endl; - return addressee; - } - //set the addressees name and formated name - TQStringList tmpList = vCard->getValues(VCARD_N); - TQString formattedName = ""; - if (tmpList.count() > 0) - addressee.setFamilyName(tmpList[0]); - if (tmpList.count() > 1) - addressee.setGivenName(tmpList[1]); - if (tmpList.count() > 2) - addressee.setAdditionalName(tmpList[2]); - if (tmpList.count() > 3) - addressee.setPrefix(tmpList[3]); - if (tmpList.count() > 4) - addressee.setSuffix(tmpList[4]); - - tmpStr = (vCard->getValue(VCARD_FN)); - if (!tmpStr.isEmpty()) - addressee.setFormattedName(tmpStr); - - //set the addressee's nick name - tmpStr = vCard->getValue(VCARD_NICKNAME); - addressee.setNickName(tmpStr); - //set the addressee's organization - tmpStr = vCard->getValue(VCARD_ORG); - addressee.setOrganization(tmpStr); - //set the addressee's title - tmpStr = vCard->getValue(VCARD_TITLE); - addressee.setTitle(tmpStr); - //set the addressee's email - we can only deal with two. The preferenced one and one other. - tmpStr = vCard->getValue(VCARD_EMAIL, VCARD_EMAIL_INTERNET); - addressee.insertEmail(tmpStr, false); - tmpStr = vCard->getValue(VCARD_EMAIL,VCARD_EMAIL_PREF); - addressee.insertEmail(tmpStr, true); - //set the addressee's url - tmpStr = vCard->getValue(VCARD_URL); - if (tmpStr.isEmpty()) tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_WORK); - if (tmpStr.isEmpty()) tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_HOME); - if (!tmpStr.isEmpty()) { - addressee.setUrl(KURL(tmpStr)); - } - - //set the addressee's birthday - tmpStr = vCard->getValue(VCARD_BDAY); - addressee.setBirthday(VCardStringToDate(tmpStr)); - - //set the addressee's phone numbers - for ( TQValueListIterator<VCardLineX> i = vCard->_vcdata->begin();i != vCard->_vcdata->end(); ++i ) { - if ( (*i).name == VCARD_TEL ) { - int type = 0; - if ( (*i).qualified ) { - if ( (*i).qualifiers.contains( VCARD_TEL_HOME ) ) - type |= PhoneNumber::Home; - if ( (*i).qualifiers.contains( VCARD_TEL_WORK ) ) - type |= PhoneNumber::Work; - if ( (*i).qualifiers.contains( VCARD_TEL_PREF ) ) - type |= PhoneNumber::Pref; - // if ( (*i).qualifiers.contains( VCARD_TEL_VOICE ) ) - // type |= PhoneNumber::Voice; - if ( (*i).qualifiers.contains( VCARD_TEL_FAX ) ) - type |= PhoneNumber::Fax; - if ( (*i).qualifiers.contains( VCARD_TEL_MSG ) ) - type |= PhoneNumber::Msg; - if ( (*i).qualifiers.contains( VCARD_TEL_CELL ) ) - type |= PhoneNumber::Cell; - if ( (*i).qualifiers.contains( VCARD_TEL_PAGER ) ) - type |= PhoneNumber::Pager; - if ( (*i).qualifiers.contains( VCARD_TEL_BBS ) ) - type |= PhoneNumber::Bbs; - if ( (*i).qualifiers.contains( VCARD_TEL_MODEM ) ) - type |= PhoneNumber::Modem; - if ( (*i).qualifiers.contains( VCARD_TEL_CAR ) ) - type |= PhoneNumber::Car; - if ( (*i).qualifiers.contains( VCARD_TEL_ISDN ) ) - type |= PhoneNumber::Isdn; - if ( (*i).qualifiers.contains( VCARD_TEL_VIDEO ) ) - type |= PhoneNumber::Video; - if ( (*i).qualifiers.contains( VCARD_TEL_PCS ) ) - type |= PhoneNumber::Pcs; - } - addressee.insertPhoneNumber( PhoneNumber( (*i).parameters[ 0 ], type ) ); - } - } - - //set the addressee's addresses - for ( TQValueListIterator<VCardLineX> i = vCard->_vcdata->begin();i != vCard->_vcdata->end(); ++i ) { - if ( (*i).name == VCARD_ADR ) { - int type = 0; - if ( (*i).qualified ) { - if ( (*i).qualifiers.contains( VCARD_ADR_DOM ) ) - type |= Address::Dom; - if ( (*i).qualifiers.contains( VCARD_ADR_INTL ) ) - type |= Address::Intl; - if ( (*i).qualifiers.contains( VCARD_ADR_POSTAL ) ) - type |= Address::Postal; - if ( (*i).qualifiers.contains( VCARD_ADR_PARCEL ) ) - type |= Address::Parcel; - if ( (*i).qualifiers.contains( VCARD_ADR_HOME ) ) - type |= Address::Home; - if ( (*i).qualifiers.contains( VCARD_ADR_WORK ) ) - type |= Address::Work; - if ( (*i).qualifiers.contains( VCARD_ADR_PREF ) ) - type |= Address::Pref; - } - addressee.insertAddress( readAddressFromQStringList( (*i).parameters, type ) ); - } - } - - //set the addressee's delivery label - tmpStr = vCard->getValue(VCARD_LABEL); - if (!tmpStr.isEmpty()) { - tmpStr.replace("\r\n","\n"); - Address tmpAddress; - tmpAddress.setLabel(tmpStr); - addressee.insertAddress(tmpAddress); - } - - //set the addressee's notes - tmpStr = vCard->getValue(VCARD_NOTE); - tmpStr.replace("\r\n","\n"); - addressee.setNote(tmpStr); - - //set the addressee's timezone - tmpStr = vCard->getValue(VCARD_TZ); - TimeZone tmpZone(tmpStr.toInt()); - addressee.setTimeZone(tmpZone); - - //set the addressee's geographical position - tmpList = vCard->getValues(VCARD_GEO); - if (tmpList.count()==2) - { - tmpStr = tmpList[0]; - float glat = tmpStr.toFloat(); - tmpStr = tmpList[1]; - float glong = tmpStr.toFloat(); - Geo tmpGeo(glat,glong); - addressee.setGeo(tmpGeo); - } - - //set the last revision date - tmpStr = vCard->getValue(VCARD_REV); - addressee.setRevision(VCardStringToDate(tmpStr)); - - //set the role of the addressee - tmpStr = vCard->getValue(VCARD_ROLE); - addressee.setRole(tmpStr); - - delete vCard; - - return addressee; -} - - - -KABC::Address VCard21Parser::readAddressFromQStringList ( const TQStringList &data, const int type ) -{ - KABC::Address mAddress; - mAddress.setType( type ); - - if ( data.count() > 0 ) - mAddress.setPostOfficeBox( data[0] ); - if ( data.count() > 1 ) - mAddress.setExtended( data[1] ); - if ( data.count() > 2 ) - mAddress.setStreet( data[2] ); - if ( data.count() > 3 ) - mAddress.setLocality( data[3] ); - if ( data.count() > 4 ) - mAddress.setRegion( data[4] ); - if ( data.count() > 5 ) - mAddress.setPostalCode( data[5] ); - if ( data.count() > 6 ) - mAddress.setCountry( data[6] ); - - return mAddress; -} - - -VCard21ParserImpl *VCard21ParserImpl::parseVCard( const TQString& vc, int *err ) -{ - int _err = 0; - int _state = VC_STATE_BEGIN; - - TQValueList<VCardLineX> *vcdata; - TQValueList<TQString> lines; - - vcdata = new TQValueList<VCardLineX>; - - lines = TQStringList::split( TQRegExp( "[\x0d\x0a]" ), vc ); - - // for each line in the vCard - for ( TQStringList::Iterator j = lines.begin(); j != lines.end(); ++j ) { - VCardLineX _vcl; - - // take spaces off the end - ugly but necessary hack - for ( int g = (*j).length()-1; g > 0 && (*j)[g].isSpace(); --g ) - (*j)[g] = 0; - - // first token: - // verify state, update if necessary - if ( _state & VC_STATE_BEGIN) { - if ( !tqstricmp( (*j).latin1(), VCARD_BEGIN ) ) { - _state = VC_STATE_BODY; - continue; - } else { - _err = VC_ERR_NO_BEGIN; - break; - } - } else if ( _state & VC_STATE_BODY ) { - if ( !tqstricmp( (*j).latin1(), VCARD_END ) ) { - _state |= VC_STATE_END; - break; - } - - // split into two tokens - int colon = (*j).find( ':' ); - if ( colon < 0 ) { - _err = VC_ERR_INVALID_LINE; - break; - } - - TQString key = (*j).left( colon ); - TQString value = (*j).mid( colon + 1 ); - - // check for qualifiers and - // set name, qualified, qualifier(s) - TQStringList keyTokens = TQStringList::split( ';', key ); - bool qp = false, first_pass = true; - bool b64 = false; - - if ( keyTokens.count() > 0 ) { - _vcl.qualified = false; - _vcl.name = keyTokens[ 0 ].lower(); - - for ( TQStringList::Iterator z = keyTokens.begin(); z != keyTokens.end(); ++z ) { - TQString zz = (*z).lower(); - if ( zz == VCARD_QUOTED_PRINTABLE || zz == VCARD_ENCODING_QUOTED_PRINTABLE ) { - qp = true; - } else if ( zz == VCARD_BASE64 ) { - b64 = true; - } else if ( !first_pass ) { - _vcl.qualified = true; - _vcl.qualifiers.append( zz ); - } - first_pass = false; - } - } else { - _err = VC_ERR_INVALID_LINE; - } - - if ( _err != 0 ) - break; - - if ( _vcl.name == VCARD_VERSION ) - _state |= VC_STATE_HAVE_VERSION; - - if ( _vcl.name == VCARD_N || _vcl.name == VCARD_FN ) - _state |= VC_STATE_HAVE_N; - - // second token: - // split into tokens by ; - // add to parameters vector - if ( b64 ) { - if ( value[ value.length() - 1 ] != '=' ) - do { - value += *( ++j ); - } while ( (*j)[ (*j).length() - 1 ] != '=' ); - } else { - if ( qp ) { // join any split lines - while ( value[ value.length() - 1 ] == '=' ) { - value.remove( value.length() - 1, 1 ); - value.append(*( ++j )); - } - } - _vcl.parameters = TQStringList::split( ';', value, true ); - if ( qp ) { // decode the quoted printable - for ( TQStringList::Iterator z = _vcl.parameters.begin(); z != _vcl.parameters.end(); ++z ) - *z = KCodecs::quotedPrintableDecode( TQCString((*z).latin1()) ); - } - } - } else { - _err = VC_ERR_INTERNAL; - break; - } - - // validate VCardLineX - if ( !_vcl.isValid() ) { - _err = VC_ERR_INVALID_LINE; - break; - } - - // add to vector - vcdata->append( _vcl ); - } - - // errors to check at the last minute (exit state related) - if ( _err == 0 ) { - if ( !( _state & VC_STATE_END ) ) // we have to have an end!! - _err = VC_ERR_NO_END; - - if ( !( _state & VC_STATE_HAVE_N ) || // we have to have the mandatories! - !( _state & VC_STATE_HAVE_VERSION ) ) - _err = VC_ERR_MISSING_MANDATORY; - } - - // set the error message if we can, and only return an object - // if the vCard was valid. - if ( err ) - *err = _err; - - if ( _err != 0 ) { - delete vcdata; - return 0; - } - - return new VCard21ParserImpl( vcdata ); -} - -VCard21ParserImpl::VCard21ParserImpl() - : _vcdata( 0 ) -{ -} - -VCard21ParserImpl::VCard21ParserImpl(TQValueList<VCardLineX> *_vcd) - : _vcdata(_vcd) -{ -} - -VCard21ParserImpl::~VCard21ParserImpl() -{ - delete _vcdata; - _vcdata = 0; -} - -TQString VCard21ParserImpl::getValue(const TQString& name, const TQString& qualifier) -{ - TQString failed; - const TQString lowname = name.lower(); - const TQString lowqualifier = qualifier.lower(); - - for (TQValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { - if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) { - if ((*i).parameters.count() > 0) - return (*i).parameters[0]; - else return failed; - } - } - return failed; -} - - -TQString VCard21ParserImpl::getValue(const TQString& name) -{ - TQString failed; - const TQString lowname = name.lower(); - - for (TQValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { - if ((*i).name == lowname && !(*i).qualified) { - if ((*i).parameters.count() > 0) - return (*i).parameters[0]; - else return failed; - } - } - return failed; -} - - -TQStringList VCard21ParserImpl::getValues(const TQString& name) -{ - const TQString lowname = name.lower(); - for (TQValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { - if ((*i).name == lowname && !(*i).qualified) - return (*i).parameters; - } - // failed. - return TQStringList(); -} - -TQStringList VCard21ParserImpl::getValues(const TQString& name, const TQString& qualifier) -{ - const TQString lowname = name.lower(); - const TQString lowqualifier = qualifier.lower(); - for (TQValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { - if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) - return (*i).parameters; - } - // failed. - return TQStringList(); -} - - diff --git a/kabc/vcard21parser.h b/kabc/vcard21parser.h deleted file mode 100644 index 0eb66fa93..000000000 --- a/kabc/vcard21parser.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2002 Mark Westcott <mark@houseoffish.org> - Copyright (c) 2000 George Staikos <staikos@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 KABC_VCARD21FORMAT_H -#define KABC_VCARD21FORMAT_H - -#include <tqdatetime.h> -#include <kdebug.h> -#include <tqregexp.h> -#include <tqstring.h> -#include <kurl.h> -#include <tqvaluelist.h> - -#include "addressee.h" -#include "addressbook.h" -#include "phonenumber.h" - - -#define VCARD_BEGIN "begin:vcard" -#define VCARD_END "end:vcard" -#define VCARD_BEGIN_N "begin" -#define VCARD_END_N "end" -#define VCARD_VERSION "version" - -#define VCARD_FN "fn" -#define VCARD_N "n" - -// optional -#define VCARD_NAME "name" -#define VCARD_NICKNAME "nickname" -#define VCARD_PHOTO "photo" -#define VCARD_BDAY "bday" -#define VCARD_ADR "adr" - -// types -#define VCARD_ADR_DOM "dom" -#define VCARD_ADR_INTL "intl" -#define VCARD_ADR_POSTAL "postal" -#define VCARD_ADR_PARCEL "parcel" -#define VCARD_ADR_HOME "home" -#define VCARD_ADR_WORK "work" -#define VCARD_ADR_PREF "pref" -// values -#define VCARD_ADR_POBOX "PO Box" -#define VCARD_ADR_EXTADR "Extended Address" -#define VCARD_ADR_STREET "Street" -#define VCARD_ADR_LOCALITY "Locality" -#define VCARD_ADR_REGION "Region" -#define VCARD_ADR_POSTCODE "Postal Code" -#define VCARD_ADR_COUNTRY "Country Name" -#define VCARD_LABEL "label" -#define VCARD_PROFILE "profile" -#define VCARD_SOURCE "source" -#define VCARD_TEL "tel" -// types -#define VCARD_TEL_HOME "home" -#define VCARD_TEL_WORK "work" -#define VCARD_TEL_PREF "pref" -#define VCARD_TEL_VOICE "voice" -#define VCARD_TEL_FAX "fax" -#define VCARD_TEL_MSG "msg" -#define VCARD_TEL_CELL "cell" -#define VCARD_TEL_PAGER "pager" -#define VCARD_TEL_BBS "bbs" -#define VCARD_TEL_MODEM "modem" -#define VCARD_TEL_CAR "car" -#define VCARD_TEL_ISDN "isdn" -#define VCARD_TEL_VIDEO "video" -#define VCARD_TEL_PCS "pcs" -#define VCARD_EMAIL "email" -// types -#define VCARD_EMAIL_PREF "pref" -#define VCARD_EMAIL_INTERNET "internet" -#define VCARD_EMAIL_X400 "x400" -#define VCARD_TZ "tz" -#define VCARD_GEO "geo" -#define VCARD_MAILER "mailer" -#define VCARD_TITLE "title" -#define VCARD_ROLE "role" -#define VCARD_LOGO "logo" -#define VCARD_AGENT "agent" -#define VCARD_ORG "org" -#define VCARD_CATEGORIES "categories" -#define VCARD_NOTE "note" -#define VCARD_PRODID "prodid" -#define VCARD_REV "rev" -#define VCARD_SOUND "sound" -#define VCARD_UID "uid" -#define VCARD_URL "url" -#define VCARD_CLASS "class" -#define VCARD_CLASS_PUBLIC "public" -#define VCARD_CLASS_PRIVATE "private" -#define VCARD_CLASS_CONFIDENTIAL "confidential" -#define VCARD_KEY "key" -// types -#define VCARD_KEY_X509 "x509" -#define VCARD_KEY_PGP "pgp" - -#define VCARD_QUOTED_PRINTABLE "quoted-printable" -// this one is a temporary hack until we support TYPE=VALUE -#define VCARD_ENCODING_QUOTED_PRINTABLE "encoding=quoted-printable" -#define VCARD_BASE64 "base64" - -#define VC_STATE_BEGIN 1 -#define VC_STATE_BODY 2 -#define VC_STATE_END 4 -#define VC_STATE_HAVE_N 8 -#define VC_STATE_HAVE_VERSION 16 - -#define VC_ERR_NO_BEGIN 1 -#define VC_ERR_NO_END 2 -#define VC_ERR_INVALID_LINE 3 -#define VC_ERR_INTERNAL 4 -#define VC_ERR_INVALID_NAME 5 -#define VC_ERR_MISSING_MANDATORY 6 - -namespace KABC { - -class AddressBook; - -/** - @deprecated use VCardConverter instead. - */ -class KABC_EXPORT_DEPRECATED VCard21Parser -{ -public: - - /** - * Constructor. - */ - VCard21Parser(); - - /** - * Destructor. - */ - virtual ~VCard21Parser(); - - /** - * Parses a string in vcard2.1 format and saves the single addressees - * to the address book. - * - * @param ab The address book. - * @param str The vcard string. - */ - void readFromString( KABC::AddressBook *ab, const TQString &str ); - - /** - * FIXME: we need a writeToString method - * TQString writeToString (KABC::AddressBook *); - */ - - /** - * Parses a string in vcard2.1 format and returns the inherent addressee. - */ - KABC::Addressee readFromString( const TQString &data); - - /** - * Helper method to store a address. - * - * @param data A string list, that is filled with 'street', 'house number' ... - * @param type The type of the returned address. - */ - static KABC::Address readAddressFromQStringList (const TQStringList &data, const int type); -}; - -} - -/** - * @short Helper class - */ -class KABC_EXPORT VCardLineX -{ -public: - TQString name; - bool qualified; - TQValueList<TQString> qualifiers; - TQValueList<TQString> parameters; - bool isValid() const; -}; - -/** - * @short Helper class - */ -class KABC_EXPORT VCard21ParserImpl -{ - friend class VCardLineX; - -public: - VCard21ParserImpl(); - virtual ~VCard21ParserImpl(); - static VCard21ParserImpl *parseVCard(const TQString& vc, int *err = NULL); - TQString getValue(const TQString& name, const TQString& qualifier); - TQString getValue(const TQString& name); - TQStringList getValues(const TQString& name, const TQString& qualifier); - TQStringList getValues(const TQString& name); - - TQValueList<VCardLineX> *_vcdata; - -private: - VCard21ParserImpl (TQValueList<VCardLineX> *_vcd); -}; - -#endif diff --git a/kabc/vcardconverter.cpp b/kabc/vcardconverter.cpp deleted file mode 100644 index d575b019c..000000000 --- a/kabc/vcardconverter.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 "vcard21parser.h" -#include "vcardformatimpl.h" -#include "vcardtool.h" - -#include "vcardconverter.h" - -using namespace KABC; - -struct VCardConverter::VCardConverterData -{ - VCard21Parser vcard21parser; - VCardFormatImpl vcard30parser; -}; - -VCardConverter::VCardConverter() - : d( new VCardConverterData ) -{ -} - -VCardConverter::~VCardConverter() -{ - delete d; - d = 0; -} - -TQString VCardConverter::createVCard( const Addressee &addr, Version version ) -{ - Addressee::List list; - list.append( addr ); - - return createVCards( list, version ); -} - -TQString VCardConverter::createVCards( Addressee::List list, Version version ) -{ - VCardTool tool; - - return tool.createVCards( list, ( version == v3_0 ? VCard::v3_0 : VCard::v2_1 ) ); -} - -Addressee VCardConverter::parseVCard( const TQString& vcard ) -{ - Addressee::List list = parseVCards( vcard ); - - return list[ 0 ]; -} - -Addressee::List VCardConverter::parseVCards( const TQString& vcard ) -{ - VCardTool tool; - - return tool.parseVCards( vcard ); -} - -// ---------------------------- deprecated stuff ---------------------------- // - -bool VCardConverter::vCardToAddressee( const TQString &str, Addressee &addr, Version version ) -{ - if ( version == v2_1 ) { - addr = d->vcard21parser.readFromString( str ); - return true; - } - - if ( version == v3_0 ) - return d->vcard30parser.readFromString( str, addr ); - - return false; -} - -bool VCardConverter::addresseeToVCard( const Addressee &addr, TQString &str, Version version ) -{ - if ( version == v2_1 ) - return false; - - if ( version == v3_0 ) - return d->vcard30parser.writeToString( addr, str ); - - return false; -} - - -/* Helper functions */ - -TQString KABC::dateToVCardString( const TQDateTime &dateTime ) -{ - return dateTime.toString("yyyyMMddThhmmssZ"); -} - -TQString KABC::dateToVCardString( const TQDate &date ) -{ - return date.toString("yyyyMMdd"); -} - -TQDateTime KABC::VCardStringToDate( const TQString &dateString ) -{ - TQDate date; - TQTime time; - TQString d( dateString ); - - d = d.remove('-').remove(':'); - - if (d.length()>=8) - date = TQDate( d.mid(0,4).toUInt(), d.mid(4,2).toUInt(), d.mid(6,2).toUInt() ); - if (d.length()>9 && d[8].upper()=='T') - time = TQTime( d.mid(9,2).toUInt(), d.mid(11,2).toUInt(), d.mid(13,2).toUInt() ); - - return TQDateTime( date, time ); -} - diff --git a/kabc/vcardconverter.h b/kabc/vcardconverter.h deleted file mode 100644 index ab09279f2..000000000 --- a/kabc/vcardconverter.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_VCARDCONVERTER_H -#define KABC_VCARDCONVERTER_H - -#include <tqstring.h> - -#include "addressee.h" - -namespace KABC { - -/** - @short Class to converting contact objects into vCard format and vice versa. - - This class implements reading and writing of contact using from/to the - vCard format. Currently vCard version 2.1 and 3.0 is supported. - - Example: - - \code - - TQFile file( "myfile.vcf" ); - file.open( IO_ReadOnly ); - - TQString data = file.readAll(); - - VCardConverter converter; - Addressee::List list = converter.parseVCards( data ); - - // print formatted name of first contact - tqDebug( "name=%s", list[ 0 ].formattedName().latin1() ); - - \endcode -*/ -class KABC_EXPORT VCardConverter -{ - public: - - /** - @li v2_1 - VCard format version 2.1 - @li v3_0 - VCard format version 3.0 - */ - enum Version - { - v2_1, - v3_0 - }; - - /** - Constructor. - */ - VCardConverter(); - - /** - Destructor. - */ - ~VCardConverter(); - - /** - Creates a string in vCard format which contains the given - contact. - - @param addr The contact object - @param version The version of the generated vCard format - */ - TQString createVCard( const Addressee &addr, Version version = v3_0 ); - - /** - Creates a string in vCard format which contains the given - list of contact. - - @param list The list of contact objects - @param version The version of the generated vCard format - */ - // FIXME: Add error handling - TQString createVCards( Addressee::List list, Version version = v3_0 ); - - // FIXME: Add "createVCards( AddressBook * )" - - /** - Parses a string in vCard format and returns the first contact. - */ - Addressee parseVCard( const TQString& vcard ); - - /** - Parses a string in vCard format and returns a list of contact objects. - */ - // FIXME: Add error handling - Addressee::List parseVCards( const TQString& vcard ); - - // FIXME: Add "bool parseVCards( AddressBook *, const TQString &vcard )" - - /** - @deprecated - */ - bool vCardToAddressee( const TQString&, Addressee &, Version version = v3_0 ) KDE_DEPRECATED; - - /** - @deprecated - */ - bool addresseeToVCard( const Addressee&, TQString&, Version version = v3_0 ) KDE_DEPRECATED; - - private: - /** - Split a string and replaces escaped separators on the fly with - unescaped ones. - */ - TQStringList splitString( const TQChar &sep, const TQString &value ); - - struct VCardConverterData; - VCardConverterData *d; -}; - - -/** - Helper functions - */ - -/** - * Converts a TQDateTime to a date string as it is used in VCard and LDIF files. - * The return value is in the form "yyyyMMddThhmmssZ" (e.g. "20031201T120000Z") - * @param dateTime date and time to be converted - * @since 3.2 - */ -KABC_EXPORT TQString dateToVCardString( const TQDateTime &dateTime ); - -/** - * Converts a TQDate to a short date string as it is used in VCard and LDIF files. - * The return value is in the form "yyyyMMdd" (e.g. "20031201") - * @param date date to be converted - * @since 3.2 - */ -KABC_EXPORT TQString dateToVCardString( const TQDate &date ); - -/** - * Converts a date string as it is used in VCard and LDIF files to a TQDateTime value. - * If the date string does not contain a time value, it will be returned as 00:00:00. - * (e.g. "20031201T120000" will return a TQDateTime for 2003-12-01 at 12:00) - * @param dateString string representing the date and time. - * @since 3.2 - */ -KABC_EXPORT TQDateTime VCardStringToDate( const TQString &dateString ); - -} -#endif diff --git a/kabc/vcardformat.cpp b/kabc/vcardformat.cpp deleted file mode 100644 index 147aa4259..000000000 --- a/kabc/vcardformat.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 "vcardformatimpl.h" - -#include "vcardformat.h" - -using namespace KABC; - -VCardFormat::VCardFormat() -{ - mImpl = new VCardFormatImpl; -} - -VCardFormat::~VCardFormat() -{ - delete mImpl; -} - -bool VCardFormat::load( AddressBook *addressBook, const TQString &fileName ) -{ - TQFile f( fileName ); - if ( !f.open( IO_ReadOnly ) ) return false; - - bool result = mImpl->loadAll( addressBook, 0, &f ); - - f.close(); - - return result; -} - -bool VCardFormat::save( AddressBook *addressBook, const TQString &fileName ) -{ - TQFile f( fileName ); - if ( !f.open( IO_WriteOnly ) ) return false; - - mImpl->saveAll( addressBook, 0, &f ); - - f.close(); - - return true; -} diff --git a/kabc/vcardformat.h b/kabc/vcardformat.h deleted file mode 100644 index 8194056cb..000000000 --- a/kabc/vcardformat.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_VCARDFORMAT_H -#define KABC_VCARDFORMAT_H - -#include <tqstring.h> - -#include "format.h" - -namespace KABC { - -class AddressBook; -class VCardFormatImpl; - -/** - @deprecated use VCardFormatPlugin instead. - */ -class KABC_EXPORT_DEPRECATED VCardFormat : public Format { - public: - VCardFormat(); - virtual ~VCardFormat(); - - bool load( AddressBook *, const TQString &fileName ); - bool save( AddressBook *, const TQString &fileName ); - - private: - VCardFormatImpl *mImpl; -}; - -} - -#endif diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp deleted file mode 100644 index ebaf337b0..000000000 --- a/kabc/vcardformatimpl.cpp +++ /dev/null @@ -1,1001 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> -#include <tqregexp.h> - -#include <kdebug.h> -#include <kmdcodec.h> -#include <kstandarddirs.h> -#include <ktempfile.h> - -#include <VCard.h> - -#include "addressbook.h" -#include "vcardformatimpl.h" - -using namespace KABC; -using namespace VCARD; - -bool VCardFormatImpl::load( Addressee &addressee, TQFile *file ) -{ - kdDebug(5700) << "VCardFormat::load()" << endl; - - TQByteArray fdata = file->readAll(); - TQCString data(fdata.data(), fdata.size()+1); - - VCardEntity e( data ); - - VCardListIterator it( e.cardList() ); - - if ( it.current() ) { - VCARD::VCard v(*it.current()); - loadAddressee( addressee, v ); - return true; - } - - return false; -} - -bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, TQFile *file ) -{ - kdDebug(5700) << "VCardFormat::loadAll()" << endl; - - TQByteArray fdata = file->readAll(); - TQCString data(fdata.data(), fdata.size()+1); - - VCardEntity e( data ); - - VCardListIterator it( e.cardList() ); - - for (; it.current(); ++it) { - VCARD::VCard v(*it.current()); - Addressee addressee; - loadAddressee( addressee, v ); - addressee.setResource( resource ); - addressBook->insertAddressee( addressee ); - } - - return true; -} - -void VCardFormatImpl::save( const Addressee &addressee, TQFile *file ) -{ - VCardEntity vcards; - VCardList vcardlist; - vcardlist.setAutoDelete( true ); - - VCARD::VCard *v = new VCARD::VCard; - - saveAddressee( addressee, v, false ); - - vcardlist.append( v ); - vcards.setCardList( vcardlist ); - - TQCString vcardData = vcards.asString(); - file->writeBlock( (const char*)vcardData, vcardData.length() ); -} - -void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, TQFile *file ) -{ - VCardEntity vcards; - VCardList vcardlist; - vcardlist.setAutoDelete( true ); - - AddressBook::Iterator it; - for ( it = ab->begin(); it != ab->end(); ++it ) { - if ( (*it).resource() == resource ) { - VCARD::VCard *v = new VCARD::VCard; - saveAddressee( (*it), v, false ); - (*it).setChanged( false ); - vcardlist.append( v ); - } - } - - vcards.setCardList( vcardlist ); - - TQCString vcardData = vcards.asString(); - file->writeBlock( (const char*)vcardData, vcardData.length() ); -} - -bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCARD::VCard &v ) -{ - TQPtrList<ContentLine> contentLines = v.contentLineList(); - ContentLine *cl; - - for( cl = contentLines.first(); cl; cl = contentLines.next() ) { - TQCString n = cl->name(); - if ( n.left( 2 ) == "X-" ) { - n = n.mid( 2 ); - int posDash = n.find( "-" ); - addressee.insertCustom( TQString::fromUtf8( n.left( posDash ) ), - TQString::fromUtf8( n.mid( posDash + 1 ) ), - TQString::fromUtf8( cl->value()->asString() ) ); - continue; - } - - EntityType type = cl->entityType(); - switch( type ) { - - case EntityUID: - addressee.setUid( readTextValue( cl ) ); - break; - - case EntityURI: - addressee.setUri( readTextValue( cl ) ); - break; - - case EntityEmail: - addressee.insertEmail( readTextValue( cl ) ); - break; - - case EntityName: - addressee.setName( readTextValue( cl ) ); - break; - - case EntityFullName: - addressee.setFormattedName( readTextValue( cl ) ); - break; - - case EntityURL: - addressee.setUrl( KURL( readTextValue( cl ) ) ); - break; - - case EntityNickname: - addressee.setNickName( readTextValue( cl ) ); - break; - - case EntityLabel: - // not yet supported by kabc - break; - - case EntityMailer: - addressee.setMailer( readTextValue( cl ) ); - break; - - case EntityTitle: - addressee.setTitle( readTextValue( cl ) ); - break; - - case EntityRole: - addressee.setRole( readTextValue( cl ) ); - break; - - case EntityOrganisation: - addressee.setOrganization( readTextValue( cl ) ); - break; - - case EntityNote: - addressee.setNote( readTextValue( cl ) ); - break; - - case EntityProductID: - addressee.setProductId( readTextValue( cl ) ); - break; - - case EntitySortString: - addressee.setSortString( readTextValue( cl ) ); - break; - - case EntityN: - readNValue( cl, addressee ); - break; - - case EntityAddress: - addressee.insertAddress( readAddressValue( cl ) ); - break; - - case EntityTelephone: - addressee.insertPhoneNumber( readTelephoneValue( cl ) ); - break; - - case EntityCategories: - addressee.setCategories( TQStringList::split( ",", readTextValue( cl ) ) ); - break; - - case EntityBirthday: - addressee.setBirthday( readDateValue( cl ) ); - break; - - case EntityRevision: - addressee.setRevision( readDateTimeValue( cl ) ); - break; - - case EntityGeo: - addressee.setGeo( readGeoValue( cl ) ); - break; - - case EntityTimeZone: - addressee.setTimeZone( readUTCValue( cl ) ); - break; - - case EntityVersion: - break; - - case EntityClass: - addressee.setSecrecy( readClassValue( cl ) ); - break; - - case EntityKey: - addressee.insertKey( readKeyValue( cl ) ); - break; - - case EntityPhoto: - addressee.setPhoto( readPictureValue( cl, EntityPhoto, addressee ) ); - break; - - case EntityLogo: - addressee.setLogo( readPictureValue( cl, EntityLogo, addressee ) ); - break; - - case EntityAgent: - addressee.setAgent( readAgentValue( cl ) ); - break; - - case EntitySound: - addressee.setSound( readSoundValue( cl, addressee ) ); - break; - - default: - kdDebug(5700) << "VCardFormat::load(): Unsupported entity: " - << int( type ) << ": " << cl->asString() << endl; - break; - } - } - - for( cl = contentLines.first(); cl; cl = contentLines.next() ) { - EntityType type = cl->entityType(); - if ( type == EntityLabel ) { - int type = readAddressParam( cl ); - Address address = addressee.address( type ); - if ( address.isEmpty() ) - address.setType( type ); - - address.setLabel( TQString::fromUtf8( cl->value()->asString() ) ); - addressee.insertAddress( address ); - } - } - - return true; -} - -void VCardFormatImpl::saveAddressee( const Addressee &addressee, VCARD::VCard *v, bool intern ) -{ - ContentLine cl; - TQString value; - - addTextValue( v, EntityName, addressee.name() ); - addTextValue( v, EntityUID, addressee.uid() ); - addTextValue( v, EntityURI, addressee.uri() ); - addTextValue( v, EntityFullName, addressee.formattedName() ); - - TQStringList emails = addressee.emails(); - TQStringList::ConstIterator it4; - for( it4 = emails.begin(); it4 != emails.end(); ++it4 ) { - addTextValue( v, EntityEmail, *it4 ); - } - - TQStringList customs = addressee.customs(); - TQStringList::ConstIterator it5; - for( it5 = customs.begin(); it5 != customs.end(); ++it5 ) { - addCustomValue( v, *it5 ); - } - - addTextValue( v, EntityURL, addressee.url().url() ); - - addNValue( v, addressee ); - - addTextValue( v, EntityNickname, addressee.nickName() ); - addTextValue( v, EntityMailer, addressee.mailer() ); - addTextValue( v, EntityTitle, addressee.title() ); - addTextValue( v, EntityRole, addressee.role() ); - addTextValue( v, EntityOrganisation, addressee.organization() ); - addTextValue( v, EntityNote, addressee.note() ); - addTextValue( v, EntityProductID, addressee.productId() ); - addTextValue( v, EntitySortString, addressee.sortString() ); - - Address::List addresses = addressee.addresses(); - Address::List::ConstIterator it3; - for( it3 = addresses.begin(); it3 != addresses.end(); ++it3 ) { - addAddressValue( v, *it3 ); - addLabelValue( v, *it3 ); - } - - PhoneNumber::List phoneNumbers = addressee.phoneNumbers(); - PhoneNumber::List::ConstIterator it2; - for( it2 = phoneNumbers.begin(); it2 != phoneNumbers.end(); ++it2 ) { - addTelephoneValue( v, *it2 ); - } - - Key::List keys = addressee.keys(); - Key::List::ConstIterator it6; - for( it6 = keys.begin(); it6 != keys.end(); ++it6 ) { - addKeyValue( v, *it6 ); - } - - addTextValue( v, EntityCategories, addressee.categories().join(",") ); - - addDateValue( v, EntityBirthday, TQT_TQDATE_OBJECT(addressee.birthday().date()) ); - addDateTimeValue( v, EntityRevision, TQT_TQDATETIME_OBJECT(addressee.revision()) ); - addGeoValue( v, addressee.geo() ); - addUTCValue( v, addressee.timeZone() ); - - addClassValue( v, addressee.secrecy() ); - - addPictureValue( v, EntityPhoto, addressee.photo(), addressee, intern ); - addPictureValue( v, EntityLogo, addressee.logo(), addressee, intern ); - - addAgentValue( v, addressee.agent() ); - - addSoundValue( v, addressee.sound(), addressee, intern ); -} - -void VCardFormatImpl::addCustomValue( VCARD::VCard *v, const TQString &txt ) -{ - if ( txt.isEmpty() ) return; - - ContentLine cl; - cl.setName( "X-" + txt.left( txt.find( ":" ) ).utf8() ); - TQString value = txt.mid( txt.find( ":" ) + 1 ); - if ( value.isEmpty() ) - return; - cl.setValue( new TextValue( value.utf8() ) ); - v->add(cl); -} - -void VCardFormatImpl::addTextValue( VCARD::VCard *v, EntityType type, const TQString &txt ) -{ - if ( txt.isEmpty() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( type ) ); - cl.setValue( new TextValue( txt.utf8() ) ); - v->add(cl); -} - -void VCardFormatImpl::addDateValue( VCARD::VCard *vcard, EntityType type, - const TQDate &date ) -{ - if ( !date.isValid() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( type ) ); - - DateValue *v = new DateValue( date ); - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::addDateTimeValue( VCARD::VCard *vcard, EntityType type, - const TQDateTime &dateTime ) -{ - if ( !dateTime.isValid() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( type ) ); - - DateValue *v = new DateValue( dateTime ); - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::addAddressValue( VCARD::VCard *vcard, const Address &a ) -{ - if ( a.isEmpty() ) - return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityAddress ) ); - - AdrValue *v = new AdrValue; - v->setPOBox( a.postOfficeBox().utf8() ); - v->setExtAddress( a.extended().utf8() ); - v->setStreet( a.street().utf8() ); - v->setLocality( a.locality().utf8() ); - v->setRegion( a.region().utf8() ); - v->setPostCode( a.postalCode().utf8() ); - v->setCountryName( a.country().utf8() ); - cl.setValue( v ); - - addAddressParam( &cl, a.type() ); - - vcard->add( cl ); -} - -void VCardFormatImpl::addLabelValue( VCARD::VCard *vcard, const Address &a ) -{ - if ( a.label().isEmpty() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityLabel ) ); - cl.setValue( new TextValue( a.label().utf8() ) ); - - addAddressParam( &cl, a.type() ); - - vcard->add( cl ); -} - -void VCardFormatImpl::addAddressParam( ContentLine *cl, int type ) -{ - ParamList params; - if ( type & Address::Dom ) params.append( new Param( "TYPE", "dom" ) ); - if ( type & Address::Intl ) params.append( new Param( "TYPE", "intl" ) ); - if ( type & Address::Parcel ) params.append( new Param( "TYPE", "parcel" ) ); - if ( type & Address::Postal ) params.append( new Param( "TYPE", "postal" ) ); - if ( type & Address::Work ) params.append( new Param( "TYPE", "work" ) ); - if ( type & Address::Home ) params.append( new Param( "TYPE", "home" ) ); - if ( type & Address::Pref ) params.append( new Param( "TYPE", "pref" ) ); - cl->setParamList( params ); -} - -void VCardFormatImpl::addGeoValue( VCARD::VCard *vcard, const Geo &geo ) -{ - if ( !geo.isValid() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityGeo ) ); - - GeoValue *v = new GeoValue; - v->setLatitude( geo.latitude() ); - v->setLongitude( geo.longitude() ); - - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::addUTCValue( VCARD::VCard *vcard, const TimeZone &tz ) -{ - if ( !tz.isValid() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityTimeZone ) ); - - UTCValue *v = new UTCValue; - - v->setPositive( tz.offset() >= 0 ); - v->setHour( (tz.offset() / 60) * ( tz.offset() >= 0 ? 1 : -1 ) ); - v->setMinute( (tz.offset() % 60) * ( tz.offset() >= 0 ? 1 : -1 ) ); - - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::addClassValue( VCARD::VCard *vcard, const Secrecy &secrecy ) -{ - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityClass ) ); - - ClassValue *v = new ClassValue; - switch ( secrecy.type() ) { - case Secrecy::Public: - v->setType( (int)ClassValue::Public ); - break; - case Secrecy::Private: - v->setType( (int)ClassValue::Private ); - break; - case Secrecy::Confidential: - v->setType( (int)ClassValue::Confidential ); - break; - } - - cl.setValue( v ); - vcard->add(cl); -} - - -Address VCardFormatImpl::readAddressValue( ContentLine *cl ) -{ - Address a; - AdrValue *v = (AdrValue *)cl->value(); - a.setPostOfficeBox( TQString::fromUtf8( v->poBox() ) ); - a.setExtended( TQString::fromUtf8( v->extAddress() ) ); - a.setStreet( TQString::fromUtf8( v->street() ) ); - a.setLocality( TQString::fromUtf8( v->locality() ) ); - a.setRegion( TQString::fromUtf8( v->region() ) ); - a.setPostalCode( TQString::fromUtf8( v->postCode() ) ); - a.setCountry( TQString::fromUtf8( v->countryName() ) ); - - a.setType( readAddressParam( cl ) ); - - return a; -} - -int VCardFormatImpl::readAddressParam( ContentLine *cl ) -{ - int type = 0; - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "TYPE" ) { - if ( (*it)->value() == "dom" ) type |= Address::Dom; - else if ( (*it)->value() == "intl" ) type |= Address::Intl; - else if ( (*it)->value() == "parcel" ) type |= Address::Parcel; - else if ( (*it)->value() == "postal" ) type |= Address::Postal; - else if ( (*it)->value() == "work" ) type |= Address::Work; - else if ( (*it)->value() == "home" ) type |= Address::Home; - else if ( (*it)->value() == "pref" ) type |= Address::Pref; - } - } - return type; -} - -void VCardFormatImpl::addNValue( VCARD::VCard *vcard, const Addressee &a ) -{ - ContentLine cl; - cl.setName(EntityTypeToParamName( EntityN ) ); - NValue *v = new NValue; - v->setFamily( TQString(a.familyName()).utf8() ); - v->setGiven( TQString(a.givenName()).utf8() ); - v->setMiddle( TQString(a.additionalName()).utf8() ); - v->setPrefix( TQString(a.prefix()).utf8() ); - v->setSuffix( TQString(a.suffix()).utf8() ); - - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::readNValue( ContentLine *cl, Addressee &a ) -{ - NValue *v = (NValue *)cl->value(); - a.setFamilyName( TQString::fromUtf8( v->family() ) ); - a.setGivenName( TQString::fromUtf8( v->given() ) ); - a.setAdditionalName( TQString::fromUtf8( v->middle() ) ); - a.setPrefix( TQString::fromUtf8( v->prefix() ) ); - a.setSuffix( TQString::fromUtf8( v->suffix() ) ); -} - -void VCardFormatImpl::addTelephoneValue( VCARD::VCard *v, const PhoneNumber &p ) -{ - if ( p.number().isEmpty() ) - return; - - ContentLine cl; - cl.setName(EntityTypeToParamName(EntityTelephone)); - cl.setValue(new TelValue( p.number().utf8() )); - - ParamList params; - if( p.type() & PhoneNumber::Home ) params.append( new Param( "TYPE", "home" ) ); - if( p.type() & PhoneNumber::Work ) params.append( new Param( "TYPE", "work" ) ); - if( p.type() & PhoneNumber::Msg ) params.append( new Param( "TYPE", "msg" ) ); - if( p.type() & PhoneNumber::Pref ) params.append( new Param( "TYPE", "pref" ) ); - if( p.type() & PhoneNumber::Voice ) params.append( new Param( "TYPE", "voice" ) ); - if( p.type() & PhoneNumber::Fax ) params.append( new Param( "TYPE", "fax" ) ); - if( p.type() & PhoneNumber::Cell ) params.append( new Param( "TYPE", "cell" ) ); - if( p.type() & PhoneNumber::Video ) params.append( new Param( "TYPE", "video" ) ); - if( p.type() & PhoneNumber::Bbs ) params.append( new Param( "TYPE", "bbs" ) ); - if( p.type() & PhoneNumber::Modem ) params.append( new Param( "TYPE", "modem" ) ); - if( p.type() & PhoneNumber::Car ) params.append( new Param( "TYPE", "car" ) ); - if( p.type() & PhoneNumber::Isdn ) params.append( new Param( "TYPE", "isdn" ) ); - if( p.type() & PhoneNumber::Pcs ) params.append( new Param( "TYPE", "pcs" ) ); - if( p.type() & PhoneNumber::Pager ) params.append( new Param( "TYPE", "pager" ) ); - cl.setParamList( params ); - - v->add(cl); -} - -PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl ) -{ - PhoneNumber p; - TelValue *value = (TelValue *)cl->value(); - p.setNumber( TQString::fromUtf8( value->asString() ) ); - - int type = 0; - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "TYPE" ) { - if ( (*it)->value() == "home" ) type |= PhoneNumber::Home; - else if ( (*it)->value() == "work" ) type |= PhoneNumber::Work; - else if ( (*it)->value() == "msg" ) type |= PhoneNumber::Msg; - else if ( (*it)->value() == "pref" ) type |= PhoneNumber::Pref; - else if ( (*it)->value() == "voice" ) type |= PhoneNumber::Voice; - else if ( (*it)->value() == "fax" ) type |= PhoneNumber::Fax; - else if ( (*it)->value() == "cell" ) type |= PhoneNumber::Cell; - else if ( (*it)->value() == "video" ) type |= PhoneNumber::Video; - else if ( (*it)->value() == "bbs" ) type |= PhoneNumber::Bbs; - else if ( (*it)->value() == "modem" ) type |= PhoneNumber::Modem; - else if ( (*it)->value() == "car" ) type |= PhoneNumber::Car; - else if ( (*it)->value() == "isdn" ) type |= PhoneNumber::Isdn; - else if ( (*it)->value() == "pcs" ) type |= PhoneNumber::Pcs; - else if ( (*it)->value() == "pager" ) type |= PhoneNumber::Pager; - } - } - p.setType( type ); - - return p; -} - -TQString VCardFormatImpl::readTextValue( ContentLine *cl ) -{ - VCARD::Value *value = cl->value(); - if ( value ) { - return TQString::fromUtf8( value->asString() ); - } else { - kdDebug(5700) << "No value: " << cl->asString() << endl; - return TQString::null; - } -} - -TQDate VCardFormatImpl::readDateValue( ContentLine *cl ) -{ - DateValue *dateValue = (DateValue *)cl->value(); - if ( dateValue ) - return dateValue->qdate(); - else - return TQDate(); -} - -TQDateTime VCardFormatImpl::readDateTimeValue( ContentLine *cl ) -{ - DateValue *dateValue = (DateValue *)cl->value(); - if ( dateValue ) - return dateValue->qdt(); - else - return TQDateTime(); -} - -Geo VCardFormatImpl::readGeoValue( ContentLine *cl ) -{ - GeoValue *geoValue = (GeoValue *)cl->value(); - if ( geoValue ) { - Geo geo( geoValue->latitude(), geoValue->longitude() ); - return geo; - } else - return Geo(); -} - -TimeZone VCardFormatImpl::readUTCValue( ContentLine *cl ) -{ - UTCValue *utcValue = (UTCValue *)cl->value(); - if ( utcValue ) { - TimeZone tz; - tz.setOffset(((utcValue->hour()*60)+utcValue->minute())*(utcValue->positive() ? 1 : -1)); - return tz; - } else - return TimeZone(); -} - -Secrecy VCardFormatImpl::readClassValue( ContentLine *cl ) -{ - ClassValue *classValue = (ClassValue *)cl->value(); - if ( classValue ) { - Secrecy secrecy; - switch ( classValue->type() ) { - case ClassValue::Public: - secrecy.setType( Secrecy::Public ); - break; - case ClassValue::Private: - secrecy.setType( Secrecy::Private ); - break; - case ClassValue::Confidential: - secrecy.setType( Secrecy::Confidential ); - break; - } - - return secrecy; - } else - return Secrecy(); -} - -void VCardFormatImpl::addKeyValue( VCARD::VCard *vcard, const Key &key ) -{ - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityKey ) ); - - ParamList params; - if ( key.isBinary() ) { - cl.setValue( new TextValue( KCodecs::base64Encode( key.binaryData() ) ) ); - params.append( new Param( "ENCODING", "b" ) ); - } else { - cl.setValue( new TextValue( key.textData().utf8() ) ); - } - - switch ( key.type() ) { - case Key::X509: - params.append( new Param( "TYPE", "X509" ) ); - break; - case Key::PGP: - params.append( new Param( "TYPE", "PGP" ) ); - break; - case Key::Custom: - params.append( new Param( "TYPE", key.customTypeString().utf8() ) ); - break; - } - - cl.setParamList( params ); - vcard->add( cl ); -} - -Key VCardFormatImpl::readKeyValue( VCARD::ContentLine *cl ) -{ - Key key; - bool isBinary = false; - TextValue *v = (TextValue *)cl->value(); - - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) - isBinary = true; - if ( (*it)->name() == "TYPE" ) { - if ( (*it)->value().isEmpty() ) - continue; - if ( (*it)->value() == "X509" ) - key.setType( Key::X509 ); - else if ( (*it)->value() == "PGP" ) - key.setType( Key::PGP ); - else { - key.setType( Key::Custom ); - key.setCustomTypeString( TQString::fromUtf8( (*it)->value() ) ); - } - } - } - - - if ( isBinary ) { - TQByteArray data; - KCodecs::base64Decode( v->asString().stripWhiteSpace(), data ); - key.setBinaryData( data ); - } else { - key.setTextData( TQString::fromUtf8( v->asString() ) ); - } - - return key; -} - - -void VCardFormatImpl::addAgentValue( VCARD::VCard *vcard, const Agent &agent ) -{ - if ( agent.isIntern() && !agent.addressee() ) - return; - - if ( !agent.isIntern() && agent.url().isEmpty() ) - return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityAgent ) ); - - ParamList params; - if ( agent.isIntern() ) { - TQString vstr; - Addressee *addr = agent.addressee(); - if ( addr ) { - writeToString( (*addr), vstr ); - vstr.replace( ":", "\\:" ); - vstr.replace( ",", "\\," ); - vstr.replace( ";", "\\;" ); - vstr.replace( "\r\n", "\\n" ); - cl.setValue( new TextValue( vstr.utf8() ) ); - } else - return; - } else { - cl.setValue( new TextValue( agent.url().utf8() ) ); - params.append( new Param( "VALUE", "uri" ) ); - } - - cl.setParamList( params ); - vcard->add( cl ); -} - -Agent VCardFormatImpl::readAgentValue( VCARD::ContentLine *cl ) -{ - Agent agent; - bool isIntern = true; - TextValue *v = (TextValue *)cl->value(); - - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "VALUE" && (*it)->value() == "uri" ) - isIntern = false; - } - - if ( isIntern ) { - TQString vstr = TQString::fromUtf8( v->asString() ); - vstr.replace( "\\n", "\r\n" ); - vstr.replace( "\\:", ":" ); - vstr.replace( "\\,", "," ); - vstr.replace( "\\;", ";" ); - Addressee *addr = new Addressee; - readFromString( vstr, *addr ); - agent.setAddressee( addr ); - } else { - agent.setUrl( TQString::fromUtf8( v->asString() ) ); - } - - return agent; -} - -void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType type, const Picture &pic, const Addressee &addr, bool intern ) -{ - ContentLine cl; - cl.setName( EntityTypeToParamName( type ) ); - - if ( pic.isIntern() && pic.data().isNull() ) - return; - - if ( !pic.isIntern() && pic.url().isEmpty() ) - return; - - ParamList params; - if ( pic.isIntern() ) { - TQImage img = pic.data(); - if ( intern ) { // only for vCard export we really write the data inline - TQByteArray data; - TQDataStream s( data, IO_WriteOnly ); - s.setVersion( 4 ); // to produce valid png files - s << img; - cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); - } else { // save picture in cache - TQString dir; - if ( type == EntityPhoto ) - dir = "photos"; - if ( type == EntityLogo ) - dir = "logos"; - - img.save( locateLocal( "data", "kabc/" + dir + "/" + addr.uid() ), pic.type().utf8() ); - cl.setValue( new TextValue( "<dummy>" ) ); - } - params.append( new Param( "ENCODING", "b" ) ); - if ( !pic.type().isEmpty() ) - params.append( new Param( "TYPE", pic.type().utf8() ) ); - } else { - cl.setValue( new TextValue( pic.url().utf8() ) ); - params.append( new Param( "VALUE", "uri" ) ); - } - - cl.setParamList( params ); - vcard->add( cl ); -} - -Picture VCardFormatImpl::readPictureValue( VCARD::ContentLine *cl, VCARD::EntityType type, const Addressee &addr ) -{ - Picture pic; - bool isInline = false; - TQString picType; - TextValue *v = (TextValue *)cl->value(); - - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) - isInline = true; - if ( (*it)->name() == "TYPE" && !(*it)->value().isEmpty() ) - picType = TQString::fromUtf8( (*it)->value() ); - } - - if ( isInline ) { - TQImage img; - if ( v->asString() == "<dummy>" ) { // no picture inline stored => picture is in cache - TQString dir; - if ( type == EntityPhoto ) - dir = "photos"; - if ( type == EntityLogo ) - dir = "logos"; - - img.load( locateLocal( "data", "kabc/" + dir + "/" + addr.uid() ) ); - } else { - TQByteArray data; - KCodecs::base64Decode( v->asString(), data ); - img.loadFromData( data ); - } - pic.setData( img ); - pic.setType( picType ); - } else { - pic.setUrl( TQString::fromUtf8( v->asString() ) ); - } - - return pic; -} - -void VCardFormatImpl::addSoundValue( VCARD::VCard *vcard, const Sound &sound, const Addressee &addr, bool intern ) -{ - ContentLine cl; - cl.setName( EntityTypeToParamName( EntitySound ) ); - - if ( sound.isIntern() && sound.data().isNull() ) - return; - - if ( !sound.isIntern() && sound.url().isEmpty() ) - return; - - ParamList params; - if ( sound.isIntern() ) { - TQByteArray data = sound.data(); - if ( intern ) { // only for vCard export we really write the data inline - cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); - } else { // save sound in cache - TQFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); - if ( file.open( IO_WriteOnly ) ) { - file.writeBlock( data ); - } - cl.setValue( new TextValue( "<dummy>" ) ); - } - params.append( new Param( "ENCODING", "b" ) ); - } else { - cl.setValue( new TextValue( sound.url().utf8() ) ); - params.append( new Param( "VALUE", "uri" ) ); - } - - cl.setParamList( params ); - vcard->add( cl ); -} - -Sound VCardFormatImpl::readSoundValue( VCARD::ContentLine *cl, const Addressee &addr ) -{ - Sound sound; - bool isInline = false; - TextValue *v = (TextValue *)cl->value(); - - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) - isInline = true; - } - - if ( isInline ) { - TQByteArray data; - if ( v->asString() == "<dummy>" ) { // no sound inline stored => sound is in cache - TQFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); - if ( file.open( IO_ReadOnly ) ) { - data = file.readAll(); - file.close(); - } - } else { - KCodecs::base64Decode( v->asString(), data ); - } - sound.setData( data ); - } else { - sound.setUrl( TQString::fromUtf8( v->asString() ) ); - } - - return sound; -} - -bool VCardFormatImpl::readFromString( const TQString &vcard, Addressee &addressee ) -{ - VCardEntity e( vcard.utf8() ); - VCardListIterator it( e.cardList() ); - - if ( it.current() ) { - VCARD::VCard v(*it.current()); - loadAddressee( addressee, v ); - return true; - } - - return false; -} - -bool VCardFormatImpl::writeToString( const Addressee &addressee, TQString &vcard ) -{ - VCardEntity vcards; - VCardList vcardlist; - vcardlist.setAutoDelete( true ); - - VCARD::VCard *v = new VCARD::VCard; - - saveAddressee( addressee, v, true ); - - vcardlist.append( v ); - vcards.setCardList( vcardlist ); - vcard = TQString::fromUtf8( vcards.asString() ); - - return true; -} diff --git a/kabc/vcardformatimpl.h b/kabc/vcardformatimpl.h deleted file mode 100644 index 78c466a86..000000000 --- a/kabc/vcardformatimpl.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_VCARDFORMATIMPL_H -#define KABC_VCARDFORMATIMPL_H - -#include <tqstring.h> -#include <tqfile.h> - -#include "address.h" -#include "addressee.h" - -#ifdef __CYGWIN__ -#include <vcard/include/VCard.h> -#else -#include <VCard.h> -#endif - -namespace KABC { - -class AddressBook; - -/** - @deprecated use VCardFormatPlugin instead. - */ -class KABC_EXPORT_DEPRECATED VCardFormatImpl -{ - public: - bool load( Addressee &, TQFile *file ); - bool loadAll( AddressBook *, Resource *, TQFile *file ); - void save( const Addressee &, TQFile *file ); - void saveAll( AddressBook *, Resource *, TQFile *file ); - - bool readFromString( const TQString &vcard, Addressee &addr ); - bool writeToString( const Addressee &addressee, TQString &vcard ); - - protected: - bool loadAddressee( Addressee &, VCARD::VCard & ); - void saveAddressee( const Addressee &, VCARD::VCard *, bool intern ); - - void addTextValue (VCARD::VCard *, VCARD::EntityType, const TQString & ); - TQString readTextValue( VCARD::ContentLine * ); - - void addDateValue( VCARD::VCard *, VCARD::EntityType, const TQDate & ); - TQDate readDateValue( VCARD::ContentLine * ); - - void addDateTimeValue( VCARD::VCard *, VCARD::EntityType, const TQDateTime & ); - TQDateTime readDateTimeValue( VCARD::ContentLine * ); - - void addAddressValue( VCARD::VCard *, const Address & ); - Address readAddressValue( VCARD::ContentLine * ); - - void addLabelValue( VCARD::VCard *, const Address & ); - - void addTelephoneValue( VCARD::VCard *, const PhoneNumber & ); - PhoneNumber readTelephoneValue( VCARD::ContentLine * ); - - void addNValue( VCARD::VCard *, const Addressee & ); - void readNValue( VCARD::ContentLine *, Addressee & ); - - void addCustomValue( VCARD::VCard *, const TQString & ); - - void addAddressParam( VCARD::ContentLine *, int ); - int readAddressParam( VCARD::ContentLine * ); - - void addGeoValue( VCARD::VCard *, const Geo & ); - Geo readGeoValue( VCARD::ContentLine * ); - - void addUTCValue( VCARD::VCard *, const TimeZone & ); - TimeZone readUTCValue( VCARD::ContentLine * ); - - void addClassValue( VCARD::VCard *, const Secrecy & ); - Secrecy readClassValue( VCARD::ContentLine * ); - - void addKeyValue( VCARD::VCard *, const Key & ); - Key readKeyValue( VCARD::ContentLine * ); - - void addPictureValue( VCARD::VCard *, VCARD::EntityType, const Picture &, const Addressee &, bool ); - Picture readPictureValue( VCARD::ContentLine *, VCARD::EntityType, const Addressee &addr ); - - void addSoundValue( VCARD::VCard *, const Sound &, const Addressee &, bool ); - Sound readSoundValue( VCARD::ContentLine *, const Addressee &addr ); - - void addAgentValue( VCARD::VCard *, const Agent & ); - Agent readAgentValue( VCARD::ContentLine * ); -}; - -} -#endif diff --git a/kabc/vcardformatplugin.cpp b/kabc/vcardformatplugin.cpp deleted file mode 100644 index 6194cd0fe..000000000 --- a/kabc/vcardformatplugin.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> - -#include "address.h" -#include "addressee.h" -#include "vcardconverter.h" - -#include "vcardformatplugin.h" - -using namespace KABC; - -VCardFormatPlugin::VCardFormatPlugin() -{ -} - -VCardFormatPlugin::~VCardFormatPlugin() -{ -} - -bool VCardFormatPlugin::load( Addressee &addressee, TQFile *file ) -{ - TQString data; - - TQTextStream t( file ); - t.setEncoding( TQTextStream::Latin1 ); - data = t.read(); - - VCardConverter converter; - Addressee::List l = converter.parseVCards( data ); - - if ( ! l.first().isEmpty() ) { - addressee = l.first(); - return true; - } - - return false; -} - -bool VCardFormatPlugin::loadAll( AddressBook*, Resource *resource, TQFile *file ) -{ - TQString data; - - TQTextStream t( file ); - t.setEncoding( TQTextStream::Latin1 ); - data = t.read(); - - VCardConverter converter; - - Addressee::List l = converter.parseVCards( data ); - - Addressee::List::iterator itr; - for ( itr = l.begin(); itr != l.end(); ++itr) { - Addressee addressee = *itr; - addressee.setResource( resource ); - addressee.setChanged( false ); - resource->insertAddressee( addressee ); - } - - return true; -} - -void VCardFormatPlugin::save( const Addressee &addressee, TQFile *file ) -{ - VCardConverter converter ; - Addressee::List vcardlist; - - - vcardlist.append( addressee ); - - TQTextStream t( file ); - t.setEncoding( TQTextStream::UnicodeUTF8 ); - t << converter.createVCards( vcardlist ); -} - -void VCardFormatPlugin::saveAll( AddressBook*, Resource *resource, TQFile *file ) -{ - VCardConverter converter; - Addressee::List vcardlist; - - Resource::Iterator it; - for ( it = resource->begin(); it != resource->end(); ++it ) { - (*it).setChanged( false ); - vcardlist.append( *it ); - } - - TQTextStream t( file ); - t.setEncoding( TQTextStream::UnicodeUTF8 ); - t << converter.createVCards( vcardlist ); -} - -bool VCardFormatPlugin::checkFormat( TQFile *file ) const -{ - TQString line; - - file->readLine( line, 1024 ); - line = line.stripWhiteSpace(); - if ( line == "BEGIN:VCARD" ) - return true; - else - return false; -} diff --git a/kabc/vcardformatplugin.h b/kabc/vcardformatplugin.h deleted file mode 100644 index 5ac7e49c2..000000000 --- a/kabc/vcardformatplugin.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_VCARDFORMATPLUGIN_H -#define KABC_VCARDFORMATPLUGIN_H - -#include "formatplugin.h" - -namespace KABC { - -class AddressBook; -class Addressee; - -/** - @short Interface of vCard backend for address book. - - This class implements the file format interface of address book entries for - the vCard format. -*/ -class KABC_EXPORT VCardFormatPlugin : public FormatPlugin -{ - public: - VCardFormatPlugin(); - virtual ~VCardFormatPlugin(); - - bool load( Addressee &, TQFile *file ); - bool loadAll( AddressBook *, Resource *, TQFile *file ); - void save( const Addressee &, TQFile *file ); - void saveAll( AddressBook *, Resource *, TQFile *file ); - - bool checkFormat( TQFile *file ) const; - - private: - struct VCardFormatPrivate; - VCardFormatPrivate *d; -}; - -} -#endif diff --git a/kabc/vcardparser/CMakeLists.txt b/kabc/vcardparser/CMakeLists.txt deleted file mode 100644 index 2c6fa112a..000000000 --- a/kabc/vcardparser/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdecore -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - vcard.h vcardline.h vcardparser.h - DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) - - -##### vcards #################################### - -set( target vcards ) - -set( ${target}_SRCS - vcard.cpp vcardline.cpp vcardparser.cpp -) - -tde_add_library( ${target} STATIC_PIC - SOURCES ${${target}_SRCS} -) diff --git a/kabc/vcardparser/Makefile.am b/kabc/vcardparser/Makefile.am deleted file mode 100644 index 53e4e42ab..000000000 --- a/kabc/vcardparser/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) - -noinst_LTLIBRARIES = libvcards.la -libvcards_la_SOURCES = vcard.cpp vcardline.cpp vcardparser.cpp - -vcardsincludedir = $(includedir)/kabc -vcardsinclude_HEADERS = vcard.h vcardline.h vcardparser.h - -check_PROGRAMS = testread testwrite testread2 - -testread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testread_LDADD = libvcards.la $(top_builddir)/kabc/libkabc.la -testread_SOURCES = testread.cpp - -testread2_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testread2_LDADD = libvcards.la $(top_builddir)/kabc/libkabc.la -testread2_SOURCES = testread2.cpp testutils.cpp - -testwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testwrite_LDADD = libvcards.la $(top_builddir)/kabc/libkabc.la -testwrite_SOURCES = testwrite.cpp - -TESTFILES = vcard1.vcf vcard2.vcf vcard3.vcf vcard4.vcf vcard6.vcf vcard7.vcf - -check-local: testread - rm -f FAILED; \ - for i in $(TESTFILES); \ - do perl $(top_srcdir)/kabc/vcardparser/checkvcard.pl \ - $(top_srcdir)/kabc/vcardparser/tests/$$i; \ - done; \ - [ ! -e FAILED ] diff --git a/kabc/vcardparser/README.testing b/kabc/vcardparser/README.testing deleted file mode 100644 index a7794931d..000000000 --- a/kabc/vcardparser/README.testing +++ /dev/null @@ -1,15 +0,0 @@ -For testing the vcardparser there are some test files and a small testsuite -automatically checking for regressions. The tests directory contains some vCard -files and correpsonding reference output files (with an additional ".ref" -suffix). For running the geression test do "make check". This will compile some -test programs, parse the test files, write them out as vCard again and compare -the output to the reference file. The check fails, if there are unexpected -differences and shows which lines differed. - -For creating a new test put a vCard file to be parsed into the tests directory. -Create a reference file by running "testread" on the test file. It will put out -the parsed data as vCard again on stdout. Carefully check the output, manually -correct any errors and save the result as reference file in the tests directory. -Now add the filename to the TESTFILES variable in Makefile.am and run "make -check". If the check fails adapt the reference file or fix the bugs in the -parser, whatever is appropriate. diff --git a/kabc/vcardparser/checkvcard.pl b/kabc/vcardparser/checkvcard.pl deleted file mode 100755 index 67160ea4a..000000000 --- a/kabc/vcardparser/checkvcard.pl +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl - -if ( @ARGV != 1 ) { - print STDERR "Missing arg: filename\n"; - exit 1; -} - -$file = $ARGV[0]; - -if ( !open( IN, "$file" ) ) { - print STDERR "Unable to open '$file'\n"; - exit 1; -} - -while( <IN> ) { - if (/^VERSION:(.*)$/ ) { - $version = $1; - if ( $version eq "2.1" ) { $options = "--vcard21"; } - } -} - -close IN; - -$ref = "$file.ref"; - -if ( !open( REF, "$ref" ) ) { - print STDERR "Unable to open $ref\n"; - exit 1; -} - -while( <REF> ) { - push @ref, $_; -} - -close REF; - -if ( !open( READ, "./testread $file $options 2> /dev/null |" ) ) { - print STDERR "Unable to open testread\n"; - exit 1; -} - -print "Checking '$file':\n"; - -$gotsomething = 0; -$error = 0; -$i = 0; -while( <READ> ) { - $gotsomething = 1; - $out = $_; - $ref = @ref[$i++]; - - if ( $out ne $ref ) { - if ( $ref =~ /^UID/ && $out =~ /^UID/ ) { next; } - $error++; - print " Expected : $ref"; - print " Parser output : $out"; - } -} - -close READ; - -if ( $gotsomething == 0 ) { - print "\n FAILED: testread didn't output anything\n"; - system "touch FAILED"; - exit 1; -} -if ( $error > 0 ) { - print "\n FAILED: $error errors found.\n"; - system "touch FAILED"; - exit 1; -} else { - print " OK\n"; -} - -exit 0; diff --git a/kabc/vcardparser/testread.cpp b/kabc/vcardparser/testread.cpp deleted file mode 100644 index 6c3405ef9..000000000 --- a/kabc/vcardparser/testread.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - This file is part of libkabc. - - 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 <iostream> -#include <stdlib.h> - -#include <tqfile.h> -#include <tqtextstream.h> - -#include <kprocess.h> -#include <kdebug.h> -#include <tdeapplication.h> -#include <tdecmdlineargs.h> -#include <klocale.h> -#include <tdeaboutdata.h> - -#include "vcardconverter.h" -#include "vcard.h" - -static const TDECmdLineOptions options[] = -{ - {"vcard21", I18N_NOOP("vCard 2.1"), 0}, - {"+inputfile", I18N_NOOP("Input file"), 0}, - TDECmdLineLastOption -}; - -int main( int argc, char **argv ) -{ - TDEApplication::disableAutoDcopRegistration(); - - TDEAboutData aboutData( "testread", "vCard test reader", "0.1" ); - aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); - - TDECmdLineArgs::init( argc, argv, &aboutData ); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app( false, false ); - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - if ( args->count() != 1 ) { - std::cerr << "Missing argument" << std::endl; - return 1; - } - - TQString inputFile( args->arg( 0 ) ); - - TQFile file( inputFile ); - if ( !file.open( IO_ReadOnly ) ) { - tqDebug( "Unable to open file '%s' for reading!", file.name().latin1() ); - return 1; - } - - TQString text; - - TQTextStream s( &file ); - s.setEncoding( TQTextStream::Latin1 ); - text = s.read(); - file.close(); - - KABC::VCardConverter converter; - KABC::Addressee::List list = converter.parseVCards( text ); - - if ( args->isSet( "vcard21" ) ) { - text = converter.createVCards( list, KABC::VCardConverter::v2_1 ); // uses version 2.1 - } else { - text = converter.createVCards( list ); // uses version 3.0 - } - - std::cout << text.utf8(); - - return 0; -} diff --git a/kabc/vcardparser/testread2.cpp b/kabc/vcardparser/testread2.cpp deleted file mode 100644 index ba73081e7..000000000 --- a/kabc/vcardparser/testread2.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "testutils.h" -#include <kabc/addressee.h> -#include <vcardconverter.h> -#include <kdebug.h> - -using namespace KABC; - -int -main() -{ - Addressee::List l = vCardsAsAddresseeList(); - TQString vcards = vCardsAsText(); - - VCardConverter vct; - - Addressee::List parsed = vct.parseVCards( vcards ); - - if ( l.size() != parsed.size() ) { - kdDebug()<<"\tSize - FAILED : "<<l.size()<<" vs. parsed "<<parsed.size()<<endl; - } else { - kdDebug()<<"\tSize - PASSED"<<endl; - } - - Addressee::List::iterator itr1; - Addressee::List::iterator itr2; - for ( itr1 = l.begin(), itr2 = parsed.begin(); - itr1 != l.end(); ++itr1, ++itr2 ) { - if ( (*itr1).fullEmail() == (*itr2).fullEmail() && - (*itr1).organization() == (*itr2).organization() && - (*itr1).phoneNumbers() == (*itr2).phoneNumbers() && - (*itr1).emails() == (*itr2).emails() && - (*itr1).role() == (*itr2).role() ) { - kdDebug()<<"\tAddressee - PASSED"<<endl; - kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl; - } else { - kdDebug()<<"\tAddressee - FAILED"<<endl; - (*itr1).dump(); - (*itr2).dump(); - //kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl; - } - } -} diff --git a/kabc/vcardparser/tests/vcard1.vcf b/kabc/vcardparser/tests/vcard1.vcf deleted file mode 100644 index 2c77b094c..000000000 --- a/kabc/vcardparser/tests/vcard1.vcf +++ /dev/null @@ -1,13 +0,0 @@ -BEGIN:vCard -VERSION:3.0 -FN:Frank Dawson -ORG:Lotus Development Corporation -ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive - ;Raleigh;NC;27613-3502;U.S.A. -TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515 -TEL;TYPE=FAX,WORK:+1-919-676-9564 -EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com -EMAIL;TYPE=INTERNET:fdawson@earthlink.net -URL:http://home.earthlink.net/~fdawson -END:vCard - diff --git a/kabc/vcardparser/tests/vcard1.vcf.ref b/kabc/vcardparser/tests/vcard1.vcf.ref deleted file mode 100644 index 073a7f31d..000000000 --- a/kabc/vcardparser/tests/vcard1.vcf.ref +++ /dev/null @@ -1,15 +0,0 @@ -BEGIN:VCARD -ADR;TYPE=parcel;TYPE=postal;TYPE=work:;;6544 Battleford Drive;Raleigh;NC;27 - 613-3502;U.S.A. -EMAIL;TYPE=PREF:Frank_Dawson@Lotus.com -EMAIL:fdawson@earthlink.net -FN:Frank Dawson -N:;;;; -ORG:Lotus Development Corporation -TEL;TYPE=MSG;TYPE=VOICE;TYPE=WORK:+1-919-676-9515 -TEL;TYPE=FAX;TYPE=WORK:+1-919-676-9564 -UID:gDVbA6LY3t -URL:http://home.earthlink.net/~fdawson -VERSION:3.0 -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard2.vcf b/kabc/vcardparser/tests/vcard2.vcf deleted file mode 100644 index a4136b1b8..000000000 --- a/kabc/vcardparser/tests/vcard2.vcf +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN:vCard -VERSION:3.0 -FN:Tim Howes -ORG:Netscape Communications Corp. -ADR;TYPE=WORK:;;501 E. Middlefield Rd.;Mountain View; - CA; 94043;U.S.A. -TEL;TYPE=VOICE,MSG,WORK:+1-415-937-3419 -TEL;TYPE=FAX,WORK:+1-415-528-4164 -EMAIL;TYPE=INTERNET:howes@netscape.com -END:vCard - diff --git a/kabc/vcardparser/tests/vcard2.vcf.ref b/kabc/vcardparser/tests/vcard2.vcf.ref deleted file mode 100644 index 55151c797..000000000 --- a/kabc/vcardparser/tests/vcard2.vcf.ref +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN:VCARD -ADR;TYPE=work:;;501 E. Middlefield Rd.;Mountain View;CA; 94043;U.S.A. -EMAIL:howes@netscape.com -FN:Tim Howes -N:;;;; -ORG:Netscape Communications Corp. -TEL;TYPE=MSG;TYPE=VOICE;TYPE=WORK:+1-415-937-3419 -TEL;TYPE=FAX;TYPE=WORK:+1-415-528-4164 -UID:1UgvYejJMs -VERSION:3.0 -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard3.vcf b/kabc/vcardparser/tests/vcard3.vcf deleted file mode 100644 index f3f649784..000000000 --- a/kabc/vcardparser/tests/vcard3.vcf +++ /dev/null @@ -1,11 +0,0 @@ -begin:vcard -n:geiser;ian -x-mozilla-html:FALSE -org:Source eXtreme -version:2.1 -email;internet:geiseri@yahoo.com -title:VP of Engineering -x-mozilla-cpt:;0 -fn:ian geiser -end:vcard - diff --git a/kabc/vcardparser/tests/vcard3.vcf.ref b/kabc/vcardparser/tests/vcard3.vcf.ref deleted file mode 100644 index c91351769..000000000 --- a/kabc/vcardparser/tests/vcard3.vcf.ref +++ /dev/null @@ -1,12 +0,0 @@ -BEGIN:VCARD -EMAIL:geiseri@yahoo.com -FN:ian geiser -N:geiser;ian;;; -ORG:Source eXtreme -TITLE:VP of Engineering -UID:ebvq9Wo9rO -VERSION:3.0 -X-mozilla-cpt:;0 -X-mozilla-html:FALSE -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard4.vcf b/kabc/vcardparser/tests/vcard4.vcf deleted file mode 100644 index 7152ceb05..000000000 --- a/kabc/vcardparser/tests/vcard4.vcf +++ /dev/null @@ -1,14 +0,0 @@ -BEGIN:VCARD -X-EVOLUTION-FILE-AS:Ximian, Inc. -FN -N: -LABEL;QUOTED-PRINTABLE;WORK:401 Park Drive 3 West=0ABoston, MA 02215=0AUSA -TEL;WORK;VOICE:(617) 236-0442 -TEL;WORK;FAX:(617) 236-8630 -EMAIL;INTERNET:hello@ximian.com -URL:www.ximian.com/ -ORG:Ximian, Inc. -NOTE:Welcome to the Ximian Addressbook. -UID:pas-id-3E136F9B00000000 -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard4.vcf.ref b/kabc/vcardparser/tests/vcard4.vcf.ref deleted file mode 100644 index fc3b7a500..000000000 --- a/kabc/vcardparser/tests/vcard4.vcf.ref +++ /dev/null @@ -1,14 +0,0 @@ -BEGIN:VCARD -EMAIL:hello@ximian.com -LABEL;TYPE=work:401 Park Drive 3 West\nBoston\, MA 02215\nUSA -N:;;;; -NOTE:Welcome to the Ximian Addressbook. -ORG:Ximian\, Inc. -TEL;TYPE=VOICE;TYPE=WORK:(617) 236-0442 -TEL;TYPE=FAX;TYPE=WORK:(617) 236-8630 -UID:pas-id-3E136F9B00000000 -URL:www.ximian.com/ -VERSION:3.0 -X-EVOLUTION-FILE-AS:Ximian\, Inc. -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard5.vcf b/kabc/vcardparser/tests/vcard5.vcf deleted file mode 100644 index 957a1e552..000000000 --- a/kabc/vcardparser/tests/vcard5.vcf +++ /dev/null @@ -1,313 +0,0 @@ -BEGIN:VCARD -ADR;TYPE=home;TYPE=pref:;;Buehlauer Strasse 45;Dresden;Sachsen;01327;German - y -ADR;TYPE=work:;;Prager Strasse 55;Dresden;Sachsen;01066;Germany -BDAY:1955-07-19T00:00:00Z -CATEGORIES:Friend -CLASS:CONFIDENTIAL -EMAIL;TYPE=PREF:heiko.mustermann@freenet.org -EMAIL:heiko8@tst.inf.tu-dresden.de -FN:Mustermann, Heiko -GEO:19.283333;166.616669 -LOGO;ENCODING=b;TYPE=image/png:iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVU - AAAOW0lEQVR4nO1df2hb1xX+OlyQwQEJXJAgBQlaiEwDsdqO2l1H47RjMe2gbjOoszG2dozG7aC - YMIqTjS7NYKSmbE1StsQpWxMXmsSF1WhlTeSwJlZY06gsSVXWUAkakKAGPajBDxrQ/jjnez8k27 - EjJdyU+/0jPz29X9L57jnnO+deAxYWFhYWFhYWFu3Hbe082XT2ZF3+WgAAdHZ0AgBqTg0A4H7DT - 7oAgNSdKQDAg99/sK33caPB53RqFQBA5PYIAMBdkOf6yc9+ct3P852W786irWjJMs/8+0wdACpV - sZTS50V5vSLb1UoVQMCCvnFDx0c65f3BHw4CABJ3RL19mwYfM4Y1e/+0V5h/VbbPXzwPACiVSgA - A15XnikVjAIB44Dli3TIKjL+2e0XPYxliGFZshSdzZ+r8OyKGjdl8AQCQfe84AKBaFUaUrojlRL - vEUpx5h0eGjo9EZH+kQ7Yz9/d71+vdkAYApO+W16d+/NQNZ8ye8T11ACiV5TkcR5jufCX3XyrLc - 9XmxUe6bvi5XH3OaNRnSKRL9vWsywAAstNTyz6HZYhhsD+IYbjmMPDxfz6uA0BMqQcAR96eAgBM - vSevtTkJa6tzQnVSNn2XOLSZ03ljHHQ7MLxlSIa2kg5pOrTVHHHu/hANRDrke4t2y3cy+KgEMPs - P7F/0O7EMMQzXtNxLn16qA8DUu1nvvcm3DgEAFlxxbo4jFpFYK4woXix8qxhxLYxuH6sDQG5Gvq - NSueLtcxwdNTTASemoUTi3+HdkGWIYlrTkj2clzC1ckGRv3xv7vH2VK7QAlUDuktA0f/bG+YpL5 - 4WpDDXv7TdPbjm472AdACbe9L+r4mdMHuW+42uTAIByuWwZciugY6kdER3zzn8iMkFt3pc93Kvy - d0QzvHYxI5h8Qq/BiK1YLur78nJw4mBIznj2V88ueg+HjxyrA0BEdE7EumLePp773u/e25b7jyb - kfAObh7z3SleELS40SVZ/u+2F0ToA7H99PHRtyxDD0GQZZ9RKKxUZ+/YdmAAAFD4peJ9hbF2dq7 - aHGSpn12p+dJI7PQsAcDS3YcxfmZPXnrt65F40P+pd3wsgwF69x/xHedlWNkfX+PlUep0ck0omA - ACxO+R10w82tfRch8leAJOas82ek+cho/sfkGtnT8xYhpiMJh9CiytVZayjYIgO37KCmWgrOPy3 - w3UAKKpsf/zd496+wkVhpOu5Lje0XS6X9X5lbJ49KxZIJqSSEu+Xrsj9V1Xw5OcBIPJBDoCfPw0 - 9IVn0sanpOgA8NXR9JYBILO7/rd8n/RV9SM1tPg6wDDEOTQxhFEKLYjbuBljBX9tjzyox/Q+xQO - crOf7I20cAAIVz+cCnVNJu8Alo3Nb43nEjoSfa8dIOAMDs6Zy+3wcAyM3kvCtUyZ6qXLd0WZj6z - E+fAeAX4FZbYo5Fmt9zXfeanwEsQ4xDE0Nqbi203ZhztANVZUb2PdF+imqZLgLX0OvSd7lLbPO+ - OFan1B8wGotEE3pCYfpWtX4A2L1rZ+gcHN+Pa8EtEpX3mR9tGlieKSf/dVJ9Ysl7j/fhMYTfuDa - ANMIyxDA0Z+r6Qy7MC1Mi3lge1PijTYetBNNTkjUfOjQJAMi+LzE6S7nJtX50krknE74hZQZbij - o19U7eKcfQAKuaP7lam+hRdZXl19kZX7Xe+PBG2acM7YzE9Bpi1UfeFN9G7Y6+77EfLR59UdGtV - X2G8D7IEPrf7PtZq2XdCmhiCBsUYnGxLJfxP5rzkI0Pb6wDwMypmWXHVupOk0eFEfQZIy+MAQB6 - 79OGhnSvd0yk4c5o4c7Xamlrwj7Nqck9uVf5eblGVnONqIY1W38+4h3DyJH1i6j6jFi3+B1GaPm - 8RGFsa9qrqu7zI6KfHXtHmM8KKq8ZfNZg/rMcLEMMQ5NlH/zLwVDz28SbomVRUxI0RDZJZrqici - biYmHFz8Q6cmox6bR8bsfOVwD44ylzH47dgK9lTf5dqpOzZ0V1Hnh0AIDfXMdmO7Zx0h8MaO2aT - JtQf7D16Se9a9CS0+uEofQVmV7ZjqhPmXhrIvQcnV2doeemv6UfIysAeNoVg9TMfdLqZH3ILYIl - x36Oi/v+Knp+/mwhsFfHcR0X2W3Su0Gy4ZrG3tU5GaOHtwhzXv3jqwB8ZgFiaezamFVWAMDO30u - OQAsjfvFL8QHpdFLOoPE8FQXG99UvxecMbhameOrCnB8tbh0WtjA3IZuYl6TXC1PoY/b9eRwAUL - hYDH3emXdD20EwX4p3SzS4VKWQsAwxDPYHMQxLlnDpJNlbSyEO8BvjvDKrJnZFlcxJ+biGkRT6Y - nf45VMAqHypXfMa0uY+8JM2Fpycr+QzfQ+JM0+nhPoMBHit3FFxuHT6FB8rGsYnusWZVsoBAVOH - QzrlkoqlcW1qSyQkOMmsE+c9sk2Gy+d//Xzo+Ago40RD3wsARKMrG6oIyxDDsCRDOAtodLsU44M - d3QtXKcnzLGELoXN7cos4y3jcl0QAYOFrOZ4ySLGooWqgOYBs4XVp+Qw9i2XZX1GyZtIJvQdhRi - Il23S4ntgYSNB67xcWTs2ouDmn97FRrlX6MlzUSt8jo8XQlq0AgMm3J8Ln1OfmnBBg9U2DliGGY - UmGEON7pE1lVNtWAGD2IwlPK1fF6jhziGMxE8eR54QhnWtUatY5hpS5ixfCPmexsDHRLedOeDK6 - YOARsdLxabHqVJIiozbvqQzvsZnvJ33r7dkgfuXQBWHC6NMSIrvqZ+grOTOsX+evPLlZRMlCXsv - GGsZn1osgOt7Q2rMaWIYYhmsyhAj+6tue2ybNZ59ruVfl5k614igL+90NvoNz9LT5jkJgKiVWS5 - 8CAOVSGYAv9FU0eezXaItsHHkkCQBI360RnDKBzODx7iKNGcPa1FCZk3JArZzT53FC5yB4DxGN8 - IY04d3+m+23AcDMqZmma6wWliGGYcUMCWL/G+HJJsNbhkPtPBxrGwv5pcufAgDcrzlPXayX430w - D2GMTx/CQlkqqUzokGO8MpZGUwtagqbASTAScuZ8ATOVlGa7wT6Jnnb/QacTaO4CFR0JFsXiiXj - oGrte3lUHgJ2/29ly46BliGG4LoY0YvLoZMgyjr9zXCKyTrEozuemsEfRjtEZfUq+4MvWjFxojd - ympTNqamq+iKjP8LJlln6VGQGxkj4hpS2lbJYeXC++xZuQpOxjO2hCi3f0lSxVtAOWIYahLQxpB - KXmijJjQed1R9nbptbNAhbbgRBoQYomxAobW0M5jvuWrpGQRj7MyFlsYg6RSDCS863ZnZf3EmuF - VcNPDMv9/FNKsfsPHAoxf/RFmbpWLLBtVa5JNvY90FcHWpueYRliGNrKkC/+90Ud8EucLjR7dtQ - 3qALLaCz7vsT9nO6V7vVXcqBi6jYUqHB7wyvCDWccz6kGpFU1ZqNCENWaKAWOMjZzn8RsbOTDgU - Ohz690vZJWYBliGNr6i1/6r0zM9LQqVXGZI3yqeQjfZ4ae2SCWyaY3QbhldOB7kqHHEuGaSiNe+ - a3UXlh2zeiaKYOPS7nW19uA8dekPB3TXGf0xVEAgXKv1oCok+VOCcs2DbY2oWc5WIYYhrb4kOms - tFgWL0tUlf9QNB0ygcwoXw5XzQY3D9YBIK7M4MQZwM87HM1dSmzP1KgrFgv7joUFNjlwqSF5efV - 1YUHurFj32PYx75gdL+uUhbyuf6UZeq9WFznJv6KqL33fjYRliGFoiSGc0FLUxQW8VsolmsAa4U - VCSRnng1PlqBPFNO/gKnVs76RP6WRuo35q6HHJsqkKsPZOto7v2e1dY+QF8RkDfaqIdZCVmsOo+ - swIjbX/GwnLEMPQEkPatZoomdE47QsAoHX6aDRcm+B4X/K6YbT+oYxg/ZttopzKxsmhgF8zrzR0 - 0bDjhp/l8iL508s3lbcDliGGwf4ghsGIFXWONaxHAvgrDMVUhmGLEfuA4xoiT70rgQQdrteBr6X - bktcoF94G/GY6hrO5U9pipAEAz1mttmfFipXAMsQw3BD5fbVwuJbUGl868UJMXdNEa0eIdocLUJ - wH8souSfI8eV7DYcr2lPqDgUNlPtzKSqawIMXQ+3rn418PLEMMgxE+hNirCxkDQK82SrgqBqY5K - 1eZUanK+94ahrpaUfGCyCCDm0VMpDBImb4SaHKgD/FWFVVmMGFl6Tl3Qgpok0eXXwS5HbAMMQxG - MSSIsZekXNp7v8zKymzo0T26WpHO42MjNxsmGHWx6a6/rz/0uWDBi+coFJRdnDHLiI4rTqxQCmo - HLEMMgxFR1mJgMOQ1YHO7S14b1zQhQ5iHsLXoiM6g9SbTICDPdIRbiLw5kyqpNK72djNgGWIYjG - VIPB5e+cBrauvSdh5tGWKbEHMJFrn6HxDf0bNOfE+Na7cEWaFPT+m+oNMjip9J/pE90Xrz9GphG - WIYjGUIW/zZyMysOcrGuTjXVAwXjbgST0WjKbZ70nXkC77VFy9r/jEXZteC077W0NXCMsQwGJuH - NGJsp+QlfZqXsHWHKi4n1xS0YZvToWc+lPLr+U+k2BSqgV31MnNjvgfLEMNgjGWsFFytiM3WcZW - BOUWgoj6kqv/Ii00RXBm7GljViBFXwaD/d2IZYhiMjbKWgreUhlb3OAFz4CHZz6aGWHd4hTnHFc - WWjeBAeJKpKbAMMQy3HEO45Mfecfl3qNSyuB5iRtt/XP43hK5w3nK+4rcBNa7FZQIsQwyDMdFFq - xh9UZb+6HtIlr1wF8SHFM6JPsVGueDiMzej8W21sAwxDPYHMQy3nFNfCmltrKuWRDrhv0HlUMWV - 8Rrn1JsGyxDDYLS1XA927ZZWooL+MzC29sycuHmNCq3AMsQwfGt8CFHISwEqskbDWwPlkeVgGWJ - xczH20lidTXe3AixDLCwsLCwsviX4P68/8cprSSqmAAAAAElFTkSuQmCC -N:Mustermann;Heiko;;; -NICKNAME:clown -NOTE:I'm a friendly note text,\nplease copy me to your address book... -ORG:KDE -PHOTO;ENCODING=b;TYPE=image/png:iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pV - UAAAOW0lEQVR4nO1df2hb1xX+OlyQwQEJXJAgBQlaiEwDsdqO2l1H47RjMe2gbjOoszG2dozG7a - CYMIqTjS7NYKSmbE1StsQpWxMXmsSF1WhlTeSwJlZY06gsSVXWUAkakKAGPajBDxrQ/jjnez8k2 - 7EjJdyU+/0jPz29X9L57jnnO+deAxYWFhYWFhYWFu3Hbe082XT2ZF3+WgAAdHZ0AgBqTg0A4H7D - T7oAgNSdKQDAg99/sK33caPB53RqFQBA5PYIAMBdkOf6yc9+ct3P852W786irWjJMs/8+0wdACp - VsZTS50V5vSLb1UoVQMCCvnFDx0c65f3BHw4CABJ3RL19mwYfM4Y1e/+0V5h/VbbPXzwPACiVSg - AA15XnikVjAIB44Dli3TIKjL+2e0XPYxliGFZshSdzZ+r8OyKGjdl8AQCQfe84AKBaFUaUrojlR - LvEUpx5h0eGjo9EZH+kQ7Yz9/d71+vdkAYApO+W16d+/NQNZ8ye8T11ACiV5TkcR5jufCX3XyrL - c9XmxUe6bvi5XH3OaNRnSKRL9vWsywAAstNTyz6HZYhhsD+IYbjmMPDxfz6uA0BMqQcAR96eAgB - MvSevtTkJa6tzQnVSNn2XOLSZ03ljHHQ7MLxlSIa2kg5pOrTVHHHu/hANRDrke4t2y3cy+KgEMP - sP7F/0O7EMMQzXtNxLn16qA8DUu1nvvcm3DgEAFlxxbo4jFpFYK4woXix8qxhxLYxuH6sDQG5Gv - qNSueLtcxwdNTTASemoUTi3+HdkGWIYlrTkj2clzC1ckGRv3xv7vH2VK7QAlUDuktA0f/bG+YpL - 54WpDDXv7TdPbjm472AdACbe9L+r4mdMHuW+42uTAIByuWwZciugY6kdER3zzn8iMkFt3pc93Kv - yd0QzvHYxI5h8Qq/BiK1YLur78nJw4mBIznj2V88ueg+HjxyrA0BEdE7EumLePp773u/e25b7jy - bkfAObh7z3SleELS40SVZ/u+2F0ToA7H99PHRtyxDD0GQZZ9RKKxUZ+/YdmAAAFD4peJ9hbF2dq - 7aHGSpn12p+dJI7PQsAcDS3YcxfmZPXnrt65F40P+pd3wsgwF69x/xHedlWNkfX+PlUep0ck0om - AACxO+R10w82tfRch8leAJOas82ek+cho/sfkGtnT8xYhpiMJh9CiytVZayjYIgO37KCmWgrOPy - 3w3UAKKpsf/zd496+wkVhpOu5Lje0XS6X9X5lbJ49KxZIJqSSEu+Xrsj9V1Xw5OcBIPJBDoCfPw - 09IVn0sanpOgA8NXR9JYBILO7/rd8n/RV9SM1tPg6wDDEOTQxhFEKLYjbuBljBX9tjzyox/Q+xQ - OcrOf7I20cAAIVz+cCnVNJu8Alo3Nb43nEjoSfa8dIOAMDs6Zy+3wcAyM3kvCtUyZ6qXLd0WZj6 - zE+fAeAX4FZbYo5Fmt9zXfeanwEsQ4xDE0Nqbi203ZhztANVZUb2PdF+imqZLgLX0OvSd7lLbPO - +OFan1B8wGotEE3pCYfpWtX4A2L1rZ+gcHN+Pa8EtEpX3mR9tGlieKSf/dVJ9Ysl7j/fhMYTfuD - aANMIyxDA0Z+r6Qy7MC1Mi3lge1PijTYetBNNTkjUfOjQJAMi+LzE6S7nJtX50krknE74hZQZbi - jo19U7eKcfQAKuaP7lam+hRdZXl19kZX7Xe+PBG2acM7YzE9Bpi1UfeFN9G7Y6+77EfLR59UdGt - VX2G8D7IEPrf7PtZq2XdCmhiCBsUYnGxLJfxP5rzkI0Pb6wDwMypmWXHVupOk0eFEfQZIy+MAQB - 679OGhnSvd0yk4c5o4c7Xamlrwj7Nqck9uVf5eblGVnONqIY1W38+4h3DyJH1i6j6jFi3+B1GaP - m8RGFsa9qrqu7zI6KfHXtHmM8KKq8ZfNZg/rMcLEMMQ5NlH/zLwVDz28SbomVRUxI0RDZJZrqic - ibiYmHFz8Q6cmox6bR8bsfOVwD44ylzH47dgK9lTf5dqpOzZ0V1Hnh0AIDfXMdmO7Zx0h8MaO2a - TJtQf7D16Se9a9CS0+uEofQVmV7ZjqhPmXhrIvQcnV2doeemv6UfIysAeNoVg9TMfdLqZH3ILYI - lx36Oi/v+Knp+/mwhsFfHcR0X2W3Su0Gy4ZrG3tU5GaOHtwhzXv3jqwB8ZgFiaezamFVWAMDO30 - uOQAsjfvFL8QHpdFLOoPE8FQXG99UvxecMbhameOrCnB8tbh0WtjA3IZuYl6TXC1PoY/b9eRwAU - LhYDH3emXdD20EwX4p3SzS4VKWQsAwxDPYHMQxLlnDpJNlbSyEO8BvjvDKrJnZFlcxJ+biGkRT6 - Ynf45VMAqHypXfMa0uY+8JM2Fpycr+QzfQ+JM0+nhPoMBHit3FFxuHT6FB8rGsYnusWZVsoBAVO - HQzrlkoqlcW1qSyQkOMmsE+c9sk2Gy+d//Xzo+Ago40RD3wsARKMrG6oIyxDDsCRDOAtodLsU44 - Md3QtXKcnzLGELoXN7cos4y3jcl0QAYOFrOZ4ySLGooWqgOYBs4XVp+Qw9i2XZX1GyZtIJvQdhR - iIl23S4ntgYSNB67xcWTs2ouDmn97FRrlX6MlzUSt8jo8XQlq0AgMm3J8Ln1OfmnBBg9U2DliGG - YUmGEON7pE1lVNtWAGD2IwlPK1fF6jhziGMxE8eR54QhnWtUatY5hpS5ixfCPmexsDHRLedOeDK - 6YOARsdLxabHqVJIiozbvqQzvsZnvJ33r7dkgfuXQBWHC6NMSIrvqZ+grOTOsX+evPLlZRMlCXs - vGGsZn1osgOt7Q2rMaWIYYhmsyhAj+6tue2ybNZ59ruVfl5k614igL+90NvoNz9LT5jkJgKiVWS - 58CAOVSGYAv9FU0eezXaItsHHkkCQBI360RnDKBzODx7iKNGcPa1FCZk3JArZzT53FC5yB4DxGN - 8IY04d3+m+23AcDMqZmma6wWliGGYcUMCWL/G+HJJsNbhkPtPBxrGwv5pcufAgDcrzlPXayX430 - wD2GMTx/CQlkqqUzokGO8MpZGUwtagqbASTAScuZ8ATOVlGa7wT6Jnnb/QacTaO4CFR0JFsXiiX - joGrte3lUHgJ2/29ly46BliGG4LoY0YvLoZMgyjr9zXCKyTrEozuemsEfRjtEZfUq+4MvWjFxoj - dympTNqamq+iKjP8LJlln6VGQGxkj4hpS2lbJYeXC++xZuQpOxjO2hCi3f0lSxVtAOWIYahLQxp - BKXmijJjQed1R9nbptbNAhbbgRBoQYomxAobW0M5jvuWrpGQRj7MyFlsYg6RSDCS863ZnZf3Emu - FVcNPDMv9/FNKsfsPHAoxf/RFmbpWLLBtVa5JNvY90FcHWpueYRliGNrKkC/+90Ud8EucLjR7dt - Q3qALLaCz7vsT9nO6V7vVXcqBi6jYUqHB7wyvCDWccz6kGpFU1ZqNCENWaKAWOMjZzn8RsbOTDg - UOhz690vZJWYBliGNr6i1/6r0zM9LQqVXGZI3yqeQjfZ4ae2SCWyaY3QbhldOB7kqHHEuGaSiNe - +a3UXlh2zeiaKYOPS7nW19uA8dekPB3TXGf0xVEAgXKv1oCok+VOCcs2DbY2oWc5WIYYhrb4kOm - stFgWL0tUlf9QNB0ygcwoXw5XzQY3D9YBIK7M4MQZwM87HM1dSmzP1KgrFgv7joUFNjlwqSF5ef - V1YUHurFj32PYx75gdL+uUhbyuf6UZeq9WFznJv6KqL33fjYRliGFoiSGc0FLUxQW8VsolmsAa4 - UVCSRnng1PlqBPFNO/gKnVs76RP6WRuo35q6HHJsqkKsPZOto7v2e1dY+QF8RkDfaqIdZCVmsOo - +swIjbX/GwnLEMPQEkPatZoomdE47QsAoHX6aDRcm+B4X/K6YbT+oYxg/ZttopzKxsmhgF8zrzR - 00bDjhp/l8iL508s3lbcDliGGwf4ghsGIFXWONaxHAvgrDMVUhmGLEfuA4xoiT70rgQQdrteBr6 - XbktcoF94G/GY6hrO5U9pipAEAz1mttmfFipXAMsQw3BD5fbVwuJbUGl868UJMXdNEa0eIdocLU - JwH8souSfI8eV7DYcr2lPqDgUNlPtzKSqawIMXQ+3rn418PLEMMgxE+hNirCxkDQK82SrgqBqY5 - K1eZUanK+94ahrpaUfGCyCCDm0VMpDBImb4SaHKgD/FWFVVmMGFl6Tl3Qgpok0eXXwS5HbAMMQx - GMSSIsZekXNp7v8zKymzo0T26WpHO42MjNxsmGHWx6a6/rz/0uWDBi+coFJRdnDHLiI4rTqxQCm - oHLEMMgxFR1mJgMOQ1YHO7S14b1zQhQ5iHsLXoiM6g9SbTICDPdIRbiLw5kyqpNK72djNgGWIYj - GVIPB5e+cBrauvSdh5tGWKbEHMJFrn6HxDf0bNOfE+Na7cEWaFPT+m+oNMjip9J/pE90Xrz9Gph - GWIYjGUIW/zZyMysOcrGuTjXVAwXjbgST0WjKbZ70nXkC77VFy9r/jEXZteC077W0NXCMsQwGJu - HNGJsp+QlfZqXsHWHKi4n1xS0YZvToWc+lPLr+U+k2BSqgV31MnNjvgfLEMNgjGWsFFytiM3WcZ - WBOUWgoj6kqv/Ii00RXBm7GljViBFXwaD/d2IZYhiMjbKWgreUhlb3OAFz4CHZz6aGWHd4hTnHF - cWWjeBAeJKpKbAMMQy3HEO45Mfecfl3qNSyuB5iRtt/XP43hK5w3nK+4rcBNa7FZQIsQwyDMdFF - qxh9UZb+6HtIlr1wF8SHFM6JPsVGueDiMzej8W21sAwxDPYHMQy3nFNfCmltrKuWRDrhv0HlUMW - V8Rrn1JsGyxDDYLS1XA927ZZWooL+MzC29sycuHmNCq3AMsQwfGt8CFHISwEqskbDWwPlkeVgGW - JxczH20lidTXe3AixDLCwsLCwsviX4P68/8cprSSqmAAAAAElFTkSuQmCC -ROLE:Developer -SOUND;ENCODING=b:UklGRiQgAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAgAA - B/f39/f39/f39/f39/f4B/gH+Af4CAgIGBgYGBgYGBgYGBgYGBgYGBgIGAgICBgYGBgYGBgYCAg - YGAgICAgICAgIGBgICAgYCAgICBgICAgICAgICAgIGAgICAgYCAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAf4CAgICAgICAgICAgICAgIB/f4CAgICAgICAgIB/f4B/f39/f39/f3+AgICAf4CAf3 - 9/gIB/f4CAgH9/gICAgH+AgICAgICAgICAf4CAgIB/gICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgIB/gICAf39/f39/f3+Af4CAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgH9/f39/f39/f39/f39/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgYCAgICB - gICAgYGBgICAgICAgICAgIGAgICBgICBgYGBgYGBgYGAgYGBgYCBgYGBgYGBgYGBgYGBgYGBgYG - BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgICAgYGBgIGBgYGAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYGAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgH+AgICAgICAgICAgICAgICAgICAf4CAgIB/gH+Af4B/f39/f39/f - 39/f39/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgYG - BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgY - GBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAgIGBgYCAgICBgYCAgYGBgYCAgICBg - YCAgICAgICAgICAgICAgIGAgICAgICAgICAgICAgYGBgYGAgICAgIGBgYCAgICBgYGAgICAgIGA - gICAgICAgIGBgYCBgYGAgYGBgYGBgoGBgYGCgoGAgICBgYGBgYCBgYKCgYGBgYGBgYGAgYGBgH9 - /gIB/f3+AgIB/gH9/gICAf4CBgYB/f35+gIB/f4CBgX9/gYCAgYKCgYCAgYOBgICAgoGAf4GCgn - 9/gIB/gICBgH5/f4GAfX+BgYB+fn9/fn+Afn6Af39+f35+fn9+fn6AgH9/f4CAgYCAgYKCgH9/g - IKBf3+AgYJ/f4GCg4F/gIGCgoOBfoCDgYF/fH+BgYGAfn6Af4CCgn58gIN/fX+AgICBgYGAgYCB - goOCgICBgYB/fXyBhIGAgH5+f4GBgX9/f35+gIKCgXt9goN/f318f4GAf4B/fHt9fn5+fXx+fn5 - /gH9+fHx/gHx9f4CAfn18gIB9e4GBfn5+foCBfHyAgoGAfX6CgYCBgH+DgHt9gYN/fX2BhYB7en - 6AgH98foKCgH18foCAfoCAf4CAf31+fn+AgH1+goJ/fX5/gIKAgIGAfH6CgX17foCBf3+BgoB/g - YOBgIB/f4KDgoJ+e3+ChIOBfn1/gX+BfX2BgH59foCCfn1/gX99fICAgoB/f39/gISCf36AgoSB - foCBgYGAf4CCf4CCgX5/gYKDgYB/gH+BhIOBgYB/gIOEhIF9foGCg4OBgICBgoOCgICChIOBg4O - CgoSDgoKAgYKBgoODhISBf4CCg4SEgoGCg4SEgH6BhIWEgX+EhYKAgoKFhIB+gIKChYKAgYOCgo - B+gYWFhIKAg4WEg4ODhIWFhYaGhIWGhYWGh4eHhYOCgoSFg4B/gIB+fX1+fn57e3t7fHt6fH5/f - 4GDhYiMkJGQj5GVmZycmZiXlZGIfXRwcnZ4d3Nva2hoamppaWxvc3R0dXl+iJCPjZShqrCzvNHi - rFYxOmKSrJ6UmJOAbV1ZboSMjI6JfnNjW2JweYGFg4B/e3Z0c3Btc3p9fHp4fIGBf3+Dh4qLjJG - YnZuWkY6MhnpwbnN6fHlya2hlZmdmaW9ycXFzd3t/g42cpquzvMzd/sRADiBZkL6xpLa1jFpANV - iHoJ2ioJWGbEQ2VHaOm5aHhIFuYmZzgoVxZFxfdJCSgnt/kKewr7bDsopcSV6JopyRjpOQfmNXZ - HmGhYB8fXtvXExKXnyKgnJsc3t8fZC0ysfK0+vHTxEeXY6yr6rAxJRSNTdbh5+fp7KjglQ6PVx3 - ho6Ph3dmW15oa2x0hIuNkK3R18jJ0Ys8LUlxkqais8WtdlBFT2yDjpywro9mS0VVaXaBiIdyX2J - rcG5udYKKjaXT4dfV2Y82JkBpiaKkvdO2eE9GTGZ4hZu6u51yTUNOX2l9kZWKdl5PXG93dHeAip - KZut7j2tacRjJIYHCOo77XvoRdVlFYZniVuL+kfl9ST1Rcb4mTjoNxW1pqdXd5fH6CiKHN4d7k2 - 4E4N05Yaoqo1eO0emVbTU5ZdKDCuZV9b1tMSVlyiYp8dHl7cmpqdYCCgIqixNTR2OqnRTlPXFt3 - ksbnw4lzcFdKS2KMtLWZiIZwV0lPZXZ1b3uNinZqbXJ3dX2XxOPg4/zDUDRCTUhmiMXx1p+If1g - +O1J7pK+yspN3W0pGVGdugYmCen54b21rb3V9i6vZ7vD92WpAS0gzSny04tq3qp5qPDhHX3uVrs - KukXVhT0hRYnF/gnuCh31ubG9zdHeMs+Dr8P7KalFVOylJeq7QzMPIqmtIRUZOY4KovqicknhZS - 1BWXWh6gIeLiH91b21vc4GcyuXt/umTZGhGIjJfh6y+yt7LkGlfTD1GYYOipKKwnXhkXldVUFhs - dYOMjYWBem9ucoCWvNTm9+2weHdZMSpQboujvtnUrY6BZEdDUmV4jZypppeFd2dcWVFWWWh8hYS - Ii393c3Z7iJ3A1ePp3aGDfVYyOVZkfJe5zsavpJNsU1BTVmR9kpmcn5uGdGxoWU5VVGZ0fIKLh4 - F/d3Z6g4ufuc3e3depjoViPz9VWm2FqLu8tLGifmphWlJZbH+Lj5+elod+c19WU0xUZW11gISEg - nx6e3h6g4qWp7zM3NrSpZGIYkRFVVVlfZ6vsbW3qIl7b2BUWGVwe4ybn52TkIRuX2BVRVFjZmp7 - hIF9fX12cnZ6eX6LlZyousfP0c++jot6X0ZRXF9sgaCnqa6yn4eAdGZZYGlvd4mcnqCWnY91aWN - cSUtYYmJxf399f351cXFzcHF4foOIlZ+hp7CytLm8uLKNg4RtYF5oanN8j5qZnqGaioV9dGpqb3 - J1f42Rk5iZjIKAcmFcW1RXYGhwdXt+e3Z2c25tcXJxd3yChY2Tl5udn6Gho6ioq6uonoaHbWNzZ - GdxgoGPlZqdj5CJgHFzcWxwdH1/hYqOioSFfnFpaWBdX2Jqb3N5fHh4eHNxcXFxc3d7foOJjI6Q - lZOSlZOTl5eYnJucnpyZkYiEfnd1dnZ5fYKHio6QkIyHg394dHRzc3Z5fHt2enJrcG5obG9sbW9 - ucHJzdnh3eXp5eXt9foCDhoeJjI6OkJGSk5aYmZudn6Gjn5qLh4J3cnJ0dHR5g4GEi42Ih4aBfH - h4dXR1eHl4dXhuaW5rZ2ltaWttbW5vcnR1dHZ2dXV2d3d7fn+BhIeIiYuOjpCTlJWZnJueoKarr - ZuJhntvaW1ucnh+hIWJi4qFg4F7d3V1c3R3fH1/gHlvbXJnXmdpYmdtamtxcW9vbm9tamxtbG5z - dXZ5fHx7fX9+fH6AgoWHioyNj5CRlZeYmp2TiYyGenp9eXh9fX19foB/fH1/e3p8e3l5e3x7e3x - 6d3FxcnBwcG9vb29vb29wb25tbWxsbW5vb3Fyc3N1dXV1dnd4ent9fn+BgoGAgoWEhoqJiYyLi4 - yPioaLiYSEh4WDhIOCgoKAgX58fXx5eXp4eHl4dXZ1cnN0dHR1cnJycXBxcnJycW9ubGxsbW1ub - m5ub29vcXNzdHZ2dXh6enp+fn5/gYCBhIKFiYeGiomJi4qKjIuLjIyLiomKh4aKioeIiIWDgYB9 - fHx7e3l4eHh2dnd3d3l7enp6enp5ent7e3x7enl6e3t7fHx7e3p8fX5/gIKDg4GCg4KCg4OEhoe - Hh4iJiomLjIqLi4uLi46Pjo2OjouJiomHh4aDgH9/fXp5eXh3d3h4eHh4d3V2d3Z0dnd0dXd3d3 - p7fH59fX19fH5+fn+Af4CAf3+Af359f4KDgoSIiIeJjI6PkJOUk5SYmZiYmZqZmJqamJiZmJaWl - ZSTkZCQj46Ni4qHh4iFgoKBfn9+fn+AgYCAgYOCgoSEg4SFhIODg4OCgICBf35/gICAgYKCgYGD - hIOBgYOCgYGAgIGBgIGCgoKBgoSEg4KCgH9/f318fHt6e3t7enl5eHh5fH18foCAf4GDg4OFhoa - GhoeJh4aJioiIiYiIhoWGh4aGh4eHiImHh4mIiIeHh4iIiIqJioqJh4mKh4eJiYiHh4eHhoWGhY - OEhYWEhYWDg4SFhYWEg4SDgYKCgH+AgICBgoOCgYGBgYKEhoaGhoiIh4eJiYmKioqKiomKioiJi - oqJiYmJiIiIiYiHh4eHh4eGhYWFhISDgoKCgoKCgYGAf31+fXx9fn58e3x8fHx9fX19fX19fX19 - fHx9fn5/gICBgYGCgoKCg4OCgoODgoKDg4OCgoKCgoGBgYGBgYGCgYCBgIGCgoKDg4KCg4OEhIS - FhYWFhYWFhYWFhoWGhoWEhISDg4ODg4ODg4ODg4SDgoKDg4OCg4SDgoKDgoGBgoGAgIB/f35+fn - 9+fn9/f35+fn5/gICAgIGBgYKCg4ODg4SEg4OEhIODhIODhIODg4ODg4OCgoKBgoKCg4OCgoODg - 4ODg4OEhISEhIWEhIWFhISEhISEhIWEhISEhIODhISEg4ODg4ODg4ODg4ODgoKCgoKCg4KCgoKC - goKCgoKCgoOCgoKCgoKBgYKCgoKCgoGBgYGAgICAgYGBgYCAf39/f39/f3+Af39/f39/f39/gIC - AgIB/f39/f39/gICAgIB/f39/gIB/f39/gH9/f39/f39/fn5+f39/f39/fn5+fn5/f39/f39/fn - 5+fn9/f39/f35+fn5+fn9/f35/f39+fn5+fn9/fn5+fn5+fn5+f39+fn5+fn19fX5+fn5+fn5+f - X5+fn5+fn5+fn19fn5+fn5+fX19fX59fn5+fn19fX19fX1+fX19fX19fX19fX19fX19fX19fX19 - fX19fX19fX19fX19fX19fX19fX19fX19fXx9fX18fH19fXx8fXx9fXx8fHx8fHx8fH19fX19fXx - 9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX - 19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f - X19fX19fX19fX19fX19fX19fX19fX19fX1+fX5+fn19fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ - fn5+fn5+fn5+fn5+f39/fn5/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f3 - 9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f - 39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/ - f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 - 9/f39/f39/f39/f39/f39/f35+fn5+f35/f39/f39/f39/f39/f39/f39/f39/f39/f39/f35+f - 39+fn5/fn5+f39/fn9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/ - f39/f39/f39/f39/f39+fn9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f4CAf39/f39/f39/gIB/f39/f39/f4B/f4CAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgIB/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAgIC - AgICAgICAgICAgICAgICAgICAgICAgIGBgYGAgYGBgICAgIGAgICBgYGAgYGBgYGBgYGBgYGBgY - GBgYGBgYGBgYGBgYGBgYGAgYCAgICAgICAgICAgICAgICAgICAgICAgICAgH+AgICAf39/gH9/f - 3+Af39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4CAgH9/gIB/f39/f4B/f3+AgICAf4CA - gICAgICAgICAgICAgH9/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgIB/f39/f39/f39/f4CAf39/f39/f39/f39/f39/f39+fn - 9/fn5+fn5+fn5+fn5+fX19fX19fX19fX19fX19fX19fn5+fn5+fn9/f39/f4CAgICAgICBgYGBg - YGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICAgICAgICAgICAgICAgYGAgICA - gICAgICAgICAgICBgYGAgICAgICAgICAgICAgICAgICAgICAgIB/gICAgH9/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAgICAf39/f39/gH+AgI - CAgICAgIB/f39/f39/f4B/f39/f39/f39/f39/f39/f39/f39/f39/f39/fn9/f39/f39/f39+f - 39/f39/f39/f39/f39/f39/f39/f4B/f4CAgICAf39/f39/gICAf39/gICAgICAgICAgICAgICA - gICAgIGAgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICBgYGBgYGBgYCBgYGBgYCAgIG - BgICAgICAgICAgICAgICAgICAgICAgICAgICBgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAf3+AgIB/f4CAf39/f39/f3+AgICAgH+AgICAf3+AgICAgICAgH9/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 - 9/f39/f39/gH9/gICAgICAgICAgIB/gICAgH+AgIB/f39/f39/gICAgICAgH9/f3+AgH9/f4B/f - 39/f39/f39/f39/f3+AgICAgICAf3+AgIB/f4CAgIB/f4CAgICAgICAgICAf39/f3+AgIB/f4CA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAf39/f39 - /f4CAgH9/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f39/f39/gIB/f39/f39/f39/gH9/f3 - 9/f4CAgICAgIB/gICAgICAgICAgICAgICAgICAgICAgICAgH+AgICAf4CAgICAgICAgIB/gICAf - 4CAgICAgH+Af4CAgH9/f39/f39/f39/gICAgICAgICAgICAf39/f39/f4CAgH9/gICAf3+AgICA - gICAgICAgICAgICAgICAgICAgIB/f39/gIB/f4CAgIB/f4CAgH9/gICAf39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 - 9/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAf39/gH9/f3+AgH9/f39/f39/f39/f39/f - 39/f39/f39/f39/f39/f39/f39/gICAf3+AgH9/f3+AgH9/f4CAgH9/gICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICBgYGBgIGBgYCAgYGAgICAgYCAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAf39/f39/f4CAgIB/f4CAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAf39/f3+Af39/f39/f39/f4B/f39/f4CAgICAgICAgICAgA== -TEL;TYPE=HOME:0351 223344 -TEL;TYPE=WORK:0351 443322 -TEL;TYPE=CELL:0173 223344 -UID:P9HXg34Oav -URL:http://www.mustermann.de/~heiko/ -VERSION:3.0 -X-KADDRESSBOOK-X-Anniversary:1982-07-07 -X-KADDRESSBOOK-X-AssistantsName:Mr. Smithers -X-KADDRESSBOOK-X-Department:Edutainment -X-KADDRESSBOOK-X-IMAddress:122334455 -X-KADDRESSBOOK-X-ManagersName:Mr. Burnes -X-KADDRESSBOOK-X-Office:223 2nd stage -X-KADDRESSBOOK-X-Profession:Clown -X-KADDRESSBOOK-X-SpousesName:femal clown -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard5.vcf.ref b/kabc/vcardparser/tests/vcard5.vcf.ref deleted file mode 100644 index 712b49494..000000000 --- a/kabc/vcardparser/tests/vcard5.vcf.ref +++ /dev/null @@ -1,313 +0,0 @@ -BEGIN:VCARD -ADR;TYPE=home;TYPE=pref:;;Buehlauer Strasse 45;Dresden;Sachsen;01327;German - y -ADR;TYPE=work:;;Prager Strasse 55;Dresden;Sachsen;01066;Germany -BDAY:1955-07-19T00:00:00Z -CATEGORIES:Friend -CLASS:CONFIDENTIAL -EMAIL;TYPE=PREF:heiko.mustermann@freenet.org -EMAIL:heiko8@tst.inf.tu-dresden.de -FN:Mustermann, Heiko -GEO:19.283333;166.616669 -LOGO;ENCODING=b;TYPE=image/png:iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVU - AAAOW0lEQVR4nO1df2hb1xX+OlyQwQEJXJAgBQlaiEwDsdqO2l1H47RjMe2gbjOoszG2dozG7aC - YMIqTjS7NYKSmbE1StsQpWxMXmsSF1WhlTeSwJlZY06gsSVXWUAkakKAGPajBDxrQ/jjnez8k27 - EjJdyU+/0jPz29X9L57jnnO+deAxYWFhYWFhYWFu3Hbe082XT2ZF3+WgAAdHZ0AgBqTg0A4H7DT - 7oAgNSdKQDAg99/sK33caPB53RqFQBA5PYIAMBdkOf6yc9+ct3P852W786irWjJMs/8+0wdACpV - sZTS50V5vSLb1UoVQMCCvnFDx0c65f3BHw4CABJ3RL19mwYfM4Y1e/+0V5h/VbbPXzwPACiVSgA - A15XnikVjAIB44Dli3TIKjL+2e0XPYxliGFZshSdzZ+r8OyKGjdl8AQCQfe84AKBaFUaUrojlRL - vEUpx5h0eGjo9EZH+kQ7Yz9/d71+vdkAYApO+W16d+/NQNZ8ye8T11ACiV5TkcR5jufCX3XyrLc - 9XmxUe6bvi5XH3OaNRnSKRL9vWsywAAstNTyz6HZYhhsD+IYbjmMPDxfz6uA0BMqQcAR96eAgBM - vSevtTkJa6tzQnVSNn2XOLSZ03ljHHQ7MLxlSIa2kg5pOrTVHHHu/hANRDrke4t2y3cy+KgEMPs - P7F/0O7EMMQzXtNxLn16qA8DUu1nvvcm3DgEAFlxxbo4jFpFYK4woXix8qxhxLYxuH6sDQG5Gvq - NSueLtcxwdNTTASemoUTi3+HdkGWIYlrTkj2clzC1ckGRv3xv7vH2VK7QAlUDuktA0f/bG+YpL5 - 4WpDDXv7TdPbjm472AdACbe9L+r4mdMHuW+42uTAIByuWwZciugY6kdER3zzn8iMkFt3pc93Kvy - d0QzvHYxI5h8Qq/BiK1YLur78nJw4mBIznj2V88ueg+HjxyrA0BEdE7EumLePp773u/e25b7jyb - kfAObh7z3SleELS40SVZ/u+2F0ToA7H99PHRtyxDD0GQZZ9RKKxUZ+/YdmAAAFD4peJ9hbF2dq7 - aHGSpn12p+dJI7PQsAcDS3YcxfmZPXnrt65F40P+pd3wsgwF69x/xHedlWNkfX+PlUep0ck0omA - ACxO+R10w82tfRch8leAJOas82ek+cho/sfkGtnT8xYhpiMJh9CiytVZayjYIgO37KCmWgrOPy3 - w3UAKKpsf/zd496+wkVhpOu5Lje0XS6X9X5lbJ49KxZIJqSSEu+Xrsj9V1Xw5OcBIPJBDoCfPw0 - 9IVn0sanpOgA8NXR9JYBILO7/rd8n/RV9SM1tPg6wDDEOTQxhFEKLYjbuBljBX9tjzyox/Q+xQO - crOf7I20cAAIVz+cCnVNJu8Alo3Nb43nEjoSfa8dIOAMDs6Zy+3wcAyM3kvCtUyZ6qXLd0WZj6z - E+fAeAX4FZbYo5Fmt9zXfeanwEsQ4xDE0Nqbi203ZhztANVZUb2PdF+imqZLgLX0OvSd7lLbPO+ - OFan1B8wGotEE3pCYfpWtX4A2L1rZ+gcHN+Pa8EtEpX3mR9tGlieKSf/dVJ9Ysl7j/fhMYTfuDa - ANMIyxDA0Z+r6Qy7MC1Mi3lge1PijTYetBNNTkjUfOjQJAMi+LzE6S7nJtX50krknE74hZQZbij - o19U7eKcfQAKuaP7lam+hRdZXl19kZX7Xe+PBG2acM7YzE9Bpi1UfeFN9G7Y6+77EfLR59UdGtV - X2G8D7IEPrf7PtZq2XdCmhiCBsUYnGxLJfxP5rzkI0Pb6wDwMypmWXHVupOk0eFEfQZIy+MAQB6 - 79OGhnSvd0yk4c5o4c7Xamlrwj7Nqck9uVf5eblGVnONqIY1W38+4h3DyJH1i6j6jFi3+B1GaPm - 8RGFsa9qrqu7zI6KfHXtHmM8KKq8ZfNZg/rMcLEMMQ5NlH/zLwVDz28SbomVRUxI0RDZJZrqici - biYmHFz8Q6cmox6bR8bsfOVwD44ylzH47dgK9lTf5dqpOzZ0V1Hnh0AIDfXMdmO7Zx0h8MaO2aT - JtQf7D16Se9a9CS0+uEofQVmV7ZjqhPmXhrIvQcnV2doeemv6UfIysAeNoVg9TMfdLqZH3ILYIl - x36Oi/v+Knp+/mwhsFfHcR0X2W3Su0Gy4ZrG3tU5GaOHtwhzXv3jqwB8ZgFiaezamFVWAMDO30u - OQAsjfvFL8QHpdFLOoPE8FQXG99UvxecMbhameOrCnB8tbh0WtjA3IZuYl6TXC1PoY/b9eRwAUL - hYDH3emXdD20EwX4p3SzS4VKWQsAwxDPYHMQxLlnDpJNlbSyEO8BvjvDKrJnZFlcxJ+biGkRT6Y - nf45VMAqHypXfMa0uY+8JM2Fpycr+QzfQ+JM0+nhPoMBHit3FFxuHT6FB8rGsYnusWZVsoBAVOH - QzrlkoqlcW1qSyQkOMmsE+c9sk2Gy+d//Xzo+Ago40RD3wsARKMrG6oIyxDDsCRDOAtodLsU44M - d3QtXKcnzLGELoXN7cos4y3jcl0QAYOFrOZ4ySLGooWqgOYBs4XVp+Qw9i2XZX1GyZtIJvQdhRi - Il23S4ntgYSNB67xcWTs2ouDmn97FRrlX6MlzUSt8jo8XQlq0AgMm3J8Ln1OfmnBBg9U2DliGGY - UmGEON7pE1lVNtWAGD2IwlPK1fF6jhziGMxE8eR54QhnWtUatY5hpS5ixfCPmexsDHRLedOeDK6 - YOARsdLxabHqVJIiozbvqQzvsZnvJ33r7dkgfuXQBWHC6NMSIrvqZ+grOTOsX+evPLlZRMlCXsv - GGsZn1osgOt7Q2rMaWIYYhmsyhAj+6tue2ybNZ59ruVfl5k614igL+90NvoNz9LT5jkJgKiVWS5 - 8CAOVSGYAv9FU0eezXaItsHHkkCQBI360RnDKBzODx7iKNGcPa1FCZk3JArZzT53FC5yB4DxGN8 - IY04d3+m+23AcDMqZmma6wWliGGYcUMCWL/G+HJJsNbhkPtPBxrGwv5pcufAgDcrzlPXayX430w - D2GMTx/CQlkqqUzokGO8MpZGUwtagqbASTAScuZ8ATOVlGa7wT6Jnnb/QacTaO4CFR0JFsXiiXj - oGrte3lUHgJ2/29ly46BliGG4LoY0YvLoZMgyjr9zXCKyTrEozuemsEfRjtEZfUq+4MvWjFxojd - ympTNqamq+iKjP8LJlln6VGQGxkj4hpS2lbJYeXC++xZuQpOxjO2hCi3f0lSxVtAOWIYahLQxpB - KXmijJjQed1R9nbptbNAhbbgRBoQYomxAobW0M5jvuWrpGQRj7MyFlsYg6RSDCS863ZnZf3EmuF - VcNPDMv9/FNKsfsPHAoxf/RFmbpWLLBtVa5JNvY90FcHWpueYRliGNrKkC/+90Ud8EucLjR7dtQ - 3qALLaCz7vsT9nO6V7vVXcqBi6jYUqHB7wyvCDWccz6kGpFU1ZqNCENWaKAWOMjZzn8RsbOTDgU - Ohz690vZJWYBliGNr6i1/6r0zM9LQqVXGZI3yqeQjfZ4ae2SCWyaY3QbhldOB7kqHHEuGaSiNe+ - a3UXlh2zeiaKYOPS7nW19uA8dekPB3TXGf0xVEAgXKv1oCok+VOCcs2DbY2oWc5WIYYhrb4kOms - tFgWL0tUlf9QNB0ygcwoXw5XzQY3D9YBIK7M4MQZwM87HM1dSmzP1KgrFgv7joUFNjlwqSF5efV - 1YUHurFj32PYx75gdL+uUhbyuf6UZeq9WFznJv6KqL33fjYRliGFoiSGc0FLUxQW8VsolmsAa4U - VCSRnng1PlqBPFNO/gKnVs76RP6WRuo35q6HHJsqkKsPZOto7v2e1dY+QF8RkDfaqIdZCVmsOo+ - swIjbX/GwnLEMPQEkPatZoomdE47QsAoHX6aDRcm+B4X/K6YbT+oYxg/ZttopzKxsmhgF8zrzR0 - 0bDjhp/l8iL508s3lbcDliGGwf4ghsGIFXWONaxHAvgrDMVUhmGLEfuA4xoiT70rgQQdrteBr6X - bktcoF94G/GY6hrO5U9pipAEAz1mttmfFipXAMsQw3BD5fbVwuJbUGl868UJMXdNEa0eIdocLUJ - wH8souSfI8eV7DYcr2lPqDgUNlPtzKSqawIMXQ+3rn418PLEMMgxE+hNirCxkDQK82SrgqBqY5K - 1eZUanK+94ahrpaUfGCyCCDm0VMpDBImb4SaHKgD/FWFVVmMGFl6Tl3Qgpok0eXXwS5HbAMMQxG - MSSIsZekXNp7v8zKymzo0T26WpHO42MjNxsmGHWx6a6/rz/0uWDBi+coFJRdnDHLiI4rTqxQCmo - HLEMMgxFR1mJgMOQ1YHO7S14b1zQhQ5iHsLXoiM6g9SbTICDPdIRbiLw5kyqpNK72djNgGWIYjG - VIPB5e+cBrauvSdh5tGWKbEHMJFrn6HxDf0bNOfE+Na7cEWaFPT+m+oNMjip9J/pE90Xrz9GphG - WIYjGUIW/zZyMysOcrGuTjXVAwXjbgST0WjKbZ70nXkC77VFy9r/jEXZteC077W0NXCMsQwGJuH - NGJsp+QlfZqXsHWHKi4n1xS0YZvToWc+lPLr+U+k2BSqgV31MnNjvgfLEMNgjGWsFFytiM3WcZW - BOUWgoj6kqv/Ii00RXBm7GljViBFXwaD/d2IZYhiMjbKWgreUhlb3OAFz4CHZz6aGWHd4hTnHFc - WWjeBAeJKpKbAMMQy3HEO45Mfecfl3qNSyuB5iRtt/XP43hK5w3nK+4rcBNa7FZQIsQwyDMdFFq - xh9UZb+6HtIlr1wF8SHFM6JPsVGueDiMzej8W21sAwxDPYHMQy3nFNfCmltrKuWRDrhv0HlUMWV - 8Rrn1JsGyxDDYLS1XA927ZZWooL+MzC29sycuHmNCq3AMsQwfGt8CFHISwEqskbDWwPlkeVgGWJ - xczH20lidTXe3AixDLCwsLCwsviX4P68/8cprSSqmAAAAAElFTkSuQmCC -N:Mustermann;Heiko;;; -NICKNAME:clown -NOTE:I'm a friendly note text,\nplease copy me to your address book... -ORG:KDE -PHOTO;ENCODING=b;TYPE=image/png:iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pV - UAAAOW0lEQVR4nO1df2hb1xX+OlyQwQEJXJAgBQlaiEwDsdqO2l1H47RjMe2gbjOoszG2dozG7a - CYMIqTjS7NYKSmbE1StsQpWxMXmsSF1WhlTeSwJlZY06gsSVXWUAkakKAGPajBDxrQ/jjnez8k2 - 7EjJdyU+/0jPz29X9L57jnnO+deAxYWFhYWFhYWFu3Hbe082XT2ZF3+WgAAdHZ0AgBqTg0A4H7D - T7oAgNSdKQDAg99/sK33caPB53RqFQBA5PYIAMBdkOf6yc9+ct3P852W786irWjJMs/8+0wdACp - VsZTS50V5vSLb1UoVQMCCvnFDx0c65f3BHw4CABJ3RL19mwYfM4Y1e/+0V5h/VbbPXzwPACiVSg - AA15XnikVjAIB44Dli3TIKjL+2e0XPYxliGFZshSdzZ+r8OyKGjdl8AQCQfe84AKBaFUaUrojlR - LvEUpx5h0eGjo9EZH+kQ7Yz9/d71+vdkAYApO+W16d+/NQNZ8ye8T11ACiV5TkcR5jufCX3XyrL - c9XmxUe6bvi5XH3OaNRnSKRL9vWsywAAstNTyz6HZYhhsD+IYbjmMPDxfz6uA0BMqQcAR96eAgB - MvSevtTkJa6tzQnVSNn2XOLSZ03ljHHQ7MLxlSIa2kg5pOrTVHHHu/hANRDrke4t2y3cy+KgEMP - sP7F/0O7EMMQzXtNxLn16qA8DUu1nvvcm3DgEAFlxxbo4jFpFYK4woXix8qxhxLYxuH6sDQG5Gv - qNSueLtcxwdNTTASemoUTi3+HdkGWIYlrTkj2clzC1ckGRv3xv7vH2VK7QAlUDuktA0f/bG+YpL - 54WpDDXv7TdPbjm472AdACbe9L+r4mdMHuW+42uTAIByuWwZciugY6kdER3zzn8iMkFt3pc93Kv - yd0QzvHYxI5h8Qq/BiK1YLur78nJw4mBIznj2V88ueg+HjxyrA0BEdE7EumLePp773u/e25b7jy - bkfAObh7z3SleELS40SVZ/u+2F0ToA7H99PHRtyxDD0GQZZ9RKKxUZ+/YdmAAAFD4peJ9hbF2dq - 7aHGSpn12p+dJI7PQsAcDS3YcxfmZPXnrt65F40P+pd3wsgwF69x/xHedlWNkfX+PlUep0ck0om - AACxO+R10w82tfRch8leAJOas82ek+cho/sfkGtnT8xYhpiMJh9CiytVZayjYIgO37KCmWgrOPy - 3w3UAKKpsf/zd496+wkVhpOu5Lje0XS6X9X5lbJ49KxZIJqSSEu+Xrsj9V1Xw5OcBIPJBDoCfPw - 09IVn0sanpOgA8NXR9JYBILO7/rd8n/RV9SM1tPg6wDDEOTQxhFEKLYjbuBljBX9tjzyox/Q+xQ - OcrOf7I20cAAIVz+cCnVNJu8Alo3Nb43nEjoSfa8dIOAMDs6Zy+3wcAyM3kvCtUyZ6qXLd0WZj6 - zE+fAeAX4FZbYo5Fmt9zXfeanwEsQ4xDE0Nqbi203ZhztANVZUb2PdF+imqZLgLX0OvSd7lLbPO - +OFan1B8wGotEE3pCYfpWtX4A2L1rZ+gcHN+Pa8EtEpX3mR9tGlieKSf/dVJ9Ysl7j/fhMYTfuD - aANMIyxDA0Z+r6Qy7MC1Mi3lge1PijTYetBNNTkjUfOjQJAMi+LzE6S7nJtX50krknE74hZQZbi - jo19U7eKcfQAKuaP7lam+hRdZXl19kZX7Xe+PBG2acM7YzE9Bpi1UfeFN9G7Y6+77EfLR59UdGt - VX2G8D7IEPrf7PtZq2XdCmhiCBsUYnGxLJfxP5rzkI0Pb6wDwMypmWXHVupOk0eFEfQZIy+MAQB - 679OGhnSvd0yk4c5o4c7Xamlrwj7Nqck9uVf5eblGVnONqIY1W38+4h3DyJH1i6j6jFi3+B1GaP - m8RGFsa9qrqu7zI6KfHXtHmM8KKq8ZfNZg/rMcLEMMQ5NlH/zLwVDz28SbomVRUxI0RDZJZrqic - ibiYmHFz8Q6cmox6bR8bsfOVwD44ylzH47dgK9lTf5dqpOzZ0V1Hnh0AIDfXMdmO7Zx0h8MaO2a - TJtQf7D16Se9a9CS0+uEofQVmV7ZjqhPmXhrIvQcnV2doeemv6UfIysAeNoVg9TMfdLqZH3ILYI - lx36Oi/v+Knp+/mwhsFfHcR0X2W3Su0Gy4ZrG3tU5GaOHtwhzXv3jqwB8ZgFiaezamFVWAMDO30 - uOQAsjfvFL8QHpdFLOoPE8FQXG99UvxecMbhameOrCnB8tbh0WtjA3IZuYl6TXC1PoY/b9eRwAU - LhYDH3emXdD20EwX4p3SzS4VKWQsAwxDPYHMQxLlnDpJNlbSyEO8BvjvDKrJnZFlcxJ+biGkRT6 - Ynf45VMAqHypXfMa0uY+8JM2Fpycr+QzfQ+JM0+nhPoMBHit3FFxuHT6FB8rGsYnusWZVsoBAVO - HQzrlkoqlcW1qSyQkOMmsE+c9sk2Gy+d//Xzo+Ago40RD3wsARKMrG6oIyxDDsCRDOAtodLsU44 - Md3QtXKcnzLGELoXN7cos4y3jcl0QAYOFrOZ4ySLGooWqgOYBs4XVp+Qw9i2XZX1GyZtIJvQdhR - iIl23S4ntgYSNB67xcWTs2ouDmn97FRrlX6MlzUSt8jo8XQlq0AgMm3J8Ln1OfmnBBg9U2DliGG - YUmGEON7pE1lVNtWAGD2IwlPK1fF6jhziGMxE8eR54QhnWtUatY5hpS5ixfCPmexsDHRLedOeDK - 6YOARsdLxabHqVJIiozbvqQzvsZnvJ33r7dkgfuXQBWHC6NMSIrvqZ+grOTOsX+evPLlZRMlCXs - vGGsZn1osgOt7Q2rMaWIYYhmsyhAj+6tue2ybNZ59ruVfl5k614igL+90NvoNz9LT5jkJgKiVWS - 58CAOVSGYAv9FU0eezXaItsHHkkCQBI360RnDKBzODx7iKNGcPa1FCZk3JArZzT53FC5yB4DxGN - 8IY04d3+m+23AcDMqZmma6wWliGGYcUMCWL/G+HJJsNbhkPtPBxrGwv5pcufAgDcrzlPXayX430 - wD2GMTx/CQlkqqUzokGO8MpZGUwtagqbASTAScuZ8ATOVlGa7wT6Jnnb/QacTaO4CFR0JFsXiiX - joGrte3lUHgJ2/29ly46BliGG4LoY0YvLoZMgyjr9zXCKyTrEozuemsEfRjtEZfUq+4MvWjFxoj - dympTNqamq+iKjP8LJlln6VGQGxkj4hpS2lbJYeXC++xZuQpOxjO2hCi3f0lSxVtAOWIYahLQxp - BKXmijJjQed1R9nbptbNAhbbgRBoQYomxAobW0M5jvuWrpGQRj7MyFlsYg6RSDCS863ZnZf3Emu - FVcNPDMv9/FNKsfsPHAoxf/RFmbpWLLBtVa5JNvY90FcHWpueYRliGNrKkC/+90Ud8EucLjR7dt - Q3qALLaCz7vsT9nO6V7vVXcqBi6jYUqHB7wyvCDWccz6kGpFU1ZqNCENWaKAWOMjZzn8RsbOTDg - UOhz690vZJWYBliGNr6i1/6r0zM9LQqVXGZI3yqeQjfZ4ae2SCWyaY3QbhldOB7kqHHEuGaSiNe - +a3UXlh2zeiaKYOPS7nW19uA8dekPB3TXGf0xVEAgXKv1oCok+VOCcs2DbY2oWc5WIYYhrb4kOm - stFgWL0tUlf9QNB0ygcwoXw5XzQY3D9YBIK7M4MQZwM87HM1dSmzP1KgrFgv7joUFNjlwqSF5ef - V1YUHurFj32PYx75gdL+uUhbyuf6UZeq9WFznJv6KqL33fjYRliGFoiSGc0FLUxQW8VsolmsAa4 - UVCSRnng1PlqBPFNO/gKnVs76RP6WRuo35q6HHJsqkKsPZOto7v2e1dY+QF8RkDfaqIdZCVmsOo - +swIjbX/GwnLEMPQEkPatZoomdE47QsAoHX6aDRcm+B4X/K6YbT+oYxg/ZttopzKxsmhgF8zrzR - 00bDjhp/l8iL508s3lbcDliGGwf4ghsGIFXWONaxHAvgrDMVUhmGLEfuA4xoiT70rgQQdrteBr6 - XbktcoF94G/GY6hrO5U9pipAEAz1mttmfFipXAMsQw3BD5fbVwuJbUGl868UJMXdNEa0eIdocLU - JwH8souSfI8eV7DYcr2lPqDgUNlPtzKSqawIMXQ+3rn418PLEMMgxE+hNirCxkDQK82SrgqBqY5 - K1eZUanK+94ahrpaUfGCyCCDm0VMpDBImb4SaHKgD/FWFVVmMGFl6Tl3Qgpok0eXXwS5HbAMMQx - GMSSIsZekXNp7v8zKymzo0T26WpHO42MjNxsmGHWx6a6/rz/0uWDBi+coFJRdnDHLiI4rTqxQCm - oHLEMMgxFR1mJgMOQ1YHO7S14b1zQhQ5iHsLXoiM6g9SbTICDPdIRbiLw5kyqpNK72djNgGWIYj - GVIPB5e+cBrauvSdh5tGWKbEHMJFrn6HxDf0bNOfE+Na7cEWaFPT+m+oNMjip9J/pE90Xrz9Gph - GWIYjGUIW/zZyMysOcrGuTjXVAwXjbgST0WjKbZ70nXkC77VFy9r/jEXZteC077W0NXCMsQwGJu - HNGJsp+QlfZqXsHWHKi4n1xS0YZvToWc+lPLr+U+k2BSqgV31MnNjvgfLEMNgjGWsFFytiM3WcZ - WBOUWgoj6kqv/Ii00RXBm7GljViBFXwaD/d2IZYhiMjbKWgreUhlb3OAFz4CHZz6aGWHd4hTnHF - cWWjeBAeJKpKbAMMQy3HEO45Mfecfl3qNSyuB5iRtt/XP43hK5w3nK+4rcBNa7FZQIsQwyDMdFF - qxh9UZb+6HtIlr1wF8SHFM6JPsVGueDiMzej8W21sAwxDPYHMQy3nFNfCmltrKuWRDrhv0HlUMW - V8Rrn1JsGyxDDYLS1XA927ZZWooL+MzC29sycuHmNCq3AMsQwfGt8CFHISwEqskbDWwPlkeVgGW - JxczH20lidTXe3AixDLCwsLCwsviX4P68/8cprSSqmAAAAAElFTkSuQmCC -ROLE:Developer -SOUND;ENCODING=b:UklGRiQgAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAgAA - B/f39/f39/f39/f39/f4B/gH+Af4CAgIGBgYGBgYGBgYGBgYGBgYGBgIGAgICBgYGBgYGBgYCAg - YGAgICAgICAgIGBgICAgYCAgICBgICAgICAgICAgIGAgICAgYCAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAf4CAgICAgICAgICAgICAgIB/f4CAgICAgICAgIB/f4B/f39/f39/f3+AgICAf4CAf3 - 9/gIB/f4CAgH9/gICAgH+AgICAgICAgICAf4CAgIB/gICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgIB/gICAf39/f39/f3+Af4CAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgH9/f39/f39/f39/f39/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgYCAgICB - gICAgYGBgICAgICAgICAgIGAgICBgICBgYGBgYGBgYGAgYGBgYCBgYGBgYGBgYGBgYGBgYGBgYG - BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgICAgYGBgIGBgYGAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYGAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgH+AgICAgICAgICAgICAgICAgICAf4CAgIB/gH+Af4B/f39/f39/f - 39/f39/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgYG - BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgY - GBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAgIGBgYCAgICBgYCAgYGBgYCAgICBg - YCAgICAgICAgICAgICAgIGAgICAgICAgICAgICAgYGBgYGAgICAgIGBgYCAgICBgYGAgICAgIGA - gICAgICAgIGBgYCBgYGAgYGBgYGBgoGBgYGCgoGAgICBgYGBgYCBgYKCgYGBgYGBgYGAgYGBgH9 - /gIB/f3+AgIB/gH9/gICAf4CBgYB/f35+gIB/f4CBgX9/gYCAgYKCgYCAgYOBgICAgoGAf4GCgn - 9/gIB/gICBgH5/f4GAfX+BgYB+fn9/fn+Afn6Af39+f35+fn9+fn6AgH9/f4CAgYCAgYKCgH9/g - IKBf3+AgYJ/f4GCg4F/gIGCgoOBfoCDgYF/fH+BgYGAfn6Af4CCgn58gIN/fX+AgICBgYGAgYCB - goOCgICBgYB/fXyBhIGAgH5+f4GBgX9/f35+gIKCgXt9goN/f318f4GAf4B/fHt9fn5+fXx+fn5 - /gH9+fHx/gHx9f4CAfn18gIB9e4GBfn5+foCBfHyAgoGAfX6CgYCBgH+DgHt9gYN/fX2BhYB7en - 6AgH98foKCgH18foCAfoCAf4CAf31+fn+AgH1+goJ/fX5/gIKAgIGAfH6CgX17foCBf3+BgoB/g - YOBgIB/f4KDgoJ+e3+ChIOBfn1/gX+BfX2BgH59foCCfn1/gX99fICAgoB/f39/gISCf36AgoSB - foCBgYGAf4CCf4CCgX5/gYKDgYB/gH+BhIOBgYB/gIOEhIF9foGCg4OBgICBgoOCgICChIOBg4O - CgoSDgoKAgYKBgoODhISBf4CCg4SEgoGCg4SEgH6BhIWEgX+EhYKAgoKFhIB+gIKChYKAgYOCgo - B+gYWFhIKAg4WEg4ODhIWFhYaGhIWGhYWGh4eHhYOCgoSFg4B/gIB+fX1+fn57e3t7fHt6fH5/f - 4GDhYiMkJGQj5GVmZycmZiXlZGIfXRwcnZ4d3Nva2hoamppaWxvc3R0dXl+iJCPjZShqrCzvNHi - rFYxOmKSrJ6UmJOAbV1ZboSMjI6JfnNjW2JweYGFg4B/e3Z0c3Btc3p9fHp4fIGBf3+Dh4qLjJG - YnZuWkY6MhnpwbnN6fHlya2hlZmdmaW9ycXFzd3t/g42cpquzvMzd/sRADiBZkL6xpLa1jFpANV - iHoJ2ioJWGbEQ2VHaOm5aHhIFuYmZzgoVxZFxfdJCSgnt/kKewr7bDsopcSV6JopyRjpOQfmNXZ - HmGhYB8fXtvXExKXnyKgnJsc3t8fZC0ysfK0+vHTxEeXY6yr6rAxJRSNTdbh5+fp7KjglQ6PVx3 - ho6Ph3dmW15oa2x0hIuNkK3R18jJ0Ys8LUlxkqais8WtdlBFT2yDjpywro9mS0VVaXaBiIdyX2J - rcG5udYKKjaXT4dfV2Y82JkBpiaKkvdO2eE9GTGZ4hZu6u51yTUNOX2l9kZWKdl5PXG93dHeAip - KZut7j2tacRjJIYHCOo77XvoRdVlFYZniVuL+kfl9ST1Rcb4mTjoNxW1pqdXd5fH6CiKHN4d7k2 - 4E4N05Yaoqo1eO0emVbTU5ZdKDCuZV9b1tMSVlyiYp8dHl7cmpqdYCCgIqixNTR2OqnRTlPXFt3 - ksbnw4lzcFdKS2KMtLWZiIZwV0lPZXZ1b3uNinZqbXJ3dX2XxOPg4/zDUDRCTUhmiMXx1p+If1g - +O1J7pK+yspN3W0pGVGdugYmCen54b21rb3V9i6vZ7vD92WpAS0gzSny04tq3qp5qPDhHX3uVrs - KukXVhT0hRYnF/gnuCh31ubG9zdHeMs+Dr8P7KalFVOylJeq7QzMPIqmtIRUZOY4KovqicknhZS - 1BWXWh6gIeLiH91b21vc4GcyuXt/umTZGhGIjJfh6y+yt7LkGlfTD1GYYOipKKwnXhkXldVUFhs - dYOMjYWBem9ucoCWvNTm9+2weHdZMSpQboujvtnUrY6BZEdDUmV4jZypppeFd2dcWVFWWWh8hYS - Ii393c3Z7iJ3A1ePp3aGDfVYyOVZkfJe5zsavpJNsU1BTVmR9kpmcn5uGdGxoWU5VVGZ0fIKLh4 - F/d3Z6g4ufuc3e3depjoViPz9VWm2FqLu8tLGifmphWlJZbH+Lj5+elod+c19WU0xUZW11gISEg - nx6e3h6g4qWp7zM3NrSpZGIYkRFVVVlfZ6vsbW3qIl7b2BUWGVwe4ybn52TkIRuX2BVRVFjZmp7 - hIF9fX12cnZ6eX6LlZyousfP0c++jot6X0ZRXF9sgaCnqa6yn4eAdGZZYGlvd4mcnqCWnY91aWN - cSUtYYmJxf399f351cXFzcHF4foOIlZ+hp7CytLm8uLKNg4RtYF5oanN8j5qZnqGaioV9dGpqb3 - J1f42Rk5iZjIKAcmFcW1RXYGhwdXt+e3Z2c25tcXJxd3yChY2Tl5udn6Gho6ioq6uonoaHbWNzZ - GdxgoGPlZqdj5CJgHFzcWxwdH1/hYqOioSFfnFpaWBdX2Jqb3N5fHh4eHNxcXFxc3d7foOJjI6Q - lZOSlZOTl5eYnJucnpyZkYiEfnd1dnZ5fYKHio6QkIyHg394dHRzc3Z5fHt2enJrcG5obG9sbW9 - ucHJzdnh3eXp5eXt9foCDhoeJjI6OkJGSk5aYmZudn6Gjn5qLh4J3cnJ0dHR5g4GEi42Ih4aBfH - h4dXR1eHl4dXhuaW5rZ2ltaWttbW5vcnR1dHZ2dXV2d3d7fn+BhIeIiYuOjpCTlJWZnJueoKarr - ZuJhntvaW1ucnh+hIWJi4qFg4F7d3V1c3R3fH1/gHlvbXJnXmdpYmdtamtxcW9vbm9tamxtbG5z - dXZ5fHx7fX9+fH6AgoWHioyNj5CRlZeYmp2TiYyGenp9eXh9fX19foB/fH1/e3p8e3l5e3x7e3x - 6d3FxcnBwcG9vb29vb29wb25tbWxsbW5vb3Fyc3N1dXV1dnd4ent9fn+BgoGAgoWEhoqJiYyLi4 - yPioaLiYSEh4WDhIOCgoKAgX58fXx5eXp4eHl4dXZ1cnN0dHR1cnJycXBxcnJycW9ubGxsbW1ub - m5ub29vcXNzdHZ2dXh6enp+fn5/gYCBhIKFiYeGiomJi4qKjIuLjIyLiomKh4aKioeIiIWDgYB9 - fHx7e3l4eHh2dnd3d3l7enp6enp5ent7e3x7enl6e3t7fHx7e3p8fX5/gIKDg4GCg4KCg4OEhoe - Hh4iJiomLjIqLi4uLi46Pjo2OjouJiomHh4aDgH9/fXp5eXh3d3h4eHh4d3V2d3Z0dnd0dXd3d3 - p7fH59fX19fH5+fn+Af4CAf3+Af359f4KDgoSIiIeJjI6PkJOUk5SYmZiYmZqZmJqamJiZmJaWl - ZSTkZCQj46Ni4qHh4iFgoKBfn9+fn+AgYCAgYOCgoSEg4SFhIODg4OCgICBf35/gICAgYKCgYGD - hIOBgYOCgYGAgIGBgIGCgoKBgoSEg4KCgH9/f318fHt6e3t7enl5eHh5fH18foCAf4GDg4OFhoa - GhoeJh4aJioiIiYiIhoWGh4aGh4eHiImHh4mIiIeHh4iIiIqJioqJh4mKh4eJiYiHh4eHhoWGhY - OEhYWEhYWDg4SFhYWEg4SDgYKCgH+AgICBgoOCgYGBgYKEhoaGhoiIh4eJiYmKioqKiomKioiJi - oqJiYmJiIiIiYiHh4eHh4eGhYWFhISDgoKCgoKCgYGAf31+fXx9fn58e3x8fHx9fX19fX19fX19 - fHx9fn5/gICBgYGCgoKCg4OCgoODgoKDg4OCgoKCgoGBgYGBgYGCgYCBgIGCgoKDg4KCg4OEhIS - FhYWFhYWFhYWFhoWGhoWEhISDg4ODg4ODg4ODg4SDgoKDg4OCg4SDgoKDgoGBgoGAgIB/f35+fn - 9+fn9/f35+fn5/gICAgIGBgYKCg4ODg4SEg4OEhIODhIODhIODg4ODg4OCgoKBgoKCg4OCgoODg - 4ODg4OEhISEhIWEhIWFhISEhISEhIWEhISEhIODhISEg4ODg4ODg4ODg4ODgoKCgoKCg4KCgoKC - goKCgoKCgoOCgoKCgoKBgYKCgoKCgoGBgYGAgICAgYGBgYCAf39/f39/f3+Af39/f39/f39/gIC - AgIB/f39/f39/gICAgIB/f39/gIB/f39/gH9/f39/f39/fn5+f39/f39/fn5+fn5/f39/f39/fn - 5+fn9/f39/f35+fn5+fn9/f35/f39+fn5+fn9/fn5+fn5+fn5+f39+fn5+fn19fX5+fn5+fn5+f - X5+fn5+fn5+fn19fn5+fn5+fX19fX59fn5+fn19fX19fX1+fX19fX19fX19fX19fX19fX19fX19 - fX19fX19fX19fX19fX19fX19fX19fX19fXx9fX18fH19fXx8fXx9fXx8fHx8fHx8fH19fX19fXx - 9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX - 19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f - X19fX19fX19fX19fX19fX19fX19fX19fX1+fX5+fn19fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ - fn5+fn5+fn5+fn5+f39/fn5/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f3 - 9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f - 39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/ - f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 - 9/f39/f39/f39/f39/f39/f35+fn5+f35/f39/f39/f39/f39/f39/f39/f39/f39/f39/f35+f - 39+fn5/fn5+f39/fn9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/ - f39/f39/f39/f39/f39+fn9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f4CAf39/f39/f39/gIB/f39/f39/f4B/f4CAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgIB/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAgIC - AgICAgICAgICAgICAgICAgICAgICAgIGBgYGAgYGBgICAgIGAgICBgYGAgYGBgYGBgYGBgYGBgY - GBgYGBgYGBgYGBgYGBgYGAgYCAgICAgICAgICAgICAgICAgICAgICAgICAgH+AgICAf39/gH9/f - 3+Af39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4CAgH9/gIB/f39/f4B/f3+AgICAf4CA - gICAgICAgICAgICAgH9/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgIB/f39/f39/f39/f4CAf39/f39/f39/f39/f39/f39+fn - 9/fn5+fn5+fn5+fn5+fX19fX19fX19fX19fX19fX19fn5+fn5+fn9/f39/f4CAgICAgICBgYGBg - YGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICAgICAgICAgICAgICAgYGAgICA - gICAgICAgICAgICBgYGAgICAgICAgICAgICAgICAgICAgICAgIB/gICAgH9/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAgICAf39/f39/gH+AgI - CAgICAgIB/f39/f39/f4B/f39/f39/f39/f39/f39/f39/f39/f39/f39/fn9/f39/f39/f39+f - 39/f39/f39/f39/f39/f39/f39/f4B/f4CAgICAf39/f39/gICAf39/gICAgICAgICAgICAgICA - gICAgIGAgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICBgYGBgYGBgYCBgYGBgYCAgIG - BgICAgICAgICAgICAgICAgICAgICAgICAgICBgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAf3+AgIB/f4CAf39/f39/f3+AgICAgH+AgICAf3+AgICAgICAgH9/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 - 9/f39/f39/gH9/gICAgICAgICAgIB/gICAgH+AgIB/f39/f39/gICAgICAgH9/f3+AgH9/f4B/f - 39/f39/f39/f39/f3+AgICAgICAf3+AgIB/f4CAgIB/f4CAgICAgICAgICAf39/f3+AgIB/f4CA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAf39/f39 - /f4CAgH9/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f39/f39/gIB/f39/f39/f39/gH9/f3 - 9/f4CAgICAgIB/gICAgICAgICAgICAgICAgICAgICAgICAgH+AgICAf4CAgICAgICAgIB/gICAf - 4CAgICAgH+Af4CAgH9/f39/f39/f39/gICAgICAgICAgICAf39/f39/f4CAgH9/gICAf3+AgICA - gICAgICAgICAgICAgICAgICAgIB/f39/gIB/f4CAgIB/f4CAgH9/gICAf39/f39/f39/f39/f39 - /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 - 9/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAf39/gH9/f3+AgH9/f39/f39/f39/f39/f - 39/f39/f39/f39/f39/f39/f39/gICAf3+AgH9/f3+AgH9/f4CAgH9/gICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAgICAgICBgYGBgIGBgYCAgYGAgICAgYCAgICAgICAgICAgICAgICAg - ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA - gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC - AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI - CAgICAgICAgICAgICAgICAf39/f39/f4CAgIB/f4CAgICAgICAgICAgICAgICAgICAgICAgICAg - ICAf39/f3+Af39/f39/f39/f4B/f39/f4CAgICAgICAgICAgA== -TEL;TYPE=HOME:0351 223344 -TEL;TYPE=WORK:0351 443322 -TEL;TYPE=CELL:0173 223344 -UID:P9HXg34Oav -URL:http://www.mustermann.de/~heiko/ -VERSION:3.0 -X-KADDRESSBOOK-X-Anniversary:1982-07-07 -X-KADDRESSBOOK-X-AssistantsName:Mr. Smithers -X-KADDRESSBOOK-X-Department:Edutainment -X-KADDRESSBOOK-X-IMAddress:122334455 -X-KADDRESSBOOK-X-ManagersName:Mr. Burnes -X-KADDRESSBOOK-X-Office:223 2nd stage -X-KADDRESSBOOK-X-Profession:Clown -X-KADDRESSBOOK-X-SpousesName:femal clown -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard6.vcf b/kabc/vcardparser/tests/vcard6.vcf deleted file mode 100644 index 92339c798..000000000 --- a/kabc/vcardparser/tests/vcard6.vcf +++ /dev/null @@ -1,10 +0,0 @@ -BEGIN:VCARD -CLASS:PUBLIC -EMAIL;TYPE=PREF:email1@abc.de -EMAIL:email2@abc.de -FN:Test User -N:User;Test;;; -UID:uJTkVqH5Qt -VERSION:3.0 -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard6.vcf.ref b/kabc/vcardparser/tests/vcard6.vcf.ref deleted file mode 100644 index 3cfde20b9..000000000 --- a/kabc/vcardparser/tests/vcard6.vcf.ref +++ /dev/null @@ -1,10 +0,0 @@ -BEGIN:VCARD -CLASS:PUBLIC -EMAIL;TYPE=PREF:email1@abc.de -EMAIL:email2@abc.de -FN:Test User -N:User;Test;;; -UID:uJTkVqH5Qt -VERSION:3.0 -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard7.vcf b/kabc/vcardparser/tests/vcard7.vcf deleted file mode 100644 index 8b5be8ec7..000000000 --- a/kabc/vcardparser/tests/vcard7.vcf +++ /dev/null @@ -1,7 +0,0 @@ -BEGIN:VCARD -N: -LABEL;QUOTED-PRINTABLE;WORK:401 Park Drive 3 West=0ABoston, MA 02215=0AUSA=0A= -Herecomesyetanotherline -UID:pas-id-3E136F9B00000000 -END:VCARD - diff --git a/kabc/vcardparser/tests/vcard7.vcf.ref b/kabc/vcardparser/tests/vcard7.vcf.ref deleted file mode 100644 index 84ed6236b..000000000 --- a/kabc/vcardparser/tests/vcard7.vcf.ref +++ /dev/null @@ -1,8 +0,0 @@ -BEGIN:VCARD -LABEL;TYPE=work:401 Park Drive 3 West\nBoston\, MA 02215\nUSA\nHerecomesye - tanotherline -N:;;;; -UID:pas-id-3E136F9B00000000 -VERSION:3.0 -END:VCARD - diff --git a/kabc/vcardparser/testutils.cpp b/kabc/vcardparser/testutils.cpp deleted file mode 100644 index df4b60c9c..000000000 --- a/kabc/vcardparser/testutils.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include <vcardparser.h> -#include <kabc/addressee.h> -#include <tqfile.h> - -using namespace KABC; - -Addressee -vcard1() -{ - Addressee addr; - - addr.setName( "Frank Dawson" ); - addr.setOrganization( "Lotus Development Corporation" ); - addr.setUrl( KURL( "http://home.earthlink.net/~fdawson") ); - addr.insertEmail( "fdawson@earthlink.net" ); - addr.insertEmail( "Frank_Dawson@Lotus.com", true ); - addr.insertPhoneNumber( PhoneNumber("+1-919-676-9515",PhoneNumber::Voice|PhoneNumber::Msg - |PhoneNumber::Work ) ); - addr.insertPhoneNumber( PhoneNumber("+1-919-676-9564",PhoneNumber::Fax |PhoneNumber::Work )); - Address a( Address::Work | Address::Postal | Address::Parcel ); - a.setStreet( "6544 Battleford Drive" ); - a.setLocality( "Raleigh" ); - a.setRegion( "NC" ); - a.setPostalCode( "27613-3502" ); - a.setCountry( "U.S.A." ); - addr.insertAddress( a ); - return addr; -} - -Addressee -vcard2() -{ - Addressee addr; - - addr.setName( "Tim Howes" ); - addr.setOrganization( "Netscape Communications Corp." ); - addr.insertEmail( "howes@netscape.com" ); - addr.insertPhoneNumber( PhoneNumber("+1-415-937-3419",PhoneNumber::Voice|PhoneNumber::Msg - |PhoneNumber::Work) ); - addr.insertPhoneNumber( PhoneNumber("+1-415-528-4164",PhoneNumber::Fax |PhoneNumber::Work) ); - Address a( Address::Work ); - a.setStreet( "501 E. Middlefield Rd." ); - a.setLocality( "Mountain View" ); - a.setRegion( "CA" ); - a.setPostalCode( "94043" ); - a.setCountry( "U.S.A." ); - addr.insertAddress( a ); - return addr; -} - -Addressee -vcard3() -{ - Addressee addr; - - addr.setName( "ian geiser" ); - addr.setOrganization( "Source eXtreme" ); - addr.insertEmail( "geiseri@yahoo.com" ); - addr.setTitle( "VP of Engineering" ); - return addr; -} - - -QString -vcardAsText( const TQString& location ) -{ - TQString line; - TQFile file( location ); - if ( file.open( IO_ReadOnly ) ) { - TQTextStream stream( &file ); - if ( !stream.eof() ) { - line = stream.read(); - } - file.close(); - } - return line; -} - -Addressee::List -vCardsAsAddresseeList() -{ - Addressee::List l; - - l.append( vcard1() ); - l.append( vcard2() ); - l.append( vcard3() ); - - return l; -} - -QString -vCardsAsText() -{ - TQString vcards = vcardAsText( "tests/vcard1.vcf" ); - vcards += vcardAsText( "tests/vcard2.vcf" ); - vcards += vcardAsText( "tests/vcard3.vcf" ); - - return vcards; -} diff --git a/kabc/vcardparser/testutils.h b/kabc/vcardparser/testutils.h deleted file mode 100644 index 4f2024177..000000000 --- a/kabc/vcardparser/testutils.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef TESTUTILS_H -#define TESTUTILS_H - -#include <kabc/addressee.h> -#include <tqstring.h> - -KABC::Addressee vcard1(); -KABC::Addressee vcard2(); -KABC::Addressee vcard3(); -KABC::Addressee::List vCardsAsAddresseeList(); -TQString vCardAsText( const TQString& location ); -TQString vCardsAsText(); - -#endif diff --git a/kabc/vcardparser/testwrite.cpp b/kabc/vcardparser/testwrite.cpp deleted file mode 100644 index 5a58bd8a8..000000000 --- a/kabc/vcardparser/testwrite.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - This file is part of libkabc. - - 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 <kabc/addressee.h> -#include <kabc/phonenumber.h> -#include <kabc/address.h> -#include <kabc/key.h> -#include <kabc/picture.h> -#include <kabc/sound.h> -#include <kabc/secrecy.h> -#include <tdeaboutdata.h> -#include <tdeapplication.h> -#include <tdecmdlineargs.h> - -#include <tqfile.h> -#include <tqtextstream.h> - -#include "vcardconverter.h" - -int main( int argc, char **argv ) -{ - TDEAboutData aboutData( "testwrite", "vCard test writer", "0.1" ); - - TDECmdLineArgs::init( argc, argv, &aboutData ); - - TDEApplication app( false, false ); - - - KABC::Addressee addressee; - - addressee.setNameFromString( "Mr. Tobias Koenig Jr." ); - addressee.setNickName( "tokoe" ); - addressee.setBirthday( TQDate( 1982, 7, 19 ) ); - addressee.setMailer( "mutt1.2" ); - addressee.setTimeZone( KABC::TimeZone( +2 ) ); - - KABC::Geo geo; - geo.setLatitude( 30 ); - geo.setLongitude( 51 ); - addressee.setGeo( geo ); - - addressee.setTitle( "nerd" ); - addressee.setRole( "Maintainer" ); - addressee.setOrganization( "KDE" ); - addressee.setNote( "nerver\ntouch a running system" ); - addressee.setProductId( "testId" ); - addressee.setRevision( TQDateTime::currentDateTime() ); - addressee.setSortString( "koenig" ); - addressee.setUrl( KURL( "http://wgess16.dyndns.org") ); - addressee.setSecrecy( KABC::Secrecy( KABC::Secrecy::Confidential ) ); -/* - TQImage img; - img.load( "testimg.png", "PNG" ); - KABC::Picture photo; - photo.setData( img ); - addressee.setPhoto( photo ); - - TQImage img2; - img2.load( "testimg.png", "PNG" ); - KABC::Picture logo; - logo.setData( img2 ); - addressee.setLogo( logo ); - - TQFile soundFile( "testsound.wav" ); - soundFile.open( IO_ReadOnly ); - TQByteArray data = soundFile.readAll(); - soundFile.close(); - KABC::Sound sound; - sound.setData( data ); - addressee.setSound( sound ); -*/ - addressee.insertEmail( "tokoe@kde.org", true ); - addressee.insertEmail( "tokoe82@yahoo.de", true ); - - KABC::PhoneNumber phone1( "3541523475", KABC::PhoneNumber::Pref | KABC::PhoneNumber::Home ); - KABC::PhoneNumber phone2( "+46745673475", KABC::PhoneNumber::Work ); - addressee.insertPhoneNumber( phone1 ); - addressee.insertPhoneNumber( phone2 ); - - KABC::Key key( "secret key", KABC::Key::X509 ); - addressee.insertKey( key ); - - TQStringList categories; - categories << "Friends" << "School" << "KDE"; - addressee.setCategories( categories ); - - KABC::Address a( KABC::Address::Work | KABC::Address::Postal | KABC::Address::Parcel ); - a.setStreet( "6544 Battleford Drive" ); - a.setLocality( "Raleigh" ); - a.setRegion( "NC" ); - a.setPostalCode( "27613-3502" ); - a.setCountry( "U.S.A." ); - addressee.insertAddress( a ); - - addressee.insertCustom( "1hsdf", "ertuer", "iurt" ); - addressee.insertCustom( "2hsdf", "ertuer", "iurt" ); - addressee.insertCustom( "3hsdf", "ertuer", "iurt" ); - - KABC::Addressee::List list; - for ( int i = 0; i < 1000; ++i ) { - KABC::Addressee addr = addressee; - addr.setUid( TQString::number( i ) ); - list.append( addr ); - } - - KABC::VCardConverter converter; - TQString txt = converter.createVCards( list ); - - TQFile file( "out.vcf" ); - file.open( IO_WriteOnly ); - - TQTextStream s( &file ); - s.setEncoding( TQTextStream::UnicodeUTF8 ); - s << txt; - file.close(); - - return 0; -} diff --git a/kabc/vcardparser/vcard.cpp b/kabc/vcardparser/vcard.cpp deleted file mode 100644 index 30a8e1c49..000000000 --- a/kabc/vcardparser/vcard.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 "vcard.h" - -using namespace KABC; - -VCard::VCard() -{ -} - -VCard::VCard( const VCard& vcard ) -{ - mLineMap = vcard.mLineMap; -} - -VCard::~VCard() -{ -} - -VCard& VCard::operator=( const VCard& vcard ) -{ - if ( &vcard == this ) - return *this; - - mLineMap = vcard.mLineMap; - - return *this; -} - -void VCard::clear() -{ - mLineMap.clear(); -} - -TQStringList VCard::identifiers() const -{ - return mLineMap.keys(); -} - -void VCard::addLine( const VCardLine& line ) -{ - mLineMap[ line.identifier() ].append( line ); -} - -VCardLine::List VCard::lines( const TQString& identifier ) const -{ - LineMap::ConstIterator it = mLineMap.find( identifier ); - if ( it == mLineMap.end() ) - return VCardLine::List(); - - return *it; -} - -VCardLine VCard::line( const TQString& identifier ) const -{ - LineMap::ConstIterator it = mLineMap.find( identifier ); - if ( it == mLineMap.end() ) - return VCardLine(); - - if ( (*it).isEmpty() ) - return VCardLine(); - else - return (*it).first(); -} - -void VCard::setVersion( Version version ) -{ - mLineMap.erase( "VERSION" ); - - VCardLine line; - line.setIdentifier( "VERSION" ); - if ( version == v2_1 ) - line.setIdentifier( "2.1" ); - else if ( version == v3_0 ) - line.setIdentifier( "3.0" ); - - mLineMap[ "VERSION" ].append( line ); -} - -VCard::Version VCard::version() const -{ - LineMap::ConstIterator versionEntry = mLineMap.find( "VERSION" ); - if ( versionEntry == mLineMap.end() ) - return v3_0; - - VCardLine line = ( *versionEntry )[ 0 ]; - if ( line.value() == "2.1" ) - return v2_1; - else - return v3_0; -} diff --git a/kabc/vcardparser/vcard.h b/kabc/vcardparser/vcard.h deleted file mode 100644 index 6afeeda26..000000000 --- a/kabc/vcardparser/vcard.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 VCARDPARSER_VCARD_H -#define VCARDPARSER_VCARD_H - -#include "vcardline.h" -#include <tqmap.h> -#include <tqstringlist.h> -#include <tqvaluelist.h> - -namespace KABC { - -class VCard -{ - public: - typedef TQValueList<VCard> List; - typedef TQMap< TQString, VCardLine::List > LineMap; - - enum Version { v2_1, v3_0 }; - - VCard(); - VCard( const VCard& ); - - ~VCard(); - - VCard& operator=( const VCard& ); - - /** - * Removes all lines from the vCard. - */ - void clear(); - - /** - * Returns a list of all identifiers that exists in the - * vCard. - */ - TQStringList identifiers() const; - - /** - * Adds a VCardLine to the VCard - */ - void addLine( const VCardLine& line ); - - /** - * Returns all lines of the vcard with a special identifier. - */ - VCardLine::List lines( const TQString& identifier ) const; - - /** - * Returns only the first line of the vcard with a special identifier. - */ - VCardLine line( const TQString& identifier ) const; - - /** - * Set the version of the vCard. - */ - void setVersion( Version version ); - - /** - * Returns the version of this vCard. - */ - Version version() const; - - private: - LineMap mLineMap; - - class VCardPrivate; - VCardPrivate *d; -}; - -} - -#endif diff --git a/kabc/vcardparser/vcardline.cpp b/kabc/vcardparser/vcardline.cpp deleted file mode 100644 index 6680cf7d0..000000000 --- a/kabc/vcardparser/vcardline.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 "vcardline.h" - -using namespace KABC; - -class VCardLine::VCardLinePrivate -{ - public: - TQString mGroup; -}; - -VCardLine::VCardLine() - : d( 0 ) -{ -} - -VCardLine::VCardLine( const TQString &identifier ) - : d( 0 ) -{ - mIdentifier = identifier; -} - -VCardLine::VCardLine( const TQString &identifier, const TQVariant &value ) - : d( 0 ) -{ - mIdentifier = identifier; - mValue = value; -} - -VCardLine::VCardLine( const VCardLine& line ) - : d( 0 ) -{ - mParamMap = line.mParamMap; - mValue = line.mValue; - mIdentifier = line.mIdentifier; -} - -VCardLine::~VCardLine() -{ - delete d; - d = 0; -} - -VCardLine& VCardLine::operator=( const VCardLine& line ) -{ - if ( &line == this ) - return *this; - - mParamMap = line.mParamMap; - mValue = line.mValue; - mIdentifier = line.mIdentifier; - - return *this; -} - -void VCardLine::setIdentifier( const TQString& identifier ) -{ - mIdentifier = identifier; -} - -TQString VCardLine::identifier() const -{ - return mIdentifier; -} - -void VCardLine::setValue( const TQVariant& value ) -{ - mValue = value; -} - -TQVariant VCardLine::value() const -{ - return mValue; -} - -void VCardLine::setGroup( const TQString& group ) -{ - if ( !d ) - d = new VCardLinePrivate(); - - d->mGroup = group; -} - -TQString VCardLine::group() const -{ - if ( d ) - return d->mGroup; - else - return TQString(); -} - -bool VCardLine::hasGroup() const -{ - if ( !d ) - return false; - else - return d->mGroup.isEmpty(); -} - -TQStringList VCardLine::parameterList() const -{ - return mParamMap.keys(); -} - -void VCardLine::addParameter( const TQString& param, const TQString& value ) -{ - TQStringList &list = mParamMap[ param ]; - if ( list.findIndex( value ) == -1 ) // not included yet - list.append( value ); -} - -TQStringList VCardLine::parameters( const TQString& param ) const -{ - ParamMap::ConstIterator it = mParamMap.find( param ); - if ( it == mParamMap.end() ) - return TQStringList(); - else - return *it; -} - -TQString VCardLine::parameter( const TQString& param ) const -{ - ParamMap::ConstIterator it = mParamMap.find( param ); - if ( it == mParamMap.end() ) - return TQString::null; - else { - if ( (*it).isEmpty() ) - return TQString::null; - else - return (*it).first(); - } -} diff --git a/kabc/vcardparser/vcardline.h b/kabc/vcardparser/vcardline.h deleted file mode 100644 index 92fe743f6..000000000 --- a/kabc/vcardparser/vcardline.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 VCARDLINE_H -#define VCARDLINE_H - -#include <tqstringlist.h> -#include <tqvaluelist.h> -#include <tqvariant.h> -#include <tqmap.h> -#include <tqstring.h> - -namespace KABC { - -class VCardLine -{ - public: - typedef TQValueList<VCardLine> List; - typedef TQMap<TQString, TQStringList> ParamMap; - - VCardLine(); - VCardLine( const TQString &identifier ); - VCardLine( const TQString &identifier, const TQVariant &value ); - VCardLine( const VCardLine& ); - - ~VCardLine(); - - VCardLine& operator=( const VCardLine& ); - - /** - * Sets the identifier of this line e.g. UID, FN, CLASS - */ - void setIdentifier( const TQString& identifier ); - - /** - * Returns the identifier of this line. - */ - TQString identifier() const; - - /** - * Sets the value of of this line. - */ - void setValue( const TQVariant& value ); - - /** - * Returns the value of this line. - */ - TQVariant value() const; - - /** - * Sets the group the line belongs to. - */ - void setGroup( const TQString& group ); - - /** - * Returns the group the line belongs to. - */ - TQString group() const; - - /** - * Returns whether the line belongs to a group. - */ - bool hasGroup() const; - - /** - * Returns all parameters. - */ - TQStringList parameterList() const; - - /** - * Add a new parameter to the line. - */ - void addParameter( const TQString& param, const TQString& value ); - - /** - * Returns the values of a special parameter. - * You can get a list of all parameters with paramList(). - */ - TQStringList parameters( const TQString& param ) const; - - /** - * Returns only the first value of a special parameter. - * You can get a list of all parameters with paramList(). - */ - TQString parameter( const TQString& param ) const; - - private: - ParamMap mParamMap; - TQString mIdentifier; - TQVariant mValue; - - class VCardLinePrivate; - VCardLinePrivate *d; -}; - -} - -#endif diff --git a/kabc/vcardparser/vcardparser.cpp b/kabc/vcardparser/vcardparser.cpp deleted file mode 100644 index aed9ebd39..000000000 --- a/kabc/vcardparser/vcardparser.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 <tqregexp.h> -#include <tqtextcodec.h> - -#include <kmdcodec.h> - -#include "vcardparser.h" - -#define FOLD_WIDTH 75 - -using namespace KABC; - -static TQString backslash( "\\\\" ); -static TQString comma( "\\," ); -static TQString newline( "\\n" ); -static TQString cr( "\\r" ); - -static void addEscapes( TQString &str ) -{ - str.replace( '\\', backslash ); - str.replace( ',', comma ); - str.replace( '\r', cr ); - str.replace( '\n', newline ); -} - -static void removeEscapes( TQString &str ) -{ - str.replace( cr, "\\r" ); - str.replace( newline, "\n" ); - str.replace( comma, "," ); - str.replace( backslash, "\\" ); -} - -VCardParser::VCardParser() -{ -} - -VCardParser::~VCardParser() -{ -} - -VCard::List VCardParser::parseVCards( const TQString& text ) -{ - static TQRegExp sep( "[\x0d\x0a]" ); - - VCard currentVCard; - VCard::List vCardList; - TQString currentLine; - - const TQStringList lines = TQStringList::split( sep, text ); - TQStringList::ConstIterator it; - - bool inVCard = false; - TQStringList::ConstIterator linesEnd( lines.end() ); - for ( it = lines.begin(); it != linesEnd; ++it ) { - - if ( (*it).isEmpty() ) // empty line - continue; - - if ( (*it)[ 0 ] == ' ' || (*it)[ 0 ] == '\t' ) { // folded line => append to previous - currentLine += TQString( *it ).remove( 0, 1 ); - continue; - } else { - if ( inVCard && !currentLine.isEmpty() ) { // now parse the line - int colon = currentLine.find( ':' ); - if ( colon == -1 ) { // invalid line - currentLine = (*it); - continue; - } - - VCardLine vCardLine; - const TQString key = currentLine.left( colon ).stripWhiteSpace(); - TQString value = currentLine.mid( colon + 1 ); - - TQStringList params = TQStringList::split( ';', key ); - - // check for group - if ( params[0].find( '.' ) != -1 ) { - const TQStringList groupList = TQStringList::split( '.', params[0] ); - vCardLine.setGroup( groupList[0] ); - vCardLine.setIdentifier( groupList[1] ); - } else - vCardLine.setIdentifier( params[0] ); - - if ( params.count() > 1 ) { // find all parameters - TQStringList::ConstIterator paramIt = params.begin(); - for ( ++paramIt; paramIt != params.end(); ++paramIt ) { - TQStringList pair = TQStringList::split( '=', *paramIt ); - if ( pair.size() == 1 ) { - // correct the 2.1 'standard' - if ( pair[0].lower() == "quoted-printable" ) { - pair[0] = "encoding"; - pair[1] = "quoted-printable"; - } else if ( pair[0].lower() == "base64" ) { - pair[0] = "encoding"; - pair[1] = "base64"; - } else { - pair.prepend( "type" ); - } - } - // This is pretty much a faster pair[1].contains( ',' )... - if ( pair[1].find( ',' ) != -1 ) { // parameter in type=x,y,z format - const TQStringList args = TQStringList::split( ',', pair[ 1 ] ); - TQStringList::ConstIterator argIt; - for ( argIt = args.begin(); argIt != args.end(); ++argIt ) - vCardLine.addParameter( pair[0].lower(), *argIt ); - } else - vCardLine.addParameter( pair[0].lower(), pair[1] ); - } - } - - removeEscapes( value ); - - TQByteArray output; - bool wasBase64Encoded = false; - - params = vCardLine.parameterList(); - if ( params.findIndex( "encoding" ) != -1 ) { // have to decode the data - TQByteArray input; - input = TQCString(value.latin1()); - if ( vCardLine.parameter( "encoding" ).lower() == "b" || - vCardLine.parameter( "encoding" ).lower() == "base64" ) { - KCodecs::base64Decode( input, output ); - wasBase64Encoded = true; - } - else if ( vCardLine.parameter( "encoding" ).lower() == "quoted-printable" ) { - // join any qp-folded lines - while ( value.at( value.length() - 1 ) == '=' && it != linesEnd ) { - value = value.remove( value.length() - 1, 1 ) + (*it); - ++it; - } - input = TQCString(value.latin1()); - KCodecs::quotedPrintableDecode( input, output ); - } - } else { - output = TQCString(value.latin1()); - } - - if ( params.findIndex( "charset" ) != -1 ) { // have to convert the data - TQTextCodec *codec = - TQTextCodec::codecForName( vCardLine.parameter( "charset" ).latin1() ); - if ( codec ) { - vCardLine.setValue( codec->toUnicode( output ) ); - } else { - vCardLine.setValue( TQString(TQString::fromUtf8( output )) ); - } - } else if ( wasBase64Encoded ) { - vCardLine.setValue( output ); - } else { // if charset not given, assume it's in UTF-8 (as used in previous KDE versions) - vCardLine.setValue( TQString(TQString::fromUtf8( output )) ); - } - - currentVCard.addLine( vCardLine ); - } - - // we do not save the start and end tag as vcardline - if ( (*it).lower().startsWith( "begin:vcard" ) ) { - inVCard = true; - currentLine.setLength( 0 ); - currentVCard.clear(); // flush vcard - continue; - } - - if ( (*it).lower().startsWith( "end:vcard" ) ) { - inVCard = false; - vCardList.append( currentVCard ); - currentLine.setLength( 0 ); - currentVCard.clear(); // flush vcard - continue; - } - - currentLine = (*it); - } - } - - return vCardList; -} - -TQString VCardParser::createVCards( const VCard::List& list ) -{ - TQString text; - TQString textLine; - TQString encodingType; - TQStringList idents; - TQStringList params; - TQStringList values; - TQStringList::ConstIterator identIt; - TQStringList::Iterator paramIt; - TQStringList::ConstIterator valueIt; - - VCardLine::List lines; - VCardLine::List::ConstIterator lineIt; - VCard::List::ConstIterator cardIt; - - bool hasEncoding; - - text.reserve( list.size() * 300 ); // reserve memory to be more efficient - - // iterate over the cards - VCard::List::ConstIterator listEnd( list.end() ); - for ( cardIt = list.begin(); cardIt != listEnd; ++cardIt ) { - text.append( "BEGIN:VCARD\r\n" ); - - idents = (*cardIt).identifiers(); - for ( identIt = idents.constBegin(); identIt != idents.constEnd(); ++identIt ) { - lines = (*cardIt).lines( (*identIt) ); - - // iterate over the lines - for ( lineIt = lines.constBegin(); lineIt != lines.constEnd(); ++lineIt ) { - if ( !(*lineIt).value().asString().isEmpty() ) { - if ((*lineIt).identifier() != TQString("URI")) { - if ( (*lineIt).hasGroup() ) - textLine = (*lineIt).group() + "." + (*lineIt).identifier(); - else - textLine = (*lineIt).identifier(); - - params = (*lineIt).parameterList(); - hasEncoding = false; - if ( params.count() > 0 ) { // we have parameters - for ( paramIt = params.begin(); paramIt != params.end(); ++paramIt ) { - if ( (*paramIt) == "encoding" ) { - hasEncoding = true; - encodingType = (*lineIt).parameter( "encoding" ).lower(); - } - - values = (*lineIt).parameters( *paramIt ); - for ( valueIt = values.constBegin(); valueIt != values.constEnd(); ++valueIt ) { - textLine.append( ";" + (*paramIt).upper() ); - if ( !(*valueIt).isEmpty() ) - textLine.append( "=" + (*valueIt) ); - } - } - } - - if ( hasEncoding ) { // have to encode the data - TQByteArray input, output; - if ( encodingType == "b" ) { - input = (*lineIt).value().toByteArray(); - KCodecs::base64Encode( input, output ); - } else if ( encodingType == "quoted-printable" ) { - input = (*lineIt).value().toString().utf8(); - input.resize( input.size() - 1 ); // strip \0 - KCodecs::quotedPrintableEncode( input, output, false ); - } - - TQString value( output ); - addEscapes( value ); - textLine.append( ":" + value ); - } else { - TQString value( (*lineIt).value().asString() ); - addEscapes( value ); - textLine.append( ":" + value ); - } - - if ( textLine.length() > FOLD_WIDTH ) { // we have to fold the line - for ( uint i = 0; i <= ( textLine.length() / FOLD_WIDTH ); ++i ) - text.append( ( i == 0 ? "" : " " ) + textLine.mid( i * FOLD_WIDTH, FOLD_WIDTH ) + "\r\n" ); - } else - text.append( textLine + "\r\n" ); - } - else { - // URIs can be full of weird symbols, etc. so bypass all checks - textLine = (*lineIt).identifier(); - TQString value( (*lineIt).value().asString() ); - addEscapes( value ); - textLine.append( ":" + value ); - text.append( textLine + "\r\n" ); - } - } - } - } - - text.append( "END:VCARD\r\n" ); - text.append( "\r\n" ); - } - - return text; -} diff --git a/kabc/vcardparser/vcardparser.h b/kabc/vcardparser/vcardparser.h deleted file mode 100644 index da5fdd46e..000000000 --- a/kabc/vcardparser/vcardparser.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 VCARDPARSER_H -#define VCARDPARSER_H - -#include "vcard.h" - -namespace KABC { - -class VCardParser -{ - public: - VCardParser(); - ~VCardParser(); - - static VCard::List parseVCards( const TQString& text ); - static TQString createVCards( const VCard::List& list ); - - private: - class VCardParserPrivate; - VCardParserPrivate *d; -}; - -} - -#endif diff --git a/kabc/vcardtool.cpp b/kabc/vcardtool.cpp deleted file mode 100644 index 295360a03..000000000 --- a/kabc/vcardtool.cpp +++ /dev/null @@ -1,896 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 <tqbuffer.h> -#include <tqdatastream.h> -#include <tqstring.h> - -#include "agent.h" -#include "key.h" -#include "picture.h" -#include "secrecy.h" -#include "sound.h" - -#include "vcardtool.h" - -using namespace KABC; - -static bool needsEncoding( const TQString &value ) -{ - uint length = value.length(); - for ( uint i = 0; i < length; ++i ) { - char c = value.at( i ).latin1(); - if ( (c < 33 || c > 126) && c != ' ' && c != '=' ) - return true; - } - - return false; -} - -VCardTool::VCardTool() -{ - mAddressTypeMap.insert( "dom", Address::Dom ); - mAddressTypeMap.insert( "intl", Address::Intl ); - mAddressTypeMap.insert( "postal", Address::Postal ); - mAddressTypeMap.insert( "parcel", Address::Parcel ); - mAddressTypeMap.insert( "home", Address::Home ); - mAddressTypeMap.insert( "work", Address::Work ); - mAddressTypeMap.insert( "pref", Address::Pref ); - - mPhoneTypeMap.insert( "HOME", PhoneNumber::Home ); - mPhoneTypeMap.insert( "WORK", PhoneNumber::Work ); - mPhoneTypeMap.insert( "MSG", PhoneNumber::Msg ); - mPhoneTypeMap.insert( "PREF", PhoneNumber::Pref ); - mPhoneTypeMap.insert( "VOICE", PhoneNumber::Voice ); - mPhoneTypeMap.insert( "FAX", PhoneNumber::Fax ); - mPhoneTypeMap.insert( "CELL", PhoneNumber::Cell ); - mPhoneTypeMap.insert( "VIDEO", PhoneNumber::Video ); - mPhoneTypeMap.insert( "BBS", PhoneNumber::Bbs ); - mPhoneTypeMap.insert( "MODEM", PhoneNumber::Modem ); - mPhoneTypeMap.insert( "CAR", PhoneNumber::Car ); - mPhoneTypeMap.insert( "ISDN", PhoneNumber::Isdn ); - mPhoneTypeMap.insert( "PCS", PhoneNumber::Pcs ); - mPhoneTypeMap.insert( "PAGER", PhoneNumber::Pager ); -} - -VCardTool::~VCardTool() -{ -} - -// TODO: make list a const& -TQString VCardTool::createVCards( Addressee::List list, VCard::Version version ) -{ - VCard::List vCardList; - - Addressee::List::ConstIterator addrIt; - Addressee::List::ConstIterator listEnd( list.constEnd() ); - for ( addrIt = list.constBegin(); addrIt != listEnd; ++addrIt ) { - VCard card; - TQStringList::ConstIterator strIt; - - // ADR + LABEL - const Address::List addresses = (*addrIt).addresses(); - for ( Address::List::ConstIterator it = addresses.begin(); it != addresses.end(); ++it ) { - TQStringList address; - - bool isEmpty = ( (*it).postOfficeBox().isEmpty() && - (*it).extended().isEmpty() && - (*it).street().isEmpty() && - (*it).locality().isEmpty() && - (*it).region().isEmpty() && - (*it).postalCode().isEmpty() && - (*it).country().isEmpty() ); - - address.append( (*it).postOfficeBox().replace( ';', "\\;" ) ); - address.append( (*it).extended().replace( ';', "\\;" ) ); - address.append( (*it).street().replace( ';', "\\;" ) ); - address.append( (*it).locality().replace( ';', "\\;" ) ); - address.append( (*it).region().replace( ';', "\\;" ) ); - address.append( (*it).postalCode().replace( ';', "\\;" ) ); - address.append( (*it).country().replace( ';', "\\;" ) ); - - VCardLine adrLine( "ADR", address.join( ";" ) ); - if ( version == VCard::v2_1 && needsEncoding( address.join( ";" ) ) ) { - adrLine.addParameter( "charset", "UTF-8" ); - adrLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - - VCardLine labelLine( "LABEL", (*it).label() ); - if ( version == VCard::v2_1 && needsEncoding( (*it).label() ) ) { - labelLine.addParameter( "charset", "UTF-8" ); - labelLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - - bool hasLabel = !(*it).label().isEmpty(); - TQMap<TQString, int>::ConstIterator typeIt; - for ( typeIt = mAddressTypeMap.constBegin(); typeIt != mAddressTypeMap.constEnd(); ++typeIt ) { - if ( typeIt.data() & (*it).type() ) { - adrLine.addParameter( "TYPE", typeIt.key() ); - if ( hasLabel ) - labelLine.addParameter( "TYPE", typeIt.key() ); - } - } - - if ( !isEmpty ) - card.addLine( adrLine ); - if ( hasLabel ) - card.addLine( labelLine ); - } - - // AGENT - card.addLine( createAgent( version, (*addrIt).agent() ) ); - - // BDAY - card.addLine( VCardLine( "BDAY", createDateTime( TQT_TQDATETIME_OBJECT((*addrIt).birthday()) ) ) ); - - // CATEGORIES - if ( version == VCard::v3_0 ) { - TQStringList categories = (*addrIt).categories(); - TQStringList::Iterator catIt; - for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) - (*catIt).replace( ',', "\\," ); - - VCardLine catLine( "CATEGORIES", categories.join( "," ) ); - if ( version == VCard::v2_1 && needsEncoding( categories.join( "," ) ) ) { - catLine.addParameter( "charset", "UTF-8" ); - catLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - - card.addLine( catLine ); - } - - // CLASS - if ( version == VCard::v3_0 ) { - card.addLine( createSecrecy( (*addrIt).secrecy() ) ); - } - - // EMAIL - const TQStringList emails = (*addrIt).emails(); - bool pref = true; - for ( strIt = emails.begin(); strIt != emails.end(); ++strIt ) { - VCardLine line( "EMAIL", *strIt ); - if ( pref == true && emails.count() > 1 ) { - line.addParameter( "TYPE", "PREF" ); - pref = false; - } - card.addLine( line ); - } - - // FN - VCardLine fnLine( "FN", TQString((*addrIt).formattedName()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).formattedName() ) ) { - fnLine.addParameter( "charset", "UTF-8" ); - fnLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( fnLine ); - - // GEO - Geo geo = (*addrIt).geo(); - if ( geo.isValid() ) { - TQString str; - str.sprintf( "%.6f;%.6f", geo.latitude(), geo.longitude() ); - card.addLine( VCardLine( "GEO", str ) ); - } - - // KEY - const Key::List keys = (*addrIt).keys(); - Key::List::ConstIterator keyIt; - for ( keyIt = keys.begin(); keyIt != keys.end(); ++keyIt ) - card.addLine( createKey( *keyIt ) ); - - // LOGO - card.addLine( createPicture( "LOGO", (*addrIt).logo() ) ); - - // MAILER - VCardLine mailerLine( "MAILER", TQString((*addrIt).mailer()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).mailer() ) ) { - mailerLine.addParameter( "charset", "UTF-8" ); - mailerLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( mailerLine ); - - // N - TQStringList name; - name.append( (*addrIt).familyName().replace( ';', "\\;" ) ); - name.append( (*addrIt).givenName().replace( ';', "\\;" ) ); - name.append( (*addrIt).additionalName().replace( ';', "\\;" ) ); - name.append( (*addrIt).prefix().replace( ';', "\\;" ) ); - name.append( (*addrIt).suffix().replace( ';', "\\;" ) ); - - VCardLine nLine( "N", name.join( ";" ) ); - if ( version == VCard::v2_1 && needsEncoding( name.join( ";" ) ) ) { - nLine.addParameter( "charset", "UTF-8" ); - nLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( nLine ); - - // NAME - VCardLine nameLine( "NAME", TQString((*addrIt).name()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).name() ) ) { - nameLine.addParameter( "charset", "UTF-8" ); - nameLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( nameLine ); - - // NICKNAME - if ( version == VCard::v3_0 ) - card.addLine( VCardLine( "NICKNAME", TQString((*addrIt).nickName()) ) ); - - // NOTE - VCardLine noteLine( "NOTE", TQString((*addrIt).note()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).note() ) ) { - noteLine.addParameter( "charset", "UTF-8" ); - noteLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( noteLine ); - - // ORG - TQStringList organization; - organization.append( ( *addrIt ).organization().replace( ';', "\\;" ) ); - if ( !( *addrIt ).department().isEmpty() ) - organization.append( ( *addrIt ).department().replace( ';', "\\;" ) ); - VCardLine orgLine( "ORG", organization.join( ";" ) ); - if ( version == VCard::v2_1 && needsEncoding( organization.join( ";" ) ) ) { - orgLine.addParameter( "charset", "UTF-8" ); - orgLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( orgLine ); - - // PHOTO - card.addLine( createPicture( "PHOTO", (*addrIt).photo() ) ); - - // PROID - if ( version == VCard::v3_0 ) - card.addLine( VCardLine( "PRODID", TQString((*addrIt).productId()) ) ); - - // REV - card.addLine( VCardLine( "REV", createDateTime( TQT_TQDATETIME_OBJECT((*addrIt).revision()) ) ) ); - - // ROLE - VCardLine roleLine( "ROLE", TQString((*addrIt).role()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).role() ) ) { - roleLine.addParameter( "charset", "UTF-8" ); - roleLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( roleLine ); - - // SORT-STRING - if ( version == VCard::v3_0 ) - card.addLine( VCardLine( "SORT-STRING", TQString((*addrIt).sortString()) ) ); - - // SOUND - card.addLine( createSound( (*addrIt).sound() ) ); - - // TEL - const PhoneNumber::List phoneNumbers = (*addrIt).phoneNumbers(); - PhoneNumber::List::ConstIterator phoneIt; - for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { - VCardLine line( "TEL", (*phoneIt).number() ); - - TQMap<TQString, int>::ConstIterator typeIt; - for ( typeIt = mPhoneTypeMap.constBegin(); typeIt != mPhoneTypeMap.constEnd(); ++typeIt ) { - if ( typeIt.data() & (*phoneIt).type() ) - line.addParameter( "TYPE", typeIt.key() ); - } - - card.addLine( line ); - } - - // TITLE - VCardLine titleLine( "TITLE", TQString((*addrIt).title()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).title() ) ) { - titleLine.addParameter( "charset", "UTF-8" ); - titleLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( titleLine ); - - // TZ - TimeZone timeZone = (*addrIt).timeZone(); - if ( timeZone.isValid() ) { - TQString str; - - int neg = 1; - if ( timeZone.offset() < 0 ) - neg = -1; - - str.sprintf( "%c%02d:%02d", ( timeZone.offset() >= 0 ? '+' : '-' ), - ( timeZone.offset() / 60 ) * neg, - ( timeZone.offset() % 60 ) * neg ); - - card.addLine( VCardLine( "TZ", str ) ); - } - - // UID - card.addLine( VCardLine( "UID", (*addrIt).uid() ) ); - - // UID - card.addLine( VCardLine( "URI", (*addrIt).uri() ) ); - - // URL - card.addLine( VCardLine( "URL", (*addrIt).url().url() ) ); - - // VERSION - if ( version == VCard::v2_1 ) - card.addLine( VCardLine( "VERSION", "2.1" ) ); - if ( version == VCard::v3_0 ) - card.addLine( VCardLine( "VERSION", "3.0" ) ); - - // X- - const TQStringList customs = (*addrIt).customs(); - for ( strIt = customs.begin(); strIt != customs.end(); ++strIt ) { - TQString identifier = "X-" + (*strIt).left( (*strIt).find( ":" ) ); - TQString value = (*strIt).mid( (*strIt).find( ":" ) + 1 ); - if ( value.isEmpty() ) - continue; - - VCardLine line( identifier, value ); - if ( version == VCard::v2_1 && needsEncoding( value ) ) { - line.addParameter( "charset", "UTF-8" ); - line.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( line ); - } - - vCardList.append( card ); - } - - return VCardParser::createVCards( vCardList ); -} - -Addressee::List VCardTool::parseVCards( const TQString& vcard ) -{ - static const TQChar semicolonSep( ';' ); - static const TQChar commaSep( ',' ); - TQString identifier; - - Addressee::List addrList; - const VCard::List vCardList = VCardParser::parseVCards( vcard ); - - VCard::List::ConstIterator cardIt; - VCard::List::ConstIterator listEnd( vCardList.end() ); - for ( cardIt = vCardList.begin(); cardIt != listEnd; ++cardIt ) { - Addressee addr; - - const TQStringList idents = (*cardIt).identifiers(); - TQStringList::ConstIterator identIt; - TQStringList::ConstIterator identEnd( idents.end() ); - for ( identIt = idents.begin(); identIt != identEnd; ++identIt ) { - const VCardLine::List lines = (*cardIt).lines( (*identIt) ); - VCardLine::List::ConstIterator lineIt; - - // iterate over the lines - for ( lineIt = lines.begin(); lineIt != lines.end(); ++lineIt ) { - identifier = (*lineIt).identifier().lower(); - // ADR - if ( identifier == "adr" ) { - Address address; - const TQStringList addrParts = splitString( semicolonSep, (*lineIt).value().asString() ); - if ( addrParts.count() > 0 ) - address.setPostOfficeBox( addrParts[ 0 ] ); - if ( addrParts.count() > 1 ) - address.setExtended( addrParts[ 1 ] ); - if ( addrParts.count() > 2 ) - address.setStreet( addrParts[ 2 ] ); - if ( addrParts.count() > 3 ) - address.setLocality( addrParts[ 3 ] ); - if ( addrParts.count() > 4 ) - address.setRegion( addrParts[ 4 ] ); - if ( addrParts.count() > 5 ) - address.setPostalCode( addrParts[ 5 ] ); - if ( addrParts.count() > 6 ) - address.setCountry( addrParts[ 6 ] ); - - int type = 0; - - const TQStringList types = (*lineIt).parameters( "type" ); - for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) - type += mAddressTypeMap[ (*it).lower() ]; - - address.setType( type ); - addr.insertAddress( address ); - } - - // AGENT - else if ( identifier == "agent" ) - addr.setAgent( parseAgent( *lineIt ) ); - - // BDAY - else if ( identifier == "bday" ) - addr.setBirthday( parseDateTime( (*lineIt).value().asString() ) ); - - // CATEGORIES - else if ( identifier == "categories" ) { - const TQStringList categories = splitString( commaSep, (*lineIt).value().asString() ); - addr.setCategories( categories ); - } - - // CLASS - else if ( identifier == "class" ) - addr.setSecrecy( parseSecrecy( *lineIt ) ); - - // EMAIL - else if ( identifier == "email" ) { - const TQStringList types = (*lineIt).parameters( "type" ); - addr.insertEmail( (*lineIt).value().asString(), types.findIndex( "PREF" ) != -1 ); - } - - // FN - else if ( identifier == "fn" ) - addr.setFormattedName( (*lineIt).value().asString() ); - - // GEO - else if ( identifier == "geo" ) { - Geo geo; - - const TQStringList geoParts = TQStringList::split( ';', (*lineIt).value().asString(), true ); - geo.setLatitude( geoParts[ 0 ].toFloat() ); - geo.setLongitude( geoParts[ 1 ].toFloat() ); - - addr.setGeo( geo ); - } - - // KEY - else if ( identifier == "key" ) - addr.insertKey( parseKey( *lineIt ) ); - - // LABEL - else if ( identifier == "label" ) { - int type = 0; - - const TQStringList types = (*lineIt).parameters( "type" ); - for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) - type += mAddressTypeMap[ (*it).lower() ]; - - bool available = false; - KABC::Address::List addressList = addr.addresses(); - KABC::Address::List::Iterator it; - for ( it = addressList.begin(); it != addressList.end(); ++it ) { - if ( (*it).type() == type ) { - (*it).setLabel( (*lineIt).value().asString() ); - addr.insertAddress( *it ); - available = true; - break; - } - } - - if ( !available ) { // a standalone LABEL tag - KABC::Address address( type ); - address.setLabel( (*lineIt).value().asString() ); - addr.insertAddress( address ); - } - } - - // LOGO - else if ( identifier == "logo" ) - addr.setLogo( parsePicture( *lineIt ) ); - - // MAILER - else if ( identifier == "mailer" ) - addr.setMailer( (*lineIt).value().asString() ); - - // N - else if ( identifier == "n" ) { - const TQStringList nameParts = splitString( semicolonSep, (*lineIt).value().asString() ); - if ( nameParts.count() > 0 ) - addr.setFamilyName( nameParts[ 0 ] ); - if ( nameParts.count() > 1 ) - addr.setGivenName( nameParts[ 1 ] ); - if ( nameParts.count() > 2 ) - addr.setAdditionalName( nameParts[ 2 ] ); - if ( nameParts.count() > 3 ) - addr.setPrefix( nameParts[ 3 ] ); - if ( nameParts.count() > 4 ) - addr.setSuffix( nameParts[ 4 ] ); - } - - // NAME - else if ( identifier == "name" ) - addr.setName( (*lineIt).value().asString() ); - - // NICKNAME - else if ( identifier == "nickname" ) - addr.setNickName( (*lineIt).value().asString() ); - - // NOTE - else if ( identifier == "note" ) - addr.setNote( (*lineIt).value().asString() ); - - // ORGANIZATION - else if ( identifier == "org" ) { - const TQStringList orgParts = splitString( semicolonSep, (*lineIt).value().asString() ); - if ( orgParts.count() > 0 ) - addr.setOrganization( orgParts[ 0 ] ); - if ( orgParts.count() > 1 ) - addr.setDepartment( orgParts[ 1 ] ); - } - - // PHOTO - else if ( identifier == "photo" ) - addr.setPhoto( parsePicture( *lineIt ) ); - - // PROID - else if ( identifier == "prodid" ) - addr.setProductId( (*lineIt).value().asString() ); - - // REV - else if ( identifier == "rev" ) - addr.setRevision( parseDateTime( (*lineIt).value().asString() ) ); - - // ROLE - else if ( identifier == "role" ) - addr.setRole( (*lineIt).value().asString() ); - - // SORT-STRING - else if ( identifier == "sort-string" ) - addr.setSortString( (*lineIt).value().asString() ); - - // SOUND - else if ( identifier == "sound" ) - addr.setSound( parseSound( *lineIt ) ); - - // TEL - else if ( identifier == "tel" ) { - PhoneNumber phone; - phone.setNumber( (*lineIt).value().asString() ); - - int type = 0; - - const TQStringList types = (*lineIt).parameters( "type" ); - for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) - type += mPhoneTypeMap[(*it).upper()]; - - phone.setType( type ); - - addr.insertPhoneNumber( phone ); - } - - // TITLE - else if ( identifier == "title" ) - addr.setTitle( (*lineIt).value().asString() ); - - // TZ - else if ( identifier == "tz" ) { - TimeZone tz; - const TQString date = (*lineIt).value().asString(); - - int hours = date.mid( 1, 2).toInt(); - int minutes = date.mid( 4, 2 ).toInt(); - int offset = ( hours * 60 ) + minutes; - offset = offset * ( date[ 0 ] == '+' ? 1 : -1 ); - - tz.setOffset( offset ); - addr.setTimeZone( tz ); - } - - // UID - else if ( identifier == "uid" ) - addr.setUid( (*lineIt).value().asString() ); - - // URI - else if ( identifier == "uri" ) - addr.setUri( (*lineIt).value().asString() ); - - // URL - else if ( identifier == "url" ) - addr.setUrl( KURL( (*lineIt).value().asString() ) ); - - // X- - else if ( identifier.startsWith( "x-" ) ) { - const TQString key = (*lineIt).identifier().mid( 2 ); - int dash = key.find( "-" ); - addr.insertCustom( key.left( dash ), key.mid( dash + 1 ), (*lineIt).value().asString() ); - } - } - } - - addrList.append( addr ); - } - - return addrList; -} - -TQDateTime VCardTool::parseDateTime( const TQString &str ) -{ - TQDateTime dateTime; - - if ( str.find( '-' ) == -1 ) { // is base format (yyyymmdd) - dateTime.setDate( TQDate( str.left( 4 ).toInt(), str.mid( 4, 2 ).toInt(), - str.mid( 6, 2 ).toInt() ) ); - - if ( str.find( 'T' ) ) // has time information yyyymmddThh:mm:ss - dateTime.setTime( TQTime( str.mid( 11, 2 ).toInt(), str.mid( 14, 2 ).toInt(), - str.mid( 17, 2 ).toInt() ) ); - - } else { // is extended format yyyy-mm-dd - dateTime.setDate( TQDate( str.left( 4 ).toInt(), str.mid( 5, 2 ).toInt(), - str.mid( 8, 2 ).toInt() ) ); - - if ( str.find( 'T' ) ) // has time information yyyy-mm-ddThh:mm:ss - dateTime.setTime( TQTime( str.mid( 11, 2 ).toInt(), str.mid( 14, 2 ).toInt(), - str.mid( 17, 2 ).toInt() ) ); - } - - return dateTime; -} - -TQString VCardTool::createDateTime( const TQDateTime &dateTime ) -{ - TQString str; - - if ( dateTime.date().isValid() ) { - str.sprintf( "%4d-%02d-%02d", dateTime.date().year(), dateTime.date().month(), - dateTime.date().day() ); - if ( dateTime.time().isValid() ) { - TQString tmp; - tmp.sprintf( "T%02d:%02d:%02dZ", dateTime.time().hour(), dateTime.time().minute(), - dateTime.time().second() ); - str += tmp; - } - } - - return str; -} - -Picture VCardTool::parsePicture( const VCardLine &line ) -{ - Picture pic; - - const TQStringList params = line.parameterList(); - if ( params.findIndex( "encoding" ) != -1 ) { - TQImage img; - img.loadFromData( line.value().asByteArray() ); - pic.setData( img ); - } else if ( params.findIndex( "value" ) != -1 ) { - if ( line.parameter( "value" ).lower() == "uri" ) - pic.setUrl( line.value().asString() ); - } - - if ( params.findIndex( "type" ) != -1 ) - pic.setType( line.parameter( "type" ) ); - - return pic; -} - -VCardLine VCardTool::createPicture( const TQString &identifier, const Picture &pic ) -{ - VCardLine line( identifier ); - - if ( pic.isIntern() ) { - if ( !pic.data().isNull() ) { - TQByteArray input; - TQBuffer buffer( input ); - buffer.open( IO_WriteOnly ); - - TQImageIO iio( &buffer, "JPEG" ); - iio.setImage( pic.data() ); - iio.setQuality( 100 ); - iio.write(); - - line.setValue( input ); - line.addParameter( "encoding", "b" ); - line.addParameter( "type", "image/jpeg" ); - } - } else if ( !pic.url().isEmpty() ) { - line.setValue( pic.url() ); - line.addParameter( "value", "URI" ); - } - - return line; -} - -Sound VCardTool::parseSound( const VCardLine &line ) -{ - Sound snd; - - const TQStringList params = line.parameterList(); - if ( params.findIndex( "encoding" ) != -1 ) - snd.setData( line.value().asByteArray() ); - else if ( params.findIndex( "value" ) != -1 ) { - if ( line.parameter( "value" ).lower() == "uri" ) - snd.setUrl( line.value().asString() ); - } - -/* TODO: support sound types - if ( params.contains( "type" ) ) - snd.setType( line.parameter( "type" ) ); -*/ - - return snd; -} - -VCardLine VCardTool::createSound( const Sound &snd ) -{ - VCardLine line( "SOUND" ); - - if ( snd.isIntern() ) { - if ( !snd.data().isEmpty() ) { - line.setValue( snd.data() ); - line.addParameter( "encoding", "b" ); - // TODO: need to store sound type!!! - } - } else if ( !snd.url().isEmpty() ) { - line.setValue( snd.url() ); - line.addParameter( "value", "URI" ); - } - - return line; -} - -Key VCardTool::parseKey( const VCardLine &line ) -{ - Key key; - - const TQStringList params = line.parameterList(); - if ( params.findIndex( "encoding" ) != -1 ) - key.setBinaryData( line.value().asByteArray() ); - else - key.setTextData( line.value().asString() ); - - if ( params.findIndex( "type" ) != -1 ) { - if ( line.parameter( "type" ).lower() == "x509" ) - key.setType( Key::X509 ); - else if ( line.parameter( "type" ).lower() == "pgp" ) - key.setType( Key::PGP ); - else { - key.setType( Key::Custom ); - key.setCustomTypeString( line.parameter( "type" ) ); - } - } - - return key; -} - -VCardLine VCardTool::createKey( const Key &key ) -{ - VCardLine line( "KEY" ); - - if ( key.isBinary() ) { - if ( !key.binaryData().isEmpty() ) { - line.setValue( key.binaryData() ); - line.addParameter( "encoding", "b" ); - } - } else if ( !key.textData().isEmpty() ) - line.setValue( key.textData() ); - - if ( key.type() == Key::X509 ) - line.addParameter( "type", "X509" ); - else if ( key.type() == Key::PGP ) - line.addParameter( "type", "PGP" ); - else if ( key.type() == Key::Custom ) - line.addParameter( "type", key.customTypeString() ); - - return line; -} - -Secrecy VCardTool::parseSecrecy( const VCardLine &line ) -{ - Secrecy secrecy; - - if ( line.value().asString().lower() == "public" ) - secrecy.setType( Secrecy::Public ); - if ( line.value().asString().lower() == "private" ) - secrecy.setType( Secrecy::Private ); - if ( line.value().asString().lower() == "confidential" ) - secrecy.setType( Secrecy::Confidential ); - - return secrecy; -} - -VCardLine VCardTool::createSecrecy( const Secrecy &secrecy ) -{ - VCardLine line( "CLASS" ); - - int type = secrecy.type(); - - if ( type == Secrecy::Public ) - line.setValue( "PUBLIC" ); - else if ( type == Secrecy::Private ) - line.setValue( "PRIVATE" ); - else if ( type == Secrecy::Confidential ) - line.setValue( "CONFIDENTIAL" ); - - return line; -} - -Agent VCardTool::parseAgent( const VCardLine &line ) -{ - Agent agent; - - const TQStringList params = line.parameterList(); - if ( params.findIndex( "value" ) != -1 ) { - if ( line.parameter( "value" ).lower() == "uri" ) - agent.setUrl( line.value().asString() ); - } else { - TQString str = line.value().asString(); - str.replace( "\\n", "\r\n" ); - str.replace( "\\N", "\r\n" ); - str.replace( "\\;", ";" ); - str.replace( "\\:", ":" ); - str.replace( "\\,", "," ); - - const Addressee::List list = parseVCards( str ); - if ( list.count() > 0 ) { - Addressee *addr = new Addressee; - *addr = list[ 0 ]; - agent.setAddressee( addr ); - } - } - - return agent; -} - -VCardLine VCardTool::createAgent( VCard::Version version, const Agent &agent ) -{ - VCardLine line( "AGENT" ); - - if ( agent.isIntern() ) { - if ( agent.addressee() != 0 ) { - Addressee::List list; - list.append( *agent.addressee() ); - - TQString str = createVCards( list, version ); - str.replace( "\r\n", "\\n" ); - str.replace( ";", "\\;" ); - str.replace( ":", "\\:" ); - str.replace( ",", "\\," ); - line.setValue( str ); - } - } else if ( !agent.url().isEmpty() ) { - line.setValue( agent.url() ); - line.addParameter( "value", "URI" ); - } - - return line; -} - -TQStringList VCardTool::splitString( const TQChar &sep, const TQString &str ) -{ - TQStringList list; - TQString value( str ); - - int start = 0; - int pos = value.find( sep, start ); - - while ( pos != -1 ) { - if ( value[ pos - 1 ] != '\\' ) { - if ( pos > start && pos <= (int)value.length() ) - list << value.mid( start, pos - start ); - else - list << TQString::null; - - start = pos + 1; - pos = value.find( sep, start ); - } else { - if ( pos != 0 ) { - value.replace( pos - 1, 2, sep ); - pos = value.find( sep, pos ); - } else - pos = value.find( sep, pos + 1 ); - } - } - - int l = value.length() - 1; - if ( value.mid( start, l - start + 1 ).length() > 0 ) - list << value.mid( start, l - start + 1 ); - else - list << TQString::null; - - return list; -} diff --git a/kabc/vcardtool.h b/kabc/vcardtool.h deleted file mode 100644 index fbf959613..000000000 --- a/kabc/vcardtool.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig <tokoe@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 KABC_VCARDTOOL_H -#define KABC_VCARDTOOL_H - -#include "addressee.h" -#include "vcardparser.h" - -class TQDateTime; - -namespace KABC { - -class Agent; -class Key; -class Picture; -class Secrecy; -class Sound; - -class KABC_EXPORT VCardTool -{ - public: - VCardTool(); - ~VCardTool(); - - /** - Creates a string that contains the addressees from the list in - the vCard format. - */ - TQString createVCards( Addressee::List list, VCard::Version version = VCard::v3_0 ); - - /** - Parses the string and returns a list of addressee objects. - */ - Addressee::List parseVCards( const TQString& vcard ); - - private: - /** - Split a string and replaces escaped separators on the fly with - unescaped ones. - */ - TQStringList splitString( const TQChar &sep, const TQString &value ); - - TQDateTime parseDateTime( const TQString &str ); - TQString createDateTime( const TQDateTime &dateTime ); - - Picture parsePicture( const VCardLine &line ); - VCardLine createPicture( const TQString &identifier, const Picture &pic ); - - Sound parseSound( const VCardLine &line ); - VCardLine createSound( const Sound &snd ); - - Key parseKey( const VCardLine &line ); - VCardLine createKey( const Key &key ); - - Secrecy parseSecrecy( const VCardLine &line ); - VCardLine createSecrecy( const Secrecy &secrecy ); - - Agent parseAgent( const VCardLine &line ); - VCardLine createAgent( VCard::Version version, const Agent &agent ); - - TQMap<TQString, int> mAddressTypeMap; - TQMap<TQString, int> mPhoneTypeMap; - - class VCardToolPrivate; - VCardToolPrivate *d; -}; - -} - -#endif diff --git a/kate/part/kateautoindent.cpp b/kate/part/kateautoindent.cpp index d904e16ce..9bbe317df 100644 --- a/kate/part/kateautoindent.cpp +++ b/kate/part/kateautoindent.cpp @@ -27,7 +27,7 @@ #include "katejscript.h" #include "kateview.h" -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tdepopupmenu.h> diff --git a/kate/part/katebookmarks.cpp b/kate/part/katebookmarks.cpp index 5a1a085c2..f29ec9915 100644 --- a/kate/part/katebookmarks.cpp +++ b/kate/part/katebookmarks.cpp @@ -23,7 +23,7 @@ #include "katedocument.h" #include "kateview.h" -#include <klocale.h> +#include <tdelocale.h> #include <tdeaction.h> #include <tdepopupmenu.h> #include <kstringhandler.h> diff --git a/kate/part/katebuffer.cpp b/kate/part/katebuffer.cpp index 7d930570d..61f81fadf 100644 --- a/kate/part/katebuffer.cpp +++ b/kate/part/katebuffer.cpp @@ -31,7 +31,7 @@ #include "kateautoindent.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kcharsets.h> #include <tqpopupmenu.h> diff --git a/kate/part/katecmds.cpp b/kate/part/katecmds.cpp index ad8943328..09dd46f13 100644 --- a/kate/part/katecmds.cpp +++ b/kate/part/katecmds.cpp @@ -32,7 +32,7 @@ #include "../interfaces/katecmd.h" #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kurl.h> #include <kshellcompletion.h> diff --git a/kate/part/kateconfig.cpp b/kate/part/kateconfig.cpp index 9c8e0856f..ed4eaacd2 100644 --- a/kate/part/kateconfig.cpp +++ b/kate/part/kateconfig.cpp @@ -29,9 +29,9 @@ #include <tdeapplication.h> #include <tdeconfig.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kcharsets.h> -#include <klocale.h> +#include <tdelocale.h> #include <kfinddialog.h> #include <kreplacedialog.h> #include <kinstance.h> diff --git a/kate/part/katedialogs.cpp b/kate/part/katedialogs.cpp index 03257735c..1b8ce89eb 100644 --- a/kate/part/katedialogs.cpp +++ b/kate/part/katedialogs.cpp @@ -53,15 +53,15 @@ #include <tdeconfig.h> #include <kdebug.h> #include <tdefontdialog.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kiconloader.h> #include <kkeybutton.h> #include <kkeydialog.h> #include <klineedit.h> #include <tdelistview.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kmimetypechooser.h> #include <knuminput.h> #include <tdeparts/componentfactory.h> @@ -72,7 +72,7 @@ #include <krun.h> #include <kseparator.h> #include <kstandarddirs.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <tqbuttongroup.h> #include <tqcheckbox.h> diff --git a/kate/part/katedocument.cpp b/kate/part/katedocument.cpp index 1928ec225..e42bfb0bd 100644 --- a/kate/part/katedocument.cpp +++ b/kate/part/katedocument.cpp @@ -49,24 +49,24 @@ #include <tdeparts/event.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <tdeapplication.h> #include <tdepopupmenu.h> #include <tdeconfig.h> #include <tdefiledialog.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kstdaction.h> #include <kiconloader.h> #include <kxmlguifactory.h> #include <kdialogbase.h> #include <kdebug.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <klibloader.h> #include <kdirwatch.h> #include <twin.h> #include <kencodingfiledialog.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kmdcodec.h> #include <kstandarddirs.h> diff --git a/kate/part/katedocument.h b/kate/part/katedocument.h index a2a2c6408..adc0dc92a 100644 --- a/kate/part/katedocument.h +++ b/kate/part/katedocument.h @@ -38,7 +38,7 @@ #include <dcopobject.h> #include <kmimetype.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqintdict.h> #include <tqmap.h> diff --git a/kate/part/katedocumenthelpers.cpp b/kate/part/katedocumenthelpers.cpp index e50906b0d..b2e43758f 100644 --- a/kate/part/katedocumenthelpers.cpp +++ b/kate/part/katedocumenthelpers.cpp @@ -25,7 +25,7 @@ #include "kateview.h" #include <tdepopupmenu.h> -#include <klocale.h> +#include <tdelocale.h> KateBrowserExtension::KateBrowserExtension( KateDocument* doc ) : KParts::BrowserExtension( doc, "katepartbrowserextension" ), diff --git a/kate/part/katefactory.cpp b/kate/part/katefactory.cpp index eb760aaff..d6a9e0d59 100644 --- a/kate/part/katefactory.cpp +++ b/kate/part/katefactory.cpp @@ -34,7 +34,7 @@ #include "../interfaces/katecmd.h" #include <kvmallocator.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdirwatch.h> #include <kstaticdeleter.h> diff --git a/kate/part/katefiletype.cpp b/kate/part/katefiletype.cpp index f0b01ef2d..281bf7e2d 100644 --- a/kate/part/katefiletype.cpp +++ b/kate/part/katefiletype.cpp @@ -32,7 +32,7 @@ #include <kdebug.h> #include <kiconloader.h> #include <knuminput.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdepopupmenu.h> #include <tqregexp.h> diff --git a/kate/part/katefont.cpp b/kate/part/katefont.cpp index 29955d7e2..c00953469 100644 --- a/kate/part/katefont.cpp +++ b/kate/part/katefont.cpp @@ -21,7 +21,7 @@ #include "katefont.h" -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tqfontinfo.h> diff --git a/kate/part/katehighlight.cpp b/kate/part/katehighlight.cpp index f6d5ae315..119b718fb 100644 --- a/kate/part/katehighlight.cpp +++ b/kate/part/katehighlight.cpp @@ -33,16 +33,16 @@ #include "kateconfig.h" #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kinstance.h> #include <kmimetype.h> -#include <klocale.h> +#include <tdelocale.h> #include <kregexp.h> #include <tdepopupmenu.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kdebug.h> #include <kstandarddirs.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kstaticdeleter.h> #include <tdeapplication.h> diff --git a/kate/part/katejscript.cpp b/kate/part/katejscript.cpp index f3a5cd548..cab335312 100644 --- a/kate/part/katejscript.cpp +++ b/kate/part/katejscript.cpp @@ -35,8 +35,8 @@ #include <kdebug.h> #include <kstandarddirs.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tdeconfig.h> #include <kjs/function_object.h> diff --git a/kate/part/kateluaindentscript.cpp b/kate/part/kateluaindentscript.cpp index 46cf531a7..375b0b7d4 100644 --- a/kate/part/kateluaindentscript.cpp +++ b/kate/part/kateluaindentscript.cpp @@ -32,8 +32,8 @@ #include <kstandarddirs.h> #include <tdeconfig.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> extern "C" { #include <lua.h> diff --git a/kate/part/kateprinter.cpp b/kate/part/kateprinter.cpp index 6f22b2407..e66119747 100644 --- a/kate/part/kateprinter.cpp +++ b/kate/part/kateprinter.cpp @@ -35,7 +35,7 @@ #include <kdebug.h> #include <kdialog.h> // for spacingHint() #include <tdefontdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprinter.h> #include <kurl.h> #include <kuser.h> // for loginName diff --git a/kate/part/kateschema.cpp b/kate/part/kateschema.cpp index 388513f17..5b71c92e8 100644 --- a/kate/part/kateschema.cpp +++ b/kate/part/kateschema.cpp @@ -27,7 +27,7 @@ #include "kateview.h" #include "katerenderer.h" -#include <klocale.h> +#include <tdelocale.h> #include <kdialogbase.h> #include <kcolorbutton.h> #include <kcombobox.h> @@ -35,7 +35,7 @@ #include <tdefontdialog.h> #include <kdebug.h> #include <kiconloader.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdepopupmenu.h> #include <kcolordialog.h> #include <tdeapplication.h> diff --git a/kate/part/katesearch.cpp b/kate/part/katesearch.cpp index 9d0dc896b..930e4d906 100644 --- a/kate/part/katesearch.cpp +++ b/kate/part/katesearch.cpp @@ -31,9 +31,9 @@ #include "kateconfig.h" #include "katehighlight.h" -#include <klocale.h> +#include <tdelocale.h> #include <kstdaction.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kstringhandler.h> #include <kdebug.h> #include <kfinddialog.h> diff --git a/kate/part/katespell.cpp b/kate/part/katespell.cpp index fc7e943cf..494e52894 100644 --- a/kate/part/katespell.cpp +++ b/kate/part/katespell.cpp @@ -31,7 +31,7 @@ #include <tdespell.h> #include <ksconfig.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> KateSpell::KateSpell( KateView* view ) : TQObject( view ) diff --git a/kate/part/katesyntaxdocument.cpp b/kate/part/katesyntaxdocument.cpp index d90f5de73..700daa9da 100644 --- a/kate/part/katesyntaxdocument.cpp +++ b/kate/part/katesyntaxdocument.cpp @@ -25,8 +25,8 @@ #include <kdebug.h> #include <kstandarddirs.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tdeconfig.h> #include <tqfile.h> diff --git a/kate/part/katetextline.cpp b/kate/part/katetextline.cpp index 6c701e1ed..005892607 100644 --- a/kate/part/katetextline.cpp +++ b/kate/part/katetextline.cpp @@ -23,7 +23,7 @@ #include "katetextline.h" #include "katerenderer.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <tqregexp.h> diff --git a/kate/part/kateview.cpp b/kate/part/kateview.cpp index 92d1bb97e..821cb0faf 100644 --- a/kate/part/kateview.cpp +++ b/kate/part/kateview.cpp @@ -57,10 +57,10 @@ #include <kdebug.h> #include <tdeapplication.h> #include <kcursor.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kcharsets.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeaction.h> #include <kstdaction.h> #include <kxmlguifactory.h> @@ -68,7 +68,7 @@ #include <klibloader.h> #include <kencodingfiledialog.h> #include <tdemultipledrag.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <ksavefile.h> #include <tqfont.h> diff --git a/kate/part/kateviewhelpers.cpp b/kate/part/kateviewhelpers.cpp index e8df70aa8..dd52451b0 100644 --- a/kate/part/kateviewhelpers.cpp +++ b/kate/part/kateviewhelpers.cpp @@ -33,10 +33,10 @@ #include "kateviewinternal.h" #include <tdeapplication.h> -#include <kglobalsettings.h> -#include <klocale.h> +#include <tdeglobalsettings.h> +#include <tdelocale.h> #include <knotifyclient.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kcharsets.h> #include <tdepopupmenu.h> diff --git a/kate/part/kateviewinternal.cpp b/kate/part/kateviewinternal.cpp index a687c5523..c2b0ca4db 100644 --- a/kate/part/kateviewinternal.cpp +++ b/kate/part/kateviewinternal.cpp @@ -38,7 +38,7 @@ #include <kcursor.h> #include <kdebug.h> #include <tdeapplication.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kurldrag.h> #include <tqstyle.h> diff --git a/kate/part/test_regression.cpp b/kate/part/test_regression.cpp index a503020c3..1b6decfe3 100644 --- a/kate/part/test_regression.cpp +++ b/kate/part/test_regression.cpp @@ -45,7 +45,7 @@ #include <tdeio/job.h> #include <tdemainwindow.h> #include <ksimpleconfig.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tqcolor.h> #include <tqcursor.h> diff --git a/kate/plugins/autobookmarker/autobookmarker.cpp b/kate/plugins/autobookmarker/autobookmarker.cpp index 495233d40..3f87f1580 100644 --- a/kate/plugins/autobookmarker/autobookmarker.cpp +++ b/kate/plugins/autobookmarker/autobookmarker.cpp @@ -34,7 +34,7 @@ #include <kgenericfactory.h> #include <kiconloader.h> #include <tdelistview.h> -#include <klocale.h> +#include <tdelocale.h> #include <kmimetype.h> #include <kmimetypechooser.h> #include <kprocess.h> diff --git a/kate/plugins/insertfile/insertfileplugin.cpp b/kate/plugins/insertfile/insertfileplugin.cpp index 567262a64..e2e3d354a 100644 --- a/kate/plugins/insertfile/insertfileplugin.cpp +++ b/kate/plugins/insertfile/insertfileplugin.cpp @@ -28,10 +28,10 @@ #include <tdeaction.h> #include <tdefiledialog.h> #include <kgenericfactory.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kpushbutton.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kurl.h> #include <tqfile.h> diff --git a/kate/plugins/isearch/ISearchPlugin.cpp b/kate/plugins/isearch/ISearchPlugin.cpp index a36c9dc60..7cb01ccc9 100644 --- a/kate/plugins/isearch/ISearchPlugin.cpp +++ b/kate/plugins/isearch/ISearchPlugin.cpp @@ -21,7 +21,7 @@ #include <tqstyle.h> #include <tqpopupmenu.h> #include <kgenericfactory.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaction.h> #include <kcombobox.h> #include <tdeconfig.h> diff --git a/kate/plugins/kdatatool/kate_kdatatool.cpp b/kate/plugins/kdatatool/kate_kdatatool.cpp index d3b762b8e..e14cd9249 100644 --- a/kate/plugins/kdatatool/kate_kdatatool.cpp +++ b/kate/plugins/kdatatool/kate_kdatatool.cpp @@ -29,7 +29,7 @@ #include <tdepopupmenu.h> #include <tdetexteditor/viewcursorinterface.h> #include <tdetexteditor/editinterface.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> //END includes diff --git a/kate/plugins/wordcompletion/docwordcompletion.cpp b/kate/plugins/wordcompletion/docwordcompletion.cpp index 4a3d34207..26dce06d0 100644 --- a/kate/plugins/wordcompletion/docwordcompletion.cpp +++ b/kate/plugins/wordcompletion/docwordcompletion.cpp @@ -37,7 +37,7 @@ #include <tdeconfig.h> #include <kdialog.h> #include <kgenericfactory.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaction.h> #include <knotifyclient.h> #include <tdeparts/part.h> diff --git a/kded/kbuildimageiofactory.cpp b/kded/kbuildimageiofactory.cpp index 267af31f6..b5873cad8 100644 --- a/kded/kbuildimageiofactory.cpp +++ b/kded/kbuildimageiofactory.cpp @@ -20,10 +20,10 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <assert.h> #include <kimageiofactory.h> diff --git a/kded/kbuildprotocolinfofactory.cpp b/kded/kbuildprotocolinfofactory.cpp index f3fe698d4..921e55ab9 100644 --- a/kded/kbuildprotocolinfofactory.cpp +++ b/kded/kbuildprotocolinfofactory.cpp @@ -21,11 +21,11 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kmessageboxwrapper.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <assert.h> KBuildProtocolInfoFactory::KBuildProtocolInfoFactory() : diff --git a/kded/kbuildservicefactory.cpp b/kded/kbuildservicefactory.cpp index 7d9406d36..6f127caf2 100644 --- a/kded/kbuildservicefactory.cpp +++ b/kded/kbuildservicefactory.cpp @@ -23,10 +23,10 @@ #include "kresourcelist.h" #include "kmimetype.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kmessageboxwrapper.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <assert.h> diff --git a/kded/kbuildservicegroupfactory.cpp b/kded/kbuildservicegroupfactory.cpp index 76f27ba57..3903a6b39 100644 --- a/kded/kbuildservicegroupfactory.cpp +++ b/kded/kbuildservicegroupfactory.cpp @@ -21,11 +21,11 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kmessageboxwrapper.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <assert.h> KBuildServiceGroupFactory::KBuildServiceGroupFactory() : diff --git a/kded/kbuildservicetypefactory.cpp b/kded/kbuildservicetypefactory.cpp index 351b7847a..da2863347 100644 --- a/kded/kbuildservicetypefactory.cpp +++ b/kded/kbuildservicetypefactory.cpp @@ -21,11 +21,11 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kmessageboxwrapper.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <assert.h> #include <kdesktopfile.h> diff --git a/kded/kded.cpp b/kded/kded.cpp index b6e6b523f..947d3b816 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -38,8 +38,8 @@ #include <kuniqueapplication.h> #include <tdecmdlineargs.h> #include <tdeaboutdata.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kprocess.h> #include <kdebug.h> #include <kdirwatch.h> diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 7585e0ad0..c78152b97 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -30,9 +30,9 @@ #include <tdecmdlineargs.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaboutdata.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kprocess.h> #include <kde_file.h> diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp index 4ad6bc3db..4cf7a843e 100644 --- a/kded/tde-menu.cpp +++ b/kded/tde-menu.cpp @@ -26,8 +26,8 @@ #include "tdeaboutdata.h" #include "tdeapplication.h" #include "tdecmdlineargs.h" -#include "kglobal.h" -#include "klocale.h" +#include "tdeglobal.h" +#include "tdelocale.h" #include "kservice.h" #include "kservicegroup.h" #include "kstandarddirs.h" diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index aa03c2c94..4325162f7 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -42,12 +42,12 @@ #include <assert.h> #include <tdeapplication.h> #include <dcopclient.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <kdirwatch.h> #include <kstandarddirs.h> #include <ksavefile.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaboutdata.h> #include <tdecmdlineargs.h> #include <kcrash.h> @@ -55,7 +55,7 @@ #ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build // GUI version of tdebuildsycoca, so-called "tdebuildsycocaw". # include <tqlabel.h> -# include <kmessagebox.h> +# include <tdemessagebox.h> bool silent; bool showprogress; #endif diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp index e2dc603ba..408c6af9a 100644 --- a/kded/vfolder_menu.cpp +++ b/kded/vfolder_menu.cpp @@ -23,7 +23,7 @@ #include <stdlib.h> // getenv #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kservice.h> #include <kde_file.h> diff --git a/kdewidgets/CMakeLists.txt b/kdewidgets/CMakeLists.txt index a0a6f29df..19768e7ef 100644 --- a/kdewidgets/CMakeLists.txt +++ b/kdewidgets/CMakeLists.txt @@ -61,6 +61,6 @@ add_custom_command( OUTPUT kdewidgets.cpp tde_add_kpart( ${target} AUTOMOC SOURCES ${${target}_SRCS} - LINK kabc-shared + LINK tdeabc-shared DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/designer ) diff --git a/kdewidgets/kde.widgets b/kdewidgets/kde.widgets index c81df5394..81b5ba82a 100644 --- a/kdewidgets/kde.widgets +++ b/kdewidgets/kde.widgets @@ -272,7 +272,7 @@ Group=Display (KDE) ConstructorArgs=(parent, 210, 16) [KABC::LdapConfigWidget] -IncludeFile=kabc/ldapconfigwidget.h +IncludeFile=tdeabc/ldapconfigwidget.h ToolTip=A widget which allows the user to set up LDAP connection parameters Group=Input (KDE) ConstructorArgs=(KABC::LdapConfigWidget::W_ALL, parent, name) diff --git a/kdewidgets/tests/test.widgets b/kdewidgets/tests/test.widgets index 30758f69e..aa5ade889 100644 --- a/kdewidgets/tests/test.widgets +++ b/kdewidgets/tests/test.widgets @@ -261,7 +261,7 @@ Group=Display (KDE) ConstructorArgs=(parent, 210, 16) [KABC::AddressLineEdit] -IncludeFile=kabc/addresslineedit.h +IncludeFile=tdeabc/addresslineedit.h ToolTip=A lineedit with LDAP and kabc completion. Group=Input (KDE) ConstructorArgs=(parent, true, name) diff --git a/kdoctools/meinproc.cpp b/kdoctools/meinproc.cpp index d0a1b7323..51f0b913a 100644 --- a/kdoctools/meinproc.cpp +++ b/kdoctools/meinproc.cpp @@ -19,7 +19,7 @@ #include <tqfile.h> #include <tqdir.h> #include <tdecmdlineargs.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaboutdata.h> #include <stdlib.h> #include <kdebug.h> diff --git a/kdoctools/tdeio_help.cpp b/kdoctools/tdeio_help.cpp index d9f306b43..7b9d2a36e 100644 --- a/kdoctools/tdeio_help.cpp +++ b/kdoctools/tdeio_help.cpp @@ -25,8 +25,8 @@ #include <kdebug.h> #include <kurl.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <kinstance.h> diff --git a/kdoctools/xslt.cpp b/kdoctools/xslt.cpp index 2eb03cfbc..498e6b2c8 100644 --- a/kdoctools/xslt.cpp +++ b/kdoctools/xslt.cpp @@ -12,7 +12,7 @@ #include <xslt.h> #include <kinstance.h> #include "tdeio_help.h" -#include <klocale.h> +#include <tdelocale.h> #include <assert.h> #include <kfilterbase.h> #include <kfilterdev.h> diff --git a/kimgio/dds.cpp b/kimgio/dds.cpp index d174bf893..22251002c 100644 --- a/kimgio/dds.cpp +++ b/kimgio/dds.cpp @@ -24,7 +24,7 @@ #include <tqimage.h> #include <tqdatastream.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <math.h> // sqrtf diff --git a/kimgio/eps.cpp b/kimgio/eps.cpp index d839ffe30..bcf916836 100644 --- a/kimgio/eps.cpp +++ b/kimgio/eps.cpp @@ -6,7 +6,7 @@ #include <tqpainter.h> #include <tqprinter.h> #include <tdeapplication.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kdebug.h> #include "eps.h" diff --git a/kimgio/exr.cpp b/kimgio/exr.cpp index c28cb799b..563c151a2 100644 --- a/kimgio/exr.cpp +++ b/kimgio/exr.cpp @@ -35,7 +35,7 @@ #include <kurl.h> #include <kprocess.h> -#include <klocale.h> +#include <tdelocale.h> #include <kgenericfactory.h> #include <kdebug.h> diff --git a/kimgio/gimp.h b/kimgio/gimp.h index 114ffdc0f..7da1a45f8 100644 --- a/kimgio/gimp.h +++ b/kimgio/gimp.h @@ -21,7 +21,7 @@ * */ -#include <kglobal.h> +#include <tdeglobal.h> /* * These are the constants and functions I extracted from The GIMP source diff --git a/kimgio/hdr.cpp b/kimgio/hdr.cpp index 82cba5c12..5f1832f02 100644 --- a/kimgio/hdr.cpp +++ b/kimgio/hdr.cpp @@ -14,7 +14,7 @@ #include <tqdatastream.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> typedef TQ_UINT8 uchar; diff --git a/kimgio/jp2.cpp b/kimgio/jp2.cpp index 2200c948c..5de8fff8e 100644 --- a/kimgio/jp2.cpp +++ b/kimgio/jp2.cpp @@ -12,7 +12,7 @@ #ifdef HAVE_STDINT_H #include <stdint.h> #endif -#include <ktempfile.h> +#include <tdetempfile.h> #include <tqcolor.h> #include <tqcstring.h> #include <tqfile.h> diff --git a/kinit/autostart.cpp b/kinit/autostart.cpp index 4e4ad1f56..ccdbd3d97 100644 --- a/kinit/autostart.cpp +++ b/kinit/autostart.cpp @@ -24,7 +24,7 @@ #include <tdeconfig.h> #include <kdesktopfile.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <stdlib.h> diff --git a/kinit/kinit.cpp b/kinit/kinit.cpp index f6b4a3e59..1dc03002d 100644 --- a/kinit/kinit.cpp +++ b/kinit/kinit.cpp @@ -54,11 +54,11 @@ #include <tqfont.h> #include <kinstance.h> #include <kstandarddirs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <klibloader.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #ifdef HAVE_SYS_PRCTL_H #include <sys/prctl.h> @@ -68,7 +68,7 @@ #endif #if defined Q_WS_X11 && ! defined K_WS_QTONLY -#include <kstartupinfo.h> // schroder +#include <tdestartupinfo.h> // schroder #endif #include <tdeversion.h> diff --git a/kinit/tdelauncher.cpp b/kinit/tdelauncher.cpp index 7b75bfaf5..f7ca08678 100644 --- a/kinit/tdelauncher.cpp +++ b/kinit/tdelauncher.cpp @@ -32,16 +32,16 @@ #include <tdeconfig.h> #include <kdebug.h> #include <klibloader.h> -#include <klocale.h> -#include <kprotocolmanager.h> +#include <tdelocale.h> +#include <tdeprotocolmanager.h> #include <kprotocolinfo.h> #include <krun.h> #include <kstandarddirs.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kurl.h> #if defined Q_WS_X11 && ! defined K_WS_QTONLY -#include <kstartupinfo.h> // schroder +#include <tdestartupinfo.h> // schroder #endif diff --git a/kinit/tdelauncher_main.cpp b/kinit/tdelauncher_main.cpp index d59cfb86f..747050668 100644 --- a/kinit/tdelauncher_main.cpp +++ b/kinit/tdelauncher_main.cpp @@ -31,7 +31,7 @@ #include <stdlib.h> #include <signal.h> #include <tqcstring.h> -#include <klocale.h> +#include <tdelocale.h> #include "tdelauncher_cmds.h" diff --git a/knewstuff/downloaddialog.cpp b/knewstuff/downloaddialog.cpp index ccbde83d6..8c31712cb 100644 --- a/knewstuff/downloaddialog.cpp +++ b/knewstuff/downloaddialog.cpp @@ -21,12 +21,12 @@ #include "downloaddialog.h" #include "downloaddialog.moc" -#include <klocale.h> +#include <tdelocale.h> #include <tdelistview.h> #include <kdebug.h> #include <tdeio/job.h> #include <tdeio/netaccess.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kurl.h> #include <tdeconfig.h> #include <tdeapplication.h> diff --git a/knewstuff/engine.cpp b/knewstuff/engine.cpp index a22750f8b..2b33e85f5 100644 --- a/knewstuff/engine.cpp +++ b/knewstuff/engine.cpp @@ -25,8 +25,8 @@ #include <tdeapplication.h> #include <kdebug.h> #include <tdeio/job.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kstandarddirs.h> #include "knewstuff.h" diff --git a/knewstuff/entry.cpp b/knewstuff/entry.cpp index 56dd375f4..00f7df522 100644 --- a/knewstuff/entry.cpp +++ b/knewstuff/entry.cpp @@ -23,8 +23,8 @@ #include <tqptrdict.h> #include <tqwindowdefs.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> using namespace KNS; diff --git a/knewstuff/ghns.cpp b/knewstuff/ghns.cpp index dfe86a2a4..0702f16bb 100644 --- a/knewstuff/ghns.cpp +++ b/knewstuff/ghns.cpp @@ -28,7 +28,7 @@ #include <tdeaboutdata.h> #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> #include <kprocess.h> #include <kdialog.h> diff --git a/knewstuff/knewstuff.cpp b/knewstuff/knewstuff.cpp index 07034b454..b652ba4a8 100644 --- a/knewstuff/knewstuff.cpp +++ b/knewstuff/knewstuff.cpp @@ -21,7 +21,7 @@ #include <tdeaction.h> #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include "engine.h" diff --git a/knewstuff/knewstuffbutton.cpp b/knewstuff/knewstuffbutton.cpp index 3ad0d6ac6..3baa83397 100644 --- a/knewstuff/knewstuffbutton.cpp +++ b/knewstuff/knewstuffbutton.cpp @@ -18,7 +18,7 @@ */ #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include "downloaddialog.h" #include "knewstuffbutton.h" diff --git a/knewstuff/knewstuffgeneric.cpp b/knewstuff/knewstuffgeneric.cpp index aa94559b9..ef6a37456 100644 --- a/knewstuff/knewstuffgeneric.cpp +++ b/knewstuff/knewstuffgeneric.cpp @@ -24,11 +24,11 @@ #include <tqdir.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprocess.h> #include <tdeconfig.h> #include <kstandarddirs.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <ktar.h> #include "entry.h" diff --git a/knewstuff/knewstuffsecure.cpp b/knewstuff/knewstuffsecure.cpp index b61924243..67374800e 100644 --- a/knewstuff/knewstuffsecure.cpp +++ b/knewstuff/knewstuffsecure.cpp @@ -18,10 +18,10 @@ //kde includes #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeio/netaccess.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kstandarddirs.h> #include <ktar.h> #include <ktempdir.h> diff --git a/knewstuff/provider.cpp b/knewstuff/provider.cpp index d5da6bdde..20f1668f7 100644 --- a/knewstuff/provider.cpp +++ b/knewstuff/provider.cpp @@ -21,9 +21,9 @@ #include <tdeconfig.h> #include <kdebug.h> #include <tdeio/job.h> -#include <kglobal.h> -#include <kmessagebox.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdemessagebox.h> +#include <tdelocale.h> #include <tqptrdict.h> #include <tqwindowdefs.h> diff --git a/knewstuff/providerdialog.cpp b/knewstuff/providerdialog.cpp index ddc0b2ef3..f71558ecd 100644 --- a/knewstuff/providerdialog.cpp +++ b/knewstuff/providerdialog.cpp @@ -23,8 +23,8 @@ #include <tqlabel.h> #include <tdelistview.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include "engine.h" #include "provider.h" diff --git a/knewstuff/security.cpp b/knewstuff/security.cpp index d9ad85a7c..d161c2969 100644 --- a/knewstuff/security.cpp +++ b/knewstuff/security.cpp @@ -22,9 +22,9 @@ //kde includes #include <kdebug.h> #include <kinputdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <kmdcodec.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kpassdlg.h> #include <kprocio.h> diff --git a/knewstuff/tdehotnewstuff.cpp b/knewstuff/tdehotnewstuff.cpp index 87d735330..fb9e92a9b 100644 --- a/knewstuff/tdehotnewstuff.cpp +++ b/knewstuff/tdehotnewstuff.cpp @@ -20,7 +20,7 @@ #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> #include <tdeaboutdata.h> diff --git a/knewstuff/testnewstuff.cpp b/knewstuff/testnewstuff.cpp index 82b6d18f7..3494c5230 100644 --- a/knewstuff/testnewstuff.cpp +++ b/knewstuff/testnewstuff.cpp @@ -27,7 +27,7 @@ #include <tdeaboutdata.h> #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> #include <kprocess.h> #include <kdialog.h> diff --git a/knewstuff/uploaddialog.cpp b/knewstuff/uploaddialog.cpp index 98f8f60c7..f4b3dd50e 100644 --- a/knewstuff/uploaddialog.cpp +++ b/knewstuff/uploaddialog.cpp @@ -27,10 +27,10 @@ #include <ktextedit.h> #include <tdelistview.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kurlrequester.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeconfig.h> #include <tdeapplication.h> #include <kuser.h> diff --git a/kstyles/highcontrast/config/highcontrastconfig.cpp b/kstyles/highcontrast/config/highcontrastconfig.cpp index 9de7f1bfd..f271113ca 100644 --- a/kstyles/highcontrast/config/highcontrastconfig.cpp +++ b/kstyles/highcontrast/config/highcontrastconfig.cpp @@ -28,8 +28,8 @@ DEALINGS IN THE SOFTWARE. #include <tqlayout.h> #include <tqsettings.h> #include <kdialog.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include "highcontrastconfig.h" diff --git a/kstyles/klegacy/klegacystyle.cpp b/kstyles/klegacy/klegacystyle.cpp index 5c083632e..a169de874 100644 --- a/kstyles/klegacy/klegacystyle.cpp +++ b/kstyles/klegacy/klegacystyle.cpp @@ -24,7 +24,7 @@ #include "klegacystyle.h" #include "klegacystyle.moc" -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #define INCLUDE_MENUITEM_DEF diff --git a/kstyles/klegacy/plugin.cpp b/kstyles/klegacy/plugin.cpp index 5d3a58492..558b54e73 100644 --- a/kstyles/klegacy/plugin.cpp +++ b/kstyles/klegacy/plugin.cpp @@ -1,5 +1,5 @@ #include "klegacystyle.h" -#include <klocale.h> +#include <tdelocale.h> extern "C" { TDEStyle* allocate(); diff --git a/kstyles/kthemestyle/kthemestyle.cpp b/kstyles/kthemestyle/kthemestyle.cpp index 4cc374e5d..a164821b1 100644 --- a/kstyles/kthemestyle/kthemestyle.cpp +++ b/kstyles/kthemestyle/kthemestyle.cpp @@ -53,7 +53,7 @@ Port version 0.9.7 #include <tqpalette.h> #include <tqtabbar.h> #include <tqtoolbutton.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kdrawutil.h> #include <tqdrawutil.h> #include <tqprogressbar.h> diff --git a/kstyles/plastik/config/plastitdeconf.cpp b/kstyles/plastik/config/plastitdeconf.cpp index 8d3e4acfd..38cda2426 100644 --- a/kstyles/plastik/config/plastitdeconf.cpp +++ b/kstyles/plastik/config/plastitdeconf.cpp @@ -30,8 +30,8 @@ DEALINGS IN THE SOFTWARE. #include <tqsettings.h> #include <tqcolor.h> #include <tqgroupbox.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kcolorbutton.h> #include <kdemacros.h> diff --git a/kstyles/utils/installtheme/main.cpp b/kstyles/utils/installtheme/main.cpp index 274c2d335..3ce63dfdf 100644 --- a/kstyles/utils/installtheme/main.cpp +++ b/kstyles/utils/installtheme/main.cpp @@ -27,8 +27,8 @@ #include <tdeapplication.h> #include <tdecmdlineargs.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> diff --git a/kstyles/web/plugin.cpp b/kstyles/web/plugin.cpp index 6ab10ebd8..bd4371ce3 100644 --- a/kstyles/web/plugin.cpp +++ b/kstyles/web/plugin.cpp @@ -1,4 +1,4 @@ -#include <klocale.h> +#include <tdelocale.h> #include "webstyle.h" extern "C" diff --git a/kstyles/web/webstyle.cpp b/kstyles/web/webstyle.cpp index d96688ee0..b3b461954 100644 --- a/kstyles/web/webstyle.cpp +++ b/kstyles/web/webstyle.cpp @@ -34,7 +34,7 @@ #include <tdeapplication.h> #include <kdrawutil.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kdebug.h> diff --git a/libtdemid/deviceman.cc b/libtdemid/deviceman.cc index b8210af6d..fec0ff090 100644 --- a/libtdemid/deviceman.cc +++ b/libtdemid/deviceman.cc @@ -67,7 +67,7 @@ #if 1 #include <kinstance.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #endif diff --git a/libtdescreensaver/main.cpp b/libtdescreensaver/main.cpp index f9d8ccb17..073d7845d 100644 --- a/libtdescreensaver/main.cpp +++ b/libtdescreensaver/main.cpp @@ -24,8 +24,8 @@ #include <signal.h> #include <tqdialog.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kdebug.h> #include <tdecmdlineargs.h> #include <tdeapplication.h> diff --git a/networkstatus/connectionmanager.cpp b/networkstatus/connectionmanager.cpp index c37214ecd..f36220886 100644 --- a/networkstatus/connectionmanager.cpp +++ b/networkstatus/connectionmanager.cpp @@ -20,8 +20,8 @@ */ #include <tdeapplication.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kstaticdeleter.h> #include "clientiface_stub.h" diff --git a/networkstatus/networkstatusindicator.cpp b/networkstatus/networkstatusindicator.cpp index 957d6f739..a77f1c1fd 100644 --- a/networkstatus/networkstatusindicator.cpp +++ b/networkstatus/networkstatusindicator.cpp @@ -23,7 +23,7 @@ #include <tqlabel.h> #include <tqtooltip.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include "connectionmanager.h" diff --git a/tdeabc/CMakeLists.txt b/tdeabc/CMakeLists.txt new file mode 100644 index 000000000..e0ec832d0 --- /dev/null +++ b/tdeabc/CMakeLists.txt @@ -0,0 +1,123 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( vcard ) +add_subdirectory( vcardparser ) +add_subdirectory( formats ) +add_subdirectory( plugins ) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/vcard/include + ${CMAKE_CURRENT_SOURCE_DIR}/vcard/include/generated + ${CMAKE_CURRENT_SOURCE_DIR}/vcardparser + + # external includes + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/kab +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + address.h addressbook.h addresseedialog.h + agent.h distributionlist.h distributionlistdialog.h + distributionlisteditor.h errorhandler.h field.h + format.h formatfactory.h formatplugin.h geo.h key.h + phonenumber.h picture.h plugin.h resource.h secrecy.h + resourceselectdialog.h sound.h stdaddressbook.h + timezone.h vcardconverter.h vcardformat.h lock.h + vcardformatplugin.h ldifconverter.h addresslineedit.h + ldapclient.h addresseelist.h locknull.h ldif.h + ldapurl.h ldapconfigwidget.h sortmode.h + ${CMAKE_CURRENT_BINARY_DIR}/addressee.h + DESTINATION ${INCLUDE_INSTALL_DIR}/tdeabc ) + + +##### other data ################################ + +install( FILES tdeab2tdeabc.desktop DESTINATION ${AUTOSTART_INSTALL_DIR} ) +install( FILES kabc_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources ) +install( FILES countrytransl.map DESTINATION ${DATA_INSTALL_DIR}/tdeabc ) + + +##### generated files ########################### +# FIXME this hack make compatibility with out-of-source mode + +file( COPY + scripts/makeaddressee scripts/addressee.src.cpp + scripts/addressee.src.h scripts/entrylist scripts/field.src.cpp + DESTINATION scripts ) + +add_custom_command( + OUTPUT addressee.cpp addressee.h field.cpp + COMMAND perl + ARGS makeaddressee + DEPENDS scripts/addressee.src.cpp scripts/addressee.src.h scripts/entrylist scripts/field.src.cpp + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts +) + + +##### tdeabc ###################################### + +set( target tdeabc ) + +set( ${target}_SRCS + address.cpp addressbook.cpp addressee.cpp addresseedialog.cpp + agent.cpp distributionlist.cpp distributionlistdialog.cpp + distributionlisteditor.cpp errorhandler.cpp field.cpp + formatfactory.cpp geo.cpp key.cpp phonenumber.cpp + picture.cpp plugin.cpp resource.cpp resourceselectdialog.cpp + secrecy.cpp sound.cpp stdaddressbook.cpp timezone.cpp + vcard21parser.cpp vcardconverter.cpp vcardformat.cpp + vcardformatimpl.cpp vcardformatplugin.cpp ldifconverter.cpp + addresslineedit.cpp ldapclient.cpp addresseelist.cpp + vcardtool.cpp addresseehelper.cpp lock.cpp locknull.cpp + ldif.cpp ldapurl.cpp ldapconfigwidget.cpp sortmode.cpp + addresseehelper.skel +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.2.0 + LINK vcards-static vcard-shared tdeio-shared tderesources-shared + DEPENDENCIES addressee.h dcopidl + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### tdeab2tdeabc ################################## + +set( target tdeab2tdeabc ) + +set( ${target}_SRCS + tdeab2tdeabc.cpp +) + +tde_add_executable( ${target} + SOURCES ${${target}_SRCS} + LINK kab-static tdeabc-shared + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/tdeabc/HACKING b/tdeabc/HACKING new file mode 100644 index 000000000..429ae0865 --- /dev/null +++ b/tdeabc/HACKING @@ -0,0 +1,100 @@ +Coding Style +============ + +See http://korganizer.kde.org/hacking.html for an HTML version. + +Formatting +---------- + +- No Tabs. +- Indent with 2 spaces. +- A line must not have more than 80 chars. +- Put Spaces between brackets and arguments of functions. +- For if, else, while and similar statements put the brackets on the same line + as the statement. +- Function and class definitions have their brackets on separate lines. + +Example: + +void MyClass::myFunction() +{ + if ( blah == fasel ) { + blubbVariable = arglValue; + } else { + blubbVariable = oerxValue; + } +} + + +Header Formatting +----------------- + +- General formatting rules apply. +- Access modifiers are indented. +- Put curly brackets of class definition on its own line. +- Double inclusion protection defines are all upper case letters and are + composed of the namespace (if available), the classname and a H suffix + separated by underscores. +- Inside a namespace there is no indentation. + +Example: + +#ifndef XKJ_MYCLASS_H +#define XKJ_MYCLASS_H + +namespace XKJ { + +class MyClass +{ + public: + MyClass(); + + private: + int mMyInt; +}; + +} + +#endif + + +API docs +-------- + +- Each public function must have a Doxygen compatible comment in the header +- Use C-style comments without additional asterisks +- Indent correctly. +- Comments should be grammatically correct, e.g. sentences start with uppercase + letters and end with a full stop. +- Be concise. + +Example: + + /** + This function makes tea. + + @param cups number of cups. + @result tea + */ + Tea makeTea( int cups ); + + +Class and File Names +-------------------- + +- Put classes in files, which have the same name as the class, but only + lower-case letters. +- Designer-generated files should have a name classname_base.ui and shoul + contain a class called ClassnameBase. +- Classes inheriting from designer-generated classes have the same name as the + generated class, but without the Base suffix. + +Class and Variable Names +------------------------ + +- For class, variable, function names seperate multiple words by upper-casing + the words precedeed by other words. +- Class names start with an upper-case letter. +- Function names start with a lower-case letter. +- Variable names start with a lower-case letter. +- Member variables of a class start with "m" followed by an upper-case letter. diff --git a/tdeabc/HOWTO b/tdeabc/HOWTO new file mode 100644 index 000000000..3941b2033 --- /dev/null +++ b/tdeabc/HOWTO @@ -0,0 +1,372 @@ +The KDE Address Book Framework +=============================== + +The KDE address book framework tries to provide an easy to use and powerful +mechanism to handle contacts in all KDE applications. + +If you want to make use of it, this small introduction to programming +with libkabc may be helpful. + + +General Concepts +================= + +In libkabc the storage and management of contacts is devided in 2 layers. + +****************** +Management Layer * +****************** + + .-------------------. + | KABC::AddressBook | + .--------------------------------. + | KABC::Addressee | => Iterators + | KABC::Addressee | + | KABC::Addressee | => Search functions + | ... | + `--------------------------------' + | + - - - - - - - - - - - | - - - - - - - - - - - - - + | +*************** | +Storage Layer * | +*************** | ....................... + | . . - Network + .---------------. | . .---------------. . + | ResourceFile |----+-----| ResourceLDAP | . + `---------------' | . `---------------' . + .---------------. | . .---------------. . + | ResourceDir |----+-----| ResourceNet | . + `---------------' . `---------------' . + . . + ....................... + + +The Management Layer +--------------------- +The Management Layer consists of the two classes KABC::AddressBook and +KABC::Addressee. KABC::AddressBook is a container for KABC::Addressee objects +and provides 2 kinds of access methods. +1) Iterators + With iterators you can iterate over each of the contacts of the + address book and perform an action on it + +2) Search functions + With search functions you can search for contacts with special attributes + such as "all contacts with the name 'Harald'" + +The class KABC::Addressee represents a single contact and contains all data +a vCard could store (as specified in RFC 2426). + +The Storage Layer +------------------ +The Storage Layer consists of the class KABC::Resource and its derived classes. +These classes are used by KABC::AddressBook to load and store the contacts to +the single backends. +At the moment libkabc provides 4 types of resources: +1) ResourceFile + - stores all contacts in a single file + +2) ResourceDir + - stores each contact in its own file with the unique identifier of the + contact as a filename, will all of the files together in one directory + +3) ResourceLDAP + - stores all of the contacts on a LDAP server + +4) ResourceNet + - stores all contacts in a single file, which can be accessable via HTTP, + FTP, Fish, WebDAV, POP3, IMAP or whatever the KIO frame work supports + +In general the developer does not have to take how to save the single contacts. +He just has to plug one of the above mentioned resources into KABC::AddressBook +and perform a save action. + +Examples +========= +Like a picture, C/C++ code is worth a 1000 words I'd like to give you a +lot of examples now, how to use libkabc for several tasks: + + +Using KABC::StdAddressBook and Iterators +----------------------------------------- +Normally you have to plugin the resources manually into the addressbook object +and call the load() function before you can access the contacts, but there is +a special class KABC::StdAddressBook, which loads all resources of the standard +address book of the user automatically. You can use it the following way: + + + #include <tdeabc/stdaddressbook.h> + + 1: KABC::AddressBook *ab = KABC::StdAddressBook::self(); + 2: KABC::AddressBook::Iterator it; + 3: for ( it = ab->begin(); it != ab->end(); ++it ) { + 4: KABC::Addressee addr = (*it); + 5: + 6: kdDebug() << "Name = " << addr.formattedName() << endl; + 7: } + +The above example prints out the names of all the contacts in the user's address +book. In line 1 you retrieve a pointer to the user's standard address book +(provided by KABC::StdAddressBook via a singleton design pattern). +In line 2 an iterator is defined, which is used in line 3 to iterate over the +whole address book. The assignment in line 4 is intended only to show more +clearly how iterators function. +You could also use (*it).formattedName() directly. In line 6 the formatted name +of the current contact is printed out to stderr. +As you can see that's all magic, and it's quite easy ;) + + +Using KABC::AddressBook manually +--------------------------------- +In some cases you don't want to load the user's standard address book, but, +for example, just a single vCard. For this purpose you have to use the +class KABC::AddressBook and handle the resource stuff manually. +The following code will create a file resource and save a contact into it: + + + #include <tdeabc/addressbook.h> + #include <tdeabc/resourcefile.h> + + 1: KABC::AddressBook ab; + 2: + 3: // create a file resource + 4: KABC::Resource *res = new KABC::ResourceFile( "/home/user/myvcard.vcf", "vcard" ); + 5: + 6: if ( !ab.addResource( res ) ) { + 7: kdDebug() << "Unable to open resource" << endl; + 8: return 1; + 9: } +10: +11: if ( !ab.load() ) { +12: kdDebug() << "Unable to load address book!" << endl; +13: return 2; +14: } +15: +16: KABC::Addressee addr; +17: addr.setNameFromString( "Otto Harald Meyer" ); +18: addr.setBirthday( QDate( 1982, 07, 19 ) ); +19: addr.setNickName( "otto" ); +20: addr.setMailer( "kmail" ); +21: +22: // TZ +23: KABC::TimeZone tz( 60 ); // takes time shift in minutes as argument +24: addr.setTimeZone( tz ); +25: +26: // GEO +27: KABC::Geo geo( 52.5, 13.36 ); // takes latitude and longitude as argument +28: addr.setGeo( geo ); +29: +30: addr.setTitle( "dude, the" ); +31: addr.setRole( "developer" ); +32: addr.setOrganization( "KDE e.V." ); +33: addr.setNote( "Yet another senseless note..." ); +34: addr.setUrl( KURL( "http://kaddressbook.org" ) ); +35: +36: // CLASS +37: KABC::Secrecy secrecy( KABC::Secrecy::Confidential ); +38: addr.setSecrecy( secrecy ); +39: +40: // PHOTO or LOGO +41: KABC::Picture photo; +42: QImage img; +43: if ( img.load( "face.png", "PNG" ) ) { +44: photo.setData( img ); +45: photo.setType( "image/png" ); +46: addr.setPhoto( photo ); +47: } +48: +49: addr.insertEmail( "otto@kde.se", true ); // preferred email +50: addr.insertEmail( "otti@yahoo.com", false ); +51: +52: // TEL +53: KABC::PhoneNumber phoneHome( "0351 5466738", KABC::PhoneNumber::Home ); +54: KABC::PhoneNumber phoneWork( "0351 2335411", KABC::PhoneNumber::Work ); +55: addr.insertPhoneNumber( phoneHome ); +56: addr.insertPhoneNumber( phoneWork ); +57: +58: // ADR +59: KABC::Address homeAddr( KABC::Address::Home ); +60: homeAddr.setStreet( "Milliwaystreet 42" ); +61: homeAddr.setLocality( "London" ); +62: homeAddr.setRegion( "Saxony" ); +63: homeAddr.setPostalCode( "43435" ); +64: homeAddr.setCountry( "Germany" ); +65: addr.insertAddress( homeAddr ); +66: +67: addr.insertCategory( "LUG-Dresden-Members" ); +68: +69: addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", "21.04.2009" ); +70: +71: ab.insertAddressee( addr ); // will be assigned to the standard resource +72: // automatically +73: +74: KABC::Ticket *ticket = ab.requestSaveTicket( res ); +75: if ( !ticket ) { +76: kdError() << "Resource is locked by other application!" << endl; +77: } else { +78: if ( !ab.save( ticket ) ) { +79: kdError() << "Saving failed!" << endl; +80: ab.releaseSaveTicket( ticket ); +81: } +82: +83: } +84: +85: return 0; + +In line 1 the KABC::AddressBook is created. In line 4 you creat the +KABC::ResourceFile (which will handle the loading/saving). +The resource takes 2 arguments, the first is the file name and the +second one the file format. At the moment libkabc supports two file formats: +1) vCard, as specified in RFC 2426 +2) Binary, which increases performance during loading and saving + +In line 6 we try to plug the resource into the addressbook. The addressbook +class tries to open the resource immediately and returns whether opening was +successful. We add here only one resource, but you can add as many resources +as you want. + +In line 11 we try to load all contacts from the backends into the address book. +As before, it returns whether opening was successful. + +In line 16 a KABC::Addressee is created, which we will fill now with data, +before inserting it into the KABC::AddressBook. +The setNameFromString() function in the following line takes a string as +argument and tries to parse it into the single name components such as: given +name, family name, additional names, honoric prefix and honoric suffix. +You can set these values manually as well by calling + addr.setGivenName( "Otto" ); +and + addr.setFamilyName( "Meyer" ); +etc. etc. + +In line 23 we use the class KABC::TimeZone to store the timezone. This class +takes the time shift in minutes. + +In line 27 the KABC::Geo class is used for storing the geographical +information. The arguments are the latitude and longitude as float values. + +KABC::Secrecy in line 37 represents the CLASS entity of a vCard and can take +KABC::Secrecy::Public, KABC::Secrecy::Private or KABC::Secrecy::Confidential +as argument. + +In line 41 we make use of KABC::Picture class to store the photo of the +contact. This class can contain either an URL or the raw image data in form +of a QImage, in this example we use the latter. + +In line 43 we try to load the image "face.png" from the local directory and +assign this QImage to the KABC::Picture class via the setData() function. +Additionally we set the type of the picture to "image/png". + +From 49 - 50 we insert 2 email addresses with the first one as preferred +(second argument is true). + +In 53 and the following 3 lines we add two telephone numbers. For this purpose +libkabc provides the KABC::PhoneNumber class, which takes the phone number in +string representation as first argument and the type as second. The types can +be combined, so 'KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax' would be +the Home Fax. + +In line 59 we create a KABC::Address object and set the single parts in the +following lines. + +In line 67 we assign the contact to a special category. + +A contact can also contain custom entries, which are not specified in the API, +so you can add custom values with insertCustom() as shown in line 69. +The first argument of this function should be the name of the application, so +2 applications which use the same custom entry accidentally, do not overwrite +the data for each other. The second argument contains the name of the +custom entry and the third argument the value in string representation. + +In line 71 we finally insert the KABC::Addressee object into the +KABC::AddressBook. Since we have only one resource loaded, the contact is +automatically assigned to this resource. If you have several writeable +resources loaded, you should ask the user which resource the contact shall +belong to and assign the selected resource to the contact with + KABC::Addressee.setResource( KABC::Resource *resource ); +before inserting it into the address book. + +To prevent multiple access to one resource and possible resulting data loss +we have to lock the resource before saving our changes. +For this purpose KABC::AddressBook provides the function + requestSaveTicket( KABC::Resource* ) +which takes a pointer to the resource which shall be saved as argument and +returns a so called 'Save Ticket' if locking succeeded or a null pointer +if the resource is already locked by another application. + +So when we retrieved a valid ticket in line 74, we try to save our changes in +line 78. +The KABC::AddressBook::save() function takes the save ticket as argument and +returns whether saving succeeded. It also releases the save ticket when successful. + +Important! +If the save() call fails, you have to release the save ticket manually, as is +done in line 80, otherwise possible locks, created by the resources, won't be +removed. + +You can see also, that manual use is quite easy for the KABC::AddressBook class +and for the ResourceFile. For more information about the API of KABC::Addressee +please take a look at the official API documentation or the header files. + + +Distribution Lists +------------------- +libkabc provides so called distribution lists to group contacts. These lists +just store the uid of contacts, so they can be used for every kind of contact +grouping. There are 2 classes which handle the whole distribution list tasks, +KABC::DistributionListManager and KABC::DistributionList. The first one keeps +track of all available distribution lists and the latter one is the +representation of one list. + + + #include <tdeabc/distributionlist.h> + #include <tdeabc/stdaddressbook.h> + + 1: KABC::DistributionListManager manager( KABC::StdAddressBook::self() ); + 2: + 3: // load the lists + 4: manager.load(); + 5: + 6: QStringList listNames = manager.listNames(); + 7: QStringList::Iterator it; + 8: for ( it = listNames.begin(); it != listNames.end(); ++it ) { + 9: KABC::DistributionList *list = manager.list( *it ); +10: kdDebug() << list->name() << endl; +11: +12: QStringList emails = list->emails(); +13: QStringList::Iterator eit; +14: for ( eit = emails.begin(); eit != emails.end(); ++eit ) +15: kdDebug() << QString( "\t%1" ).arg( (*eit).latin1() ) << endl; +16: } + +In the first line a KABC::DistributionListManager is created. The manager takes +a pointer to a KABC::AddressBook, because he has to resolve the stored uids to +currently available email addresses. +In line 4 the manager loads all distribution lists from the central config file +$HOME/.trinity/share/apps/tdeabc/distlists. +The next line queries the names of all available distribution lists, which are +used in line 9 to retrieve a pointer to the specific list. +Now that you have a KABC::DistributionList object, you can performe the +following actions on it: + - set / get the name + - insert an entry + - remove an entry + - get a list of all email addresses + - get a list of all entries (which includes the uids) + +In line 12 we query all email addresses of every resource and print them out. + +<tdeabc/distributionlist.h> contains also the declaration for the class +KABC::DistributionListWatcher. This class exists only once per application and +its only job is to emit a signal as soon as the distribution list file has +changed. So to make your application aware of changes use the following code: + + + #include <tdeabc/distributionlist.h> + + 1: connect( KABC::DistributionListWatcher::self(), SIGNAL( changed() ), + 2: this, SLOT( slotDistributionListChanged() ) ); + +You see, as usual, easy ;) + diff --git a/tdeabc/Makefile.am b/tdeabc/Makefile.am new file mode 100644 index 000000000..57e72aec2 --- /dev/null +++ b/tdeabc/Makefile.am @@ -0,0 +1,72 @@ +SUBDIRS = vcard vcardparser . formats plugins scripts tests + +# Make sure $(all_includes) remains last! +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_srcdir)/kab \ + -I$(srcdir)/vcard/include -I$(srcdir)/vcardparser/ \ + -I$(srcdir)/vcard/include/generated \ + -I$(srcdir)/vcardparser $(all_includes) + +field.cpp: addressee.h addressee.cpp +addressee.cpp: addressee.h +addressee.cpp addressee.h field.cpp: \ + $(srcdir)/scripts/makeaddressee \ + $(srcdir)/scripts/addressee.src.cpp \ + $(srcdir)/scripts/addressee.src.h \ + $(srcdir)/scripts/entrylist \ + $(srcdir)/scripts/field.src.cpp + mysrcdir=`cd $(srcdir)/scripts && pwd` ;\ + cd scripts && $(PERL) $$mysrcdir/makeaddressee + +CLEANFILES = addressee.h addressee.cpp field.cpp + +lib_LTLIBRARIES = libkabc.la +libkabc_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 3:0:2 -no-undefined +libkabc_la_LIBADD = vcard/libvcard.la vcardparser/libvcards.la $(LIB_KIO) \ + $(top_builddir)/tderesources/libtderesources.la $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDEUI) $(LIB_TDECORE) +libkabc_la_COMPILE_FIRST = addressee.h + +libkabc_la_SOURCES = \ + address.cpp addressbook.cpp addressee.cpp addresseedialog.cpp agent.cpp \ + distributionlist.cpp distributionlistdialog.cpp distributionlisteditor.cpp \ + errorhandler.cpp field.cpp formatfactory.cpp geo.cpp key.cpp \ + phonenumber.cpp picture.cpp plugin.cpp resource.cpp \ + resourceselectdialog.cpp secrecy.cpp sound.cpp stdaddressbook.cpp \ + timezone.cpp vcard21parser.cpp vcardconverter.cpp vcardformat.cpp \ + vcardformatimpl.cpp vcardformatplugin.cpp ldifconverter.cpp addresslineedit.cpp \ + ldapclient.cpp addresseelist.cpp vcardtool.cpp addresseehelper.cpp \ + addresseehelper.skel lock.cpp locknull.cpp ldif.cpp ldapurl.cpp ldapconfigwidget.cpp \ + sortmode.cpp + + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = address.h addressbook.h addressee.h addresseedialog.h \ + agent.h distributionlist.h distributionlistdialog.h distributionlisteditor.h \ + errorhandler.h field.h format.h formatfactory.h formatplugin.h geo.h key.h \ + phonenumber.h picture.h plugin.h resource.h \ + resourceselectdialog.h secrecy.h sound.h stdaddressbook.h timezone.h \ + vcardconverter.h vcardformat.h vcardformatplugin.h ldifconverter.h \ + addresslineedit.h ldapclient.h addresseelist.h lock.h locknull.h ldif.h \ + ldapurl.h ldapconfigwidget.h sortmode.h + +METASOURCES = AUTO + +bin_PROGRAMS = tdeab2tdeabc + +tdeab2tdeabc_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +tdeab2tdeabc_LDADD = libkabc.la ../kab/libkab.la +tdeab2tdeabc_SOURCES = tdeab2tdeabc.cpp + +autostart_DATA = tdeab2tdeabc.desktop +autostartdir = $(datadir)/autostart + +manager_DATA = kabc_manager.desktop +managerdir = $(kde_servicesdir)/tderesources + +DOXYGEN_REFERENCES = tdecore tdeui + +map_DATA = countrytransl.map +mapdir = $(kde_datadir)/kabc + +EXTRA_DIST = $(map_DATA) + +include ../admin/Doxyfile.am diff --git a/tdeabc/README b/tdeabc/README new file mode 100644 index 000000000..46d21b9b6 --- /dev/null +++ b/tdeabc/README @@ -0,0 +1,28 @@ +LIBKABC - new address book API for KDE + +PURPOSE: + +libkabc provides an API for address book data. This can be used by all KDE +application using data of this type, e.g. KAddressBook, KMail, KOrganizer, +KPilot etc. It is meant as replacement for libkab (in tdebase/kab). + +FEATURES: + +- Value based interface, addressbook entry data is implicitly shared. +- Address book entries are identified by a unique id. +- vCard backend (RFC 2425 / RFC 2426). +- Locking mechanism to support concurrent access to the address book by + multiple processes. +- Notification on change of addressbook by other process. +- Dialog for selecting address book entries, supports mouse and keyboard + selection, supports automatic name completion. +- GUI client for viewing, modifying address book data. This is aimed at + developers not end users. +- Tool for converting data, written with libkab, to libkabc format. +- Multiple backends (resources) for storing entries e.g. LDAP + +AUTHOR: Cornelius Schumacher <schumacher@kde.org> + +LICENCE: LPGL + +DATE: 13 Oct 2001 diff --git a/tdeabc/README.AddressFormat b/tdeabc/README.AddressFormat new file mode 100644 index 000000000..8079e4914 --- /dev/null +++ b/tdeabc/README.AddressFormat @@ -0,0 +1,66 @@ +Address formats can be a tricky thing. libkabc tries very hard to perfectly fit +the needs of ~95% of users and to be at least sufficient for the other 5%. + +The formatting of an address depends on the destination country as well as on +the origin country of a letter. Basically, the part indicating the destination +country follows the rules of the country of origin, all the rest follows the +rules of the destination country. So we need to store for every country a) the +country positioning and b) the address formatting. + +Address formats should usually be stored in a country's entry.desktop. There we +store the country position in field "AddressCountryPosition" and the address +format in a field "AddressFormat". Note that for most countries one field +"AddressFormat" is sufficient for personal as well as company addresses +(because personal addresses look just like business addresses without company); +however, in some countries (eg. Hungary) business addresses differ in their +structure. In this case you have the possibility of adding another field +"BusinessAddressFormat" which will be preferred for formatting of business +addresses; if libkabc can't find such a field, it will fall back to +"AddressFormat". (Please use BusinessAddressFormat ONLY if you really need to) + +The format consists mainly of tags that will be replaced by address fields. +The list of tags may grow in the future, the format *might* change in the near +future, but I hope not. + +Any comments very very welcome to kde-pim@kde.org or to jost@schenck.de. + +-Jost. + +Fields AddressFormat and BusinessAddressFormat +------------------------------------------------ +%n = real name +%N = REAL NAME +%cm = company +%CM = COMPANY +%s = street +%S = STREET +%z = zip code +%l = location +%L = LOCATION +%r = region +%R = REGION +%p = post office box +%, = conditional comma+whitespace, + will be left out if the value left or right of it is purged +%w = conditional whitespace, + will be left out if the value left or right of it is purged +%0(...) = the text inside the brackets will be completely purged if not + at least one tag inside it evaluates to something. Example: when the + address doesn't have a postbox, the string %0(PO Box %p) will not + evaluate to "PO Box " but to an empty string. +\n = newline + +Field AddressCountryPosition +------------------------------------------------ +below = country name below rest of address +BELOW = country name below in capital letters +above = country name above rest of address +ABOVE = country name above in capital letters + +Some Tips +------------------------------------------------ +- You sometimes have three fields in a line which can all be empty. If you eg. +separate them all with conditional whitespace (same goes for cond. comma) like +in "%z%w%r%w%l" and only the middle value (here: region) is empty, there will +be no whitespace at all between the outer values (here: zipcode and location). +To avoid this, combine two of these values with purge brackets: %0(%z%w%r)%w%l. diff --git a/tdeabc/TODO b/tdeabc/TODO new file mode 100644 index 000000000..13f75b6bb --- /dev/null +++ b/tdeabc/TODO @@ -0,0 +1 @@ +Factor out TDELockFile. diff --git a/tdeabc/address.cpp b/tdeabc/address.cpp new file mode 100644 index 000000000..112a70617 --- /dev/null +++ b/tdeabc/address.cpp @@ -0,0 +1,592 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 "address.h" + +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <ksimpleconfig.h> +#include <kstandarddirs.h> +#include <kstaticdeleter.h> + +#include <tqfile.h> + +using namespace KABC; + +TQMap<TQString, TQString> *Address::mISOMap = 0; +static KStaticDeleter< TQMap<TQString, TQString> > isoMapDeleter; + +Address::Address() : + mEmpty( true ), mType( 0 ) +{ + mId = TDEApplication::randomString( 10 ); +} + +Address::Address( int type ) : + mEmpty( true ), mType( type ) +{ + mId = TDEApplication::randomString( 10 ); +} + +bool Address::operator==( const Address &a ) const +{ + if ( mPostOfficeBox != a.mPostOfficeBox ) return false; + if ( mExtended != a.mExtended ) return false; + if ( mStreet != a.mStreet ) return false; + if ( mLocality != a.mLocality ) return false; + if ( mRegion != a.mRegion ) return false; + if ( mPostalCode != a.mPostalCode ) return false; + if ( mCountry != a.mCountry ) return false; + if ( mLabel != a.mLabel ) return false; + + return true; +} + +bool Address::operator!=( const Address &a ) const +{ + return !( a == *this ); +} + +bool Address::isEmpty() const +{ + if ( mPostOfficeBox.isEmpty() && + mExtended.isEmpty() && + mStreet.isEmpty() && + mLocality.isEmpty() && + mRegion.isEmpty() && + mPostalCode.isEmpty() && + mCountry.isEmpty() && + mLabel.isEmpty() ) { + return true; + } + return false; +} + +void Address::clear() +{ + *this = Address(); +} + +void Address::setId( const TQString &id ) +{ + mEmpty = false; + + mId = id; +} + +TQString Address::id() const +{ + return mId; +} + +void Address::setType( int type ) +{ + mEmpty = false; + + mType = type; +} + +int Address::type() const +{ + return mType; +} + +TQString Address::typeLabel() const +{ + TQString label; + bool first = true; + + const TypeList list = typeList(); + + TypeList::ConstIterator it; + for ( it = list.begin(); it != list.end(); ++it ) { + if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { + label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); + if ( first ) + first = false; + } + } + + return label; +} + +void Address::setPostOfficeBox( const TQString &s ) +{ + mEmpty = false; + + mPostOfficeBox = s; +} + +TQString Address::postOfficeBox() const +{ + return mPostOfficeBox; +} + +TQString Address::postOfficeBoxLabel() +{ + return i18n("Post Office Box"); +} + + +void Address::setExtended( const TQString &s ) +{ + mEmpty = false; + + mExtended = s; +} + +TQString Address::extended() const +{ + return mExtended; +} + +TQString Address::extendedLabel() +{ + return i18n("Extended Address Information"); +} + + +void Address::setStreet( const TQString &s ) +{ + mEmpty = false; + + mStreet = s; +} + +TQString Address::street() const +{ + return mStreet; +} + +TQString Address::streetLabel() +{ + return i18n("Street"); +} + + +void Address::setLocality( const TQString &s ) +{ + mEmpty = false; + + mLocality = s; +} + +TQString Address::locality() const +{ + return mLocality; +} + +TQString Address::localityLabel() +{ + return i18n("Locality"); +} + + +void Address::setRegion( const TQString &s ) +{ + mEmpty = false; + + mRegion = s; +} + +TQString Address::region() const +{ + return mRegion; +} + +TQString Address::regionLabel() +{ + return i18n("Region"); +} + + +void Address::setPostalCode( const TQString &s ) +{ + mEmpty = false; + + mPostalCode = s; +} + +TQString Address::postalCode() const +{ + return mPostalCode; +} + +TQString Address::postalCodeLabel() +{ + return i18n("Postal Code"); +} + + +void Address::setCountry( const TQString &s ) +{ + mEmpty = false; + + mCountry = s; +} + +TQString Address::country() const +{ + return mCountry; +} + +TQString Address::countryLabel() +{ + return i18n("Country"); +} + + +void Address::setLabel( const TQString &s ) +{ + mEmpty = false; + + mLabel = s; +} + +TQString Address::label() const +{ + return mLabel; +} + +TQString Address::labelLabel() +{ + return i18n("Delivery Label"); +} + +Address::TypeList Address::typeList() +{ + static TypeList list; + + if ( list.isEmpty() ) + list << Dom << Intl << Postal << Parcel << Home << Work << Pref; + + return list; +} + +TQString Address::typeLabel( int type ) +{ + if ( type & Pref ) + return i18n( "Preferred address", "Preferred" ); + + switch ( type ) { + case Dom: + return i18n("Domestic"); + break; + case Intl: + return i18n("International"); + break; + case Postal: + return i18n("Postal"); + break; + case Parcel: + return i18n("Parcel"); + break; + case Home: + return i18n("Home Address", "Home"); + break; + case Work: + return i18n("Work Address", "Work"); + break; + case Pref: + return i18n("Preferred Address"); + break; + default: + return i18n("Other"); + break; + } +} + +void Address::dump() const +{ + kdDebug(5700) << " Address {" << endl; + kdDebug(5700) << " Id: " << id() << endl; + kdDebug(5700) << " Extended: " << extended() << endl; + kdDebug(5700) << " Street: " << street() << endl; + kdDebug(5700) << " Postal Code: " << postalCode() << endl; + kdDebug(5700) << " Locality: " << locality() << endl; + kdDebug(5700) << " }" << endl; +} + + +TQString Address::formattedAddress( const TQString &realName, + const TQString &orgaName ) const +{ + TQString ciso; + TQString addrTemplate; + TQString ret; + + // FIXME: first check for iso-country-field and prefer that one + if ( !country().isEmpty() ) { + ciso = countryToISO( country() ); + } else { + // fall back to our own country + ciso = TDEGlobal::locale()->country(); + } + KSimpleConfig entry( locate( "locale", + TQString( "l10n/" ) + ciso + TQString( "/entry.desktop" ) ) ); + entry.setGroup( "KCM Locale" ); + + // decide whether this needs special business address formatting + if ( orgaName.isEmpty() ) { + addrTemplate = entry.readEntry( "AddressFormat" ); + } else { + addrTemplate = entry.readEntry( "BusinessAddressFormat" ); + if ( addrTemplate.isEmpty() ) + addrTemplate = entry.readEntry( "AddressFormat" ); + } + + // in the case there's no format found at all, default to what we've always + // used: + if ( addrTemplate.isEmpty() ) { + kdWarning(5700) << "address format database incomplete " + << "(no format for locale " << ciso + << " found). Using default address formatting." << endl; + addrTemplate = "%0(%n\\n)%0(%cm\\n)%0(%s\\n)%0(PO BOX %p\\n)%0(%l%w%r)%,%z"; + } + + // scan + parseAddressTemplateSection( addrTemplate, ret, realName, orgaName ); + + // now add the country line if needed (formatting this time according to + // the rules of our own system country ) + if ( !country().isEmpty() ) { + KSimpleConfig entry( locate( "locale", TQString( "l10n/" ) + + TDEGlobal::locale()->country() + TQString( "/entry.desktop" ) ) ); + entry.setGroup( "KCM Locale" ); + TQString cpos = entry.readEntry( "AddressCountryPosition" ); + if ( "BELOW" == cpos || cpos.isEmpty() ) { + ret = ret + "\n\n" + country().upper(); + } else if ( "below" == cpos ) { + ret = ret + "\n\n" + country(); + } else if ( "ABOVE" == cpos ) { + ret = country().upper() + "\n\n" + ret; + } else if ( "above" == cpos ) { + ret = country() + "\n\n" + ret; + } + } + + return ret; +} + +bool Address::parseAddressTemplateSection( const TQString &tsection, + TQString &result, const TQString &realName, const TQString &orgaName ) const +{ + // This method first parses and substitutes any bracketed sections and + // after that replaces any tags with their values. If a bracketed section + // or a tag evaluate to zero, they are not just removed but replaced + // with a placeholder. This is because in the last step conditionals are + // resolved which depend on information about zero-evaluations. + result = tsection; + int stpos = 0; + bool ret = false; + + // first check for brackets that have to be evaluated first + int fpos = result.find( KABC_FMTTAG_purgeempty, stpos ); + while ( -1 != fpos ) { + int bpos1 = fpos + KABC_FMTTAG_purgeempty.length(); + int bpos2; + // expect opening bracket and find next balanced closing bracket. If + // next char is no opening bracket, continue parsing (no valid tag) + if ( '(' == result[bpos1] ) { + bpos2 = findBalancedBracket( result, bpos1 ); + if ( -1 != bpos2 ) { + // we have balanced brackets, recursively parse: + TQString rplstr; + bool purge = !parseAddressTemplateSection( result.mid( bpos1+1, + bpos2-bpos1-1 ), rplstr, + realName, orgaName ); + if ( purge ) { + // purge -> remove all + // replace with !_P_!, so conditional tags work later + result.replace( fpos, bpos2 - fpos + 1, "!_P_!" ); + // leave stpos as it is + } else { + // no purge -> replace with recursively parsed string + result.replace( fpos, bpos2 - fpos + 1, rplstr ); + ret = true; + stpos = fpos + rplstr.length(); + } + } else { + // unbalanced brackets: keep on parsing (should not happen + // and will result in bad formatting) + stpos = bpos1; + } + } + fpos = result.find( KABC_FMTTAG_purgeempty, stpos ); + } + + // after sorting out all purge tags, we just search'n'replace the rest, + // keeping track of whether at least one tag evaluates to something. + // The following macro needs TQString for R_FIELD + // It substitutes !_P_! for empty fields so conditional tags work later +#define REPLTAG(R_TAG,R_FIELD) \ + if ( result.find(R_TAG, false) != -1 ) { \ + TQString rpl = R_FIELD.isEmpty() ? TQString("!_P_!") : R_FIELD; \ + result.replace( R_TAG, rpl ); \ + if ( !R_FIELD.isEmpty() ) { \ + ret = true; \ + } \ + } + REPLTAG( KABC_FMTTAG_realname, realName ); + REPLTAG( KABC_FMTTAG_REALNAME, realName.upper() ); + REPLTAG( KABC_FMTTAG_company, orgaName ); + REPLTAG( KABC_FMTTAG_COMPANY, orgaName.upper() ); + REPLTAG( KABC_FMTTAG_pobox, postOfficeBox() ); + REPLTAG( KABC_FMTTAG_street, street() ); + REPLTAG( KABC_FMTTAG_STREET, street().upper() ); + REPLTAG( KABC_FMTTAG_zipcode, postalCode() ); + REPLTAG( KABC_FMTTAG_location, locality() ); + REPLTAG( KABC_FMTTAG_LOCATION, locality().upper() ); + REPLTAG( KABC_FMTTAG_region, region() ); + REPLTAG( KABC_FMTTAG_REGION, region().upper() ); + result.replace( KABC_FMTTAG_newline, "\n" ); +#undef REPLTAG + + // conditional comma + fpos = result.find( KABC_FMTTAG_condcomma, 0 ); + while ( -1 != fpos ) { + TQString str1 = result.mid( fpos - 5, 5 ); + TQString str2 = result.mid( fpos + 2, 5 ); + if ( str1 != "!_P_!" && str2 != "!_P_!" ) { + result.replace( fpos, 2, ", " ); + } else { + result.remove( fpos, 2 ); + } + fpos = result.find( KABC_FMTTAG_condcomma, fpos ); + } + // conditional whitespace + fpos = result.find( KABC_FMTTAG_condwhite, 0 ); + while ( -1 != fpos ) { + TQString str1 = result.mid( fpos - 5, 5 ); + TQString str2 = result.mid( fpos + 2, 5 ); + if ( str1 != "!_P_!" && str2 != "!_P_!" ) { + result.replace( fpos, 2, " " ); + } else { + result.remove( fpos, 2 ); + } + fpos = result.find( KABC_FMTTAG_condwhite, fpos ); + } + + // remove purged: + result.remove( "!_P_!" ); + + return ret; +} + +int Address::findBalancedBracket( const TQString &tsection, int pos ) const +{ + int balancecounter = 0; + for( unsigned int i = pos + 1; i < tsection.length(); i++ ) { + if ( ')' == tsection[i] && 0 == balancecounter ) { + // found end of brackets + return i; + } else + if ( '(' == tsection[i] ) { + // nested brackets + balancecounter++; + } + } + return -1; +} + +TQString Address::countryToISO( const TQString &cname ) +{ + // we search a map file for translations from country names to + // iso codes, storing caching things in a TQMap for faster future + // access. + if ( !mISOMap ) + isoMapDeleter.setObject( mISOMap, new TQMap<TQString, TQString>() ); + + TQMap<TQString, TQString>::ConstIterator it; + it = mISOMap->find( cname ); + if ( it != mISOMap->end() ) + return it.data(); + + TQString mapfile = TDEGlobal::dirs()->findResource( "data", + TQString::fromLatin1( "tdeabc/countrytransl.map" ) ); + + TQFile file( mapfile ); + if ( file.open( IO_ReadOnly ) ) { + TQTextStream s( &file ); + TQString strbuf = s.readLine(); + while( !strbuf.isEmpty() ) { + TQStringList countryInfo = TQStringList::split( '\t', strbuf, true ); + if ( countryInfo[ 0 ] == cname ) { + file.close(); + mISOMap->insert( cname, countryInfo[ 1 ] ); + return countryInfo[ 1 ]; + } + strbuf = s.readLine(); + } + file.close(); + } + + // fall back to system country + mISOMap->insert( cname, TDEGlobal::locale()->country() ); + return TDEGlobal::locale()->country(); +} + +TQString Address::ISOtoCountry( const TQString &ISOname ) +{ + // get country name from ISO country code (e.g. "no" -> i18n("Norway")) + if ( ISOname.simplifyWhiteSpace().isEmpty() ) + return TQString::null; + + TQString mapfile = TDEGlobal::dirs()->findResource( "data", + TQString::fromLatin1( "tdeabc/countrytransl.map" ) ); + + TQFile file( mapfile ); + if ( file.open( IO_ReadOnly ) ) { + TQTextStream s( &file ); + TQString searchStr = "\t" + ISOname.simplifyWhiteSpace().lower(); + TQString strbuf = s.readLine(); + int pos; + while ( !strbuf.isEmpty() ) { + if ( (pos = strbuf.find( searchStr )) != -1 ) { + file.close(); + return i18n( strbuf.left( pos ).utf8() ); + } + strbuf = s.readLine(); + } + file.close(); + } + + return ISOname; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Address &addr ) +{ + return s << addr.mId << addr.mType << addr.mPostOfficeBox << + addr.mExtended << addr.mStreet << addr.mLocality << + addr.mRegion << addr.mPostalCode << addr.mCountry << + addr.mLabel; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Address &addr ) +{ + s >> addr.mId >> addr.mType >> addr.mPostOfficeBox >> addr.mExtended >> + addr.mStreet >> addr.mLocality >> addr.mRegion >> + addr.mPostalCode >> addr.mCountry >> addr.mLabel; + + addr.mEmpty = false; + + return s; +} diff --git a/tdeabc/address.h b/tdeabc/address.h new file mode 100644 index 000000000..b4165a098 --- /dev/null +++ b/tdeabc/address.h @@ -0,0 +1,341 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_ADDRESS_H +#define KABC_ADDRESS_H + +#include <tqmap.h> +#include <tqstring.h> +#include <tqvaluelist.h> + +#include <tdelibs_export.h> + +// template tags for address formatting localization +#define KABC_FMTTAG_realname TQString("%n") +#define KABC_FMTTAG_REALNAME TQString("%N") +#define KABC_FMTTAG_company TQString("%cm") +#define KABC_FMTTAG_COMPANY TQString("%CM") +#define KABC_FMTTAG_pobox TQString("%p") +#define KABC_FMTTAG_street TQString("%s") +#define KABC_FMTTAG_STREET TQString("%S") +#define KABC_FMTTAG_zipcode TQString("%z") +#define KABC_FMTTAG_location TQString("%l") +#define KABC_FMTTAG_LOCATION TQString("%L") +#define KABC_FMTTAG_region TQString("%r") +#define KABC_FMTTAG_REGION TQString("%R") +#define KABC_FMTTAG_newline TQString("\\n") +#define KABC_FMTTAG_condcomma TQString("%,") +#define KABC_FMTTAG_condwhite TQString("%w") +#define KABC_FMTTAG_purgeempty TQString("%0") + +namespace KABC { + +/** + @short Postal address information. + + This class represents information about a postal address. +*/ +class KABC_EXPORT Address +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Address & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Address & ); + + public: + /** + List of addresses. + */ + typedef TQValueList<Address> List; + typedef TQValueList<int> TypeList; + + /** + Address types: + + @li @p Dom - domestic + @li @p Intl - international + @li @p Postal - postal + @li @p Parcel - parcel + @li @p Home - home address + @li @p Work - address at work + @li @p Pref - preferred address + */ + enum Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32, + Pref = 64 }; + + /** + Constructor that creates an empty Address, which is initialized + with a unique id (see id()). + */ + Address(); + + /** + This is like Address() just above, with the difference + that you can specify the type. + */ + Address( int ); + + bool operator==( const Address & ) const; + bool operator!=( const Address & ) const; + + /** + Returns true, if the address is empty. + */ + bool isEmpty() const; + + /** + Clears all entries of the address. + */ + void clear(); + + /** + Sets the unique id. + */ + void setId( const TQString & ); + + /* + Returns the unique id. + */ + TQString id() const; + + /** + Sets the type of address. See enum for definiton of types. + + @param type type, can be a bitwise or of multiple types. + */ + void setType( int type ); + + /** + Returns the type of address. Can be a bitwise or of multiple types. + */ + int type() const; + + /** + Returns a translated string of all types the address has. + */ + TQString typeLabel() const; + + /** + Sets the post office box. + */ + void setPostOfficeBox( const TQString & ); + + /** + Returns the post office box. + */ + TQString postOfficeBox() const; + + /** + Returns the translated label for post office box field. + */ + static TQString postOfficeBoxLabel(); + + /** + Sets the extended address information. + */ + void setExtended( const TQString & ); + + /** + Returns the extended address information. + */ + TQString extended() const; + + /** + Returns the translated label for extended field. + */ + static TQString extendedLabel(); + + /** + Sets the street (including number). + */ + void setStreet( const TQString & ); + + /** + Returns the street. + */ + TQString street() const; + + /** + Returns the translated label for street field. + */ + static TQString streetLabel(); + + /** + Sets the locality, e.g. city. + */ + void setLocality( const TQString & ); + + /** + Returns the locality. + */ + TQString locality() const; + + /** + Returns the translated label for locality field. + */ + static TQString localityLabel(); + + /** + Sets the region, e.g. state. + */ + void setRegion( const TQString & ); + + /** + Returns the region. + */ + TQString region() const; + + /** + Returns the translated label for region field. + */ + static TQString regionLabel(); + + /** + Sets the postal code. + */ + void setPostalCode( const TQString & ); + + /** + Returns the postal code. + */ + TQString postalCode() const; + + /** + Returns the translated label for postal code field. + */ + static TQString postalCodeLabel(); + + /** + Sets the country. + */ + void setCountry( const TQString & ); + + /** + Returns the country. + */ + TQString country() const; + + /** + Returns the translated label for country field. + */ + static TQString countryLabel(); + + /** + Sets the delivery label. This is the literal text to be used as label. + */ + void setLabel( const TQString & ); + + /** + Returns the delivery label. + */ + TQString label() const; + + /** + Returns the translated label for delivery label field. + */ + static TQString labelLabel(); + + /** + Returns the list of available types. + */ + static TypeList typeList(); + + /** + Returns the translated label for a special type. + */ + static TQString typeLabel( int type ); + + /** + Used for debug output. + */ + void dump() const; + + /** + Returns this address formatted according to the country-specific + address formatting rules. The formatting rules applied depend on + either the addresses {@link #country country} field, or (if the + latter is empty) on the system country setting. If companyName is + provided, an available business address format will be preferred. + + @param realName the formatted name of the contact + @param orgaName the name of the organization or company + @return the formatted address (containing newline characters) + */ + TQString formattedAddress( const TQString &realName=TQString::null + , const TQString &orgaName=TQString::null ) const; + + /** + Returns ISO code for a localized country name. Only localized country + names will be understood. This might be replaced by a TDELocale method in + the future. + @param cname name of the country + @return two digit ISO code + */ + static TQString countryToISO( const TQString &cname ); + + /** + Returns a localized country name for a ISO code. + This might be replaced by a TDELocale method in the future. + @param ISOname two digit ISO code + @return localized name of the country + @since 3.2 + */ + static TQString ISOtoCountry( const TQString &ISOname ); + + private: + /** + Parses a snippet of an address template + @param tsection the template string to be parsed + @param result TQString reference in which the result will be stored + @return true if at least one tag evaluated positively, else false + */ + bool parseAddressTemplateSection( const TQString &tsection + , TQString &result + , const TQString &realName + , const TQString &orgaName ) const; + + /** + Finds the balanced closing bracket starting from the opening bracket at + pos in tsection. + @return position of closing bracket, -1 for unbalanced brackets + */ + int findBalancedBracket( const TQString &tsection, int pos ) const; + + bool mEmpty; + + TQString mId; + int mType; + + TQString mPostOfficeBox; + TQString mExtended; + TQString mStreet; + TQString mLocality; + TQString mRegion; + TQString mPostalCode; + TQString mCountry; + TQString mLabel; + + static TQMap<TQString, TQString> *mISOMap; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Address & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Address & ); + +} + +#endif diff --git a/tdeabc/addressbook.cpp b/tdeabc/addressbook.cpp new file mode 100644 index 000000000..50cd9c8a6 --- /dev/null +++ b/tdeabc/addressbook.cpp @@ -0,0 +1,842 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> +#include <tqregexp.h> +#include <tqtimer.h> + +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdeglobal.h> +#include <kinstance.h> +#include <tdelocale.h> +#include <kstandarddirs.h> + +#include "errorhandler.h" +#include "resource.h" + +#include "addressbook.h" +#include "addressbook.moc" + +using namespace KABC; + +struct AddressBook::AddressBookData +{ + Field::List mAllFields; + ErrorHandler *mErrorHandler; + TDEConfig *mConfig; + KRES::Manager<Resource> *mManager; + TQPtrList<Resource> mPendingLoadResources; + TQPtrList<Resource> mPendingSaveResources; + Iterator end; +}; + +struct AddressBook::Iterator::IteratorData +{ + Resource::Iterator mIt; + TQValueList<Resource*> mResources; + int mCurrRes; +}; + +struct AddressBook::ConstIterator::ConstIteratorData +{ + Resource::ConstIterator mIt; + TQValueList<Resource*> mResources; + int mCurrRes; +}; + +AddressBook::Iterator::Iterator() + : d( new IteratorData ) +{ +} + +AddressBook::Iterator::Iterator( const AddressBook::Iterator &i ) + : d( new IteratorData ) +{ + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; +} + +AddressBook::Iterator &AddressBook::Iterator::operator=( const AddressBook::Iterator &i ) +{ + if ( this == &i ) + return *this; // guard against self assignment + + delete d; // delete the old data the Iterator was completely constructed before + d = new IteratorData; + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; + + return *this; +} + +AddressBook::Iterator::~Iterator() +{ + delete d; + d = 0; +} + +const Addressee &AddressBook::Iterator::operator*() const +{ + return *(d->mIt); +} + +Addressee &AddressBook::Iterator::operator*() +{ + return *(d->mIt); +} + +Addressee *AddressBook::Iterator::operator->() +{ + return &(*(d->mIt)); +} + +AddressBook::Iterator &AddressBook::Iterator::operator++() +{ + do { + bool jumped = false; + while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource + if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { + return *this; + } + + d->mCurrRes++; // jump to next resource + + jumped = true; + d->mIt = (d->mResources[ d->mCurrRes ])->begin(); + } + + if ( !jumped ) + (d->mIt)++; + + } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); + + return *this; +} + +AddressBook::Iterator &AddressBook::Iterator::operator++( int ) +{ + do { + bool jumped = false; + while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource + if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { + return *this; + } + + d->mCurrRes++; // jump to next resource + + jumped = true; + d->mIt = (d->mResources[ d->mCurrRes ])->begin(); + } + + if ( !jumped ) + (d->mIt)++; + + } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); + + return *this; +} + +AddressBook::Iterator &AddressBook::Iterator::operator--() +{ + (d->mIt)--; + + return *this; +} + +AddressBook::Iterator &AddressBook::Iterator::operator--( int ) +{ + (d->mIt)--; + + return *this; +} + +bool AddressBook::Iterator::operator==( const Iterator &it ) +{ + return ( d->mIt == it.d->mIt ); +} + +bool AddressBook::Iterator::operator!=( const Iterator &it ) +{ + return ( d->mIt != it.d->mIt ); +} + + +AddressBook::ConstIterator::ConstIterator() + : d( new ConstIteratorData ) +{ +} + +AddressBook::ConstIterator::ConstIterator( const AddressBook::ConstIterator &i ) + : d( new ConstIteratorData ) +{ + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; +} + +AddressBook::ConstIterator::ConstIterator( const AddressBook::Iterator &i ) +{ + d = new ConstIteratorData; + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator=( const AddressBook::ConstIterator &i ) +{ + if ( this == &i ) + return *this; // guard for self assignment + + delete d; // delete the old data because the Iterator was really constructed before + d = new ConstIteratorData; + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; + + return *this; +} + +AddressBook::ConstIterator::~ConstIterator() +{ + delete d; + d = 0; +} + +const Addressee &AddressBook::ConstIterator::operator*() const +{ + return *(d->mIt); +} + +const Addressee* AddressBook::ConstIterator::operator->() const +{ + return &(*(d->mIt)); +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator++() +{ + do { + bool jumped = false; + while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource + if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { + return *this; + } + + d->mCurrRes++; // jump to next resource + + jumped = true; + d->mIt = (d->mResources[ d->mCurrRes ])->begin(); + } + + if ( !jumped ) + (d->mIt)++; + + } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); + + return *this; +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator++(int) +{ + do { + bool jumped = false; + while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource + if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { + return *this; + } + + d->mCurrRes++; // jump to next resource + + jumped = true; + d->mIt = (d->mResources[ d->mCurrRes ])->begin(); + } + + if ( !jumped ) + (d->mIt)++; + + } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); + + return *this; +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator--() +{ + (d->mIt)--; + return *this; +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator--(int) +{ + (d->mIt)--; + return *this; +} + +bool AddressBook::ConstIterator::operator==( const ConstIterator &it ) +{ + return ( d->mIt == it.d->mIt ); +} + +bool AddressBook::ConstIterator::operator!=( const ConstIterator &it ) +{ + return ( d->mIt != it.d->mIt ); +} + + +AddressBook::AddressBook() + : d( new AddressBookData ) +{ + d->mErrorHandler = 0; + d->mConfig = 0; + d->mManager = new KRES::Manager<Resource>( "contact" ); + d->end.d->mResources = TQValueList<Resource*>(); + d->end.d->mCurrRes = -1; +} + +AddressBook::AddressBook( const TQString &config ) + : d( new AddressBookData ) +{ + d->mErrorHandler = 0; + if ( config.isEmpty() ) + d->mConfig = 0; + else + d->mConfig = new TDEConfig( config ); + d->mManager = new KRES::Manager<Resource>( "contact" ); + d->mManager->readConfig( d->mConfig ); + d->end.d->mResources = TQValueList<Resource*>(); + d->end.d->mCurrRes = -1; +} + +AddressBook::~AddressBook() +{ + delete d->mManager; d->mManager = 0; + delete d->mConfig; d->mConfig = 0; + delete d->mErrorHandler; d->mErrorHandler = 0; + delete d; d = 0; +} + +bool AddressBook::load() +{ + kdDebug(5700) << "AddressBook::load()" << endl; + + clear(); + + KRES::Manager<Resource>::ActiveIterator it; + bool ok = true; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + if ( !(*it)->load() ) { + error( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) ); + ok = false; + } + } + + return ok; +} + +bool AddressBook::asyncLoad() +{ + kdDebug(5700) << "AddressBook::asyncLoad()" << endl; + + clear(); + + KRES::Manager<Resource>::ActiveIterator it; + bool ok = true; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + d->mPendingLoadResources.append( *it ); + if ( !(*it)->asyncLoad() ) { + error( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) ); + ok = false; + } + } + + return ok; +} + +bool AddressBook::save( Ticket *ticket ) +{ + kdDebug(5700) << "AddressBook::save()"<< endl; + + if ( ticket->resource() ) { + deleteRemovedAddressees(); + bool ok = ticket->resource()->save( ticket ); + if ( ok ) ticket->resource()->releaseSaveTicket( ticket ); + return ok; + } + + return false; +} + +bool AddressBook::asyncSave( Ticket *ticket ) +{ + kdDebug(5700) << "AddressBook::asyncSave()"<< endl; + + if ( ticket->resource() ) { + d->mPendingSaveResources.append( ticket->resource() ); + bool ok = ticket->resource()->asyncSave( ticket ); + if ( ok ) ticket->resource()->releaseSaveTicket( ticket ); + return ok; + } + + return false; +} + +AddressBook::Iterator AddressBook::begin() +{ + TQValueList<Resource*> list; + KRES::Manager<Resource>::ActiveIterator resIt; + for ( resIt = d->mManager->activeBegin(); resIt != d->mManager->activeEnd(); ++resIt ) + list.append( *resIt ); + + if ( list.count() == 0 ) + return end(); + + Iterator it = Iterator(); + it.d->mResources = list; + it.d->mCurrRes = 0; + it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); + + while ( it.d->mIt == (it.d->mResources[ it.d->mCurrRes ])->end() ) { + if ( (uint)it.d->mCurrRes == it.d->mResources.count() - 1 ) + return end(); + + it.d->mCurrRes++; + + it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); + } + + return it; +} + +AddressBook::ConstIterator AddressBook::begin() const +{ + TQValueList<Resource*> list; + KRES::Manager<Resource>::ActiveIterator resIt; + for ( resIt = d->mManager->activeBegin(); resIt != d->mManager->activeEnd(); ++resIt ) + list.append( *resIt ); + + if ( list.count() == 0 ) + return end(); + + Iterator it = Iterator(); + it.d->mResources = list; + it.d->mCurrRes = 0; + it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); + + while ( it.d->mIt == (it.d->mResources[ it.d->mCurrRes ])->end() ) { + if ( (uint)it.d->mCurrRes == it.d->mResources.count() - 1 ) + return end(); + + it.d->mCurrRes++; + + it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); + } + + return it; +} + +AddressBook::Iterator AddressBook::end() +{ + KRES::Manager<Resource>::ActiveIterator resIt = d->mManager->activeEnd(); + + if ( resIt == d->mManager->activeBegin() || ! *(--resIt) ) { // no resource available + d->end.d->mIt = Resource::Iterator(); + } else { + d->end.d->mIt = (*resIt)->end(); + } + + return d->end; +} + +AddressBook::ConstIterator AddressBook::end() const +{ + KRES::Manager<Resource>::ActiveIterator resIt = d->mManager->activeEnd(); + + if ( resIt == d->mManager->activeBegin() || ! *(--resIt) ) { // no resource available + d->end.d->mIt = Resource::Iterator(); + } else { + d->end.d->mIt = (*resIt)->end(); + } + + return d->end; +} + +void AddressBook::clear() +{ + KRES::Manager<Resource>::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) + (*it)->clear(); +} + +Ticket *AddressBook::requestSaveTicket( Resource *resource ) +{ + kdDebug(5700) << "AddressBook::requestSaveTicket()" << endl; + + if ( !resource ) + resource = standardResource(); + + KRES::Manager<Resource>::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + if ( (*it) == resource ) { + if ( (*it)->readOnly() || !(*it)->isOpen() ) + return 0; + else + return (*it)->requestSaveTicket(); + } + } + + return 0; +} + +void AddressBook::releaseSaveTicket( Ticket *ticket ) +{ + if ( !ticket ) + return; + + if ( ticket->resource() ) { + ticket->resource()->releaseSaveTicket( ticket ); + } +} + +void AddressBook::insertAddressee( const Addressee &a ) +{ + Resource *resource = a.resource(); + if ( resource == 0 ) + resource = standardResource(); + + Resource::Iterator it; + Addressee fAddr = resource->findByUid( a.uid() ); + + Addressee addr( a ); + if ( !fAddr.isEmpty() ) { + if ( fAddr != a ) + addr.setRevision( TQDateTime::currentDateTime() ); + else { + if ( fAddr.resource() == 0 ) { + fAddr.setResource( resource ); + //NOTE: Should we have setChanged( true ) here? + resource->insertAddressee( fAddr ); + } + return; + } + } + + addr.setResource( resource ); + addr.setChanged( true ); + resource->insertAddressee( addr ); +} + +void AddressBook::removeAddressee( const Addressee &a ) +{ + if ( a.resource() ) + a.resource()->removeAddressee( a ); +} + +void AddressBook::removeAddressee( const Iterator &it ) +{ + if ( (*it).resource() ) + (*it).resource()->removeAddressee( *it ); +} + +AddressBook::Iterator AddressBook::find( const Addressee &a ) +{ + Iterator it; + for ( it = begin(); it != end(); ++it ) { + if ( a.uid() == (*it).uid() ) + return it; + } + + return end(); +} + +Addressee AddressBook::findByUid( const TQString &uid ) +{ + KRES::Manager<Resource>::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + Addressee addr = (*it)->findByUid( uid ); + if ( !addr.isEmpty() ) + return addr; + } + + return Addressee(); +} + +Addressee::List AddressBook::allAddressees() +{ + Addressee::List list; + + ConstIterator it; + for ( it = begin(); it != end(); ++it ) + list.append( *it ); + + return list; +} + +Addressee::List AddressBook::findByName( const TQString &name ) +{ + Addressee::List results; + + KRES::Manager<Resource>::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) + results += (*it)->findByName( name ); + + return results; +} + +Addressee::List AddressBook::findByEmail( const TQString &email ) +{ + Addressee::List results; + + KRES::Manager<Resource>::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) + results += (*it)->findByEmail( email ); + + return results; +} + +Addressee::List AddressBook::findByCategory( const TQString &category ) +{ + Addressee::List results; + + KRES::Manager<Resource>::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) + results += (*it)->findByCategory( category ); + + return results; +} + +void AddressBook::dump() const +{ + kdDebug(5700) << "AddressBook::dump() --- begin ---" << endl; + + ConstIterator it; + for( it = begin(); it != end(); ++it ) { + (*it).dump(); + } + + kdDebug(5700) << "AddressBook::dump() --- end ---" << endl; +} + +TQString AddressBook::identifier() +{ + TQStringList identifier; + + + KRES::Manager<Resource>::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + if ( !(*it)->identifier().isEmpty() ) + identifier.append( (*it)->identifier() ); + } + + return identifier.join( ":" ); +} + +Field::List AddressBook::fields( int category ) +{ + if ( d->mAllFields.isEmpty() ) { + d->mAllFields = Field::allFields(); + } + + if ( category == Field::All ) return d->mAllFields; + + Field::List result; + Field::List::ConstIterator it; + for ( it = d->mAllFields.constBegin(); it != d->mAllFields.constEnd(); ++it ) { + if ( (*it)->category() & category ) + result.append( *it ); + } + + return result; +} + +bool AddressBook::addCustomField( const TQString &label, int category, + const TQString &key, const TQString &app ) +{ + if ( d->mAllFields.isEmpty() ) { + d->mAllFields = Field::allFields(); + } + + TQString a = app.isNull() ? TDEGlobal::instance()->instanceName() : app; + TQString k = key.isNull() ? label : key; + + Field *field = Field::createCustomField( label, category, k, a ); + + if ( !field ) return false; + + d->mAllFields.append( field ); + + return true; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const AddressBook &ab ) +{ + if (!ab.d) return s; + + return s;// << ab.d->mAddressees; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, AddressBook &ab ) +{ + if (!ab.d) return s; + +// s >> ab.d->mAddressees; + + return s; +} + +bool AddressBook::addResource( Resource *resource ) +{ + if ( !resource->open() ) { + kdDebug(5700) << "AddressBook::addResource(): can't add resource" << endl; + return false; + } + + d->mManager->add( resource ); + resource->setAddressBook( this ); + + connect( resource, TQT_SIGNAL( loadingFinished( Resource* ) ), + this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); + connect( resource, TQT_SIGNAL( savingFinished( Resource* ) ), + this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); + + connect( resource, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); + connect( resource, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceSavingError( Resource*, const TQString& ) ) ); + + return true; +} + +bool AddressBook::removeResource( Resource *resource ) +{ + resource->close(); + + if ( resource == standardResource() ) + d->mManager->setStandardResource( 0 ); + + resource->setAddressBook( 0 ); + + disconnect( resource, TQT_SIGNAL( loadingFinished( Resource* ) ), + this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); + disconnect( resource, TQT_SIGNAL( savingFinished( Resource* ) ), + this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); + + disconnect( resource, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); + disconnect( resource, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); + + d->mManager->remove( resource ); + + return true; +} + +TQPtrList<Resource> AddressBook::resources() +{ + TQPtrList<Resource> list; + + KRES::Manager<Resource>::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + if ( d->mManager->standardResource() == (*it) ) + list.prepend( *it ); + else + list.append( *it ); + } + + return list; +} + +void AddressBook::setErrorHandler( ErrorHandler *handler ) +{ + delete d->mErrorHandler; + d->mErrorHandler = handler; +} + +void AddressBook::error( const TQString& msg ) +{ + if ( !d->mErrorHandler ) // create default error handler + d->mErrorHandler = new ConsoleErrorHandler; + + if ( d->mErrorHandler ) + d->mErrorHandler->error( msg ); + else + kdError(5700) << "no error handler defined" << endl; +} + +void AddressBook::deleteRemovedAddressees() +{ + // no any longer needed +} + +void AddressBook::setStandardResource( Resource *resource ) +{ + d->mManager->setStandardResource( resource ); +} + +Resource *AddressBook::standardResource() +{ + return d->mManager->standardResource(); +} + +KRES::Manager<Resource> *AddressBook::resourceManager() +{ + return d->mManager; +} + +void AddressBook::cleanUp() +{ +} + +bool AddressBook::loadingHasFinished() const +{ + return d->mPendingLoadResources.isEmpty(); +} + +void AddressBook::resourceLoadingFinished( Resource *res ) +{ + d->mPendingLoadResources.remove( res ); + emit loadingFinished( res ); + + if ( d->mPendingLoadResources.count() == 0 ) + emit addressBookChanged( this ); +} + +void AddressBook::resourceSavingFinished( Resource *res ) +{ + d->mPendingSaveResources.remove( res ); + + emit savingFinished( res ); +} + +void AddressBook::resourceLoadingError( Resource *res, const TQString &errMsg ) +{ + error( errMsg ); + + d->mPendingLoadResources.remove( res ); + if ( d->mPendingLoadResources.count() == 0 ) + emit addressBookChanged( this ); +} + +void AddressBook::resourceSavingError( Resource *res, const TQString &errMsg ) +{ + error( errMsg ); + + d->mPendingSaveResources.remove( res ); +} diff --git a/tdeabc/addressbook.h b/tdeabc/addressbook.h new file mode 100644 index 000000000..8b87b6898 --- /dev/null +++ b/tdeabc/addressbook.h @@ -0,0 +1,431 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_ADDRESSBOOK_H +#define KABC_ADDRESSBOOK_H + +#include <tqobject.h> +#include <tqptrlist.h> + +#include <tderesources/manager.h> + +#include "addressee.h" +#include "field.h" + +namespace KABC { + +class ErrorHandler; +class Resource; +class Ticket; + +/** + @short Address Book + + This class provides access to a collection of address book entries. + */ +class KABC_EXPORT AddressBook : public TQObject +{ + Q_OBJECT + + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const AddressBook & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, AddressBook & ); + friend class StdAddressBook; + + public: + /** + @short Address Book Iterator + + This class provides an iterator for address book entries. + */ + class KABC_EXPORT Iterator + { + public: + Iterator(); + Iterator( const Iterator & ); + ~Iterator(); + + Iterator &operator=( const Iterator & ); + const Addressee &operator*() const; + Addressee &operator*(); + Addressee* operator->(); + Iterator &operator++(); + Iterator &operator++(int); + Iterator &operator--(); + Iterator &operator--(int); + bool operator==( const Iterator &it ); + bool operator!=( const Iterator &it ); + + struct IteratorData; + IteratorData *d; + }; + + /** + @short Address Book Const Iterator + + This class provides a const iterator for address book entries. + */ + class KABC_EXPORT ConstIterator + { + public: + ConstIterator(); + ConstIterator( const ConstIterator & ); + ConstIterator( const Iterator & ); + ~ConstIterator(); + + ConstIterator &operator=( const ConstIterator & ); + const Addressee &operator*() const; + const Addressee* operator->() const; + ConstIterator &operator++(); + ConstIterator &operator++(int); + ConstIterator &operator--(); + ConstIterator &operator--(int); + bool operator==( const ConstIterator &it ); + bool operator!=( const ConstIterator &it ); + + struct ConstIteratorData; + ConstIteratorData *d; + }; + + /** + Constructs an address book object. + You have to add the resources manually before calling load(). + */ + AddressBook(); + + /** + Constructs an address book object. + The resources are loaded automatically. + + @param config The config file which contains the resource settings. + */ + AddressBook( const TQString &config ); + + /** + Destructor. + */ + virtual ~AddressBook(); + + /** + Requests a ticket for saving the addressbook. Calling this function locks + the addressbook for all other processes. You need the returned ticket + object for calling the save() function. + + @param resource A pointer to the resource which shall be locked. If 0, + the default resource is locked. + @return 0 if the resource is already locked or a valid save ticket + otherwise. + @see save() + */ + Ticket *requestSaveTicket( Resource *resource = 0 ); + + /** + Releases the ticket requested previously with requestSaveTicket(). + Call this function, if you want to release a ticket without saving. + */ + void releaseSaveTicket( Ticket *ticket ); + + /** + Loads all addressees synchronously. + + @return Whether the loading was successfully. + */ + bool load(); + + /** + Loads all addressees asynchronously. This function returns immediately + and emits the addressBookChanged() signal as soon as the loading has + finished. + + @return Whether the synchronous part of loading was successfully. + */ + bool asyncLoad(); + + /** + Saves all addressees of one resource synchronously. If the save is + successfull the ticket is deleted. + + @param ticket The ticket returned by requestSaveTicket(). + @return Whether the saving was successfully. + */ + bool save( Ticket *ticket ); + + /** + Saves all addressees of one resource asynchronously. If the save is + successfull the ticket is deleted. + + @param ticket The ticket returned by requestSaveTicket(). + @return Whether the synchronous part of saving was successfully. + */ + bool asyncSave( Ticket *ticket ); + + /** + Returns an iterator pointing to the first addressee of address book. + This iterator equals end() if the address book is empty. + */ + ConstIterator begin() const; + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + */ + Iterator begin(); + + /** + Returns an iterator pointing to the last addressee of address book. + This iterator equals begin() if the address book is empty. + */ + ConstIterator end() const; + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + */ + Iterator end(); + + + /** + Removes all addressees from the address book. + */ + void clear(); + + /** + Insert an addressee into the address book. If an addressee with the same + unique id already exists, it is replaced by the new one, otherwise it is + appended. + + @param addr The addressee which shall be insert. + */ + void insertAddressee( const Addressee &addr ); + + /** + Removes an addressee from the address book. + + @param addr The addressee which shall be removed. + */ + void removeAddressee( const Addressee &addr ); + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + + @param it An iterator pointing to the addressee which shall be removed. + */ + void removeAddressee( const Iterator &it ); + + /** + Returns an iterator pointing to the specified addressee. It will return + end() if no addressee matched. + + @param addr The addresee you are looking for. + */ + Iterator find( const Addressee &addr ); // KDE4: const + + /** + Searches an addressee with the specified unique identifier. + + @param uid The unique identifier you are looking for. + @return The addressee with the specified unique identifier or an + empty addressee. + */ + Addressee findByUid( const TQString &uid ); // KDE4: const + + /** + Returns a list of all addressees in the address book. + */ + Addressee::List allAddressees(); // KDE4: const + + /** + Searches all addressees which match the specified name. + + @param name The name you are looking for. + @return A list of all matching addressees. + */ + Addressee::List findByName( const TQString &name ); // KDE4: const + + /** + Searches all addressees which match the specified email address. + + @param email The email address you are looking for. + @return A list of all matching addressees. + */ + Addressee::List findByEmail( const TQString &email ); // KDE4: const + + /** + Searches all addressees which belongs to the specified category. + + @param category The category you are looking for. + @return A list of all matching addressees. + */ + Addressee::List findByCategory( const TQString &category ); // KDE4: const + + /** + Returns a string identifying this addressbook. The identifier is + created by concatenation of the resource identifiers. + */ + virtual TQString identifier(); // KDE4: const + + /** + Returns a list of all Fields known to the address book which are associated + with the given field category. + */ + Field::List fields( int category = Field::All ); // KDE4: const + + /** + Add custom field to address book. + + @param label User visible label of the field. + @param category Ored list of field categories. + @param key Identifier used as key for reading and writing the field. + @param app String used as application key for reading and writing + the field. + */ + bool addCustomField( const TQString &label, int category = Field::All, + const TQString &key = TQString::null, + const TQString &app = TQString::null ); + + /** + Adds a resource to the address book. + + @param resource The resource you want to add. + @return Whether opening the resource was successfully. + */ + bool addResource( Resource *resource ); + + /** + Removes a resource from the address book. + + @param resource The resource you want to remove. + @return Whether closing the resource was successfully. + */ + bool removeResource( Resource *resource ); + + /** + Returns a list of all resources. + */ + TQPtrList<Resource> resources(); // KDE4: const + + /** + Sets the @p ErrorHandler, that is used by error() to + provide GUI independent error messages. + + @param errorHandler The error handler you want to use. + */ + void setErrorHandler( ErrorHandler *errorHandler ); + + /** + Shows GUI independent error messages. + + @param msg The error message that shall be displayed. + */ + void error( const TQString &msg ); + + /** + @deprecated There is no need to call this function anymore. + */ + void cleanUp() KDE_DEPRECATED; + + /** + Used for debug output. This function prints out the list + of all addressees to kdDebug(5700). + */ + void dump() const; + + /** + */ + void emitAddressBookLocked() { emit addressBookLocked( this ); } + void emitAddressBookUnlocked() { emit addressBookUnlocked( this ); } + void emitAddressBookChanged() { emit addressBookChanged( this ); } + + /** + Returns true when the loading of the addressbook has finished, + otherwise false. + + @since 3.5 + */ + bool loadingHasFinished() const; + + signals: + /** + Emitted when one of the resources discovered a change in its backend + or the asynchronous loading of all resources has finished. + You should connect to this signal to update the presentation of + the contact data in your application. + + @param addressBook The address book which emitted this signal. + */ + void addressBookChanged( AddressBook *addressBook ); + + /** + Emitted when one of the resources has been locked for writing. + + @param addressBook The address book which emitted this signal. + */ + void addressBookLocked( AddressBook *addressBook ); + + /** + Emitted when one of the resources has been unlocked. + You should connect to this signal if you want to save your changes + to a resource which is currently locked, and want to get notified when + saving is possible again. + + @param addressBook The address book which emitted this signal. + */ + void addressBookUnlocked( AddressBook *addressBook ); + + /** + Emitted when the asynchronous loading of one resource has finished + after calling asyncLoad(). + + @param resource The resource which emitted this signal. + */ + void loadingFinished( Resource *resource ); + + /** + Emitted when the asynchronous saving of one resource has finished + after calling asyncSave(). + + @param resource The resource which emitted this signal. + */ + void savingFinished( Resource *resource ); + + protected slots: + void resourceLoadingFinished( Resource* ); + void resourceSavingFinished( Resource* ); + void resourceLoadingError( Resource*, const TQString& ); + void resourceSavingError( Resource*, const TQString& ); + + protected: + void deleteRemovedAddressees(); + void setStandardResource( Resource* ); + Resource *standardResource(); + KRES::Manager<Resource> *resourceManager(); + + private: + TQPtrList<Resource> mDummy; // Remove in KDE 4 + struct AddressBookData; + AddressBookData *d; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const AddressBook & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, AddressBook & ); + +} + +#endif diff --git a/tdeabc/addresseedialog.cpp b/tdeabc/addresseedialog.cpp new file mode 100644 index 000000000..2b8bc91e6 --- /dev/null +++ b/tdeabc/addresseedialog.cpp @@ -0,0 +1,259 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqlayout.h> +#include <tqpushbutton.h> +#include <tqgroupbox.h> +#include <tqregexp.h> + +#include <tdelocale.h> +#include <kdebug.h> + +#include "stdaddressbook.h" + +#include "addresseedialog.h" +#include "addresseedialog.moc" + +using namespace KABC; + +AddresseeItem::AddresseeItem( TQListView *parent, const Addressee &addressee ) : + TQListViewItem( parent ), + mAddressee( addressee ) +{ + setText( Name, addressee.realName() ); + setText( Email, addressee.preferredEmail() ); +} + +TQString AddresseeItem::key( int column, bool ) const +{ + if (column == Email) { + TQString value = text(Email); + TQRegExp emailRe("<\\S*>"); + int match = emailRe.search(value); + if (match > -1) + value = value.mid(match + 1, emailRe.matchedLength() - 2); + + return value.lower(); + } + + return text(column).lower(); +} + +AddresseeDialog::AddresseeDialog( TQWidget *parent, bool multiple ) : + KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), + Ok|Cancel, Ok, parent ), mMultiple( multiple ) +{ + TQWidget *topWidget = plainPage(); + + TQBoxLayout *topLayout = new TQHBoxLayout( topWidget ); + TQBoxLayout *listLayout = new TQVBoxLayout; + topLayout->addLayout( listLayout ); + + mAddresseeList = new TDEListView( topWidget ); + mAddresseeList->addColumn( i18n("Name") ); + mAddresseeList->addColumn( i18n("Email") ); + mAddresseeList->setAllColumnsShowFocus( true ); + mAddresseeList->setFullWidth( true ); + listLayout->addWidget( mAddresseeList ); + connect( mAddresseeList, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + TQT_SLOT( slotOk() ) ); + connect( mAddresseeList, TQT_SIGNAL( selectionChanged( TQListViewItem * ) ), + TQT_SLOT( updateEdit( TQListViewItem * ) ) ); + + mAddresseeEdit = new KLineEdit( topWidget ); + mAddresseeEdit->setCompletionMode( TDEGlobalSettings::CompletionAuto ); + connect( mAddresseeEdit->completionObject(), TQT_SIGNAL( match( const TQString & ) ), + TQT_SLOT( selectItem( const TQString & ) ) ); + mAddresseeEdit->setFocus(); + mAddresseeEdit->completionObject()->setIgnoreCase( true ); + listLayout->addWidget( mAddresseeEdit ); + + setInitialSize( TQSize( 450, 300 ) ); + + if ( mMultiple ) { + TQBoxLayout *selectedLayout = new TQVBoxLayout; + topLayout->addLayout( selectedLayout ); + topLayout->setSpacing( spacingHint() ); + + TQGroupBox *selectedGroup = new TQGroupBox( 1, Qt::Horizontal, i18n("Selected"), + topWidget ); + selectedLayout->addWidget( selectedGroup ); + + mSelectedList = new TDEListView( selectedGroup ); + mSelectedList->addColumn( i18n("Name") ); + mSelectedList->addColumn( i18n("Email") ); + mSelectedList->setAllColumnsShowFocus( true ); + mSelectedList->setFullWidth( true ); + connect( mSelectedList, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + TQT_SLOT( removeSelected() ) ); + + TQPushButton *unselectButton = new TQPushButton( i18n("Unselect"), selectedGroup ); + connect ( unselectButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeSelected() ) ); + + connect( mAddresseeList, TQT_SIGNAL( clicked( TQListViewItem * ) ), + TQT_SLOT( addSelected( TQListViewItem * ) ) ); + + setInitialSize( TQSize( 650, 350 ) ); + } + + mAddressBook = StdAddressBook::self( true ); + connect( mAddressBook, TQT_SIGNAL( addressBookChanged( AddressBook* ) ), + TQT_SLOT( addressBookChanged() ) ); + connect( mAddressBook, TQT_SIGNAL( loadingFinished( Resource* ) ), + TQT_SLOT( addressBookChanged() ) ); + + loadAddressBook(); +} + +AddresseeDialog::~AddresseeDialog() +{ +} + +void AddresseeDialog::loadAddressBook() +{ + mAddresseeList->clear(); + mItemDict.clear(); + mAddresseeEdit->completionObject()->clear(); + + AddressBook::Iterator it; + for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { + AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); + addCompletionItem( (*it).realName(), item ); + addCompletionItem( (*it).preferredEmail(), item ); + } +} + +void AddresseeDialog::addCompletionItem( const TQString &str, TQListViewItem *item ) +{ + if ( str.isEmpty() ) return; + + mItemDict.insert( str, item ); + mAddresseeEdit->completionObject()->addItem( str ); +} + +void AddresseeDialog::selectItem( const TQString &str ) +{ + if ( str.isEmpty() ) return; + + TQListViewItem *item = mItemDict.find( str ); + if ( item ) { + mAddresseeList->blockSignals( true ); + mAddresseeList->setSelected( item, true ); + mAddresseeList->ensureItemVisible( item ); + mAddresseeList->blockSignals( false ); + } +} + +void AddresseeDialog::updateEdit( TQListViewItem *item ) +{ + mAddresseeEdit->setText( item->text( 0 ) ); + mAddresseeEdit->setSelection( 0, item->text( 0 ).length() ); +} + +void AddresseeDialog::addSelected( TQListViewItem *item ) +{ + AddresseeItem *addrItem = dynamic_cast<AddresseeItem *>( item ); + if ( !addrItem ) return; + + Addressee a = addrItem->addressee(); + + TQListViewItem *selectedItem = mSelectedDict.find( a.uid() ); + if ( !selectedItem ) { + selectedItem = new AddresseeItem( mSelectedList, a ); + mSelectedDict.insert( a.uid(), selectedItem ); + } +} + +void AddresseeDialog::removeSelected() +{ + TQListViewItem *item = mSelectedList->selectedItem(); + AddresseeItem *addrItem = dynamic_cast<AddresseeItem *>( item ); + if ( !addrItem ) return; + + mSelectedDict.remove( addrItem->addressee().uid() ); + delete addrItem; +} + +Addressee AddresseeDialog::addressee() +{ + AddresseeItem *aItem = 0; + + if ( mMultiple ) + aItem = dynamic_cast<AddresseeItem *>( mSelectedList->firstChild() ); + else + aItem = dynamic_cast<AddresseeItem *>( mAddresseeList->selectedItem() ); + + if (aItem) return aItem->addressee(); + return Addressee(); +} + +Addressee::List AddresseeDialog::addressees() +{ + Addressee::List al; + AddresseeItem *aItem = 0; + + if ( mMultiple ) { + TQListViewItem *item = mSelectedList->firstChild(); + while( item ) { + aItem = dynamic_cast<AddresseeItem *>( item ); + if ( aItem ) al.append( aItem->addressee() ); + item = item->nextSibling(); + } + } + else + { + aItem = dynamic_cast<AddresseeItem *>( mAddresseeList->selectedItem() ); + if (aItem) al.append( aItem->addressee() ); + } + + return al; +} + +Addressee AddresseeDialog::getAddressee( TQWidget *parent ) +{ + AddresseeDialog *dlg = new AddresseeDialog( parent ); + Addressee addressee; + int result = dlg->exec(); + + if ( result == TQDialog::Accepted ) { + addressee = dlg->addressee(); + } + + delete dlg; + return addressee; +} + +Addressee::List AddresseeDialog::getAddressees( TQWidget *parent ) +{ + AddresseeDialog *dlg = new AddresseeDialog( parent, true ); + Addressee::List addressees; + int result = dlg->exec(); + if ( result == TQDialog::Accepted ) { + addressees = dlg->addressees(); + } + + delete dlg; + return addressees; +} + +void AddresseeDialog::addressBookChanged() +{ + loadAddressBook(); +} diff --git a/tdeabc/addresseedialog.h b/tdeabc/addresseedialog.h new file mode 100644 index 000000000..74470d1b4 --- /dev/null +++ b/tdeabc/addresseedialog.h @@ -0,0 +1,161 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_ADDRESSEEDIALOG_H +#define KABC_ADDRESSEEDIALOG_H + +#include <tqdict.h> + +#include <kdialogbase.h> +#include <klineedit.h> +#include <tdelistview.h> + +#include "addressbook.h" + +namespace KABC { + +/** + @short Special ListViewItem, that is used by the AddresseeDialog. +*/ +class KABC_EXPORT AddresseeItem : public TQListViewItem +{ + public: + + /** + Type of column + @li @p Name - Name in Addressee + @li @p Email - Email in Addressee + */ + enum columns { Name = 0, Email = 1 }; + + /** + Constructor. + + @param parent The parent listview. + @param addressee The associated addressee. + */ + AddresseeItem( TQListView *parent, const Addressee &addressee ); + + /** + Returns the addressee. + */ + Addressee addressee() const { return mAddressee; } + + /** + Method used by TQListView to sort the items. + */ + virtual TQString key( int column, bool ascending ) const; + + private: + Addressee mAddressee; +}; + +/** + @short Dialog for selecting address book entries. + + This class provides a dialog for selecting entries from the standard KDE + address book. Use the getAddressee() function to open a modal dialog, + returning an address book entry. + + In the dialog you can select an entry from the list with the mouse or type in + the first letters of the name or email address you are searching for. The + entry matching best is automatically selected. Use double click, pressing + return or pressing the ok button to return the selected addressee to the + application. +*/ +class KABC_EXPORT AddresseeDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + Construct addressbook entry select dialog. + + @param parent parent widget + @param multiple if true, indicates a multiple selection. + */ + AddresseeDialog( TQWidget *parent=0, bool multiple=false ); + + /** + Destructor. + */ + virtual ~AddresseeDialog(); + + /** + Return the address chosen. + + If it is a multiple select, this will return only the first address chosen + */ + Addressee addressee(); + + /** + Return the list of addresses chosen + */ + Addressee::List addressees(); + + /** + Select a single address book entry. + + Open addressee select dialog and return the entry selected by the user. + If the user doesn't select an entry or presses cancel, the returned + addressee is empty. + */ + static Addressee getAddressee( TQWidget *parent ); + + /** + Select multiple address book entries. + + Open addressee select dialog and return the entries selected by the user. + If the user doesn't select an entry or presses cancel, the returned + addressee list is empty. + */ + static Addressee::List getAddressees( TQWidget *parent ); + + private slots: + void selectItem( const TQString & ); + void updateEdit( TQListViewItem *item ); + void addSelected( TQListViewItem *item ); + void removeSelected(); + + protected slots: + void addressBookChanged(); + + private: + void loadAddressBook(); + void addCompletionItem( const TQString &str, TQListViewItem *item ); + + bool mMultiple; + + TDEListView *mAddresseeList; + KLineEdit *mAddresseeEdit; + + TDEListView *mSelectedList; + + AddressBook *mAddressBook; + + TQDict<TQListViewItem> mItemDict; + TQDict<TQListViewItem> mSelectedDict; + + class AddresseeDialogPrivate; + AddresseeDialogPrivate *d; +}; + +} +#endif diff --git a/tdeabc/addresseehelper.cpp b/tdeabc/addresseehelper.cpp new file mode 100644 index 000000000..e8faeb897 --- /dev/null +++ b/tdeabc/addresseehelper.cpp @@ -0,0 +1,111 @@ +/* + This file is part of the KDE libraries + Copyright (C) 2003 Carsten Pfeiffer <pfeiffer@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, version 2. + + 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 <tqapplication.h> + +#include <tdeconfig.h> +#include <tdelocale.h> + +#include "addresseehelper.h" + +using namespace KABC; + +AddresseeHelper * AddresseeHelper::s_self; + +// static +AddresseeHelper *AddresseeHelper::self() +{ + if ( !s_self ) + s_self = new AddresseeHelper(); + + return s_self; +} + +AddresseeHelper::AddresseeHelper() + : TQObject( tqApp ), + DCOPObject( "KABC::AddresseeHelper" ) +{ + initSettings(); + + connectDCOPSignal( "kaddressbook", "KABC::AddressBookConfig", + "changed()", "initSettings()", false ); +} + +// static +void AddresseeHelper::addToSet( const TQStringList& list, + std::set<TQString>& container ) +{ + TQStringList::ConstIterator it; + for ( it = list.begin(); it != list.end(); ++it ) { + if ( !(*it).isEmpty() ) + container.insert( *it ); + } +} + +void AddresseeHelper::initSettings() +{ + mTitles.clear(); + mSuffixes.clear(); + mPrefixes.clear(); + + mTitles.insert( i18n( "Dr." ) ); + mTitles.insert( i18n( "Miss" ) ); + mTitles.insert( i18n( "Mr." ) ); + mTitles.insert( i18n( "Mrs." ) ); + mTitles.insert( i18n( "Ms." ) ); + mTitles.insert( i18n( "Prof." ) ); + + mSuffixes.insert( i18n( "I" ) ); + mSuffixes.insert( i18n( "II" ) ); + mSuffixes.insert( i18n( "III" ) ); + mSuffixes.insert( i18n( "Jr." ) ); + mSuffixes.insert( i18n( "Sr." ) ); + + mPrefixes.insert( "van" ); + mPrefixes.insert( "von" ); + mPrefixes.insert( "de" ); + + TDEConfig config( "kabcrc", true, false ); // readonly, no kdeglobals + config.setGroup( "General" ); + + addToSet( config.readListEntry( "Prefixes" ), mTitles ); + addToSet( config.readListEntry( "Inclusions" ), mPrefixes ); + addToSet( config.readListEntry( "Suffixes" ), mSuffixes ); + mTradeAsFamilyName = config.readBoolEntry( "TradeAsFamilyName", true ); +} + +bool AddresseeHelper::containsTitle( const TQString& title ) const +{ + return mTitles.find( title ) != mTitles.end(); +} + +bool AddresseeHelper::containsPrefix( const TQString& prefix ) const +{ + return mPrefixes.find( prefix ) != mPrefixes.end(); +} + +bool AddresseeHelper::containsSuffix( const TQString& suffix ) const +{ + return mSuffixes.find( suffix ) != mSuffixes.end(); +} + +bool AddresseeHelper::tradeAsFamilyName() const +{ + return mTradeAsFamilyName; +} diff --git a/tdeabc/addresseehelper.h b/tdeabc/addresseehelper.h new file mode 100644 index 000000000..5280e6b2d --- /dev/null +++ b/tdeabc/addresseehelper.h @@ -0,0 +1,66 @@ +/* + This file is part of the KDE libraries + Copyright (C) 2003 Carsten Pfeiffer <pfeiffer@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, version 2. + + 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 KABC_ADDRESSEEHELPER_H +#define KABC_ADDRESSEEHELPER_H + +#include <tqobject.h> +#include <tqstringlist.h> + +#include <dcopobject.h> + +#include <set> + +/** + static data, shared by ALL addressee objects +*/ + +namespace KABC { + +class KABC_EXPORT AddresseeHelper : public TQObject, public DCOPObject +{ + K_DCOP + + public: + static AddresseeHelper *self(); + + bool containsTitle( const TQString& title ) const; + bool containsPrefix( const TQString& prefix ) const; + bool containsSuffix( const TQString& suffix ) const; + bool tradeAsFamilyName() const; + + k_dcop: + ASYNC initSettings(); + + private: + AddresseeHelper(); + + static void addToSet( const TQStringList& list, + std::set<TQString>& container ); + std::set<TQString> mTitles; + std::set<TQString> mPrefixes; + std::set<TQString> mSuffixes; + bool mTradeAsFamilyName; + + static AddresseeHelper *s_self; +}; + +} + +#endif diff --git a/tdeabc/addresseelist.cpp b/tdeabc/addresseelist.cpp new file mode 100644 index 000000000..47324001c --- /dev/null +++ b/tdeabc/addresseelist.cpp @@ -0,0 +1,256 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Jost Schenck <jost@schenck.de> + 2003 Tobias Koenig <tokoe@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 <kdebug.h> + +#include "addresseelist.h" + +#include "field.h" +#include "sortmode.h" + +using namespace KABC; + +// +// +// Traits +// +// + +bool SortingTraits::Uid::eq( const Addressee &a1, const Addressee &a2 ) +{ + // locale awareness doesn't make sense sorting ids + return ( TQString::compare( a1.uid(), a2.uid() ) == 0 ); +} + +bool SortingTraits::Uid::lt( const Addressee &a1, const Addressee &a2 ) +{ + // locale awareness doesn't make sense sorting ids + return ( TQString::compare( a1.uid(), a2.uid() ) < 0 ); +} + +bool SortingTraits::Name::eq( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.name(), a2.name() ) == 0 ); +} + +bool SortingTraits::Name::lt( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.name(), a2.name() ) < 0 ); +} + +bool SortingTraits::FormattedName::eq( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.formattedName(), a2.formattedName() ) == 0 ); +} + +bool SortingTraits::FormattedName::lt( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.formattedName(), a2.formattedName() ) < 0 ); +} + +bool SortingTraits::FamilyName::eq( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.familyName(), a2.familyName() ) == 0 + && TQString::localeAwareCompare( a1.givenName(), a2.givenName() ) == 0 ); +} + +bool SortingTraits::FamilyName::lt( const Addressee &a1, const Addressee &a2 ) +{ + int family = TQString::localeAwareCompare( a1.familyName(), a2.familyName() ); + if ( 0 == family ) { + return ( TQString::localeAwareCompare( a1.givenName(), a2.givenName() ) < 0 ); + } else { + return family < 0; + } +} + +bool SortingTraits::GivenName::eq( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.givenName(), a2.givenName() ) == 0 + && TQString::localeAwareCompare( a1.familyName(), a2.familyName() ) == 0 ); +} + +bool SortingTraits::GivenName::lt( const Addressee &a1, const Addressee &a2 ) +{ + int given = TQString::localeAwareCompare( a1.givenName(), a2.givenName() ); + if ( 0 == given ) { + return ( TQString::localeAwareCompare( a1.familyName(), a2.familyName() ) < 0 ); + } else { + return given < 0; + } +} + +// +// +// AddresseeList +// +// + +static Field *sActiveField=0; + +AddresseeList::AddresseeList() + : TQValueList<Addressee>() +{ + mReverseSorting = false; + mActiveSortingCriterion = FormattedName; +} + +AddresseeList::~AddresseeList() +{ +} + +AddresseeList::AddresseeList( const AddresseeList &l ) + : TQValueList<Addressee>( l ) +{ + mReverseSorting = l.reverseSorting(); + mActiveSortingCriterion = l.sortingCriterion(); +} + +AddresseeList::AddresseeList( const TQValueList<Addressee> &l ) + : TQValueList<Addressee>( l ) +{ + mReverseSorting = false; +} + +void AddresseeList::dump() const +{ + kdDebug(5700) << "AddresseeList {" << endl; + kdDebug(5700) << "reverse order: " << ( mReverseSorting ? "true" : "false" ) << endl; + + TQString crit; + if ( Uid == mActiveSortingCriterion ) { + crit = "Uid"; + } else if ( Name == mActiveSortingCriterion ) { + crit = "Name"; + } else if ( FormattedName == mActiveSortingCriterion ) { + crit = "FormattedName"; + } else if ( FamilyName == mActiveSortingCriterion ) { + crit = "FamilyName"; + } else if ( GivenName == mActiveSortingCriterion ) { + crit = "GivenName"; + } else { + crit = "unknown -- update dump method"; + } + + kdDebug(5700) << "sorting criterion: " << crit << endl; + + for ( const_iterator it = begin(); it != end(); ++it ) { + (*it).dump(); + } + + kdDebug(5700) << "}" << endl; +} + +void AddresseeList::sortBy( SortingCriterion c ) +{ + mActiveSortingCriterion = c; + if ( Uid == c ) { + sortByTrait<SortingTraits::Uid>(); + } else if ( Name == c ) { + sortByTrait<SortingTraits::Name>(); + } else if ( FormattedName == c ) { + sortByTrait<SortingTraits::FormattedName>(); + } else if ( FamilyName == c ) { + sortByTrait<SortingTraits::FamilyName>(); + } else if ( GivenName==c ) { + sortByTrait<SortingTraits::GivenName>(); + } else { + kdError(5700) << "AddresseeList sorting criterion passed for which a trait is not known. No sorting done." << endl; + } +} + +void AddresseeList::sort() +{ + sortBy( mActiveSortingCriterion ); +} + +template<class Trait> +void AddresseeList::sortByTrait() +{ + // FIXME: better sorting algorithm, bubblesort is not acceptable for larger lists. + // + // for i := 1 to n - 1 + // do for j := 1 to n - i + // do if A[j] > A[j+1] + // then temp := A[j] + // A[j] := A[j + 1] + // A[j + 1 ] := temp + + iterator i1 = begin(); + iterator endIt = end(); + --endIt; + if ( i1 == endIt ) // don't need sorting + return; + + iterator i2 = endIt; + while( i1 != endIt ) { + iterator j1 = begin(); + iterator j2 = j1; + ++j2; + while( j1 != i2 ) { + if ( !mReverseSorting && Trait::lt( *j2, *j1 ) + || mReverseSorting && Trait::lt( *j1, *j2 ) ) { + tqSwap( *j1, *j2 ); + } + ++j1; + ++j2; + } + ++i1; + --i2; + } +} + +void AddresseeList::sortByField( Field *field ) +{ + if ( !field ) { + kdWarning(5700) << "sortByField called with no active sort field" << endl; + return; + } + + sActiveField = field; + + if ( count() == 0 ) + return; + + KABC::FieldSortMode *mode = new KABC::FieldSortMode( sActiveField, !mReverseSorting ); + + KABC::Addressee::setSortMode( mode ); + qHeapSort( *this ); + KABC::Addressee::setSortMode( 0 ); + + delete mode; +} + +void AddresseeList::sortByMode( SortMode *mode ) +{ + if ( count() == 0 ) + return; + + KABC::Addressee::setSortMode( mode ); + qHeapSort( *this ); + KABC::Addressee::setSortMode( 0 ); +} + +Field* +AddresseeList::sortingField() const +{ + return sActiveField; +} diff --git a/tdeabc/addresseelist.h b/tdeabc/addresseelist.h new file mode 100644 index 000000000..7c9df0275 --- /dev/null +++ b/tdeabc/addresseelist.h @@ -0,0 +1,221 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Jost Schenck <jost@schenck.de> + 2003 Tobias Koenig <tokoe@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 KABC_ADDRESSEELIST_H +#define KABC_ADDRESSEELIST_H + +#include <tqvaluelist.h> + +#include "addressee.h" + +namespace KABC { + +class Field; +class SortField; +class SortMode; + +/** + * Each trait must implement one static function for equality, one for "less + * than". Class name should be the field name. A trait does not necessarily + * have to stick to just one field: a trait sorting by family name can e.g. + * sort addressees with equal family name by given name. + * + * If you want to implement reverse sorting, you do not have to write another + * trait, as AddresseeList takes care of that. + */ +namespace SortingTraits +{ + +class KABC_EXPORT Uid +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +class KABC_EXPORT Name +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +class KABC_EXPORT FormattedName +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +class KABC_EXPORT FamilyName // fallback to given name +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +class KABC_EXPORT GivenName // fallback to family name +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +} + +/** + * Addressee attribute used for sorting. + */ +typedef enum { Uid, Name, FormattedName, FamilyName, GivenName } SortingCriterion; + +/** + * @short a TQValueList of Addressee, with sorting functionality + * + * This class extends the functionality of TQValueList with + * sorting methods specific to the Addressee class. It can be used + * just like any other TQValueList but is no template class. + * + * An AddresseeList does not automatically keep sorted when addressees + * are added or removed or the sorting order is changed, as this would + * slow down larger operations by sorting after every step. So after + * such operations you have to call {@link #sort} or {@link #sortBy} to + * create a defined order again. + * + * Iterator usage is inherited by TQValueList and extensively documented + * there. Please remember that the state of an iterator is undefined + * after any sorting operation. + * + * For the enumeration Type SortingCriterion, which specifies the + * field by the collection will be sorted, the following values exist: + * Uid, Name, FormattedName, FamilyName, GivenName. + * + * @author Jost Schenck jost@schenck.de + */ +class KABC_EXPORT AddresseeList : public TQValueList<Addressee> +{ + public: + AddresseeList(); + ~AddresseeList(); + AddresseeList( const AddresseeList & ); + AddresseeList( const TQValueList<Addressee> & ); + + /** + * Debug output. + */ + void dump() const; + + /** + * Determines the direction of sorting. On change, the list + * will <em>not</em> automatically be resorted. + * @param r <tt>true</tt> if sorting should be done reverse, <tt>false</tt> otherwise + */ + void setReverseSorting( bool r = true ) { mReverseSorting = r; } + + /** + * Returns the direction of sorting. + * @return <tt>true</tt> if sorting is done reverse, <tt>false</tt> otherwise + */ + bool reverseSorting() const { return mReverseSorting; } + + /** + * Sorts this list by a specific criterion. + * @param c the criterion by which should be sorted + */ + void sortBy( SortingCriterion c ); + + /** + * Sorts this list by a specific field. If no parameter is given, the + * last used Field object will be used. + * @param field pointer to the Field object to be sorted by + */ + void sortByField( Field *field = 0 ); + + /** + * Sorts this list by a specific sorting mode. + * @param mode pointer to the sorting mode object to be sorted by + * @since 3.4 + */ + void sortByMode( SortMode *mode = 0 ); + + /** + * Sorts this list by its active sorting criterion. This normally is the + * criterion of the last sortBy operation or <tt>FormattedName</tt> if up + * to now there has been no sortBy operation. + * + * Please note that the sorting trait of the last {@link #sortByTrait} + * method call is not remembered and thus the action can not be repeated + * by this method. + */ + void sort(); + + /** + * Templated sort function. You normally will not want to use this but + * {@link #sortBy} and {@link #sort} instead as the existing sorting + * criteria completely suffice for most cases. + * + * However, if you do want to use some special sorting criterion, you can + * write a trait class that will be provided to this templated method. + * This trait class has to have a class declaration like the following: + * \code + * class MySortingTrait { + * public: + * // eq returns true if a1 and a2 are equal + * static bool eq(KABC::Addressee a1, KABC::Addressee a2); + * // lt returns true is a1 is "less than" a2 + * static bool lt(KABC::Addressee a1, KABC::Addressee a2); + * }; + * \endcode + * You can then pass this class to the sortByTrait method like this: + * \code + * myAddresseelist.sortByTrait<MySortingTrait>(); + * \endcode + * Please note that the {@link #sort} method can not be used to repeat the + * sorting of the last <tt>sortByTrait</tt> action. + * + * Right now this method uses the bubble sort algorithm. This should be + * replaced for a better one when I have time. + */ + template<class Trait> void sortByTrait(); + + /** + * Returns the active sorting criterion, ie the sorting criterion that + * will be used by a {@link #sort} call. + */ + SortingCriterion sortingCriterion() const { return mActiveSortingCriterion; } + + /** + * Returns the active sorting field, ie a pointer to the Field object + * which was used for the last {@link #sortByField} operation. + * This function returns the last GLOBAL sorting field, not + * the class specific one. + * You're a lot better off by keeping track of this locally. + */ + Field* sortingField() const; + + private: + bool mReverseSorting; + SortingCriterion mActiveSortingCriterion; + //KDE 4.0 - add a d-pointer here! +}; + +} + +#endif diff --git a/tdeabc/addresslineedit.cpp b/tdeabc/addresslineedit.cpp new file mode 100644 index 000000000..dc7a889a1 --- /dev/null +++ b/tdeabc/addresslineedit.cpp @@ -0,0 +1,610 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Helge Deller <deller@gmx.de> + 2002 Lubos Lunak <llunak@suse.cz> + 2001,2003 Carsten Pfeiffer <pfeiffer@kde.org> + 2001 Waldo Bastian <bastian@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. +*/ + +// $Id$ + +#include "addresslineedit.h" + +#include <tqapplication.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqregexp.h> +#include <tqevent.h> +#include <tqdragobject.h> + +#include <tdecompletionbox.h> +#include <tdeconfig.h> +#include <kcursor.h> +#include <kstandarddirs.h> +#include <kstaticdeleter.h> +#include <tdestdaccel.h> +#include <kurldrag.h> + +#include <tdeabc/stdaddressbook.h> +#include <tdeabc/distributionlist.h> +#include "ldapclient.h" + +#include <kdebug.h> + +//============================================================================= +// +// Class AddressLineEdit +// +//============================================================================= + + +using namespace KABC; + +TDECompletion * AddressLineEdit::s_completion = 0L; +bool AddressLineEdit::s_addressesDirty = false; +TQTimer* AddressLineEdit::s_LDAPTimer = 0L; +LdapSearch* AddressLineEdit::s_LDAPSearch = 0L; +TQString* AddressLineEdit::s_LDAPText = 0L; +AddressLineEdit* AddressLineEdit::s_LDAPLineEdit = 0L; +TDEConfig *AddressLineEdit::s_config = 0L; + +static KStaticDeleter<TDECompletion> completionDeleter; +static KStaticDeleter<TQTimer> ldapTimerDeleter; +static KStaticDeleter<LdapSearch> ldapSearchDeleter; +static KStaticDeleter<TQString> ldapTextDeleter; +static KStaticDeleter<TDEConfig> configDeleter; + +AddressLineEdit::AddressLineEdit(TQWidget* parent, + bool useCompletion, + const char *name) + : KLineEdit(parent,name) +{ + m_useCompletion = useCompletion; + m_completionInitialized = false; + m_smartPaste = false; + + init(); + + // Whenever a new AddressLineEdit is created (== a new composer is created), + // we set a dirty flag to reload the addresses upon the first completion. + // The address completions are shared between all AddressLineEdits. + // Is there a signal that tells us about addressbook updates? + if (m_useCompletion) + s_addressesDirty = true; +} + + +//----------------------------------------------------------------------------- +void AddressLineEdit::init() +{ + if ( !s_completion ) { + completionDeleter.setObject( s_completion, new TDECompletion() ); + s_completion->setOrder( TDECompletion::Sorted ); + s_completion->setIgnoreCase( true ); + } + + if( m_useCompletion ) { + if( !s_LDAPTimer ) { + ldapTimerDeleter.setObject( s_LDAPTimer, new TQTimer ); + ldapSearchDeleter.setObject( s_LDAPSearch, new LdapSearch ); + ldapTextDeleter.setObject( s_LDAPText, new TQString ); + } + connect( s_LDAPTimer, TQT_SIGNAL( timeout()), TQT_SLOT( slotStartLDAPLookup())); + connect( s_LDAPSearch, TQT_SIGNAL( searchData( const TQStringList& )), + TQT_SLOT( slotLDAPSearchData( const TQStringList& ))); + } + + if ( m_useCompletion && !m_completionInitialized ) + { + setCompletionObject( s_completion, false ); // we handle it ourself + connect( this, TQT_SIGNAL( completion(const TQString&)), + this, TQT_SLOT(slotCompletion() )); + + TDECompletionBox *box = completionBox(); + connect( box, TQT_SIGNAL( highlighted( const TQString& )), + this, TQT_SLOT( slotPopupCompletion( const TQString& ) )); + connect( box, TQT_SIGNAL( userCancelled( const TQString& )), + TQT_SLOT( userCancelled( const TQString& ))); + + m_completionInitialized = true; // don't connect muliple times. That's + // ugly, tho, better have completionBox() + // virtual in KDE 4 + // Why? This is only called once. Why should this be called more + // than once? And why was this protected? + } +} + +//----------------------------------------------------------------------------- +AddressLineEdit::~AddressLineEdit() +{ +} + +//----------------------------------------------------------------------------- + +TDEConfig* AddressLineEdit::config() +{ + if ( !s_config ) + configDeleter.setObject( s_config, new TDEConfig( "kabldaprc", false, false ) ); // Open read-write, no kdeglobals + + return s_config; +} + +void AddressLineEdit::setFont( const TQFont& font ) +{ + KLineEdit::setFont( font ); + if ( m_useCompletion ) + completionBox()->setFont( font ); +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::keyPressEvent(TQKeyEvent *e) +{ + bool accept = false; + + if (TDEStdAccel::shortcut(TDEStdAccel::SubstringCompletion).contains(KKey(e))) + { + doCompletion(true); + accept = true; + } + else if (TDEStdAccel::shortcut(TDEStdAccel::TextCompletion).contains(KKey(e))) + { + int len = text().length(); + + if (len == cursorPosition()) // at End? + { + doCompletion(true); + accept = true; + } + } + + if( !accept ) + KLineEdit::keyPressEvent( e ); + + if( e->isAccepted()) + { + if( m_useCompletion && s_LDAPTimer != NULL ) + { + if( *s_LDAPText != text()) + stopLDAPLookup(); + *s_LDAPText = text(); + s_LDAPLineEdit = this; + s_LDAPTimer->start( 500, true ); + } + } +} + +void AddressLineEdit::mouseReleaseEvent( TQMouseEvent * e ) +{ + if (m_useCompletion && (e->button() == Qt::MidButton)) + { + m_smartPaste = true; + KLineEdit::mouseReleaseEvent(e); + m_smartPaste = false; + return; + } + KLineEdit::mouseReleaseEvent(e); +} + +void AddressLineEdit::insert(const TQString &t) +{ + if (!m_smartPaste) + { + KLineEdit::insert(t); + return; + } + TQString newText = t.stripWhiteSpace(); + if (newText.isEmpty()) + return; + + // remove newlines in the to-be-pasted string as well as an eventual + // mailto: protocol + newText.replace( TQRegExp("\r?\n"), ", " ); + if ( newText.startsWith( "mailto:" ) ) + { + KURL u(newText); + newText = u.path(); + } + else if (newText.find(" at ") != -1) + { + // Anti-spam stuff + newText.replace( " at ", "@" ); + newText.replace( " dot ", "." ); + } + else if (newText.find("(at)") != -1) + { + newText.replace( TQRegExp("\\s*\\(at\\)\\s*"), "@" ); + } + + TQString contents = text(); + int start_sel = 0; + int end_sel = 0; + int pos = cursorPosition(); + if (getSelection(&start_sel, &end_sel)) + { + // Cut away the selection. + if (pos > end_sel) + pos -= (end_sel - start_sel); + else if (pos > start_sel) + pos = start_sel; + contents = contents.left(start_sel) + contents.right(end_sel+1); + } + + int eot = contents.length(); + while ((eot > 0) && contents[eot-1].isSpace()) eot--; + if (eot == 0) + { + contents = TQString::null; + } + else if (pos >= eot) + { + if (contents[eot-1] == ',') + eot--; + contents.truncate(eot); + contents += ", "; + pos = eot+2; + } + + contents = contents.left(pos)+newText+contents.mid(pos); + setText(contents); + setCursorPosition(pos+newText.length()); +} + +void AddressLineEdit::paste() +{ + if (m_useCompletion) + m_smartPaste = true; + KLineEdit::paste(); + m_smartPaste = false; +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::cursorAtEnd() +{ + setCursorPosition( text().length() ); +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::enableCompletion(bool enable) +{ + m_useCompletion = enable; +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::doCompletion(bool ctrlT) +{ + if ( !m_useCompletion ) + return; + + TQString prevAddr; + + TQString s(text()); + int n = s.findRev(','); + + if (n >= 0) + { + n++; // Go past the "," + + int len = s.length(); + + // Increment past any whitespace... + while( n < len && s[n].isSpace() ) + n++; + + prevAddr = s.left(n); + s = s.mid(n,255).stripWhiteSpace(); + } + + if ( s_addressesDirty ) + loadAddresses(); + + if ( ctrlT ) + { + TQStringList completions = s_completion->substringCompletion( s ); + if (completions.count() > 1) { + m_previousAddresses = prevAddr; + setCompletedItems( completions ); + } + else if (completions.count() == 1) + setText(prevAddr + completions.first()); + + cursorAtEnd(); + return; + } + + TDEGlobalSettings::Completion mode = completionMode(); + + switch ( mode ) + { + case TDEGlobalSettings::CompletionPopupAuto: + { + if (s.isEmpty()) + break; + } + case TDEGlobalSettings::CompletionPopup: + { + m_previousAddresses = prevAddr; + TQStringList items = s_completion->allMatches( s ); + items += s_completion->allMatches( "\"" + s ); + items += s_completion->substringCompletion( '<' + s ); + uint beforeDollarCompletionCount = items.count(); + + if( s.find( ' ' ) == -1 ) // one word, possibly given name + items += s_completion->allMatches( "$$" + s ); + + if ( !items.isEmpty() ) + { + if ( items.count() > beforeDollarCompletionCount ) + { + // remove the '$$whatever$' part + for( TQStringList::Iterator it = items.begin(); + it != items.end(); + ++it ) + { + int pos = (*it).find( '$', 2 ); + if( pos < 0 ) // ??? + continue; + (*it)=(*it).mid( pos + 1 ); + } + } + + items = removeMailDupes( items ); + + // We do not want KLineEdit::setCompletedItems to perform text + // completion (suggestion) since it does not know how to deal + // with providing proper completions for different items on the + // same line, e.g. comma-separated list of email addresses. + bool autoSuggest = (mode != TDEGlobalSettings::CompletionPopupAuto); + setCompletedItems( items, autoSuggest ); + + if (!autoSuggest) + { + int index = items.first().find( s ); + TQString newText = prevAddr + items.first().mid( index ); + //kdDebug() << "OLD TEXT: " << text() << endl; + //kdDebug() << "NEW TEXT: " << newText << endl; + setUserSelection(false); + setCompletedText(newText,true); + } + } + + break; + } + + case TDEGlobalSettings::CompletionShell: + { + TQString match = s_completion->makeCompletion( s ); + if ( !match.isNull() && match != s ) + { + setText( prevAddr + match ); + cursorAtEnd(); + } + break; + } + + case TDEGlobalSettings::CompletionMan: // Short-Auto in fact + case TDEGlobalSettings::CompletionAuto: + { + if (!s.isEmpty()) + { + TQString match = s_completion->makeCompletion( s ); + if ( !match.isNull() && match != s ) + { + TQString adds = prevAddr + match; + setCompletedText( adds ); + } + break; + } + } + case TDEGlobalSettings::CompletionNone: + default: // fall through + break; + } +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::slotPopupCompletion( const TQString& completion ) +{ + setText( m_previousAddresses + completion ); + cursorAtEnd(); +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::loadAddresses() +{ + s_completion->clear(); + s_addressesDirty = false; + + TQStringList adrs = addresses(); + for( TQStringList::ConstIterator it = adrs.begin(); it != adrs.end(); ++it) + addAddress( *it ); +} + +void AddressLineEdit::addAddress( const TQString& adr ) +{ + s_completion->addItem( adr ); + int pos = adr.find( '<' ); + if( pos >= 0 ) + { + ++pos; + int pos2 = adr.find( pos, '>' ); + if( pos2 >= 0 ) + s_completion->addItem( adr.mid( pos, pos2 - pos )); + } +} + +void AddressLineEdit::slotStartLDAPLookup() +{ + if( !s_LDAPSearch->isAvailable() || s_LDAPLineEdit != this ) + return; + startLoadingLDAPEntries(); +} + +void AddressLineEdit::stopLDAPLookup() +{ + s_LDAPSearch->cancelSearch(); + s_LDAPLineEdit = NULL; +} + +void AddressLineEdit::startLoadingLDAPEntries() +{ + TQString s( *s_LDAPText ); + // TODO cache last? + TQString prevAddr; + int n = s.findRev(','); + if (n>= 0) + { + prevAddr = s.left(n+1) + ' '; + s = s.mid(n+1,255).stripWhiteSpace(); + } + if( s.length() == 0 ) + return; + + loadAddresses(); // TODO reuse these? + s_LDAPSearch->startSearch( s ); +} + +void AddressLineEdit::slotLDAPSearchData( const TQStringList& adrs ) +{ + if( s_LDAPLineEdit != this ) + return; + for( TQStringList::ConstIterator it = adrs.begin(); it != adrs.end(); ++it ) { + TQString name(*it); + int pos = name.find( " <" ); + int pos_comma = name.find( ',' ); + // put name in quotes, if we have a comma in the name + if (pos>0 && pos_comma>0 && pos_comma<pos) { + name.insert(pos, '\"'); + name.prepend('\"'); + } + addAddress( name ); + } + + if( hasFocus() || completionBox()->hasFocus()) + { + if( completionMode() != TDEGlobalSettings::CompletionNone ) + { + doCompletion( false ); + } + } +} + +TQStringList AddressLineEdit::removeMailDupes( const TQStringList& adrs ) +{ + TQStringList src = adrs; + qHeapSort( src ); + TQString last; + for( TQStringList::Iterator it = src.begin(); it != src.end(); ) { + if( *it == last ) + { + it = src.remove( it ); + continue; // dupe + } + last = *it; + ++it; + } + return src; +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::dropEvent(TQDropEvent *e) +{ + KURL::List uriList; + if(KURLDrag::canDecode(e) && KURLDrag::decode( e, uriList )) + { + TQString ct = text(); + KURL::List::Iterator it = uriList.begin(); + for (; it != uriList.end(); ++it) + { + if (!ct.isEmpty()) ct.append(", "); + KURL u(*it); + if ((*it).protocol() == "mailto") + ct.append( (*it).path() ); + else + ct.append( (*it).url() ); + } + setText(ct); + setEdited( true ); + } + else { + if (m_useCompletion) + m_smartPaste = true; + TQLineEdit::dropEvent(e); + m_smartPaste = false; + } +} + + +TQStringList AddressLineEdit::addresses() +{ + TQApplication::setOverrideCursor( KCursor::waitCursor() ); // loading might take a while + + TQStringList result; + TQString space(" "); + TQRegExp needQuotes("[^ 0-9A-Za-z\\x0080-\\xFFFF]"); + TQString endQuote("\" "); + TQString addr, email; + + KABC::AddressBook *addressBook = KABC::StdAddressBook::self(); + KABC::AddressBook::Iterator it; + for( it = addressBook->begin(); it != addressBook->end(); ++it ) { + TQStringList emails = (*it).emails(); + + TQString n = (*it).prefix() + space + + (*it).givenName() + space + + (*it).additionalName() + space + + (*it).familyName() + space + + (*it).suffix(); + + n = n.simplifyWhiteSpace(); + + TQStringList::ConstIterator mit; + + for ( mit = emails.begin(); mit != emails.end(); ++mit ) { + email = *mit; + if (!email.isEmpty()) { + if (n.isEmpty() || (email.find( '<' ) != -1)) + addr = TQString::null; + else { /* do we really need quotes around this name ? */ + if (n.find(needQuotes) != -1) + addr = '"' + n + endQuote; + else + addr = n + space; + } + + if (!addr.isEmpty() && (email.find( '<' ) == -1) + && (email.find( '>' ) == -1) + && (email.find( ',' ) == -1)) + addr += '<' + email + '>'; + else + addr += email; + addr = addr.stripWhiteSpace(); + result.append( addr ); + } + } + } + + KABC::DistributionListManager manager( addressBook ); + manager.load(); + result += manager.listNames(); + + TQApplication::restoreOverrideCursor(); + + return result; +} + +#include "addresslineedit.moc" diff --git a/tdeabc/addresslineedit.h b/tdeabc/addresslineedit.h new file mode 100644 index 000000000..f81ffbfe4 --- /dev/null +++ b/tdeabc/addresslineedit.h @@ -0,0 +1,123 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Helge Deller <deller@gmx.de> + 2002 Lubos Lunak <llunak@suse.cz> + + 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 KABC_ADDRESSLINEEDIT_H +#define KABC_ADDRESSLINEEDIT_H +// $Id$ + +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqtimer.h> + +#include "klineedit.h" +#include "kcompletion.h" + +class TDEConfig; + +namespace KABC { + +class LdapSearch; + +/** + * A lineedit with LDAP and kabc completion + * + * This lineedit is supposed to be used wherever the user types email addresses + * and might want a completion. You can simply use it as a replacement for + * KLineEdit or TQLineEdit. + * + * You can enable or disable the lineedit at any time. + * + * @see AddressLineEdit::enableCompletion() + */ +class KABC_EXPORT AddressLineEdit : public KLineEdit +{ + Q_OBJECT +public: + AddressLineEdit(TQWidget* parent, bool useCompletion = true, + const char *name = 0L); + virtual ~AddressLineEdit(); + + /** + * Reimplented for internal reasons. + * @ see KLineEdit::setFont() + */ + virtual void setFont( const TQFont& ); + + static TDEConfig *config(); + +public slots: + /** + * Set cursor to end of line. + */ + void cursorAtEnd(); + /** + * Toggle completion. + */ + void enableCompletion( bool enable ); + +protected: + /** + * Always call AddressLineEdit::loadAddresses() as the first thing. + * Use addAddress() to add addresses. + */ + virtual void loadAddresses(); + void addAddress( const TQString& ); + virtual void keyPressEvent(TQKeyEvent*); + virtual void dropEvent(TQDropEvent *e); + virtual void paste(); + virtual void insert(const TQString &t); + virtual void mouseReleaseEvent( TQMouseEvent * e ); + void doCompletion(bool ctrlT); + +private slots: + void slotCompletion() { doCompletion(false); } + void slotPopupCompletion( const TQString& ); + void slotStartLDAPLookup(); + void slotLDAPSearchData( const TQStringList& ); + +private: + void init(); + void startLoadingLDAPEntries(); + void stopLDAPLookup(); + TQStringList addresses(); + TQStringList removeMailDupes( const TQStringList& adrs ); + + TQString m_previousAddresses; + bool m_useCompletion; + bool m_completionInitialized; + bool m_smartPaste; + TQString m_typedText; // unused + + static bool s_addressesDirty; + static TDECompletion *s_completion; + static TQTimer *s_LDAPTimer; + static LdapSearch *s_LDAPSearch; + static TQString *s_LDAPText; + static AddressLineEdit *s_LDAPLineEdit; + static TDEConfig *s_config; + +private: + class AddressLineEditPrivate* d; +}; + +} + +#endif /* KABC_ADDRESSLINEEDIT_H */ diff --git a/tdeabc/agent.cpp b/tdeabc/agent.cpp new file mode 100644 index 000000000..571b7803e --- /dev/null +++ b/tdeabc/agent.cpp @@ -0,0 +1,148 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 "addressee.h" + +#include "agent.h" + +using namespace KABC; + +Agent::Agent() + : mAddressee( 0 ), mIntern( false ) +{ +} + +Agent::Agent( const TQString &url ) + : mAddressee( 0 ),mUrl( url ), mIntern( false ) +{ +} + +Agent::Agent( Addressee *addressee ) + : mAddressee( addressee ), mIntern( true ) +{ +} + +Agent::~Agent() +{ + delete mAddressee; + mAddressee = 0; +} + +bool Agent::operator==( const Agent &a ) const +{ + if ( mIntern != a.mIntern ) + return false; + + if ( !mIntern ) { + if ( mUrl != a.mUrl ) + return false; + } else { + if ( mAddressee && !a.mAddressee ) return false; + if ( !mAddressee && a.mAddressee ) return false; + if ( !mAddressee && !a.mAddressee ) return false; + if ( (*mAddressee) != (*a.mAddressee) ) return false; + } + + return true; +} + +bool Agent::operator!=( const Agent &a ) const +{ + return !( a == *this ); +} + +Agent &Agent::operator=( const Agent &addr ) +{ + if ( this == &addr ) + return *this; + + if ( addr.mIntern && addr.mAddressee ) { + if ( mAddressee ) + delete mAddressee; + + mAddressee = new Addressee; + *mAddressee = *(addr.mAddressee); + } + + mUrl = addr.mUrl; + mIntern = addr.mIntern; + + return *this; +} + +void Agent::setUrl( const TQString &url ) +{ + mUrl = url; + mIntern = false; +} + +void Agent::setAddressee( Addressee *addressee ) +{ + mAddressee = addressee; + mIntern = true; +} + +bool Agent::isIntern() const +{ + return mIntern; +} + +TQString Agent::url() const +{ + return mUrl; +} + +Addressee *Agent::addressee() const +{ + return mAddressee; +} + +TQString Agent::asString() const +{ + if ( mIntern ) + return "intern agent"; + else + return mUrl; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Agent &agent ) +{ + TQ_UINT32 hasAddressee = ( agent.mAddressee != 0 ); + + s << agent.mIntern << agent.mUrl << hasAddressee; + if ( hasAddressee ) + s << (*agent.mAddressee); + + return s; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Agent &agent ) +{ + TQ_UINT32 hasAddressee; + + s >> agent.mIntern >> agent.mUrl >> hasAddressee; + + if ( hasAddressee ) { + agent.mAddressee = new Addressee; + s >> (*agent.mAddressee); + } + + return s; +} diff --git a/tdeabc/agent.h b/tdeabc/agent.h new file mode 100644 index 000000000..dbe048f08 --- /dev/null +++ b/tdeabc/agent.h @@ -0,0 +1,128 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_AGENT_H +#define KABC_AGENT_H + +class TQDataStream; + +#include <tqstring.h> + +#include <tdelibs_export.h> + +namespace KABC { + +class Addressee; + +/** + * Important!!! + * + * At the moment the vcard format does not support saving and loading + * this entity. + */ +class KABC_EXPORT Agent +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Agent & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Agent & ); + +public: + + /** + * Consturctor. Creates an empty object. + */ + Agent(); + + /** + * Consturctor. + * + * @param url A URL that describes the position of the agent file. + */ + Agent( const TQString &url ); + + /** + * Consturctor. + * + * @param addressee The addressee object of the agent. + */ + Agent( Addressee *addressee ); + + /** + * Destructor. + */ + ~Agent(); + + + bool operator==( const Agent & ) const; + bool operator!=( const Agent & ) const; + Agent &operator=( const Agent & ); + + /** + * Sets a URL for the location of the agent file. When using this + * function, isIntern() will return 'false' until you use + * setAddressee(). + * + * @param url The location URL of the agent file. + */ + void setUrl( const TQString &url ); + + /** + * Sets the addressee of the agent. When using this function, + * isIntern() will return 'true' until you use setUrl(). + * + * @param addressee The addressee object of the agent. + */ + void setAddressee( Addressee *addressee ); + + /** + * Returns whether the agent is described by a URL (extern) or + * by a addressee (intern). + * When this method returns 'true' you can use addressee() to + * get a Addressee object. Otherwise you can request the URL + * of this agent by url() and load the data from that location. + */ + bool isIntern() const; + + /** + * Returns the location URL of this agent. + */ + TQString url() const; + + /** + * Returns the addressee object of this agent. + */ + Addressee* addressee() const; + + /** + * Returns string representation of the agent. + */ + TQString asString() const; + +private: + Addressee *mAddressee; + TQString mUrl; + + int mIntern; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Agent & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Agent & ); + +} +#endif diff --git a/tdeabc/countrytransl.map b/tdeabc/countrytransl.map new file mode 100644 index 000000000..1459f0942 --- /dev/null +++ b/tdeabc/countrytransl.map @@ -0,0 +1,12381 @@ +Andorra ad +Andorra ad +أندورا ad +Ðндора ad +Ðндора ad +অà§à¦¯à¦¾à¦¨à¦¡à§‹à¦°à¦¾ ad +Andora ad +Andora ad +ΑνδόÏα ad +Andoro ad +آندورا ad +Andorre ad +Andóra ad +×נדורה ad +अंडोरा ad +アンドラ ad +អង់ដូរ៉ា ad +안ë„ë¼ ad +ອີນເດີຠad +Andora ad +Ðндора ad +Ðндорра ad +à¨à¨‚ਡੋਰਾ ad +Andora ad +Ðндорра ad +Andora ad +Ðндора ad +Andora ad +அனà¯à®Ÿà¯‹à®°à®¾ ad +Ðндора ad +à¹à¸­à¸™à¹‚ดรา ad +Ðндорра ad +Ðндорра ad +Andore ad +安é“å°” ad +安é“爾 ad +United Arab Emirates ae +Vereenigde Arabiese Emirate ae +الإمارات العربية المتحدة ae +Ð—Ð»ÑƒÑ‡Ð°Ð½Ñ‹Ñ ÐрабÑÐºÑ–Ñ Ð­Ð¼Ñ–Ñ€Ð°Ñ‚Ñ‹ ae +ОÐЕ ae +সংযà§à¦•à§à¦¤ আরব আমিরশাহি ae +Stadoù-Unanet Arabeg ae +Ujedinjeni arapski emirati ae +Emirats Àrabs Units ae +Spojené arabské emiráty ae +Emiraethau Arabaidd Unedig ae +Forenende Arabiske Emirater ae +Vereinigte Arabische Emirate ae +Ενωμένα ΑÏαβικά ΕμιÏάτα ae +UniÄintaj Arabaj Emirlandoj ae +Emiratos árabes unidos ae +Araabia Ühendemiraadid ae +Arabiar Emirato Batuak ae +امارات متحده عربی ae +Yhdistyneet Arabiemiraatit ae +Émirats Arabes Unis ae +Ferienigde Arabyske Emiraten ae +Aontas na nÉimíríochtaí Arabacha ae +Emiratos Ãrabes Unidos ae +×יחוד ×”×מירויות הערביות ae +संयà¥à¤•à¥à¤¤ अरब अमीरात ae +Ujedinjeni arapski emirati ae +Egyesült Arab Emirátusok ae +Sameinuðu arabísku furstadæmin ae +Emirati Arabi Uniti ae +アラブ首長国連邦 ae +អារ៉ាប់​រួម ae +ì•„ëž ì—미레ì´íЏ ì—°í•© ae +ສະຫະລັດ ae +Jungtiniai Arabų Emiratai ae +Apvienotie ArÄbu EmerÄti ae +Обединети ÐрапÑки Емирати ae +ÐÑгдÑÑн арабын имрат ae +Emirati Għarab Magħquda ae +De forente arabiske emirater ae +Vereenigte Araabsche Emiraten ae +Verenigde Arabische Emiraten ae +Dei sameinte arabiske emirata ae +Di-Emirate tseo di Kopanego tsa Arab ae +ਸੰਯà©à¨•ਤ ਅਰਬ ਅਮੀਰਾਤ ae +Zjednoczone Emiraty Arabskie ae +Emiratos Ãrabes Unidos ae +Emirados Ãrabes Unidos ae +Emiratele Arabe Unite ae +Объединенные ÐрабÑкие Эмираты ae +Leta Zunze Ubumwe z'Abarabu ae +Ovttastuvvon arábalaÅ¡ emiráhtat ae +Spojené arabské emiráty ae +Združeni arabski Emirati ae +Уједињени арапÑки емирати ae +Ujedinjeni arapski emirati ae +Förenade arabemiraten ae +யà¯à®©à¯ˆà®Ÿà¯†à®Ÿà¯ அரபி எமிரேடà¯à®¸à¯ ae +Ðморати муттаҳидаи Ðраб ae +สหรัà¸à¸­à¸²à¸«à¸£à¸±à¸šà¸­à¸µà¸¡à¸´à¹€à¸£à¸•ส์ ae +BirleÅŸik Arap Emirlikleri ae +Berläşkän Ğäräp Ämirlekläre ae +Об'єднані ÐрабÑькі Емірати ae +Бирлашган Ðраб Ðмирликлари ae +Mashango o tangananaho a Emirates ae +Emirat Arabes Unis ae +阿è”é…‹ ae +阿拉伯è¯åˆå¤§å…¬åœ‹ ae +Izindawo zezinduna zase-United Arab ae +Afghanistan af +Ø£ÙØºØ§Ù†Ø³ØªØ§Ù† af +ÐфганіÑтан af +ÐфганиÑтан af +আফগানিসà§à¦¤à¦¾à¦¨ af +Afganistan af +Afganistan af +Afganistan af +Afghanistán af +Affganistan af +Αφγανιστάν af +Afganio af +Afghanistán af +Afganistan af +Ø§ÙØºØ§Ù†Ø³ØªØ§Ù† af +Afganistan af +An Afganastáin af +Afganistan af +×פגניסטן af +अफगानिसà¥à¤¤à¤¾à¤¨ af +Afganistan af +Afganisztán af +Afganistan af +Afganistan af +アフガニスタン af +អាហ្វកានីស្ážáž¶áž“ af +아프가니스탄 af +ລີທົ່ວເນີຠaf +AfganistÄna af +ÐвганиÑтан af +ÐфганÑтан af +Afganistan af +ਅਫਗਾਨਿਸਤਾਨ af +Afganistan af +Afeganistão af +Afeganistão af +Afganistan af +ÐфганиÑтан af +Afuganisitani af +Afganistan af +Afganistan af +ÐвганиÑтан af +Avganistan af +Afganistan af +ஆபà¯à®•ானிஸà¯à®¤à®¾à®©à¯ af +ÐфғониÑтон af +อาฟà¸à¸²à¸™à¸´à¸ªà¸–าน af +Afganistan af +Äfğänstan af +ÐфганіÑтан af +ÐфғониÑтон af +Afganistan af +阿富汗 af +阿富汗 af +Antigua and Barbuda ag +Antigue en Barbuda ag +أنتيغوا Ùˆ باربودا ag +Antigua vÉ™ Barbuda ag +Ðнтыгуа Ñ– Барбуда ag +Ðнтигуа и Барбуда ag +অà§à¦¯à¦¾à¦¨à§à¦Ÿà¦¿à¦—à§à§Ÿà¦¾ à¦à¦¬à¦‚ বারà§à¦¬à§à¦¡à¦¾ ag +Antigua ha Barbuda ag +Antigua i Barbuda ag +Antigua i Barbuda ag +Antigua a Barbuda ag +Antigwa a Barbwda ag +Antigua og Barbuda ag +Antigua und Barbuda ag +Αντίγκουα και ΜπαÏμποÏντα ag +Antigvo-Barbudo ag +Antigua y Barbuda ag +Antigua ja Barbuda ag +Antigua eta Barbuda ag +آنتیگوا Ùˆ باربودا ag +Antigua ja Barbados ag +Antigua og Barbuda ag +Antigua et Barbuda ag +Antigua en Barbuda ag +Antigua agus Barbúda ag +Antiga e Barbuda ag +×נטיגו××” ובריבודה ag +à¤à¤¨à¥à¤Ÿà¤¿à¤—à¥à¤† और बारबूडा ag +Antigua i Barbuda ag +Antigua és Barbuda ag +Antigua dan Barbuda ag +Antígva og Barbúda ag +Antigua e Barbuda ag +アンティグアãƒãƒ¼ãƒ–ーダ ag +Antigua និង Barbuda ag +앤티가 바부다 ag +Antikva ir Barbuda ag +Antigva un Barbuda ag +Ðнтигва и Барбуда ag +Ðнтигуа ба Барбуда ag +Antigwa u Barbuda ag +Antigua og Barbuda ag +Antigua un Barbuda ag +Antigua en Barbuda ag +Antigua og Barbuda ag +Antigua le Barbuda ag +Antigua e Barbuda ag +à¨à¨‚ਟੀਗà©à¨† ਤੇ ਬਾਰਬà©à¨¡à¨¾ ag +Antigua i Barbuda ag +Antígua e Barbuda ag +Antigua e Barbuda ag +Antigua ÅŸi Barbuda ag +Ðнтигуа и Барбуда ag +Antigwa na Barubida ag +Antigua ja Barbuda ag +Antigua a Barbuda ag +Antigva in Barbuda ag +Ðнтигва и Барбуда ag +Antigva i Barbuda ag +I-Antigua kanye ne Barbuda ag +Antigua och Barbuda ag +ஆனà¯à®Ÿà®¿à®•ா மறà¯à®±à¯à®®à¯ பெரà¯à®®à¯à®Ÿà®¾ ag +Ðнтигуо ва Барбудо ag +อันทิà¸à¸±à¸§ à¹à¸¥à¸° บาร์บูดา ag +Antigua ve Barbuda ag +Antigua wä Barbuda ag +Трінідад Ñ– Тобаго ag +Ðнтигуа ва Барбуда ag +Antigua và Barbuda ag +Antigua eyet Barbuda ag +Antigua ne Barbuda ag +安æç“œå’Œå·´å¸ƒè¾¾ ag +安地瓜島和巴布é”å³¶ ag +Antigua kanye ne-Barbuda ag +Anguilla ai +أنغويلا ai +ÐÐ½Ð³Ñ–Ð»ÑŒÑ ai +Ðнгила ai +অà§à¦¯à¦¾à¦™à§à¦—à§à¦‡à¦²à¦¾ ai +Angilla ai +Angwila ai +Ανγκουίλα ai +Angvilo ai +آنگوییلا ai +×נגווילה ai +à¤à¤‚गà¥à¤à¤²à¤¾ ai +Angvilla ai +イギリス属領アンギラ ai +អង់ហ្ស៊ីឡា ai +ì•™ê¸¸ë¼ ai +à»àºžàº™àº§àº´àº™ ai +Ðнгилја ai +Ðнгуаилла ai +Angwilla ai +à¨à¨‚ਨਗà©à¨ˆà¨²à¨¾ ai +Anghila ai +Ðнгилла ai +Angwiya ai +Angvila ai +Ðнгвила ai +Angvila ai +ஆனà¯à®•ிலà¯à®²à®¾ ai +Ðнгуилло ai +à¹à¸­à¸‡à¸à¸µà¸¥à¸² ai +ÐÐ½Ð³Ñ–Ð»ÑŒÑ ai +Ðнгвилла ai +Anguila ai +安圭拉 ai +阿爾åŠåˆ©äºž ai +Albania al +Albanië al +ألبانيا al +ÐÐ»ÑŒÐ±Ð°Ð½Ñ–Ñ al +ÐÐ»Ð±Ð°Ð½Ð¸Ñ al +অলবেনিয়া al +Albani al +Albanija al +Albània al +Albánie al +Albanien al +Albanien al +Αλβανία al +Albanio al +Albaania al +آلبانی al +Albanie al +Albanië al +An Albáin al +Albánia al +×לבניה al +अलà¥à¤¬à¤¾à¤¨à¤¿à¤¯à¤¾ al +Albánia al +Albanía al +アルãƒãƒ‹ã‚¢ al +អាល់បានី al +알바니아 al +à»àº­àº”à»àº¥àº™àº•ິຠal +Albanija al +AlbÄnija al +Ðлбанија al +Ðлбани al +Albanija al +Albanien al +Albanië al +ਅਲਬਾਨੀਆ al +Albânia al +Albânia al +ÐÐ»Ð±Ð°Ð½Ð¸Ñ al +Alubaniya al +Albánia al +Albánsko al +Albanija al +Ðлбанија al +Albanija al +Albanien al +ஆலà¯à®ªà®©à®¿à®¯à®¾ al +Олбанӣ al +อัลเบเนีย al +Arnavutluk al +ÐÐ»Ð±Ð°Ð½Ñ–Ñ al +ÐÐ»Ð±Ð°Ð½Ð¸Ñ al +Albaneye al +阿尔巴尼亚 al +阿亞巴尼亞 al +Armenia am +Armenië am +أرمينيا am +ÐрмÑÐ½Ñ–Ñ am +ÐÑ€Ð¼ÐµÐ½Ð¸Ñ am +আরà§à¦®à§‡à¦¨à¦¿à§Ÿà¦¾ am +Armeni am +Armenija am +Armènia am +Arménie am +Armenien am +Armenien am +ΑÏμενία am +Armenio am +Armeenia am +ارمنستان am +Arménie am +Armenië am +An Airméin am +Arménia am +×רמניה am +आरà¥à¤®à¥‡à¤¨à¤¿à¤¯à¤¾ am +Örményország am +Armenía am +アルメニア am +អារមáŸáž“ី am +아르메니아 am +ອາເຈນຕິນາ am +ArmÄ—nija am +ArmÄ“nija am +Ерменија am +Ðрмен am +Armenien am +Armenië am +ਅਰਮੀਨੀਆ am +Arménia am +Armênia am +ÐÑ€Ð¼ÐµÐ½Ð¸Ñ am +Arumeniya am +Arménsko am +Armenija am +Јерменија am +Jermenija am +Armenien am +ஆரà¯à®®à¯‡à®©à®¿à®¯à®¾ am +ÐрманиÑтон am +อาร์เมเนีย am +Ermenistan am +Ärmänstan am +Ð’Ñ–Ñ€Ð¼ÐµÐ½Ñ–Ñ am +ÐрманиÑтон am +Ã…rmeneye am +亚美尼亚 am +亞美尼亞 am +Netherlands Antilles an +Nederlandse Antilles an +أنتيل هولندا an +ÐідÑрлÑндÑÐºÑ–Ñ Ðнтылы an +ХоландÑки Ðнтили an +নেদারলà§à¦¯à¦¾à¦£à§à¦¡à¦¸ অà§à¦¯à¦¾à¦¨à§à¦Ÿà¦¿à¦²à§‡à¦¸ an +Antilh an Izelvroioù an +Nizozemski Antili an +Antilles del Països Baixos an +Nizozemské Antily an +Ynysoedd Iseldiraidd Y Carib? an +Nederlandske antiller an +Niederländische Antillen an +Ολλανδικές Αντίλλες an +Nederlandaj Antiloj an +Antillas holandesas an +Hollandi Antillid an +Antilla Holandarrak an +آنتیلس هلند an +Alankomaiden Antillit an +Antilles néerlandaises an +Nederlânske Antillen an +Aintillí na hÃsiltíre an +Antillas Holandesas an +नीदरलैंड à¤à¤¨à¥à¤Ÿà¥€à¤²à¥€à¤¸ an +Nizozemski Antili an +Holland-Antillák an +Hollensku Antillur an +Antille Olandesi an +オランダ領アンãƒãƒ« an +អង់ទីយáŸâ€‹áž áž¼áž›áŸ’លង់ an +네ëœëž€ë“œë ¹ 안틸레스 an +ເນເທີà»àº¥àº™ an +Nyderlandų Antilai an +NÄ«derlandes Antiļas an +ХоландÑки Ðнтили an +Ðедерландын ÐнтиллÑÑ an +De nederlandske Antillene an +Nedderlandsche Antillen an +Nederlandse Antillen an +Dei nederlandske Antillane an +ਨੀਂਦਰਲੈਂਡ à¨à¨‚ਟੀਲੀਸ an +Antyle Holenderskie an +Antilhas Holandês an +Antilhas Holandesas an +Antilele Olandeze an +ÐидерландÑкие ÐнтильÑкие оÑтрова an +Antiye z'Ubuholande an +HollándalaÅ¡ Antillat an +Holandské Antily an +Nizozemski Antili an +ХоландÑки антили an +Holandski antili an +Nederländska Antillerna an +நெதரà¯à®²à®¾à®¨à¯à®¤à¯ அனà¯à®Ÿà®¿à®²à¯à®¸à¯ an +ÐнтилиÑи Ҳолланд an +เนเธอร์à¹à¸¥à¸™à¸”์ à¹à¸­à¸™à¸—ิลีส an +Hollanda Antilleri an +Niderland Antilläre an +ÐнтільÑькі оÑтрови (Ðідерланди) an +Ðидерландлар Ðнтил Ороллари an +Hà Lan Antilles an +Antiyes Neyerlandesses an +è·å±žå®‰çš„列斯群岛 an +è·å±¬å®‰åœ°åˆ—斯群島 an +Angola ao +أنغولا ao +Ðнгола ao +Ðнгола ao +অà§à¦¯à¦¾à¦™à§à¦—োলা ao +Ανγκόλα ao +Angolo ao +آنگولا ao +Angóla ao +×נגולה ao +अंगोला ao +Angóla ao +アンゴラ ao +អង់ហ្គោឡា ao +ì•™ê³¨ë¼ ao +ບັນà»àºà»€àº¥àºµàº ao +Ðнгола ao +Ðнгол ao +ਅੰਗੋਲਾ ao +Ðнгола ao +Ðнгола ao +ஆஙà¯à®•ோலா ao +Ðнгуло ao +à¹à¸­à¸‡à¹‚à¸à¸¥à¸² ao +Ðнгола ao +Ðнгола ao +安哥拉 ao +安哥拉 ao +Argentina ar +Argentinië ar +الأرجنتين ar +Ðргентына ar +Ðржентина ar +আরà§à¦œà§‡à¦¨à§à¦Ÿà¦¿à¦¨à¦¾ ar +Arc'hantina ar +Ariannin ar +Argentinien ar +ΑÏγεντινή ar +Argentino ar +آرژانتین ar +Agentiina ar +Argentine ar +Argentinië ar +An Airgintín ar +Arxentina ar +×רגנטינה ar +अरà¥à¤œà¥‡à¤‚टीना ar +Argentína ar +Argentína ar +アルゼンãƒãƒ³ ar +អាហ្សង់ទីន ar +아르헨티나 ar +ອາເຈນຕິນາ ar +ArgentÄ«na ar +Ðргентина ar +Ðргентин ar +ArÄ¡entina ar +Argentinien ar +Argentinië ar +ਅਰਜ਼ਨਟੀਨਾ ar +Argentyna ar +Ðргентина ar +Arijantina ar +Argentína ar +Ðргентина ar +I-Argentina ar +ஆரà¯à®šà¯†à®©à¯à®Ÿà®¿à®©à®¾ ar +Оржонтина ar +อาร์เจนตินา ar +Arjantin ar +Ðргентина ar +Ðргентина ar +Agenthina ar +Ã…rdjintene ar +阿根廷 ar +阿根廷 ar +American Samoa as +Amerikanse Samoa as +ساموا الأمريكية as +ÐмÑрыканÑкае Самоа as +ÐмериканÑки Самоа as +মারà§à¦•িন সামোয়া as +Samoa amerikanek as +AmeriÄka Samoa as +Samoa Americana as +Americká Samoa as +Samoa Americanaidd as +Samoa (USA) as +Amerikanisches Samoa as +ΑμεÏικανική Σαμόα as +Amerika Samoo as +Samoa americana as +Ameerika Samoa as +Amerikar Samoa as +ساموای آمریکا as +Amerikan Samoa as +Samoa américaines as +Amerikaansk Samoa as +Samó Meiriceánach as +Samoa Americana as +סמו××” ×”×מריקנית as +अमेरिकी सामोआ as +AmeriÄka Samoa as +Amerikai Szamoa as +Bandaríska Samóa as +Samoa Americane as +アメリカンサモア as +សាមូអា អាមáŸážšáž·áž€ as +미국령 사모아 as +ອາເມລິàºàº²à»€àº«àº™àº·àº­ as +Amerikos Samoa as +Amerikas Samoa as +ÐмериканÑка Самоа as +Ðмерик, Самоа as +Samoa Amerikana as +Amerikansk Samoa as +Amerikaansch Samoa as +Amerikaans Samoa as +Amerikansk Samoa as +ਅਮਰੀਕੀ ਸਾਮੋਆ as +Samoa AmerykaÅ„skie as +Samoa Americana as +Samoa Americana as +Samoa americană as +ÐмериканÑкое Самоа as +Samowa Nyamerika as +AmerihkálaÅ¡ Samoa as +Americká Samoa as +AmeriÅ¡ka Samoa as +Ðмеричка Самоа as +AmeriÄka Samoa as +Amerikanska Samoa as +அமெரிகà¯à®•ா சமோயா as +Самоаи Ðмрикоӣ as +อเมริà¸à¸±à¸™ ซามัว as +Amerika Samoası as +Amerikalı Samoa as +ÐмериканÑьке Самоа as +Ðмерика СамоаÑи as +Samowa Amerikinne as +ç¾Žå±žè¨æ‘©äºš as +美屬薩摩亞 as +Austria at +Oostenryk at +النمسا at +Avstriya at +ÐÑžÑÑ‚Ñ€Ñ‹Ñ at +ÐвÑÑ‚Ñ€Ð¸Ñ at +অসà§à¦Ÿà§à¦°à¦¿à§Ÿà¦¾ at +Aostria at +Austrija at +Àustria at +Rakousko at +Awstria at +Østrig at +Österreich at +ΑυστÏία at +AÅ­strio at +اتریش at +Itävalta at +Eysturríki at +Autriche at +Eastenryk at +An Ostair at +×וסטריה at +आसà¥à¤Ÿà¥à¤°à¤¿à¤¯à¤¾ at +Austrija at +Ausztria at +Austurríki at +オーストリア at +អូទ្រីស at +오스트리아 at +ອອດສະເຕເລີຠat +Austrija at +Austrija at +ÐвÑтрија at +ÐвÑтри at +Awtrija at +Østerrike at +Österriek at +Oostenrijk at +Austerrike at +ਆਸਟਰੀਆ at +Ãustria at +Ãustria at +ÐвÑÑ‚Ñ€Ð¸Ñ at +Ositiriya at +Nuortariika at +Rakúsko at +Avstrija at +ÐуÑтрија at +Austrija at +I-Austria at +Österrike at +ஆஸà¯à®¤à¯à®¤à®¿à®°à®¿à®¯à®¾ at +ÐвÑÑ‚Ñ€Ð¸Ñ at +ออสเตรีย at +Avusturya at +ÐвÑÑ‚Ñ€Ñ–Ñ at +ÐвÑÑ‚Ñ€Ð¸Ñ at +Ositiria at +Ão at +Otriche at +奥地利 at +奧地利 at +Australia au +Australië au +أستراليا au +Avustralya au +ÐÑžÑÑ‚Ñ€Ð°Ð»Ñ–Ñ au +ÐвÑÑ‚Ñ€Ð°Ð»Ð¸Ñ au +অসà§à¦Ÿà§à¦°à§‡à¦²à¦¿à§Ÿà¦¾ au +Aostralia au +Australija au +Austràlia au +Austrálie au +Awstralia au +Australien au +Australien au +ΑυστÏαλία au +AÅ­stralio au +Austraalia au +استرالیا au +Australie au +Australië au +An Astráil au +Austrália au +×וסטרליה au +आसà¥à¤Ÿà¥à¤°à¥‡à¤²à¤¿à¤¯à¤¾ au +Australija au +Ausztrália au +Ãstralía au +オーストラリア au +អូស្ážáŸ’រាលី au +오스트레ì¼ë¦¬ì•„ au +ອອດສະເຕເລີຠau +Australija au +AustrÄlija au +ÐвÑтралија au +ÐвÑтрали au +Awstralja au +Australien au +Australië au +ਅਸਟਰੇਲੀਆ au +Austrália au +Austrália au +ÐвÑÑ‚Ñ€Ð°Ð»Ð¸Ñ au +Ositaraliya au +Austrália au +Austrália au +Avstralija au +ÐуÑтралија au +Australija au +I-Australia au +Australien au +ஆஸà¯à®¤à¯à®¤à®¿à®°à¯‡à®²à®¿à®¯à®¾ au +ОÑтролиё au +ออสเตรเลีย au +Avusturalya au +ÐвÑÑ‚Ñ€Ð°Ð»Ñ–Ñ au +ÐвÑÑ‚Ñ€Ð°Ð»Ð¸Ñ au +Ositiralia au +Úc au +Ostraleye au +澳大利亚 au +澳大利亞 au +Aruba aw +أروبا aw +Ðруба aw +আরà§à¦¬à¦¾ aw +Arwba aw +ΑÏοÏμπα aw +Arubo aw +آروبا aw +×רובה aw +अरूबा aw +Arúba aw +オランダ自治領アルムaw +អារូបា aw +아루바 aw +ເàºàº¡à»„ັພ່ aw +Ðруба aw +Ðрува aw +ਅਰੂਬੀ aw +Ðруба aw +Ãruba aw +Ðруба aw +à®…à®°à¯à®ªà®¾ aw +Ðрубо aw +อรูบา aw +Ðруба aw +Ðруба aw +Arouba aw +阿é²å·´ aw +阿魯巴 aw +Ã…land Islands ax +Ã…land Eilande ax +ОÑтрови Ðланд ax +Illes Ã…land ax +Ã…landské ostrovy ax +Ã…land-øerne ax +Aland ax +Îησιά Ã…land ax +Islas Aland ax +Ahvenamaa ax +Ã…land irlak ax +Ahvenanmaan saaret ax +ÃŽles Ã…land ax +Ã…land-eilannen ax +Na hOileáin Ã…land ax +Illas Ã…land ax +Ã…land-szigetek ax +Ãlandseyjar ax +Isole Ã…land ax +オーランド諸島 ax +កោះ Ã…land ax +Ã…land salos ax +ОÑтрови Оланд ax +Ã…land-øyene ax +Ã…land-Inseln ax +Ã…land-eilanden ax +Ã…land-øyane ax +ਅਮਾਨ ਟਾਪੂ ax +Wyspy Ã…land ax +Ilhas Ã…land ax +Ilhas Ã…land ax +ÐландÑкие оÑтрова ax +Ibirwa by'Ã…land ax +Ã…land sullot ax +Ã…landski otoki ax +ÐландÑка оÑтрва ax +Alandska ostrva ax +Ã…land ax +หมู่เà¸à¸²à¸°à¸­à¸²à¸¥à¸±à¸™à¸”์ ax +Cayman Adaları ax +Aland Utrawları ax +ÐландÑькі оÑтрови ax +Ðланд Ороллари ax +阿兰群岛 ax +奧蘭群島 ax +Azerbaijan az +أذربيجان az +AzÉ™rbaycan az +ÐзÑрбайджан az +Ðзербайджан az +আজেরবাইজান az +Azerbeidjan az +Azerbejdžan az +Azerbaitjan az +Ãzerbajdžánský az +Aserbaijan az +Azerbajdjan az +Aserbaidschan az +ΑζεÏμπαϊτζάν az +AzerbajÄano az +Azerbaiján az +Aserbaidžaan az +آذربایجان az +Azerbaidäani az +Aserbadsjan az +Azerbeidjan az +An Asarbaiseáin az +×זרביג'ן az +अजरबैजान az +Azerbejdžan az +Azerbajdzsán az +Aserbaídsjan az +Azerbaigian az +アゼルãƒã‚¤ã‚¸ãƒ£ãƒ³ az +អាហ្ស៊ែរបែហ្សង់ az +아제르바ì´ìž” az +ອາເຊີໄບຈັນ az +Azerbaidžanas az +AzerbaidžÄna az +Ðзербејџан az +Ðзарбайжан az +AżerbajÄ¡an az +Aserbajdsjan az +Aserbaidschan az +Azerbeidjan az +Aserbajdsjan az +ਅਜ਼ਰਬਾਈਜਾਨ az +Azerbejdżan az +Azerbaijão az +Azerbaijão az +Ðзербайджан az +Azeribayijani az +Aserbaižan az +Ãzerbajdžánsky az +Azerbajdžan az +Ðзербејџан az +Azerbejdžan az +I-Azerbaijan az +அசரà¯à®ªà¯ˆà®šà®¾à®©à¯ az +Озарбойҷон az +อาร์เซอร์ไบจัน az +Azerice az +Äzärbaycan az +Ðзербайджан az +Озарбайжон az +Azerbaydjan az +阿塞拜疆 az +亞塞拜然 az +Bosnia and Herzegovina ba +Bosnië en Herzegovina ba +البوسنا Ùˆ الهرسك ba +БоÑÑŒÐ½Ñ–Ñ Ñ– Герцагавіна ba +БоÑна и Херцеговина ba +বসনিয়া à¦à¦¬à¦‚ হারজিগোভিনা ba +Bosni hag Herzigovi ba +Bosna i Hercegovina ba +Bòsnia i Hercegovina ba +Bosna a Herzegovina ba +Bosnia a Hertsegofina ba +Bosnien-Herzegovina ba +Bosnien und Herzegowina ba +Βοσνία και ΕÏζεγοβίνη ba +Bosnio kaj Hercegovino ba +Bosnia y Herzegovina ba +Bosnia ja Hertsegovina ba +Bosnia eta Herzegovina ba +بوسنی Ùˆ هرزگوین ba +Bosnia ja Herzegovina ba +Bosnia-Herzegovina ba +Bosnie herzégovine ba +Bosnië en Herzegovina ba +An Bhoisnia agus Heirseagóivéin ba +Bosnia e Herzegovina ba +בוסניה הרצגובינה ba +बोसà¥à¤¨à¤¿à¤¯à¤¾ और हरà¥à¤œà¥‡à¤—ोविना ba +Bosna i Hercegovina ba +Bosznia-Hercegovina ba +Bosnía og Hersegóvína ba +Bosnia e Erzegovina ba +ボスニアヘルツェゴビナ ba +បូស្ន៊ី និង​ហឺហ្ស៊áŸáž áŸ’គោវីណា ba +보스니아어와 헤르체고비나 ba +ບອສເນີຠà»àº¥àº° ເຫີເຊີໂàºàº§àº´àº™àº² ba +Bosnija ir Hercegovina ba +Bosnija un Hercogovina ba +БоÑна и Херцеговина ba +БоÑни ба Херцеговина ba +Bożnia u Ħerżegovina ba +Bosnia-Hercegovina ba +Bosnien-Herzegowina ba +Bosnië en Herzegovina ba +Bosnia-Hercegovina ba +Bosnia le Herzegovina ba +ਬੋਸਨੀਆ ਤੇ ਹਰਜ਼ੀਗੋਵਿਨਾ ba +BoÅ›nia i Hercegowina ba +Bósnia e Herzegovina ba +Bósnia Herzegovina ba +Bosnia ÅŸi HerÅ£egovina ba +БоÑÐ½Ð¸Ñ Ð¸ Герцеговина ba +Bosiniya na Herizegovina ba +Bosnia ja Hercegovina ba +Bosna a Hercegovina ba +Bosna in Hercegovina ba +БоÑна и Херцеговина ba +Bosna i Hercegovina ba +I-Bosnia kanye ne Herzegovina ba +Bosnien och Herzegovina ba +பொசà¯à®©à®¿à®¯à®¾ மறà¯à®±à¯à®®à¯ ஹரà¯à®œà®¿à®•ோவினா ba +БоÑÐ½Ð¸Ñ Ð²Ð° ГерÑогавина ba +บอสเนียà¹à¸¥à¸°à¹€à¸®à¸­à¸£à¹Œà¹€à¸‹à¹‚à¸à¸§à¸´à¸™à¸² ba +Bosna Hersek ba +Bosnia wä Herzegovina ba +БоÑÐ½Ñ–Ñ Ñ– Герцеговина ba +БоÑÐ½Ð¸Ñ Ð²Ð° Герцоговина ba +Mubosinia na Muhezegovina ba +Bosnia và Herzegovina ba +Bosneye ba +Bosnia ne Herzegovina ba +波斯尼亚和黑塞哥维那 ba +æ³¢å£«å°¼äºžèˆ‡èµ«å¡žå“¥ç¶­ç´ ba +Bosnia kanye ne-Herzegovina ba +Barbados bb +بربادوس bb +Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb +Ð‘Ð°Ñ€Ð±ÐµÐ¹Ð´Ð¾Ñ bb +বারবাডোস bb +ΜπαÏμπάντος bb +Barbado bb +باربادوس bb +Barbade bb +Barbadós bb +ברבדוס bb +बारबाडोस bb +ãƒãƒ«ãƒãƒ‰ã‚¹ bb +បារបាដូស bb +바르바ë„스 bb +ບາລບາດອດສ bb +Barbadosas bb +Barbadosa bb +Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb +Ð‘Ð°Ñ€Ð±Ð¾Ð´Ð°Ñ bb +ਬਾਰਬਾਡੋਸ bb +Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb +Barubadosi bb +Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb +I-Barbados bb +பாரà¯à®ªà¯‡à®Ÿà®¾à®šà¯ bb +Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb +บาร์บาดอส bb +Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb +Ð‘Ð°Ñ€Ð±Ð°Ð´Ð¾Ñ bb +BÃ¥rbades bb +巴巴多斯 bb +å·´è²å¤š bb +Bangladesh bd +بنغلاديش bd +BanqladeÅŸ bd +БанглÑдÑш bd +Бангладеш bd +বাংলাদেশ bd +Bangladaech bd +BangladeÅ¡ bd +Bangladéš bd +Bangladesch bd +Μπαγκλαντές bd +BangladeÅo bd +بنگلادش bd +An Bhanglaidéis bd +בנגלדש bd +बांगà¥à¤²à¤¾à¤¦à¥‡à¤¶ bd +BangladeÅ¡ bd +Banglades bd +Bangladess bd +ãƒãƒ³ã‚°ãƒ©ãƒ‡ã‚·ãƒ¥ bd +បង់ក្លាដáŸážŸáŸ’áž  bd +방글ë¼ë°ì‹œ bd +ບັງຄະລາເທດ bd +BangladeÅ¡as bd +BangladeÅ¡a bd +Бангладеш bd +Бангладеш bd +Bangladexx bd +Bangladesch bd +ਬੰਗਲਾਦੇਸ਼ bd +Bangladesz bd +BangladeÅŸ bd +Бангладеш bd +Bangaladeshi bd +Bangladéš bd +BangladeÅ¡ bd +Бангладеш bd +BangladeÅ¡ bd +I-Bangladesh bd +பஙà¯à®•ளாதேச௠bd +Банглодеш bd +บังคลาเทศ bd +BangladeÅŸ bd +BangladeÅŸ bd +Бангладеш bd +Бангладеш bd +孟加拉国 bd +孟加拉 bd +Belgium be +België be +بلجيكا be +Belçika be +БÑÐ»ÑŒÐ³Ñ–Ñ be +Ð‘ÐµÐ»Ð³Ð¸Ñ be +বেলজিয়াম be +Belgia be +Belgija be +Bèlgica be +Belgie be +Gwlad Belg be +Belgien be +Belgien be +Βέλγιο be +Belgio be +Bélgica be +Belgia be +Belgika be +بلژیک be +Belgia be +Belgia be +Belgique be +België be +An Bheilg be +Bélxica be +בלגיה be +बेलà¥à¤œà¤¿à¤¯à¤® be +Belgija be +Belgia be +Belgía be +Belgio be +ベルギー be +បែលហ្ស៊ិក be +ë²¨ê¸°ì— be +ເບລຢ່ງມ be +Belgija be +Beļģija be +Белгија be +Белги be +BelÄ¡ju be +Belgia be +Belgien be +België be +Belgia be +Bèlgica be +ਬੈਲਜੀਅਮ be +Belgia be +Bélgica be +Bélgica be +Belgia be +Ð‘ÐµÐ»ÑŒÐ³Ð¸Ñ be +Ububiligi be +Belgia be +Belgicko be +Belgija be +Белгија be +Belgija be +I-Belgium be +Belgien be +பெலà¯à®šà®¿à®¯à®®à¯ be +Ð‘ÐµÐ»Ð³Ð¸Ñ be +เบลเยียม be +Belçika be +Belgia be +Ð‘ÐµÐ»ÑŒÐ³Ñ–Ñ be +Ð‘ÐµÐ»Ð³Ð¸Ñ be +Bỉ be +Beldjike be +比利时 be +比利時 be +Burkina Faso bf +بوركينا ÙØ§Ø³Ùˆ bf +Буркіна ФаÑо bf +Буркина ФаÑо bf +বারকিনা ফাসো bf +Bwrcina Ffaso bf +ΜπουÏκίνα Φάσο bf +Burkino bf +Ø¨ÙˆØ±Ú©ÛŒÙ†Ø§ÙØ§Ø³Ùˆ bf +Buircíne Fasó bf +בורניקה פ×סו bf +बà¥à¤°à¥à¤•िना फासो bf +Burkina faso bf +Búrkína Fasó bf +ブルキナファソ bf +ប៊ូរគីណាហ្វាសូ bf +부르키나 파소 bf +ຕຸລະàºàºµ bf +Буркина ФаÑо bf +Буркина ФаÑо bf +ਬà©à¨°à¨•ਿਨਾ ਫਾਸੋ bf +Буркина-ФаÑо bf +Burukina Faso bf +Буркина ФаÑо bf +பரà¯à®•ினா ஃபசோ bf +Буркина ФаÑу bf +เบอร์à¸à¸´à¸™à¸²à¸Ÿà¸²à¹‚ซ bf +Буркіна-ФаÑо bf +Буркина-ФаÑÑо bf +Bourkina Fasso bf +布基纳法索 bf +布å‰ç´æ³•ç´¢ bf +Bulgaria bg +Bulgarye bg +بلغاريا bg +Bolgarıstan bg +Ð‘Ð°ÑžÐ³Ð°Ñ€Ñ‹Ñ bg +Ð‘ÑŠÐ»Ð³Ð°Ñ€Ð¸Ñ bg +বà§à¦²à¦—েরিয়া bg +Bulgari bg +Bugarska bg +Bulgària bg +Bulharsko bg +Bwlgaria bg +Bulgarien bg +Bulgarien bg +ΒουλγαÏία bg +Bulgario bg +Bulgaaria bg +بلغارستان bg +Bulgarie bg +Bulgarije bg +An Bhulgáir bg +Bulgária bg +בולגריה bg +बà¥à¤²à¥à¤—ारिया bg +Bugarska bg +Bulgária bg +Búlgaría bg +ブルガリア bg +ប៊ុលហ្ការី bg +불가리아 bg +ບັນà»àºà»€àº¥àºµàº bg +Bulgarija bg +BulgÄrija bg +Бугарија bg +Болгари bg +Bulgarija bg +Bulgarien bg +Bulgarije bg +ਬà©à¨²à¨—ਾਰੀਆ bg +BuÅ‚garia bg +Bulgária bg +Bulgária bg +Ð‘Ð¾Ð»Ð³Ð°Ñ€Ð¸Ñ bg +Buligariya bg +Bulgária bg +Bulharsko bg +Bolgarija bg +БугарÑка bg +Bugarska bg +I-Bulgaria bg +Bulgarien bg +பலà¯à®•ேரியா bg +БулғориÑтон bg +บัลà¹à¸à¹€à¸£à¸µà¸¢ bg +Bulgaristan bg +Ð‘Ð¾Ð»Ð³Ð°Ñ€Ñ–Ñ bg +Ð‘Ð¾Ð»Ð³Ð°Ñ€Ð¸Ñ bg +Baligaria bg +BulgÃ¥reye bg +ä¿åŠ åˆ©äºš bg +ä¿åŠ åˆ©äºž bg +Bahrain bh +البحرين bh +БахрÑйн bh +Бахрейн bh +বাহরেন bh +Barein bh +Bahrein bh +Bahrajn bh +ΜπαχÏέιν bh +Barejno bh +Bahrein bh +Bahrein bh +بحرین bh +Baghrein bh +Bairéin bh +Barein bh +בחריין bh +बहारीन bh +Barein bh +ãƒãƒ¼ãƒ¬ãƒ¼ãƒ³ bh +បារ៉ែន bh +ë°”ë ˆì¸ bh +ຖັàºàºà»ˆàº‡àº§ bh +Bahreinas bh +Bahreina bh +Бахреин bh +Бахрайн bh +Baħrain bh +Baghrein bh +ਬਹਿਰੀਨ bh +Bahrajn bh +Bahrein bh +Бахрейн bh +Bahirayini bh +Bahrajn bh +Bahrajn bh +Бахреин bh +Bahrein bh +I-Bahrain bh +Bahrein bh +பஹà¯à®°à¯ˆà®©à¯ bh +Баҳрайн bh +บาห์เรียน bh +Bahreyn bh +Bahreyn bh +Бахрейн bh +Баҳрайн bh +Bareyn bh +å·´æž— bh +å·´æž— bh +Burundi bi +بوروندي bi +Бурундзі bi +Бурунди bi +বà§à¦°à§à¦¨à§à¦¡à¦¿ bi +Bwrwndi bi +ΜπουÏουντί bi +Burundo bi +بروندی bi +An Bhurúin bi +בורונדי bi +बà¥à¤°à¥‚ंडी bi +Búrúndí bi +ブルンジ bi +ប៊ូរុនឌី bi +부룬디 bi +ເຄອຣດ bi +Burundija bi +Бурунди bi +Бурунди bi +ਬà©à¨°à©à¨¨à¨¡à©€ bi +Бурунди bi +Бурунди bi +பà¯à®°à¯à®©à¯à®Ÿà®¿ bi +Бурундӣ bi +บูรันดิ bi +Бурунді bi +Бурунди bi +Bouroundi bi +布隆迪 bi +浦隆地 bi +Benin bj +Denin bj +بينين bj +БÑнін bj +Бенин bj +বেনিন bj +Μπενίν bj +Benino bj +بنین bj +Bénin bj +Beinin bj +בנין bj +बेनिन bj +Benín bj +ベナン bj +áž”áŸážŽáž¶áŸ†áž„ bj +베냉 bj +ບອສເນີຠbj +Benina bj +Бенин bj +Бенин bj +ਬੀਨਿਨ bj +Benim bj +Бенин bj +Bene bj +Бенин bj +பெனின௠bj +Бенини bj +เบนิน bj +Бенін bj +Бенин bj +è´å® bj +è²å— bj +Bermuda bm +برمودا bm +БÑрмуды bm +Бермуда bm +বারà§à¦®à§à¦¡à¦¾ bm +Bermud bm +Bermudy bm +Bermwda bm +Bermudas bm +ΒεÏμοÏδες bm +Bermudoj bm +برمودا bm +Bermudes bm +Beirmiúda bm +ברמודה bm +बरमूडा bm +Bermúdaeyjar bm +英領ãƒãƒ¼ãƒŸãƒ¥ãƒ¼ãƒ€ bm +ប៊áŸážšáž˜áž¼ážŠáž¶ bm +버뮤다 bm +ເàºàº¥àº¥àº°àº¡àº±àº™ bm +Bermudų bm +Bermudas bm +Бермуди bm +Бермуда bm +ਬੀਰਮà©à¨¡à¨¾ bm +Bermudy bm +Bermude bm +БермудÑкие ОÑтрова bm +Berimuda bm +Bermudy bm +Bermudi bm +Бермуда bm +பெரà¯à®®à¯à®Ÿà®¾ bm +Бермудо bm +เบอร์มิวดา bm +Бермуди bm +Бермуда Ороллари bm +Bermudes bm +百慕大 bm +ç™¾æ…•é” bm +Brunei Darussalam bn +بروناي دار السلام bn +БрунÑй bn +Бруней bn +বà§à¦°à§à¦¨à§‡à¦‡ দারà¦à¦¸à¦¸à¦²à¦¾à¦® bn +Darussalam Brunei bn +Brunej bn +Brwnei Darwsalam bn +Brunei bn +ΜπÏουνέι ÎταÏουσαλάμ bn +Brunejo bn +Brunei bn +برونویی بیت‌المقدس bn +Brunei bn +Brúiné bn +בורניי ×“×¨×•×¡×œ× bn +बà¥à¤°à¥‚नेई दारेसà¥à¤¸à¤²à¤¾à¤® bn +Brunei Szultánság bn +Brúnei Darussalam bn +Brunei bn +ブルãƒã‚¤ bn +ប្រ៊ុយណ០bn +ë¸Œë£¨ë‚˜ì´ bn +ເບລາລັສເຊີຠbn +Bruneja Darusalama bn +Брунеи Дар ÐµÑ Ð¡Ð°Ð»Ð°Ð¼ bn +Бруней ДаруÑÑалам bn +Brunei bn +Brunei bn +Brunei bn +ਬਰੂਨੀ ਡਾਰੂਸਲਾਮ bn +Brunei Dar-es-Salam bn +Brunei bn +Бруней bn +Buruneyi Darusalamu bn +Brunei bn +Brunei Darusalam bn +Брунеј ДаруÑалам bn +Brunej Darusalam bn +பà¯à®°à¯‚னை டரà¯à®šà®²à®¾à®®à¯ bn +Брунеи Ð‘Ð°Ð¹Ñ‚ÑƒÐ»Ð¼ÑƒÒ›Ð°Ð´Ð´Ð°Ñ bn +บรูไนดูรัสซาลาม bn +Brunei bn +Бруней ДаруÑÑалам bn +Бруней ДоруÑÑалом bn +Bruney Darussalam bn +文莱达é²è¨å…° bn +æ–‡èŠé”魯薩蘭 bn +Bolivia bo +Bolivië bo +بوليÙيا bo +Boliviya bo +Ð‘Ð°Ð»Ñ–Ð²Ñ–Ñ bo +Ð‘Ð¾Ð»Ð¸Ð²Ð¸Ñ bo +বলিভিয়া bo +Bolivija bo +Bolívia bo +Bolívie bo +Bolifia bo +Bolivien bo +Βολιβία bo +Bolivio bo +Boliivia bo +بولیوی bo +Bolivie bo +An Bholaiv bo +Bolívia bo +בוליביה bo +बोलिविया bo +Bolivija bo +Bolívia bo +Bólivía bo +ボリビア bo +បូលីវី bo +볼리비아 bo +ໂບລີເວີຠbo +Bolivija bo +BolÄ«vija bo +Боливија bo +Боливи bo +Bolivja bo +Bolivien bo +ਬੋਲਵੀਆ bo +Boliwia bo +Bolívia bo +Bolívia bo +Ð‘Ð¾Ð»Ð¸Ð²Ð¸Ñ bo +Boliviya bo +Bolívia bo +Bolivija bo +Боливија bo +Bolivija bo +I-Bolivia bo +பொலிவியா bo +Ð‘Ð¾Ð»Ð¸Ð²Ð¸Ñ bo +โบลิเวีย bo +Bolivya bo +Ð‘Ð¾Ð»Ñ–Ð²Ñ–Ñ bo +Ð‘Ð¾Ð»Ð¸Ð²Ð¸Ñ bo +Boliveye bo +玻利维亚 bo +玻利維亞 bo +Brazil br +Brazilië br +البرازيل br +Braziliya br +Ð‘Ñ€Ð°Ð·Ñ‹Ð»Ñ–Ñ br +Ð‘Ñ€Ð°Ð·Ð¸Ð»Ð¸Ñ br +বà§à¦°à¦¾à¦œà¦¿à¦² br +Brasil br +Brazílie br +Brasil br +Brasilien br +Brasilien br +Î’Ïαζιλία br +Brazilo br +Brasil br +Brasiilia br +Brasil br +برزیل br +Brasilia br +Brésil br +Brazilië br +An Bhrasaíl br +Brasil br +ברזיל br +बà¥à¤°à¤¾à¤œà¥€à¤² br +Brazília br +Brasilía br +Brasile br +ブラジル br +ប្រáŸáž áŸ’ស៊ីល br +브ë¼ì§ˆ br +ບາຊີລ br +Brazilija br +BrazÄ«lija br +Бразил br +Бразил br +Brażil br +Brasil br +Brasilien br +Brazilië br +Brasil br +Brasil br +ਬਰਾਜ਼ੀਲ br +Brazylia br +Brasil br +Brasil br +Brazilia br +Ð‘Ñ€Ð°Ð·Ð¸Ð»Ð¸Ñ br +Burezile br +Brasil br +Brazília br +Brazilija br +Бразил br +I-Brazil br +Brasilien br +பிரேசில௠br +Бразил br +บราซิล br +Brezilya br +Ð‘Ñ€Ð°Ð·Ð¸Ð»Ñ–Ñ br +Ð‘Ñ€Ð°Ð·Ð¸Ð»Ð¸Ñ br +Burazili br +Braezi br +巴西 br +巴西 br +Bahamas bs +جزر الباهاما bs +Багамы bs +БахамÑки оÑтрови bs +বাহামাস bs +Bahami bs +Bahames bs +Bahamy bs +Ynysoedd Bahama bs +Μπαχάμες bs +Bahamoj bs +Bahama bs +باهاماس bs +Bahaman saaret bs +Na Bahámaí bs +Baamas bs +בהמס bs +बहामा bs +Bahamák bs +Bahamaeyjar bs +ãƒãƒãƒž bs +បាហាម៉ា bs +바하마 bs +ປານາມາ bs +Bahamų bs +Бахами bs +Ð‘Ð°Ñ…Ð°Ð¼Ð°Ñ bs +Baħamas bs +ਬਾਹਾਮਾਸ bs +Bahamy bs +БагамÑкие оÑтрова bs +Bahamasi bs +Bahamy bs +Bahami bs +Бахами bs +Bahami bs +பனாமா bs +Ð‘Ð¾Ò³Ð¾Ð¼Ð¾Ñ bs +บาฮามา bs +Bahamalar bs +Багами bs +Багама Ороллари bs +巴哈马 bs +巴拿馬 bs +Bhutan bt +بوتان bt +Бутан bt +Бутан bt +ভূটান bt +Butañ bt +Butan bt +Bhútán bt +Bhwtan bt +Μπουτάν bt +Butano bt +Bhután bt +بوتان bt +Bhoutan bt +An Bhútáin bt +Bután bt +בהוטן bt +भूटान bt +Bhután bt +Bútan bt +ブータン bt +ប៊ូážáž¶áž“ bt +부탄 bt +ຖັàºàºà»ˆàº‡àº§ bt +Bhutano bt +ButÄna bt +Бутан bt +Бутан bt +Butan bt +ਭà©à¨Ÿà¨¾à¨¨ bt +Butão bt +Butão bt +Butan bt +Бутан bt +Butani bt +Butan bt +Бутан bt +Butan bt +பூடான௠bt +Бутон bt +ภูà¸à¸²à¸™ bt +Butan bt +Бутан bt +Бутан bt +Boutan bt +ä¸ä¸¹ bt +ä¸ä¸¹ bt +Botswana bw +بوتسوانا bw +БатÑвана bw +БотÑуана bw +বটসওয়ানা bw +Bocvana bw +Μποτσουάνα bw +Bocvano bw +بوتسووانا bw +An Bhotsuáin bw +Botsuana bw +בוצ×ונה bw +बोतà¥à¤¸à¤µà¤¾à¤¨à¤¾ bw +Botsvana bw +Botsvana bw +ボツワナ bw +បុážážŸáŸ’វាណា bw +보츠와나 bw +ບອດສເນີຠbw +Botsvanos bw +BotsvÄna bw +Боцвана bw +БотÑвана bw +ਬੋਟਸਵਾਨਾ bw +Botsuana bw +БотÑвана bw +Botsvana bw +Боцвана bw +Bocvana bw +பாடà¯à®¸à¯à®µà®©à®¾ bw +БотÑвана bw +บอทสวานา bw +Botsvana bw +БотÑвана bw +Боцвана bw +Boswana bw +åšèŒ¨ç“¦çº³ bw +波札那 bw +Belarus by +روسيا البيضاء by +БеларуÑÑŒ by +Ð‘ÐµÐ»Ð°Ñ€ÑƒÑ by +বেলারà§à¦¸ by +Belarusi by +Bjelorusija by +Bielorússia by +BÄ›lorusko by +Belarws by +Hviderusland by +Weißrussland by +ΛευκοÏωσία by +Belorusio by +Valgevene by +بلاروس by +Valkovenäjä by +Hvítarusland by +Bélarus by +Wyt-Rusland by +An Bhealarúis by +Bielorúsia by +בלרוס by +बेलारूस by +Bjelorusija by +Fehéroroszország by +Hvíta-Rússland by +Bielorussia by +ベラルーシ by +áž”áŸáž¡áž¶ážšáž»ážŸáŸ’ស by +벨ë¼ë£¨ìФ by +ເບລາລັສ by +Baltarusija by +Baltkrievija by +БелоруÑија by +Цагаан Ð¾Ñ€Ð¾Ñ by +Hviterussland by +Wittrussland by +Wit-Rusland by +Kviterussland by +ਬੇਲਾਰੂਸ by +BiaÅ‚oruÅ› by +Bielorrússia by +БеларуÑÑŒ by +Belarusi by +Vilges-Ruošša by +Bielorusko by +Belorusija by +БелоруÑија by +Belorusija by +I-Belarus by +Vitryssland by +பெலாரூச௠by +БелоруÑиё by +เบลารุส by +БілоруÑÑ–Ñ by +Ð‘ÐµÐ»Ð¾Ñ€ÑƒÑ by +Belaruss by +白俄罗斯 by +白俄羅斯 by +Belize bz +بيليز bz +БÑлізе bz +Белийз bz +বেলিজ bz +Beliz bz +Bel?s bz +Μπελίζε bz +Belizo bz +بلیز bz +An Bheilís bz +בליז bz +बेलिज bz +Belís bz +ベリーズ bz +áž”áŸáž›áž¸áž áŸ’ស bz +벨리즈 bz +ເບລàºà»ˆàº‡àº¡ bz +Belizo bz +Beliza bz +Белизе bz +Ð‘ÐµÐ»Ð¸Ð·Ñ bz +Beliż bz +ਬੀਲੀਜ਼ਿ bz +Белиз bz +Белиз bz +Beliz bz +பெலà¯à®šà®¿à®¯à®®à¯ bz +Белиз bz +เบลไลซ์ bz +Beliz bz +Беліз bz +Белиз bz +伯利兹 bz +比利時 bz +Default C +Standaard C +Ø§ÙØªØ±Ø§Ø¶ÙŠ C +Ön QurÄŸulu C +Па ўмаўчаньні C +По подразбиране C +ডিফলà§à¦Ÿ C +Dre ziouer C +Omissió C +Výchozí C +Rhagosodedig C +Standard C +Standard C +ΠÏοκαθοÏισμένο C +Apriora C +Predeterminado C +Vaikimisi C +Lehenetsia C +Ù¾ÛŒØ´â€ŒÙØ±Ø¶ C +Oletus C +Forsettur C +Par défaut C +Standert C +Réamhshocrú C +Por Omisión C +ברירת מחדל C +डिफ़ॉलà¥à¤Ÿ C +UobiÄajeno C +Standard C +Alapértelmezett C +Standar C +Sjálfgefið C +Predefinito C +標準 C +លំនាំដើម C +기본 C +ຄ່າປະລິàºàº²àº C +Numatyta C +NoklusÄ“tais C +Почетно C +Стандарт C +Normali C +Standard C +Standard C +Standaard C +Standard C +Thuso ya Tshoganetso C +Omission C +ਮੂਲ C +DomyÅ›lnie C +Por Omissão C +Padrão C +Implicit C +По умолчанию C +Mburabuzi C +Standárda C +Å tandardný C +Privzeto C +Подразумевано C +Podrazumevano C +Förval C +à®®à¯à®©à¯à®©à®¿à®°à¯à®ªà¯à®ªà¯ C +Пешфарзӣ C +ค่าปริยาย C +Öntanımlı C +Ğädäti C +Типовий C +Ðндоза C +Mặc định C +Prémetou C +Okwendalo C +默认 C +é è¨­ C +Okwendalo C +Canada ca +Kanada ca +كندا ca +Kanada ca +Канада ca +Канада ca +কানাডা ca +Kanada ca +Kanada ca +Canadà ca +Kanada ca +Kanada ca +Καναδάς ca +Kanado ca +Canadá ca +Kanada ca +Kanada ca +کانادا ca +Kanada ca +Kanada ca +Kanada ca +Ceanada ca +Canadá ca +קנדה ca +कनाडा ca +Kanada ca +Kanada ca +Kanada ca +Kanada ca +カナダ ca +កាណាដា ca +ìºë‚˜ë‹¤ ca +à»àº„ນາດາ ca +Kanada ca +KanÄda ca +Канада ca +Канад ca +Kanada ca +Kanada ca +ਕੈਨੇਡਾ ca +Kanada ca +Canadá ca +Canadá ca +Канада ca +Kanada ca +Kanada ca +Kanada ca +Канада ca +Kanada ca +I-Canada ca +Kanada ca +கனடா ca +Канада ca +à¹à¸„นาดา ca +Kanada ca +Kanada ca +Канада ca +Канада ca +加拿大 ca +加拿大 ca +Cocos (Keeling) Islands cc +Kokos Eilande cc +جزر كوكوس (كيلينغ) cc +КокоÑови оÑтрови cc +কোকোস (কীলিং) দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ cc +Inizi Koko (Keeling) cc +Kokosovo (Keeling) ostrvo cc +Illes Cocos (Keeling) cc +Kokosové ostrovy (Keeling) cc +Ynysoedd y Cocos (Keeling) cc +Cocos/Keeling-Inseln cc +Îήσοι Κόκος (Κήλινγκ) cc +Kokosinsuloj cc +Islas Cocos (Keeling) cc +Kookossaared cc +Cocos Irlak cc +جزایر کوکوس کیلینگ cc +Cookinsaaret cc +ÃŽles Cocos cc +Oileán na gCócónna (Keeling) cc +Illas Cocos (Keeling) cc +××™×™ קוקוס cc +कोकोस (कीलिंग) आइलैंडà¥à¤¸ cc +Cocos (Keeling) Otoci cc +Kókusz-szigetek (Keeling) cc +Kókoseyjar cc +Isole Cocos (Keeling) cc +オーストラリア領ココス島 cc +កោះ Cocos (Keeling) cc +코코스 ì œë„ cc +Kokosu salas cc +ОÑтрови ÐšÐ¾ÐºÐ¾Ñ (Килинг) cc +Cocos (Keeling) арлууд cc +Gżejjer Cocos (Keeling) cc +Kokosøyene cc +Cocos- (Keeling-) Inseln cc +Kokosøyane cc +ਕੋਕੋਸ(ਕਿਨਿੰਗ) ਟਾਪੂ cc +Wyspy Kokosowe (Keelinga) cc +Ilhas Cocos (Keeling) cc +Ilhas Cocos cc +Insulele Cocos (Keeling) cc +КокоÑовые (Килинг) оÑтрова cc +Ibirwa Kokosi cc +Kokosullut cc +Kokosove Ostrovy cc +Kokosovi (Keelingovi) otoki cc +КокоÑова (Килингова) оÑтрва cc +Kokosova (Kilingova) ostrva cc +Kokosöarna cc +கோகோஸ௠(கீலிஙà¯) தீவà¯à®•ள௠cc +Ҷазираи ÐšÐ¾ÐºÐ¾Ñ (Килинг) cc +หมู่เà¸à¸²à¸°à¹‚คคอส (Keeling) cc +Keeling Adaları cc +Kokos (Keeling) Utrawları cc +КокоÑові оÑтрови cc +ÐšÐ¾ÐºÐ¾Ñ (Килинг) Ороллари cc +Iyes Cocos cc +科科斯群岛 cc +å¯å¯æ–¯ç¾¤å³¶ cc +Congo, The Democratic Republic of the cd +Kongo, Demokratiese republiek van die cd +ДÑÐ¼Ð°ÐºÑ€Ð°Ñ‚Ñ‹Ñ‡Ð½Ð°Ñ Ð ÑÑпубліка Конга cd +ДР Конго cd +কঙà§à¦—োর গণতানà§à¦¤à§à¦°à¦¿à¦• পà§à¦°à¦œà¦¾à¦¤à¦¨à§à¦¤à§à¦° cd +Kongo, Demokratska republika cd +Congo, República Democràtica del cd +Kongo cd +Congo, Gweriniaeth Democrataidd y cd +Congo, den demokratiske republik cd +Kongo, Republik cd +Κονγκό, ΔημοκÏατία του cd +Kongo, la Demokratia Respubliko de la cd +Congo, República democrática del cd +Kongo (DV) cd +Kongoko Errepublika Demokratikoa cd +Kongon demokraattinen tasavalta cd +République Démocratique du Congo cd +Kongo, de democratische republyk van de cd +Poblacht Dhaonlathach an Chongó cd +Congo, República Democrática do cd +קונגו, הרפובליקה הדמוקרטית של cd +डेमोकà¥à¤°à¥‡à¤Ÿà¤¿à¤• रिपबà¥à¤²à¤¿à¤• ऑफ कॉगो cd +Kongói Demokratikus Köztársaság cd +Kongó, Austur cd +Congo, Repubblica Democratica del cd +コンゴ,民主共和国 cd +សាធារណរដ្ឋ​ប្រជាធិបážáŸáž™áŸ’យ​កុងហ្គោ cd +Kongo demokratinÄ— respublika cd +Kongo demokrÄtiskÄ republika cd +Конго, ДемократÑка Република на cd +Kongo (RD) cd +Kongo cd +Kongo (De demokraatsche Republiek) cd +Congo, Democratische republiek cd +Kongo cd +ਕਾਂਗੋ, ਲੋਕਤੰਤਰੀ ਗਣਰਾਜ cd +Republika Demokratyczna Kongo cd +Congo, República Democrática do cd +República Democrática do Congo cd +Congo, Republica Democrată cd +ДемократичеÑÐºÐ°Ñ Ð ÐµÑпублика Конго cd +Kongo, Repubulika Iharanira Demokarasi ya cd +Kongo cd +Demokratická Republika Kongo cd +Kongo, demokratiÄna republika cd +Конго, ДемократÑка Република cd +Kongo, Demokratska Republika cd +Demokratiska republiken Kongo cd +கானà¯à®•ோ, கà¯à®Ÿà®¿à®¯à®°à®šà¯ cd +Ҷумҳурии демократии Ҳонконг cd +สาธารณรัà¸à¸›à¸£à¸°à¸Šà¸²à¸˜à¸´à¸›à¹„ตยคองโภcd +Demokratik Kongo Cumhuriyeti cd +Kongo, Demokrat Cömhüriäte cd +Конго, демократична реÑпубліка cd +Конго Демократик РеÑпубликаÑи cd +Congo, republike democratike cd +刚果民主共和国 cd +剛果民主共和國 cd +Central African Republic cf +Sentrale Afrika Republiek cf +جمهورية Ø£ÙØ±ÙŠÙ‚يا الوسطى cf +ЦÑнтральнаафрыканÑÐºÐ°Ñ Ð ÑÑпубліка cf +ЦÐР cf +মধà§à¦¯ আফà§à¦°à¦¿à¦•ান রিপাবলিক cf +Republik centrafricaine cf +CentralnoafriÄka Republika cf +República Centro Africana cf +StÅ™edoafrická republika cf +Gweriniaeth Canolig Affrica cf +Central-afrikanske Republik cf +Zentralafrikanische Republik cf +ΔημοκÏατία ΚεντÏικής ΑφÏικής cf +Mezafrika Respubliko cf +República Centroafricana cf +Kesk-Aafrika Vabariik cf +Afrika Erdiko Errepublika cf +جمهوری Ø§ÙØ±ÛŒÙ‚ای مرکزی cf +Keski-Afrikan tasavalta cf +République centrafricaine cf +Sintraal Afrikaanse Republyk cf +Poblacht na hAfraice Láir cf +República Centro Africana cf +הרפובליקה ×”×פריקנית התיכונה cf +सेंटà¥à¤°à¤² अफà¥à¤°à¥€à¤•न रिपबà¥à¤²à¤¿à¤• cf +Centralna AfriÄka Republika cf +Közép-Afrikai Köztársaság cf +Mið-Afríkulýðveldið cf +Repubblica Centrafricana cf +中央アフリカ共和国 cf +សាធារណរដ្ឋ​អាហ្វ្រិក​កណ្ដាល cf +중앙 아프리카 공화국 cf +ໂດມິນິàºàº±àº™ cf +CentrinÄ—s Afrikos Respublika cf +CentrÄlÄfrikas republika cf +ЦентралноафриканÑка Република cf +Төв африкын ард ÑƒÐ»Ñ cf +Repubblika ÄŠentrali Afrikana cf +Den sentralafrikanske republikk cf +Zentraalafrikaansche Republiek cf +Centraal Afrikaanse Republiek cf +Den sentralafrikanske republikken cf +ਕੇਂਦਰੀ ਅਫਰੀਕੀ ਗਣਰਾਜ cf +Republika Åšrodkowej Afryki cf +República Central Africana cf +República da Ãfrica Central cf +Republica Centrafricană cf +Центрально-ÐфриканÑÐºÐ°Ñ Ð ÐµÑпублика cf +Repubulika ya Santara Afurika cf +GuovddášafrihkálaÅ¡ republihkka cf +Stredoafrická Republika cf +CentralnoafriÅ¡ka republika cf +Централноафричка Република cf +CentralnoafriÄka Republika cf +Centralafrikanska Republiken cf +மைய ஆபà¯à®ªà®¿à®°à®¿à®•à¯à®• கà¯à®Ÿà®¿à®¯à®°à®šà¯ cf +Ҷумҳурии Ðфриқои Марказӣ cf +สาธารณรัà¸à¸­à¸±à¸Ÿà¸£à¸´à¸à¸²à¸à¸¥à¸²à¸‡ cf +Orta Afrika Cumhuriyeti cf +Üzäk Afrika Cömhüriäte cf +Центральна африканÑька реÑпубліка cf +Марказий Ðфрика РеÑпубликаÑи cf +Cá»™ng hoà Trung Phi cf +Cintrafrike cf +中éžå…±å’Œå›½ cf +多明尼加共和國 cf +Congo cg +Konsole cg +الكونغو cg +Конга cg +Конго cg +কঙà§à¦—à§‹ cg +Kongo cg +Kongo cg +Kongo cg +Kongo cg +Κονγκό cg +Kongo (Brazavila) cg +Kongo cg +Kongo cg +Ú©Ù†Ú¯Ùˆ cg +Kongo cg +Kongo cg +Congó cg +קונגו cg +कोंगो cg +Kongo cg +Kongó cg +Kongó, Vestur cg +コンゴ cg +កុងហ្គោ cg +콩고 cg +ຄອນໂà»àºŠàº¥ cg +Kongo cg +Kongo cg +Конго cg +Конго cg +Kongo cg +Kongo-Brazaville cg +Kongo cg +Kongo-Brazaville cg +ਕਾਂਗੋ cg +Kongo cg +Конго cg +Kongo cg +Kongo cg +Kongo cg +Kongo cg +Конго cg +Kongo cg +Kongo cg +கானà¯à®•ோ cg +Конго cg +คองโภcg +Kongo cg +Kongo cg +Конго cg +Конго cg +刚果 cg +剛果 cg +Switzerland ch +Switserland ch +سويسرا ch +İsveçrÉ™ ch +ШвÑÐ¹Ñ†Ð°Ñ€Ñ‹Ñ ch +Ð¨Ð²ÐµÐ¹Ñ†Ð°Ñ€Ð¸Ñ ch +সà§à¦‡à¦œà¦¾à¦°à¦²à§à¦¯à¦¾à¦£à§à¦¡ ch +Suis ch +Å vicarska ch +Suïssa ch +Å výcarsko ch +Y Swistir ch +Schweiz ch +Schweiz ch +Ελβετία ch +Svislando ch +Suiza ch +Å veits ch +Suitza ch +سوییس ch +Sveitsi ch +Suisse ch +Switserlân ch +An Eilvéis ch +Suíza ch +שוייץ ch +सà¥à¤µà¤¿à¤Ÿà¥à¤œà¤°à¤²à¥ˆà¤‚ड ch +Å vicarska ch +Svájc ch +Swiss ch +Sviss ch +Svizzera ch +スイス ch +ស្វ៊ីស ch +스위스 ch +ສະວິສເຊີà»àº¥àº™ ch +Å veicarija ch +Å veice ch +Швајцарија ch +Швецарь ch +Svizzera ch +Sveits ch +Swiez ch +Zwitserland ch +Sveits ch +Suissa ch +ਸਵਿਟਜ਼ਰਲੈਂਡ ch +Szwajcaria ch +Suíça ch +Suíça ch +ElveÅ£ia ch +Ð¨Ð²ÐµÐ¹Ñ†Ð°Ñ€Ð¸Ñ ch +Swazilande ch +Å veica ch +Å vajÄiarsko ch +Å vica ch +ШвајцарÑка ch +Å vajcarska ch +I-Switzerland ch +Schweiz ch +சà¯à®µà®¿à®Ÿà¯à®šà®°à¯à®²à®¾à®¨à¯à®¤à¯ ch +Свитзерланд ch +สวิสเซอร์à¹à¸¥à¸™à¸”์ ch +İsviçre ch +İswiçrä ch +Ð¨Ð²ÐµÐ¹Ñ†Ð°Ñ€Ñ–Ñ ch +Ð¨Ð²ÐµÐ¹Ñ†Ð°Ñ€Ð¸Ñ ch +Thuỵ SÄ© ch +Swisse ch +瑞士 ch +瑞士 ch +Cote d'ivoire ci +ساحل العاج ci +Бераг Слановай КоÑьці ci +Кот Дивоар ci +Aod an Olifant ci +Obala SlonovaÄe ci +Costa d'ivori ci +PobÅ™eží slonoviny ci +Y Traeth Ifori ci +Elfenbenskysten ci +Ακτή Î•Î»ÎµÏ†Î±Î½Ï„Î¿ÏƒÏ„Î¿Ï ci +Eburio ci +Costa de Marfil ci +Cote d'Ivoire ci +Boli kosta ci +Ú©ÙØªÙ دیوÙیر ci +Côte d'Ivoire ci +Ivoorkust ci +An Cósta Eabhair ci +कोट डि'वॉरे ci +Baci kocke ci +Elefántcsontpart ci +Fílabeinsströndin ci +Costa d'Avorio ci +コートジボアール ci +កូដឌីវáŸážš ci +코트디부아르 ci +ປ່ອàºàº«àº¡àº²àºàºàº°àº¥àº­àº ci +KotdivuÄra ci +Брегот на Слоновата КоÑка ci +Kosta tal-Avorju ci +Elfenbenskysten ci +Elfenbeenküst ci +Ivoorkust ci +Elfenbeinskysten ci +ਕਾਂਟੋ ਡੀਵੋਇਰੀ ci +Wybrzeże KoÅ›ci SÅ‚oniowej ci +Costa do Marfim ci +Coasta de Azur ci +Кот Д'Ивуар ci +Kote divuware ci +ElfenÄalánriddu ci +SlonokoÅ¡Äena obala ci +Обала Ñлоноваче ci +Obala slonovaÄe ci +Elfenbenskusten ci +Соҳили Оҷ ci +อ่าวไอวอรี ci +Кот Д'Івуар ci +Кот д'Ивуар ci +Bá» biển ngà ci +Coisse d' Ivwere ci +科特迪瓦 ci +象牙海岸 ci +Cook islands ck +Cook Eilande ck +جزر كوك ck +ÐÑтравы Кука ck +ОÑтрови Кук ck +কà§à¦• দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ ck +Inizi Kook ck +Kukova ostrva ck +Illes Cook ck +Cookovy ostrovy ck +Ynysoedd Cook ck +Cook-øerne ck +Cook-Inseln ck +Îησιά Κουκ ck +Kukinsuloj ck +Islas Cook ck +Cooki saared ck +Cook Irlak ck +جزایر Ú©ÙˆÚ© ck +Cooksaaret ck +ÃŽles Cook ck +Oileáin Chook ck +Illas Cook ck +××™×™ קוק ck +कà¥à¤• आइलैंड ck +Cook otoci ck +Cook-szigetek ck +Cooks-eyjar ck +Isole Cook ck +ニュージーランド自治領クック諸島 ck +កោះ Cook ck +ì¿¡ ì œë„ ck +ຄຸàºàºàºµà»‰ ck +Kuko salų ck +Kuka salas ck +Кукови оÑтрови ck +Cook арлууд ck +Gżejjer Cook ck +Cookøyene ck +Cookinseln ck +Cook Eilanden ck +Cookøyane ck +ਕà©à©±à¨• ਟਾਪੂ ck +Wyspy Cooka ck +Ilhas Cook ck +Ilhas Cook ck +Insulele Cook ck +ОÑтрова Кука ck +Ibirwa bya Kuke ck +Cooksullut ck +Cookove ostrovy ck +Cookovi otoki ck +Кукова оÑтрва ck +Kukova ostrva ck +Cooköarna ck +கà¯à®•௠தீவ௠ck +Ҷазираи Кук ck +หมู่เà¸à¸²à¸°à¸„ุภck +Cook Adaları ck +Kok Utrawları ck +ОÑтрови Кука ck +Кук Ороллари ck +Iyes Cook ck +库克群岛 ck +庫克群島 ck +Chile cl +Chilië cl +تشيلي cl +Åžili cl +Чылі cl +Чили cl +চিলি cl +ÄŒile cl +Xile cl +Tsile cl +Χιλή cl +Ĉilio cl +TÅ¡iili cl +Txile cl +شیلی cl +Chili cl +Chili cl +An tSile cl +צ'ילה cl +चिली cl +ÄŒile cl +Chili cl +Cile cl +ãƒãƒª cl +ឈីលី cl +ì¹ ë ˆ cl +ຊີລີ cl +ÄŒilÄ— cl +Čīle cl +Чиле cl +Чили cl +ÄŠile cl +Chili cl +ਚਿੱਲੀ cl +Cile cl +Чили cl +Shili cl +ÄŒile cl +ÄŒile cl +Чиле cl +ÄŒile cl +I-Chile cl +சிலி cl +Чилли cl +ชิลี cl +Åžili cl +Çili cl +Чилі cl +Чили cl +Chi lê cl +Tchili cl +智利 cl +智利 cl +Cameroon cm +Kameroon cm +الكاميرون cm +КамÑрун cm +Камерун cm +কà§à¦¯à¦¾à¦®à§‡à¦°à§à¦¨ cm +Kameroun cm +Kamerun cm +Camerun cm +Kamerun cm +Y Camer?n cm +Cameroun cm +Kamerun cm +ΚαμεÏοÏν cm +Kameruno cm +Camerún cm +Kamerun cm +Kamerun cm +کامرون cm +Kamerun cm +Cameroun cm +Kameroen cm +Camarún cm +Camerún cm +קמרון cm +कैमरून cm +Kamerun cm +Kamerun cm +Kamerún cm +Camerun cm +カメルーン cm +កាមáŸážšáž¼áž“ cm +카메룬 cm +ຕາລາງງານ - K cm +KamerÅ«no cm +KamerÅ«na cm +Камерун cm +Камерун cm +Kamerun cm +Kamerun cm +Kamerun cm +Cameroen cm +Kamerun cm +ਕੈਮਰੂਨ cm +Kamerun cm +Camarões cm +Camarões cm +Camerun cm +Камерун cm +Kameruni cm +Kamerun cm +Komerun cm +Kamerun cm +Камерун cm +Kamerun cm +Kamerun cm +கமீரூன௠cm +Камерун cm +คาเมรูน cm +Kamerun cm +Kameroon cm +Камерун cm +Камерун cm +Camrone cm +喀麦隆 cm +喀麥隆 cm +China cn +الصين cn +Çin cn +Кітай cn +Китай cn +চীন cn +Sina cn +Kina cn +Xina cn +Čína cn +Tseina cn +Kina cn +Κίνα cn +Ĉinujo cn +Hiina cn +Txina cn +چین cn +Kiina cn +Kina cn +Chine cn +An tSín cn +סין cn +चीन cn +Kina cn +Kína cn +Cina cn +Kína cn +Cina cn +中国 cn +áž…áž·áž“ cn +중국 cn +ຈີນ cn +Kinija cn +Ķīna cn +Кина cn +Ð¥Ñтад cn +ÄŠina cn +Kina cn +Kina cn +Xina cn +ਚੀਨ cn +Chiny cn +Китай cn +Ubushinwa cn +Kiinná cn +Čína cn +Kitajska cn +Кина cn +Kina cn +I-China cn +Kina cn +சீனா cn +Хитой cn +จีน cn +Çin cn +Çin cn +Китай cn +Хитой cn +Trung Quốc cn +Chine cn +中国 cn +中國 cn +Colombia co +Colombië co +كولمبيا co +ÐšÐ°Ð»ÑŽÐ¼Ð±Ñ–Ñ co +ÐšÐ¾Ð»ÑƒÐ¼Ð±Ð¸Ñ co +কলোমà§à¦¬à¦¿à§Ÿà¦¾ co +Kolumbi co +Kolumbija co +Colòmbia co +Kolumbie co +Kolumbien co +Κολομβία co +Kolumbio co +Kolumbia co +Kolonbia co +کلمبیا co +Kolumbia co +Colombie co +Columbia co +An Cholóim co +Colómbia co +קולומביה co +कोलमà¥à¤¬à¤¿à¤¯à¤¾ co +Kolumbija co +Kolumbia co +Kólumbía co +コロンビア co +កូឡុំប៊ី co +콜롬비아 co +ໂຄລຳເບີຠco +Kolumbija co +Kolumbija co +Колумбија co +Колумб co +Kolumbja co +Kolumbien co +Columbia co +ਕੋਲੰਬੀਆ co +Kolumbia co +Colômbia co +Colômbia co +Columbia co +ÐšÐ¾Ð»ÑƒÐ¼Ð±Ð¸Ñ co +Kolombiya co +Kolombia co +Kolumbia co +Kolumbija co +Колумбија co +Kolumbija co +I-Colombia co +கொலமà¯à®ªà®¿à®¯à®¾ co +ÐšÐ¾Ð»ÑƒÐ¼Ð±Ð¸Ñ co +โคลัมเบีย co +Kolombiya co +Kolombia co +ÐšÐ¾Ð»ÑƒÐ¼Ð±Ñ–Ñ co +ÐšÐ¾Ð»ÑƒÐ¼Ð±Ð¸Ñ co +Colombeye co +Columbia co +哥伦比亚 co +哥倫比亞 co +Costa Rica cr +كوستاريكا cr +КоÑта Рыка cr +КоÑта Рика cr +কোসà§à¦Ÿà¦¾ রিকা cr +Kosta Rika cr +Kostarika cr +Kostarika cr +Κόστα Ρίκα cr +Kostariko cr +کاستاریکا cr +Kosta Rika cr +Cósta Ríce cr +קוסטה ריקה cr +कोसà¥à¤Ÿà¤¾ रिका cr +Kosta rika cr +Kostaríka cr +コスタリカ cr +កូស្ážáž¶ážšáž¸áž€áž¶ cr +코스타 리카 cr +ໂຄເອເທີຠcr +Kosta Rika cr +Kostarika cr +КоÑта Рика cr +КоÑта Рика cr +ਕੋਸਟਾ ਰੀਕਾ cr +Kostaryka cr +КоÑта-Рика cr +Kosita Rika cr +Kostarika cr +Kostarika cr +КоÑтарика cr +Kostarika cr +I-Costa Rica cr +கோஸà¯à®Ÿà®¾ ரிகா cr +КоÑта Рика cr +คอสตาริà¸à¸² cr +Kosta Rika cr +Kosta Rika cr +КоÑта-Ріка cr +КоÑта Рика cr +哥斯达黎加 cr +哥斯大黎加 cr +Cuba cu +Kuba cu +كوبا cu +Куба cu +Куба cu +কিউবা cu +Kuba cu +Kuba cu +Kuba cu +Ciwba cu +Kuba cu +ΚοÏβα cu +Kubo cu +Kuuba cu +Kuba cu +کوبا cu +Kuuba cu +Kuba cu +Cúba cu +קובה cu +कà¥à¤¯à¥‚बा cu +Kuba cu +Kuba cu +Kúba cu +キュームcu +គុយបា cu +ì¿ ë°” cu +ເàºàº¡à»„ພ່ cu +Kuba cu +Kuba cu +Куба cu +Куба cu +Kuba cu +Kuba cu +ਕਿਊਬਾ cu +Kuba cu +Куба cu +Kuba cu +Kuba cu +Kuba cu +Куба cu +Kuba cu +I-Cuba cu +Kuba cu +கியà¯à®ªà®¾ cu +Куба cu +คิวบา cu +Küba cu +Kuba cu +Куба cu +Куба cu +å¤å·´ cu +å¤å·´ cu +Cape Verde cv +Kaap Verde cv +كاب Ùيردي cv +Кабо Верде cv +কেপ ভারডি cv +Penn Verde cv +Zelenortska ostrva cv +Cap Verd cv +Kapverdy cv +Cape Ferde cv +Kapverdiske øer cv +Cap Verdische Inseln cv +ΠÏάσινο ΑκÏωτήÏιο cv +Kapo-Verdo cv +Cabo Verde cv +Roheneeme saared cv +Cabo Verde cv +کیپ‌ورده cv +Kap Verde cv +Cap vert cv +Kaap Verdië cv +Rinn Verde cv +Cabo Verde cv +×›×£ וורדה cv +कैप वरà¥à¤¡à¥‡ cv +Zöldfoki-szigetek cv +Grænhöfðaeyjar cv +Capo Verde cv +カーãƒãƒ™ãƒ«ãƒ‡ cv +កាបវែរ cv +ì¹´ë³´ë² ë¥´ë° cv +ເàºàº¡à»„ພ່ cv +Kabaverde cv +Кејп Верде cv +Капе Ð’ÑÑ€Ð´Ñ cv +Kapp Verde cv +Kap Verde cv +Kaap Verdië cv +Kapp Verde cv +ਕੇਪ ਵੀਰਡੀ cv +Cabo Verde cv +Cabo Verde cv +Capul Verde cv +Кабо-Верде cv +Kapu Veri cv +Кејп Верд cv +Kejp Verd cv +Kap Verde cv +கேப௠வெரà¯à®Ÿà¯ cv +Димоғи Верде cv +à¹à¸«à¸¥à¸¡à¹€à¸§à¸­à¸£à¹Œà¸”ี cv +Kape Verde cv +Кабо-Верде cv +Кейп Верде cv +Cap Vert cv +佛得角 cv +ç¶­å¾·è§’ cv +Christmas Island cx +Kersfees Eiland cx +جزر الكريسماس cx +ОÑтров РождеÑтво cx +কà§à¦°à¦¿à¦¸à§à¦Ÿà¦®à¦¾à¦¸ দà§à¦¬à§€à¦ª cx +Inizi Nedeleg cx +BožiÄno ostrvo cx +Illa de Pascua cx +VánoÄní ostrovy cx +Ynys y Nadolig cx +Juleøen cx +Weihnachtsinsel cx +Îήσος των ΧÏιστουγέννων cx +Kristnaskinsulo cx +Islas Christmas cx +Jõulusaar cx +Eguberri Irla cx +جزایر کریسمس cx +Joulusaari cx +ÃŽle de Noël cx +Christmas Eilân cx +Oileán na Nollag cx +Illas Christmas cx +××™×™ כריסטמס cx +कà¥à¤°à¤¿à¤¸à¤®à¤¸ आइलैंड cx +UskrÅ¡nji otoci cx +Karácsony-szigetek cx +Jólaey cx +Isola Christmas cx +クリスマス諸島 cx +កោះ Christmas cx +í¬ë¦¬ìŠ¤ë§ˆìŠ¤ 섬 cx +ຄິດສະຕອລ cx +KalÄ—dų salos cx +ZiemassvÄ“tku salas cx +ВелигденÑки ОÑтрови cx +КриÑÑ‚Ð¼Ð°Ñ Ð°Ñ€Ð»ÑƒÑƒÐ´ cx +Christmasøya cx +Wiehnachtsinsel cx +Christmasøya cx +ਕà©à¨°à¨¿à¨¸à¨®à¨¿à¨¸ ਟਾਪੂ cx +Wyspy Bożego Narodzenia cx +Ilhas Natal cx +Ilhas do Natal cx +Insulele Christmas cx +ОÑтров РождеÑтва cx +Ikirwa cya Noheli cx +Christmassuollu cx +VianoÄné Ostrovy cx +BožiÄni otok cx +Божићно оÑтрво cx +Božićno ostrvo cx +Julön cx +கிரà¯à®¸à¯à®¤à¯à®®à®¸à¯ தீவ௠cx +Ҷазираи КриÑÑ‚Ð¼Ð°Ñ cx +เà¸à¸²à¸°à¸„ริสต์มาส cx +Yılbaşı Adaları cx +Christmas Utrawları cx +ОÑтрів Різдва cx +КриÑÐ¼Ð°Ñ ÐžÑ€Ð¾Ð»Ð¸ cx +Äảo giáng sinh cx +圣诞岛 cx +è–誕島 cx +Cyprus cy +Siprus cy +قبرص cy +Кіпр cy +Кипър cy +সাইপà§à¦°à¦¾à¦¸ cy +Chipr cy +Kipar cy +Xipre cy +Kypr cy +Cypern cy +Zypern cy +ΚÏÏ€Ïος cy +Cipro cy +Chipre cy +Küpros cy +Txipre cy +قبرس cy +Kypros cy +Chypre cy +An Chipir cy +Chipre cy +קפריסין cy +साइपà¥à¤°à¤¸ cy +Cipar cy +Ciprus cy +Kýpur cy +Cipro cy +キプロス cy +ស៊ីពរ០cy +키프로스 cy +ບີບອັດ cy +Kipro cy +Kipra cy +Кипар cy +Ð¡Ð¸Ð¿Ñ€ÑƒÑ cy +ÄŠipru cy +Kypros cy +Zypern cy +Kypros cy +ਕਿਉਪਰਸ cy +Cypr cy +Chipre cy +Chipre cy +Cipru cy +Кипр cy +Shipure cy +Kypros cy +Ciper cy +Кипар cy +Kipar cy +Cypern cy +சிபà¯à®°à®¸à¯ cy +Кипр cy +ไซปรัส cy +Kıbrıs cy +Kiper cy +Кіпр cy +Кипр cy +Síp cy +Chîpe cy +塞浦路斯 cy +賽普勒斯 cy +Czechia cz +Czechië cz +التشيك cz +Çex Respublikası cz +ЧÑÑ…Ñ–Ñ cz +Чешка република cz +চেকিয়া cz +Tchekia cz +ÄŒeÅ¡ka cz +Txèquia cz +ÄŒesko cz +Y Weriniaeth Siec cz +Tjekkiet cz +Tschechien cz +Τσεχία cz +ĈeÄ¥io cz +República Checa cz +TÅ¡ehhi cz +Txekia cz +Ú†Ú© cz +Tsekki cz +République tchèque cz +Tsjechië cz +Poblacht na Seice cz +Chéquia cz +צ'×›×™×” cz +चेक cz +ÄŒeÅ¡ka cz +Csehország cz +Tékkland cz +Repubblica Ceca cz +ãƒã‚§ã‚³ cz +ឆáŸáž€ cz +ì²´ì½” cz +ÄŒekija cz +ÄŒehija cz +Чешка cz +Чехиа cz +Cżekia cz +Tsjekkia cz +Tschechien cz +Tsjechië cz +Tsjekkia cz +Chèquia cz +ਚੈੱਚੀਆ cz +Czechy cz +República Checa cz +República Tcheca cz +Cehia cz +Ð§ÐµÑ…Ð¸Ñ cz +Ceke cz +ÄŒeahkka cz +ÄŒesko cz +ÄŒeÅ¡ka cz +Чешка cz +ÄŒeÅ¡ka cz +I-Czechia cz +Tjeckien cz +செகà¯à®¯à®¾ cz +Ð§ÐµÑ…Ð¸Ñ cz +เชค cz +Çek Cumhuriyeti cz +Çexiä cz +Ð§ÐµÑ…Ñ–Ñ cz +Ð§ÐµÑ…Ð¸Ñ cz +Séc cz +Tchekeye cz +æ·å…‹ cz +æ·å…‹ cz +Germany de +Duitsland de +ألمانيا de +Almaniya de +ÐÑмеччына de +Ð“ÐµÑ€Ð¼Ð°Ð½Ð¸Ñ de +জারà§à¦®à¦¾à¦¨à¦¿ de +Alamagn de +NjemaÄka de +Alemanya de +NÄ›mecko de +Yr Almaen de +Tyskland de +Deutschland de +ΓεÏμανία de +Germanio de +Alemania de +Saksamaa de +Alemania de +آلمان de +Saksa de +Týskland de +Allemagne de +Dûtslân de +An Ghearmáin de +Alemaña de +גרמניה de +जरà¥à¤®à¤¨à¥€ de +NjemaÄka de +Németország de +Jerman de +Þýskaland de +Germania de +ドイツ de +អាល្លឺម៉ង់ de +ë…ì¼ de +ເàºàº¥àº¥àº°àº¡àº±àº™àº™àºµ de +Vokietija de +VÄcija de +Германија de +Герман de +Jerman de +Ä ermanja de +Tyskland de +Düütschland de +Duitsland de +Tyskland de +Alemanya de +ਜਰਮਨੀ de +Niemcy de +Alemanha de +Alemanha de +Germania de +Ð“ÐµÑ€Ð¼Ð°Ð½Ð¸Ñ de +Ubudage de +Duiska de +Nemecko de +NemÄija de +Ðемачка de +NemaÄka de +I-Germany de +Tyskland de +ஜெரà¯à®®à®©à®¿ de +Олмон de +เยอรมันนี de +Almanya de +Almania de +Ðімеччина de +ÐžÐ»Ð¼Ð¾Ð½Ð¸Ñ de +Äức de +Almagne de +德国 de +德國 de +IJalimani de +Djibouti dj +جيبوتي dj +Джыбуці dj +Джибути dj +জিবৌতি dj +Äibuti dj +Džibuti dj +Jib?ti dj +Dschibuti dj +Τζιμπουτί dj +Äœibutio dj +جیبوتی dj +Xibuti dj +×’'יבוטי dj +डिबौती dj +Džibuti dj +Dzsibuti dj +Djíbútí dj +Gibuti dj +ジブムdj +ហ្ស៊ីបូទី dj +지부티 dj +ພັດພາ dj +Džibutis dj +Džibutija dj +Ðибути dj +Жибут dj +DÄ¡ibuti dj +Dschibouti dj +ਡਜੀਬà©à¨‰à¨Ÿà©€ dj +Dżibuti dj +Djibuti dj +Djibuti dj +Джибути dj +Jibuti dj +Djibuhti dj +Džibuty dj +Džibuti dj +Ðибути dj +Džibuti dj +I-Djibouti dj +டிஜிபொடி dj +Ҷибойти dj +จิบูติ dj +Cibuti dj +Djibuti dj +Джібуті dj +Жибути dj +å‰å¸ƒæ dj +å‰å¸ƒåœ° dj +Denmark dk +Denemarke dk +الدنمارك dk +Danimarka dk +Ð”Ð°Ð½Ñ–Ñ dk +Ð”Ð°Ð½Ð¸Ñ dk +ডেনমারà§à¦• dk +Danmark dk +Danska dk +Dinamarca dk +Dánsko dk +Denmarc dk +Danmark dk +Dänemark dk +Δανία dk +Danlando dk +Dinamarca dk +Taani dk +Danimarka dk +دانمارک dk +Tanska dk +Danmark dk +Danemark dk +Denemarken dk +An Danmhairg dk +Dinamarca dk +דנמרק dk +डेनमारà¥à¤• dk +Danska dk +Dánia dk +Danmörk dk +Danimarca dk +デンマーク dk +ដាណឺម៉ាក dk +ë´ë§ˆí¬ dk +ເດນມາຠdk +Danija dk +DÄnija dk +ДанÑка dk +Дани dk +Danimarka dk +Danmark dk +Dänmark dk +Denemarken dk +Danmark dk +Dinamarca dk +ਡੈੱਨਮਾਰਕ dk +Dania dk +Dinamarca dk +Dinamarca dk +Danemarca dk +Ð”Ð°Ð½Ð¸Ñ dk +Danimarike dk +Dánmárku dk +Dánsko dk +Danska dk +ДанÑка dk +Danska dk +I-Denmark dk +Danmark dk +டெனà¯à®®à®¾à®°à¯à®•௠dk +Денмарк dk +เดนมาร์ภdk +Danimarka dk +Dania dk +Ð”Ð°Ð½Ñ–Ñ dk +Ð”Ð°Ð½Ð¸Ñ dk +Äan Mạch dk +DaenmÃ¥tche dk +丹麦 dk +丹麥 dk +Dominica dm +Dominisië dm +دومينيكا dm +Дамініка dm +Доминика dm +ডমিনিকা dm +Dominik dm +Dominika dm +Dominika dm +Dominikanische Republik dm +Îτομίνικα dm +Dominiko dm +دومینیکا dm +Dominique dm +Doiminice dm +דומינקה dm +डोमिनिका dm +Dominika dm +Dóminíka dm +ドミニカ dm +ដូមីនីកា dm +ë„미니카 dm +ໂລມາເນີຠdm +Dominika dm +Dominika dm +Доминика dm +Доминика dm +Dominika dm +ਡੋਮਾਨੀਕਾ dm +Dominika dm +Dominicana dm +Доминика dm +Dominikani dm +Dominikánsko dm +Dominikanska republika dm +Доминика dm +Dominika dm +டொமினிகா dm +Доминика dm +โดมินาà¸à¸±à¸™ dm +Dominik dm +Dominika dm +Домініка dm +Доминика dm +Dominike dm +多米尼加 dm +多明尼加 dm +Dominican Republic do +Dominikaanse Republiek do +جمهورية الدومينيكان do +Dominik Respublikası do +ДамініканÑÐºÐ°Ñ Ð ÑÑпубліка do +ДоминиканÑка република do +ডমিনিকান রিপাবলিক do +Republik Dominikan do +Dominikanska Republika do +República Dominicana do +Dominikánská republika do +Gweriniaeth Dominica do +Dominikanske Republik do +Dominikanische Republik do +Δομινικανή ΔημοκÏατία do +Dominika Respubliko do +República Dominicana do +Dominikaani Vabariik do +Dominikar Errepublika do +جمهوری دامینیکن do +Dominikaaninen tasavalta do +République dominicaine do +Dominicaanse Republyk do +An Phoblacht Dhoiminiceach do +República Dominicana do +הרפובליקה הדומיניקנית do +डोमिनिकन रिपबà¥à¤²à¤¿à¤• do +Dominikanska Republika do +Dominikai Köztársaság do +Republik Dominika do +Dóminíska lýðveldið do +Repubblica Dominicana do +ドミニカ共和国 do +សាធារណរដ្ឋ​ដូមីនីកែន do +ë„미니카 공화국 do +ໂດມິນີàºàº±àº™ do +Dominikos Respublika do +Dominikas Republika do +ДоминиканÑка Република do +Домникан ард ÑƒÐ»Ñ do +Repubblika Dominikana do +Den dominikanske republikk do +Dominikaansche Republiek do +Dominicaanse Republiek do +Den dominikanske republikken do +Republica Dominicana do +ਡੋਮਾਨੀਕਾ ਗਣਰਾਜ do +Dominikana do +República Dominicana do +República Dominicana do +Republica Dominicană do +ДоминиканÑÐºÐ°Ñ Ñ€ÐµÑпублика do +Repubulika Dominikani do +DominihkalaÅ¡ republihkka do +Dominikánska republika do +Dominikanska republika do +ДоминиканÑка Република do +Dominikanska Republika do +I-Dominican Republic do +Dominikanska republiken do +டொமினிகà¯à®•ன௠கà¯à®Ÿà®¿à®¯à®°à®šà¯ do +Ҷумҳурии Доминика do +สาธารณรัà¸à¹‚ดมินิà¸à¸±à¸™ do +Dominik Cumhuriyeti do +Dominika Cömhüriäte do +ДомініканÑька реÑпубліка do +Доминикана РеÑпубликаÑи do +Muvhuso wa Dominican do +Cá»™ng hoà Dominican do +Republike Dominikinne do +IRepublic yeDominican do +多米尼加共和国 do +多明尼加共和國 do +Algeria dz +Algerië dz +الجزائر dz +Ðльжыр dz +Ðлжир dz +অà§à¦¯à¦¾à¦²à¦œà§‡à¦°à¦¿à§Ÿà¦¾ dz +Aljeri dz +Alžir dz +Algèria dz +Alžírsko dz +Algeriet dz +Algerien dz +ΑλγεÏία dz +Algerio dz +Argelia dz +Alžeeria dz +الجزیره dz +Algérie dz +Algerije dz +An Ailgéir dz +Alxéria dz +×לג'יריה dz +अलà¥à¤œà¥€à¤°à¤¿à¤¯à¤¾ dz +Alžir dz +Algéria dz +Alsír dz +アルジェリア dz +អាល់ហ្សáŸážšáž¸ dz +알제리 dz +ບັນàºàº²à»€àº¥àºµàº dz +Alžyras dz +Alžīrija dz +Ðлжир dz +Ðлжер dz +AlÄ¡erija dz +Algerie dz +Algerien dz +Algerije dz +Algerie dz +ਅਲਜੀਰੀਆ dz +Algieria dz +Argélia dz +Argélia dz +Ðлжир dz +Aligeriya dz +Alžírsko dz +Alžirija dz +Ðлжир dz +Alžir dz +I-Algeria dz +Algeriet dz +அலà¯à®œà®¿à®°à®¿à®¯à®¾ dz +Ðлҷазоир dz +อัลจีเรีย dz +Aljır dz +Ðлжир dz +Жазоир dz +Aldjereye dz +阿尔åŠåˆ©äºš dz +阿爾åŠåˆ©äºž dz +Equador ec +Ewenaar ec +الإكوادور ec +Ekvator ec +Эквадор ec +Еквадор ec +ইকà§à§Ÿà§‡à¦¡à¦° ec +Ecuador ec +Ekvador ec +Ekvádor ec +Ecwador ec +Ecuador ec +ΙσημεÏινός ec +Ekvadoro ec +Ecuador ec +Ekuador ec +اکوادور ec +Équateur ec +Eacuadór ec +Ecuador ec +×קוודור ec +इकà¥à¤µà¥‡à¤¡à¥‰à¤° ec +Ekvador ec +Ecuador ec +Ekvador ec +Ecuador ec +エクアドル ec +អáŸáž€áŸ’វាឌáŸážš ec +ì—ì½°ë„르 ec +ເອàºà»àº”à» ec +Ekvadoras ec +Ekvadora ec +Еквадор ec +Эквадор ec +Ekwador ec +Ecuador ec +Ecuador ec +Ecuador ec +à¨à¨•ਾਵੇਡਰ ec +Ekwador ec +Ecuador ec +Эквадор ec +Ekwateri ec +Ekvador ec +Ekvádor ec +Ekvador ec +Еквадор ec +Ekvador ec +I-Equador ec +ஈகà¯à®µà¯†à®Ÿà®¾à®°à¯ ec +Эквадор ec +เอà¸à¸§à¸²à¸”อร์ ec +Ekvator ec +Еквадор ec +Эквадор ec +EcwÃ¥teur ec +厄瓜多尔 ec +厄瓜多 ec +Estonia ee +Estlandies ee +استونيا ee +Estoniya ee +ЭÑÑ‚Ð¾Ð½Ñ–Ñ ee +ЕÑÑ‚Ð¾Ð½Ð¸Ñ ee +à¦à¦¸à§à¦Ÿà§‹à¦¨à¦¿à§Ÿà¦¾ ee +Estonija ee +Estònia ee +Estonsko ee +Estland ee +Estland ee +Εσθονία ee +Estlando ee +Eesti ee +استونی ee +Eesti ee +Estonie ee +Estland ee +An Eastóin ee +×סטוניה ee +à¤à¤¸à¥à¤¤à¥‹à¤¨à¤¿à¤¯à¤¾ ee +Estonija ee +Észtország ee +Eistland ee +エストニア ee +អáŸážŸáŸ’ážáž¼áž“ី ee +ì—스토니아 ee +ເອໂທເນີຠee +Estija ee +Igaunija ee +ЕÑтонија ee +ЭÑтони ee +Estonja ee +Estland ee +Estland ee +Estland ee +Estland ee +Estònia ee +ਈਸਟੋਨੀਆ ee +Estónia ee +Estônia ee +ЭÑÑ‚Ð¾Ð½Ð¸Ñ ee +Esitoniya ee +Estteeana ee +Estónsko ee +Estonija ee +ЕÑтонија ee +Estonija ee +I-Estonia ee +Estland ee +எசà¯à®Ÿà¯‹à®©à®¿à®¯à®¾ ee +ЭÑÑ‚Ð¾Ð½Ð¸Ñ ee +เอสโทเนีย ee +Estonya ee +ЕÑÑ‚Ð¾Ð½Ñ–Ñ ee +ЭÑÑ‚Ð¾Ð½Ð¸Ñ ee +Estoneye ee +爱沙尼亚 ee +愛沙尼亞 ee +Egypt eg +Egipte eg +مصر eg +Misir eg +ЭгіпÑÑ‚ eg +Египет eg +মিশর eg +Ejipt eg +Egipat eg +Egipte eg +Yr Aifft eg +Egypten eg +Ägypten eg +Αίγυπτος eg +Egiptujo eg +Egipto eg +Egiptus eg +Egipto eg +مصر eg +Egypti eg +Egyptaland eg +Égypte eg +Egypte eg +An Éigipt eg +Exipto eg +×ž×¦×¨×™× eg +इजिपà¥à¤¤ eg +Egipat eg +Egyiptom eg +Egyptaland eg +Egitto eg +エジプト eg +អáŸáž áŸ’ស៊ីប eg +ì´ì§‘트 eg +ອີຢີບ eg +Egiptas eg +Ä’Ä£ipte eg +Египет eg +Египт eg +Mesir eg +EÄ¡ittu eg +Ägypten eg +Egypte eg +Egepeta eg +ਮਿਸਰ eg +Egipt eg +Egipto eg +Egito eg +Egipt eg +Египет eg +Misiri eg +Egypta eg +Egipt eg +Египат eg +Egipat eg +I-Egypt eg +Egypten eg +எகிபà¯à®¤à¯ eg +МиÑÑ€ eg +อียิปต์ eg +Mısır eg +Mısır eg +Єгипет eg +МиÑÑ€ eg +Ai Cập eg +Edjipe eg +åŸƒåŠ eg +åŸƒåŠ eg +Igibhithe eg +Western Sahara eh +Westelike Sahara eh +الصحراء الغربية eh +ЗаходнÑÑ Ð¡Ð°Ñ…Ð°Ñ€Ð° eh +Западна Сахара eh +পশà§à¦šà¦¿à¦® সাহারা eh +Sahara occidental eh +Zapadna Sahara eh +Sàhara Occidental eh +Západní Sahara eh +Gorllewin Sahara eh +Vestsahara eh +Westsahara eh +Δυτική ΣαχάÏα eh +Okcidenta Saharo eh +Sahara occidental eh +Lääne-Sahara eh +Mendebaldeko Sahara eh +صحرای غربی eh +Länsi-Sahara eh +Sahara occidental eh +West Sahara eh +An Sahára Thiar eh +Saara Ocidental eh +מערב סהרה eh +पशà¥à¤šà¤¿à¤®à¥€ सहारा eh +Westerm Sahara eh +Nyugat-Szahara eh +Vestur-Sahara eh +Sahara Occidentale eh +西サãƒãƒ© eh +សាហារ៉ា​ážáž¶áž„​លិច eh +ì„œì‚¬í•˜ë¼ eh +ພື້ນທີ່ທຳງານ eh +Vakarų Sahara eh +RietumsahÄra eh +Западна Сахара eh +Барууг Ñахар eh +Saħara tal-Punent eh +Vest-Sahara eh +Westsahara eh +West Sahara eh +Vest-Sahara eh +ਦੱਖਣੀ ਸਹਾਰਾ eh +Zachodnia Sahara eh +Sara Ocidental eh +Sahara Ocidental eh +Sahara de Vest eh +Ð—Ð°Ð¿Ð°Ð´Ð½Ð°Ñ Ð¡Ð°Ñ…Ð°Ñ€Ð° eh +Sahara y'Iburengerazuba eh +Oarje-Sahara eh +Západna Sahara eh +Zahodna Sahara eh +Западна Сахара eh +Zapadna Sahara eh +Västsahara eh +மேறà¯à®•தà¯à®¤à®¿à®¯ சஹாரா eh +Саҳрои Ғарбӣ eh +ซาฮาร่าตะวันตภeh +Batı Sahara eh +Batış Sahara eh +Західна Сахара eh +Ғарбий Сахара eh +Tây Sahara eh +Sara Coûtchantrece eh +西撒哈拉 eh +西盛哈拉 eh +Eritrea er +اريتريا er +ЭрытрÑÑ er +Ð•Ñ€Ð¸Ñ‚Ñ€ÐµÑ er +à¦à¦°à¦¿à¦Ÿà§à¦°à¦¿à§Ÿà¦¾ er +Eritre er +Eritreja er +ΕÏυθÏαία er +Eritreo er +اریتره er +Érythrée er +Eiritré er +×ריתרי××” er +à¤à¤°à¤¿à¤Ÿà¥à¤°à¥€à¤¯à¤¾ er +Eritreja er +Erítrea er +エリトリア er +អáŸážšáž¸áž‘្រា er +ì—리트레아 er +à»àºà»‰à»„ຂà»àºŸà»‰àº¡àº—ຳງານ er +EritrÄ—ja er +Eritreja er +Еритреја er +Эритреа er +ਈਰੀਟਰੀਆ er +Erytrea er +Eritreia er +Eritréia er +Ð­Ñ€Ð¸Ñ‚Ñ€ÐµÑ er +Eritereya er +Eritreja er +Еритреја er +Eritreja er +ரிடà¯à®°à®¿à®¯à®¾ er +Ð­Ñ€Ð¸Ñ‚Ñ€Ð¸Ñ er +เอริเทรีย er +Eritre er +Ð•Ñ€Ñ–Ñ‚Ñ€ÐµÑ er +Ð­Ñ€Ð¸Ñ‚Ñ€Ð¸Ñ er +Eritrêye er +厄立特里亚 er +厄利垂亞 er +Spain es +Spanje es +أسبانيا es +İspaniya es +Ð“Ñ–ÑˆÐ¿Ð°Ð½Ñ–Ñ es +ИÑÐ¿Ð°Ð½Ð¸Ñ es +সà§à¦ªà§‡à¦¨ es +Spagn es +Å panija es +Espanya es +Å panÄ›lsko es +Sbaen es +Spanien es +Spanien es +Ισπανία es +Hispanio es +España es +Hispaania es +Espainia es +اسپانیا es +Espanja es +Spania es +Espagne es +Spanje es +An Spáinn es +España es +ספרד es +सà¥à¤ªà¥‡à¤¨ es +Å panjolska es +Spanyolország es +Spanyol es +Spánn es +Spagna es +スペイン es +អáŸážŸáŸ’ប៉ាញ es +ìŠ¤íŽ˜ì¸ es +ສະເປັນ es +Ispanija es +SpÄnija es +Шпанија es +ИÑпани es +Sepanyol es +Spanja es +Spania es +Spanien es +Spanje es +Spania es +Espanha es +ਸਪੇਨ es +Hiszpania es +Espanha es +Espanha es +Spania es +ИÑÐ¿Ð°Ð½Ð¸Ñ es +Esipanye es +Spánia es +Å panielsko es +Å panija es +Шпанија es +Å panija es +I-Spain es +Spanien es +சà¯à®ªà¯†à®¯à®¿à®©à¯ es +ИÑпаниё es +สเปน es +İspanya es +İspania es +ІÑÐ¿Ð°Ð½Ñ–Ñ es +ИÑÐ¿Ð°Ð½Ð¸Ñ es +Tây Ban Nha es +Sipagne es +西ç­ç‰™ es +西ç­ç‰™ es +Ethiopia et +Ethiopië et +اثيوبيا et +Ð­Ñ‚Ñ‹Ñ‘Ð¿Ñ–Ñ et +Ð•Ñ‚Ð¸Ð¾Ð¿Ð¸Ñ et +ইথিওপিয়া et +Etiopi et +Etiopija et +Etiòpia et +Etiopie et +Ethiopien et +Äthiopien et +Αιθιοπία et +Etiopio et +Etiopía et +Etioopia et +Etiopia et +اتیوپی et +Etiopia et +Éthiopie et +Ethiopië et +An Aetóip et +Etiopia et +×תיופיה et +इथियोपिया et +Etiopija et +Etiópia et +Eþíópía et +Etiopia et +エãƒã‚ªãƒ”ã‚¢ et +អáŸážáŸ’យូពី et +ì—티오피아 et +ເອໂທເນີຠet +Etiopija et +Etiopija et +Етиопија et +Этопи et +Etjopia et +Etiopia et +Äthiopien et +Ethiopië et +Etiopia et +ਈਥੋਪੀਆ et +Etiopia et +Etiópia et +Etiópia et +Etiopia et +Ð­Ñ„Ð¸Ð¾Ð¿Ð¸Ñ et +Etiyopiya et +Etiopia et +Etiópia et +Etiopija et +Етиопија et +Etiopija et +Etiopien et +எதியோபியா et +ҲабашиÑтон et +เอธิโอเปีย et +Etiyopya et +Efiopia et +Ð•Ñ„Ñ–Ð¾Ð¿Ñ–Ñ et +Ð­Ñ„Ð¸Ð¾Ð¿Ð¸Ñ et +Etiopeye et +埃塞俄比亚 et +衣索比亞 et +Finland fi +Ùنلندا fi +Finlandiya fi +ФінлÑÐ½Ð´Ñ‹Ñ fi +Ð¤Ð¸Ð½Ð»Ð°Ð½Ð´Ð¸Ñ fi +ফিনলà§à¦¯à¦¾à¦£à§à¦¡ fi +Finska fi +Finlàndia fi +Finsko fi +Y Ffindir fi +Finnland fi +Φινλανδία fi +Finnlando fi +Finlandia fi +Soome fi +Finlandia fi +Ùنلاند fi +Suomi fi +Finnland fi +Finlande fi +Finlân fi +An Fhionlainn fi +Finlándia fi +פינלנד fi +फिनलैंड fi +Finska fi +Finnország fi +Finlandia fi +Finnland fi +Finlandia fi +フィンランド fi +ហ្វាំងឡង់ fi +핀란드 fi +ຟີນà»àº¥àº™ fi +Suomija fi +Somija fi +ФинÑка fi +Финнланд fi +Finlandja fi +Finnland fi +Finlandia fi +ਫਿਨਲੈਂਡ fi +Finlandia fi +Finlândia fi +Finlândia fi +Finlanda fi +ФинлÑÐ½Ð´Ð¸Ñ fi +Finilande fi +Suopma fi +Fínsko fi +Finska fi +ФинÑка fi +Finska fi +I-Finland fi +பினà¯à®²à®¾à®¨à¯à®¤à¯ fi +Финлонд fi +ฟินà¹à¸¥à¸™à¸”์ fi +Finlandiya fi +Finland (Suomi) fi +ФінлÑÐ½Ð´Ñ–Ñ fi +ФинлÑÐ½Ð´Ð¸Ñ fi +Phần Lan fi +Finlande fi +芬兰 fi +芬蘭 fi +Fiji fj +Ùيجي fj +Фіджы fj +ОÑтрови Фиджи fj +ফিজি fj +Fidji fj +Fidži fj +Fidži fj +Ffiji fj +Fidschi fj +Φίτζι fj +FiÄioj fj +Fidži fj +Ùیجی fj +Fidji fj +Fidsí fj +פיג'×™ fj +फिजी fj +Fidzsi fj +Fídjieyjar fj +Figi fj +フィジー fj +ហ្វ៊ីហ្ស៊ី fj +피지 fj +ມີດີ fj +Fidži fj +Фиџи fj +Фижи fj +FiÄ¡i fj +Fidschi fj +ਫਿੱਜੀ fj +Fidżi fj +Ilhas Fiji fj +Фиджи fj +Fidži fj +Fidži fj +Фиџи fj +Fidži fj +பிஜி fj +Фиҷи fj +ฟิจิ fj +Фіджі fj +Фижи fj +Fidji fj +æ–æµŽ fj +è²æ¿Ÿ fj +Falkland Islands (Malvinas) fk +Falkland Eilande (Malvinas) fk +جزر الÙوكلاند (المالÙيناس) fk +ФалклендÑÐºÑ–Ñ Ð°Ñтравы (Мальвіны) fk +ФолклендÑки оÑтрови fk +ফকলà§à¦¯à¦¾à¦£à§à¦¡ দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ (মলভিনাস) fk +Inizi Falklandi (Malvinas) fk +Foklandska ostrva (Malvini) fk +Illes Falkland (Malvines) fk +Falklandy (Malvíny) fk +Ynysoedd Y Ffalcland (Malfinas) fk +Falkland-øerne fk +Falkland-Inseln (Malvinen) fk +Îησιά Φώκλαντ (Malvinas) fk +Falklandoj fk +Islas Falkland (Malvinas) fk +Falklandi saared (Malviinid) fk +Falkland Irlak (Malvinak) fk +جزایر ÙØ§Ù„کلند مالویناس fk +Falklandin saaret (Malvinassaaret) fk +ÃŽles Falkland (Malvinas) fk +Falkland Eilannen (Malvinas) fk +Na hOileáin Fháclainne (Malvinas) fk +Illas Falkland (Malvinas) fk +××™×™ פולקלנד fk +फाकलैंड आइलैंड (मालविनास) fk +Folklandska otoÄja (Malvini) fk +Falkland-szigetek fk +Falklandseyjar fk +Isole Falkland (Malvine) fk +フォークランド諸島 fk +កោះ Falkland (Malvinas) fk +í¬í´ëžœë“œ êµ°ë„ (ë§ë¹„나스) fk +Folklendu salas fk +ФокландÑки ОÑтрови (Малвини) fk +Фалкланд арлууд (МалвинаÑ) fk +Gżejjer Falkland (Malvinas) fk +Falklandsøyene fk +Falklandinseln (Malvinas) fk +Falkland Eilanden (Malvinas) fk +Falklandsøyane fk +ਫਾਕਲੈਂਡ ਟਾਪੂ fk +Wyspy Falklandzkie (Malwiny) fk +Ilhas Falkland (Malvinas) fk +Ilhas Malvinas fk +Insulele Falkland (Malvine) fk +ФолклендÑкие (МальвинÑкие) оÑтрова fk +Ibirwa bya Falikilande (Maluvinasi) fk +Falklánddasullot fk +Falklandské Ostrovy (Malviny) fk +Falklandski otoki (Malvini) fk +ФолкландÑка оÑтрва (Малвини) fk +Folklandska ostrva (Malvini) fk +Falklandsöarna fk +ஃபாலà¯à®•௠தீவà¯(மாலà¯à®µà®¿à®©à®¾à®¸à¯) fk +Ҷазираи фолкланд (Малвина) fk +หมู่เà¸à¸²à¸°à¸Ÿà¸­à¸¥à¹Œà¸„à¹à¸¥à¸™à¸”์ (Malvinas) fk +Falkland Adaları fk +Falkland Utrawları (Malvinnar) fk +ФолклендÑькі оÑтрови (БританіÑ) fk +Фолкленд (Малвин) Ороллари fk +Iyes Malouwines fk +ç¦å…‹å…°ç¾¤å²›(马尔维纳斯) fk +ç¦å…‹è˜­ç¾¤å³¶ (é¦¬çˆ¾ç¶­ç´æ–¯) fk +Micronesia, Federated States of fm +Micronesië, Vereenigde State van fm +ФедÑÑ€Ð°Ñ†Ñ‹Ñ ÐœiкранÑзіі fm +ÐœÐ¸ÐºÑ€Ð¾Ð½ÐµÐ·Ð¸Ñ fm +মাইকà§à¦°à§‹à¦¨à§‡à¦¶à¦¿à§Ÿà¦¾, ফেডারেটেড সà§à¦Ÿà§‡à¦Ÿà¦¸ অব fm +Mikronezija, Federalne države fm +Micronesia, Estats Federats de fm +Mikronésie fm +Micronesia, Taleithau Cyfunol fm +Mikronesien, de forenede stater af fm +Mikronesien, Föderation von fm +ΜικÏονησίας, Ομόσπονδες πολιτείες της fm +Mikronezio, Respubliko de fm +Micronesia, Estados federados de fm +Mikroneesia fm +Mikronesiako Estatu Federatuak fm +Mikronesian liittovaltio fm +Etats Fédérés de Micronésie fm +Micronesië, Federale staten Fan fm +Stáit Cónascacha na Micrinéise fm +Micronésia, Estados Federados de fm +מיקרונזיה, מדינות הפדרציה של fm +फेडरेटेड सà¥à¤Ÿà¥‡à¤Ÿ ऑफ माइकà¥à¤°à¥‹à¤¨à¥‡à¤¸à¤¿à¤¯à¤¾ fm +Mikronézia fm +Míkrónesía, Sambandsríki fm +Micronesia, stati federati di fm +ミクロãƒã‚·ã‚¢,米自由連邦 fm +រដ្ឋ​សហពáŸáž“្ធ​មិក្រូនáŸážŸáŸŠáž¸ fm +Mikronezija fm +MikronÄ“zija fm +Микронезија, Федеративни Држави на fm +Mikronesja (Stati Federati ta') fm +Mikronesiaføderasjonen fm +Mikronesien, Vereenigte Staten vun fm +Micronesië, Federale staten van fm +Mikronesiaføderasjonen fm +ਮਾਇਕਰੋਨੀਸੀਆ, ਸੰਘੀ ਪà©à¨°à¨¾à¨‚ਤ fm +Federacja Stanów Mikronezji fm +Micronésia, Estados Federados da fm +Estados Federados da Micronésia fm +Micronezia, Statele Federative fm +ÐœÐ¸ÐºÑ€Ð¾Ð½ÐµÐ·Ð¸Ñ fm +Mikoronesiya, Leta Zishyizwehamwe fm +MikronesiafederaÅ¡uvdna fm +Spojené Å¡táty Mikronézie fm +Mikronezija, Združene države fm +Микронезија, Федерација држава fm +Mikronezija, Federacija država fm +Mikronesiska federationen fm +மைகà¯à®°à¯‹à®©à®¿à®šà®¾, à®’à®°à¯à®™à¯à®•ிணைநà¯à®¤ மாநிலம௠fm +สหพันธรัà¸à¸¡à¸´à¹‚ครนีเซีย fm +Mikronezya Federasyonu fm +Mikronesia, Berläşkän İlläre fm +МікронезіÑ, федеративні штати fm +ÐœÐ¸ÐºÑ€Ð¾Ð½ÐµÐ·Ð¸Ñ fm +Micronezeye fm +密克罗尼西亚è”邦 fm +密克羅尼西亞è¯é‚¦ fm +Faroe Islands fo +Faroe Eilande fo +جزر الÙيرو fo +ОÑтрови Фаро fo +ফারো দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ fo +Enez Faroe fo +Farska ostrva fo +Illes Faroe fo +Faerské ostrovy fo +Ynysoedd Ffar?e fo +Færøerne fo +Färöer-Inseln fo +Îήσοι ΦεÏόε fo +Ferooj fo +islas Faroe fo +Fääri saared fo +Faroe Irlak fo +جزایر ÙØ§Ø±Ùˆ fo +Färsaaret fo +ÃŽles Féroé fo +Faroe Eilannen fo +Na Scigirí (Oileáin Fharó) fo +Illas Feroe fo +××™×™ פ×רו fo +फारोठआइलैंड fo +Faroe Otoci fo +Faroe-szigetek fo +Færeyjar fo +Isole Fær Øer fo +フェロー諸島 fo +កោះ​ហ្វ៉ារ៉ូ fo +페로 ì œë„ fo +ໄອà»àº¥àº™ fo +Faroe salos fo +FÄ“ru salas fo +ФарÑки ОÑтрови fo +Фарое арлууд fo +Gżejjer Faroe fo +Færøyene fo +Färöerinseln fo +Faroe Eilanden fo +Færøyane fo +ਫਾਰੋਈ ਟਾਪੂ fo +Wyspy Faroe fo +Ilhas Faroe fo +Ilhas Faroe fo +Insulele Feroe fo +ФарерÑкие оÑтрова fo +Ibirwa bya Farowe fo +Fearsuolu fo +Ostrovy Faroe fo +Otoki Faroe fo +ФарÑка оÑтрва fo +Farska ostrva fo +Färöarna fo +ஃபரோ தீவà¯à®•ள௠fo +Ҷазираи Фару fo +หมู่เà¸à¸²à¸°à¸Ÿà¸²à¹‚ร fo +Faroe Adaları fo +Faroe Utrawları fo +ФарерÑькі оÑтрови fo +Фарер Ороллари fo +Äảo Faroe fo +Iye Faeroyé fo +法罗群岛 fo +法羅群島 fo +France fr +Frankryk fr +ÙØ±Ù†Ø³Ø§ fr +Fransa fr +Ð¤Ñ€Ð°Ð½Ñ†Ñ‹Ñ fr +Ð¤Ñ€Ð°Ð½Ñ†Ð¸Ñ fr +ফà§à¦°à¦¾à¦¨à§à¦¸ fr +Frañs fr +Francuska fr +França fr +Francie fr +Ffrainc fr +Frankrig fr +Frankreich fr +Γαλλία fr +Francio fr +Francia fr +Prantsusmaa fr +Frantzia fr +ÙØ±Ø§Ù†Ø³Ù‡ fr +Ranska fr +Frakland fr +Frankryk fr +An Fhrainc fr +Franza fr +צרפת fr +फà¥à¤°à¤¾à¤‚स fr +Francuska fr +Franciaország fr +Prancis fr +Frakkland fr +Francia fr +フランス fr +បារាំង fr +프랑스 fr +àºàº£àº±à»ˆàº‡ fr +PrancÅ«zija fr +Francija fr +Франција fr +Франц fr +Perancis fr +Franza fr +Frankrike fr +Frankriek fr +Frankrijk fr +Frankrike fr +Fora fr +França fr +ਫਰਾਂਸ fr +Francja fr +França fr +França fr +FranÅ£a fr +Ð¤Ñ€Ð°Ð½Ñ†Ð¸Ñ fr +Ubufaransa fr +Fránkriika fr +Francúzsko fr +Francija fr +ФранцуÑка fr +Francuska fr +I-France fr +Frankrike fr +பிரானà¯à®šà¯ fr +ФаронÑа fr +à¸à¸£à¸±à¹ˆà¸‡à¹€à¸¨à¸ª fr +Fransa fr +Fransia fr +Ð¤Ñ€Ð°Ð½Ñ†Ñ–Ñ fr +Ð¤Ñ€Ð°Ð½Ñ†Ð¸Ñ fr +Fura fr +Pháp fr +Fransi fr +法国 fr +法國 fr +Gabon ga +الغابون ga +Габон ga +Габон ga +গà§à¦¯à¦¾à¦¬à¦¨ ga +Gabun ga +Γκαμπόν ga +Gabono ga +Gabón ga +گابون ga +An Ghabúin ga +Gabón ga +גבון ga +गेबॉन ga +ガボン ga +ហ្គាបុង ga +가봉 ga +à»àºàº¥à»ˆàº‡àº™ ga +Gabonas ga +Gabona ga +Габон ga +Габон ga +Gabun ga +ਗਾਬੋਨ ga +Gabão ga +Gabão ga +Габон ga +Gabo ga +Габон ga +காபான௠ga +Габон ga +à¸à¸²à¸šà¸­à¸™ ga +Габон ga +Габон ga +加蓬 ga +加彭 ga +United Kingdom gb +Vereenigde Koninkryk gb +المملكة المتحدة gb +BirləşmiÅŸ Krallıq gb +Злучанае КаралеўÑтва gb +Ð’ÐµÐ»Ð¸ÐºÐ¾Ð±Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ gb +ইউনাইটেড কিংডম gb +Rouantelezh Unanet gb +Velika Britanija gb +Regne Unit gb +Spojené království gb +Y Deyrnas Unedig gb +Storbritannien gb +Großbritannien gb +Ηνωμένο Βασίλειο gb +Britio gb +Reino Unido gb +Suurbritannia gb +Erresuma Batua gb +بریتانیا gb +Iso-Britannia gb +Stórabretland gb +Royaume Uni gb +Ferienigd Keninkryk gb +An Ríocht Aontaithe gb +Reino Unido gb +בריטניה gb +यूनाइटेड किंगडम gb +Ujedinjeno Kraljevstvo gb +Egyesült Királyság gb +Inggris gb +Bretland gb +Regno Unito gb +イギリス gb +ចក្រភព​អង់គ្លáŸážŸ gb +ì˜êµ­ gb +ສະຫະລາດສະອານາຈັຠgb +JungtinÄ— KaralystÄ— gb +ApvienotÄ Karaliste gb +Обединето КралÑтво gb +Их британ gb +Renju Unit gb +Storbritannia gb +Grootbritannien gb +Verenigd Koninkrijk gb +Storbritannia gb +Regne Unit gb +ਬਰਤਾਨੀਆ gb +Wielka Brytania gb +Reino Unido gb +Reino Unido gb +Anglia gb +Ð’ÐµÐ»Ð¸ÐºÐ¾Ð±Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ gb +Ubwongereza gb +Stuorrabrittania gb +Anglicko gb +Združeno kraljestvo gb +Уједињено КраљевÑтво gb +Ujedinjeno Kraljevstvo gb +I-United Kingdom gb +Storbritannien gb +à®à®•à¯à®•ிய ராஜà¯à®œà®¿à®¯à®®à¯ gb +Подшоҳии Муттаҳида gb +สหราชอาณาจัà¸à¸£ gb +BirleÅŸik Krallık gb +Berläşkän PadÅŸahlıq gb +Ð’ÐµÐ»Ð¸ÐºÐ¾Ð±Ñ€Ð¸Ñ‚Ð°Ð½Ñ–Ñ gb +Буюк Ð‘Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ gb +Anh gb +RweyÃ¥me Uni gb +United Kingdom gb +英国 gb +è¯åˆçŽ‹åœ‹ gb +United Kingdom gb +Grenada gd +غرينادا gd +Qrenada gd +ГрÑнада gd +Гренада gd +গà§à¦°à§‡à¦¨à¦¾à¦¡à¦¾ gd +Granada gd +ΓÏενάδα gd +Grenado gd +Granada gd +گرانادا gd +Grenade gd +Granada gd +גרנדה gd +गà¥à¤°à¥‡à¤¨à¤¾à¤¡à¤¾ gd +Granada gd +グレナダ gd +ហ្គ្រីណាដា gd +그러네ì´ë‹¤ gd +ເàºàº™àº²àº”າ gd +GrenÄda gd +Гренада gd +Гренада gd +Granada gd +ਗਰੀਨਾਡਾ gd +Granada gd +Granada gd +Гренада gd +Gerenada gd +I-Grenada gd +கிரெனடா gd +Гронодо gd +เà¸à¸£à¸™à¸²à¸”า gd +Гренада gd +Гренада gd +GrenÃ¥de gd +格林纳达 gd +æ ¼ç‘žé‚£é” gd +Georgia ge +Georgië ge +جورجيا ge +Ð“Ñ€ÑƒÐ·Ñ–Ñ ge +Ð“Ñ€ÑƒÐ·Ð¸Ñ ge +জরà§à¦œà¦¿à§Ÿà¦¾ ge +Jeorji ge +Gruzija ge +Geòrgia ge +Gruzie ge +Georgien ge +Georgien ge +ΓεωÏγία ge +Georgino ge +Gruusia ge +گرجستان ge +Géorgie ge +Georgië ge +An tSeoirsia ge +Xeórxia ge +×’'ורג'×™×” ge +जà¥à¤¯à¤¾à¤°à¥à¤œà¤¿à¤¯à¤¾ ge +Grúzia ge +Georgía ge +ジョージア島 ge +ហ្សកហ្ស៊ី ge +그루지아 ge +ເຊີເບີຠge +Gruzija ge +Gruzija ge +Грузија ge +Георги ge +Ä orÄ¡ia ge +Georgien ge +Georgië ge +ਜਾਰਜੀਆ ge +Gruzja ge +Geórgia ge +Geórgia ge +Ð“Ñ€ÑƒÐ·Ð¸Ñ ge +Jeworugiya ge +Gruzija ge +Грузија ge +Gruzija ge +Georgien ge +ஜியோரà¯à®œà®¿à®¯à®¾ ge +ГурҷиÑтон ge +จอร์เจีย ge +Gürcistan ge +Görcestan ge +Ð“Ñ€ÑƒÐ·Ñ–Ñ ge +ГуржиÑтон ge +Djeyordjeye ge +æ ¼é²å‰äºš ge +喬治亞 ge +Ghana gh +غانا gh +Гана gh +Гана gh +ঘানা gh +Gwana gh +Gana gh +Γκάνα gh +Ganao gh +غنا gh +Gána gh +Gana gh +×’×× ×” gh +घाना gh +Gana gh +ガーナ gh +ហ្កាណា gh +가나 gh +ຈີນ gh +Gana gh +Gana gh +Гана gh +Гана gh +Gana gh +ਘਾਨਾ gh +Gana gh +Gana gh +Gana gh +Гана gh +Gana gh +Gana gh +Гана gh +Gana gh +I-Ghana gh +கானா gh +Ғано gh +à¸à¸²à¸™à¸² gh +Гана gh +Гана gh +Gana gh +加纳 gh +è¿¦ç´ gh +Gibraltar gi +جبل طارق gi +Гібралтар gi +Гибралтар gi +জিবà§à¦°à¦²à§à¦Ÿà¦¾à¦° gi +Jibraltar gi +ΓιβÏÎ±Î»Ï„Î¬Ï gi +Gibraltaro gi +گیبرالتار gi +Giobráltar gi +Xibraltar gi +גיברלטר gi +जिबà¥à¤°à¤¾à¤²à¥à¤Ÿà¤° gi +Gibraltár gi +Gíbraltar gi +Gibilterra gi +ジブラルタル gi +지브롤터 gi +ມອລຕາ gi +Gibraltaras gi +GibraltÄrs gi +Гибралтар gi +Гибралтар gi +Ä ibiltar gi +ਗੀਬਰਾਲਟਾਰ gi +Гибралтар gi +Jiburalitari gi +Гибралтар gi +ஜிபà¯à®°à®²à¯à®Ÿà®¾à®°à¯ gi +Ҷабалуттариқ gi +ยิบรอลตา gi +Cebelitarık gi +Гібралтар gi +Гибралтар gi +Djibraltar gi +直布罗陀 gi +直布羅陀 gi +Greenland gl +Groenland gl +Ð“Ñ€ÐµÐ½Ð»Ð°Ð½Ð´Ð¸Ñ gl +গà§à¦°à§€à¦¨à¦²à§à¦¯à¦¾à¦£à§à¦¡ gl +Griñland gl +Groenlàndia gl +Grónsko gl +Y Lasynys gl +Grønland gl +Grönland gl +Ισλανδία gl +Groenlandia gl +Gröönimaa gl +Gröönlanti gl +Groenland gl +Grienlân gl +An Ghraonlainn gl +Groenlándia gl +Grönland gl +Grænland gl +Groenlandia gl +グリーンランド gl +Grenlandija gl +Гренланд gl +Grønland gl +Gröönland gl +Groenland gl +Grønland gl +ਗਰੀਨਲੈਂਡ gl +Grenlandia gl +Gronelândia gl +Ð“Ñ€ÐµÐ½Ð»Ð°Ð½Ð´Ð¸Ñ gl +Goronilande gl +Ruonáeatnan gl +Grenlandija gl +Гренланд gl +Grenland gl +Grönland gl +Ð“Ñ€Ð¸Ð½Ð»Ð°Ð½Ð´Ð¸Ñ gl +à¸à¸£à¸µà¸™à¹à¸¥à¸™à¸”์ gl +Grönland gl +Ð“Ñ€ÐµÐ½Ð»Ð°Ð½Ð´Ñ–Ñ gl +Ð“Ñ€ÐµÐ½Ð»Ð°Ð½Ð´Ð¸Ñ gl +格陵兰 gl +格陵蘭 gl +Gambia gm +Gambië gm +غامبيا gm +Ð“Ð°Ð¼Ð±Ñ–Ñ gm +Ð“Ð°Ð¼Ð±Ð¸Ñ gm +গামবিয়া gm +Gambi gm +Gambija gm +Gàmbia gm +Gambie gm +Γκάμπια gm +Gambio gm +گامبیا gm +Gambie gm +An Ghaimbia gm +Gámbia gm +גמביה gm +जामà¥à¤¬à¤¿à¤¯à¤¾ gm +Gambija gm +Gambía gm +ガンビア gm +ហ្កាំប៊ី gm +ê°ë¹„ì•„ gm +à»àºàº¡àº¡àº² gm +Gambija gm +Gambija gm +Гамбија gm +Гамби gm +Gambja gm +ਗੈਂਬੀਆ gm +Gâmbia gm +Gâmbia gm +Ð“Ð°Ð¼Ð±Ð¸Ñ gm +Gambiya gm +Gambija gm +Гамбија gm +Gambija gm +காமà¯à®ªà®¿à®¯à®¾ gm +Гомбиё gm +à¹à¸à¸¡à¹€à¸šà¸µà¸¢ gm +Ð“Ð°Ð¼Ð±Ñ–Ñ gm +Ð“Ð°Ð¼Ð±Ð¸Ñ gm +Gambeye gm +冈比亚 gm +甘比亞 gm +Guinea gn +غينيا gn +ГвінÑÑ gn +Ð“Ð²Ð¸Ð½ÐµÑ gn +গিনি gn +Gine gn +Gvineja gn +Gini gn +Γουινέα gn +Gvineo gn +Ginea gn +گینه gn +Guinée gn +An Ghuine gn +Guiné gn +×’×™× ××” gn +गà¥à¤ˆà¤¨à¤¾ gn +Gvineja gn +Gínea gn +ギニア gn +ហ្គីណ០gn +기니 gn +ເຖາວັນ gn +GvinÄ—ja gn +Gvineja gn +Гвинеја gn +Гуйнеа gn +Ginea gn +ਗà©à¨‡à¨¨à©€à¨† gn +Gwinea gn +Guiné gn +Guiné gn +Ð“Ð²Ð¸Ð½ÐµÑ gn +Gineya gn +Gvineja gn +Гвинеја gn +Gvineja gn +கà¯à®¯à¯à®©à®¿à®¯à®¾ gn +Гине gn +à¸à¸´à¸™à¸µ gn +Gine gn +Ð“Ð²Ñ–Ð½ÐµÑ gn +Ð“Ð²Ð¸Ð½ÐµÑ gn +Guinêye gn +几内亚 gn +幾內亞 gn +Guadeloupe gp +غواديلوب gp +ГвадÑлупа gp +Гваделупа gp +গাডেলà§à¦ª gp +Gwadeloup gp +Gvadalupe gp +Guadalupe gp +Gwadel?p gp +ΓουαδελοÏπη gp +Gvadelupo gp +Guadalupe gp +Guadalupe gp +گوادلوپ gp +Guadalúip gp +Guadalupe gp +×’×ודלופה gp +गà¥à¤µà¤¾à¤¡à¥‡à¤²à¥‹à¤ª gp +Gvadelúpeyjar gp +Guadalupa gp +ä»é ˜ã‚°ã‚¢ãƒ‰ãƒ«ãƒ¼ãƒ— gp +ហ្គាដឺលុប gp +과들루프 gp +ເດີລຸຠgp +Gvandelupa gp +Гваделупе gp +Gwadelup gp +ਗà©à¨†à¨¡à©€à¨“ਪੀ gp +Gwadelupa gp +Guadalupe gp +Guadalupe gp +Guadelupa gp +Гваделупа gp +Gwaderupe gp +Гвадалупе gp +Gvadalupe gp +கà¯à®µà®¾à®Ÿà¯†à®²à¯à®ªà¯‹à®ªà¯ gp +Гвадалуппо gp +เà¸à¸²à¸°à¸à¸±à¸§à¹€à¸”อลูป gp +Guadelupa gp +Гваделупа gp +Гваделупа gp +瓜德罗普 gp +瓜德魯普 gp +Equatorial Guinea gq +Ekwatoriaal Guinea gq +غينيا الاستوائية gq +ЭкватарыÑÐ»ÑŒÐ½Ð°Ñ Ð“Ð²Ñ–Ð½ÑÑ gq +Екваториална Ð“Ð²Ð¸Ð½ÐµÑ gq +ইকà§à§Ÿà§‡à¦Ÿà§‹à¦°à¦¿à§Ÿà¦¾à¦² গিনি gq +Guine équatoriale gq +Ekvatorijalna Gvineja gq +Guinea Equatorial gq +Rovníková Guinea gq +Gini Gyhydeddol gq +Ækvatorial Guinea gq +Äquatorial-Guinea gq +ΙσημεÏινή Γουινέα gq +Ekvatora Gvineo gq +Guinea equatorial gq +Ekvatoriaal-Guinea gq +Ginea Ekuatoriala gq +گینه اکوادور gq +Päiväntasaajan Guinea gq +Guinée équatoriale gq +Guine Mheánchiorclach gq +Guinea Ecuatorial gq +×’×™× ××” המשוונית gq +इकà¥à¤µà¥‡à¤Ÿà¥‹à¤°à¤¿à¤¯à¤² गà¥à¤à¤¨à¤¾ gq +Ekvatorijalna Gvineja gq +EgyenlítÅ‘i Guinea gq +Miðbaugs-Gínea gq +Guinea Equatoriale gq +赤é“ギニア gq +ហ្គីណáŸâ€‹áž¢áŸáž€áŸ’វាទáŸážš gq +ì ë„ 기니 gq +àºàº²àº™àºªàº­àº™ gq +Ekvatoriaus GvinÄ—ja gq +EkvatoriÄlÄ Gvineja gq +Екваторијална Гвинеја gq +Equatorial Гуйнеа gq +Ginea Ekwatorjali gq +Ekvatorial-Guinea gq +Äquatoriaal-Guinea gq +Equatoriaal Guinea gq +Ekvatorial-Guinea gq +à¨à¨•ੂਲੇਟਰਲ ਗà©à¨ˆà¨¨à¨¿à¨† gq +Gwinea Równikowa gq +Guiné Equatorial gq +Guiné Equatorial gq +Guinea Ecuatorială gq +Ð­ÐºÐ²Ð°Ñ‚Ð¾Ñ€Ð¸Ð°Ð»ÑŒÐ½Ð°Ñ Ð“Ð²Ð¸Ð½ÐµÑ gq +Gineya Ekwatoriyale gq +EkvatorialalaÅ¡-Guinea gq +Rovníkova Guinea gq +Ekvatorialna Gvineja gq +Екваторијална Гвинеја gq +Ekvatorijalna Gvineja gq +Ekvatorialguinea gq +ஈகோடோரியல௠கà¯à®¯à¯à®©à®¿à®¯à®¾ gq +Гинеи Экваторӣ gq +à¸à¸´à¸™à¸µ ตรงเส้นศูนย์สูตร gq +Ekvatoral Gine gq +Equatorlı Guinea gq +Екваторіальна Ð“Ð²Ñ–Ð½ÐµÑ gq +Экваториал Ð“Ð²Ð¸Ð½ÐµÑ gq +Guinêye EcwÃ¥toriÃ¥le gq +赤é“几内亚 gq +赤é“幾內亞 gq +Greece gr +Griekeland gr +اليونان gr +Yunanıstan gr +ГрÑÑ†Ñ‹Ñ gr +Ð“ÑŠÑ€Ñ†Ð¸Ñ gr +গà§à¦°à§€à¦¸ gr +Gres gr +GrÄka gr +Grècia gr +Řecko gr +Gwlad Groeg gr +Grækenland gr +Griechenland gr +Ελλάδα gr +Grekujo gr +Grecia gr +Kreeka gr +Grezia gr +یونان gr +Kreikka gr +Grikkaland gr +Grèce gr +Grikelân gr +An Ghréig gr +Grécia gr +יוון gr +गà¥à¤°à¥€à¤¸ gr +GrÄka gr +Görögország gr +Grikkland gr +Grecia gr +ギリシャ gr +ក្រិក gr +그리스 gr +àºàºµàºŠ gr +Graikija gr +GrieÄ·ija gr +Грција gr +Грек gr +GreÄ‹ja gr +Hellas gr +Grekenland gr +Griekenland gr +Hellas gr +Grèça gr +ਗਰੀਸ gr +Grecja gr +Grécia gr +Grécia gr +Grecia gr +Ð“Ñ€ÐµÑ†Ð¸Ñ gr +Ubugereki gr +Greika gr +Grécko gr +GrÄija gr +Грчка gr +GrÄka gr +I-Greece gr +Grekland gr +கிரீச௠gr +Юнон gr +à¸à¸£à¸µà¸‹ gr +Yunanistan gr +Yunanstan gr +Ð“Ñ€ÐµÑ†Ñ–Ñ gr +ЮнониÑтон gr +Hy Lạp gr +Grece gr +希腊 gr +希臘 gr +Guatemala gt +Gautemala gt +غواتيمالا gt +Quatemala gt +ГватÑмала gt +Гватемала gt +গà§à§Ÿà¦¾à¦¤à§‡à¦®à¦¾à¦²à¦¾ gt +Gvatemala gt +Gwatemala gt +Γουατεμάλα gt +Gvatemalo gt +گواتمالا gt +Guatamala gt +גו×טמלה gt +गà¥à¤µà¤¾à¤Ÿà¥‡à¤®à¤¾à¤²à¤¾ gt +Gvatemala gt +Gvatemala gt +グァテマラ gt +ហ្គាážáŸáž˜áŸ‰áž¶áž¡áž¶ gt +과테ë§ë¼ gt +àºàº±àº§à»€àº•ມາລາ gt +Gvatemala gt +Gvatemala gt +Гватемала gt +ГуÑтемала gt +Gwatemala gt +ਗà©à¨†à¨Ÿà©‡à¨®à¨¾à¨²à¨¾ gt +Gwatemala gt +Гватемала gt +Gwatemala gt +Gvatemala gt +Гватемала gt +Gvatemala gt +I-Guatemala gt +கà¯à®µà®¾à®¤à¯à®¤à®®à®¾à®²à®¾ gt +Гватемоло gt +à¸à¸±à¸§à¹€à¸•มาลา gt +Гватемала gt +Гватемала gt +Gwatemala gt +å±åœ°é©¬æ‹‰ gt +瓜地馬拉 gt +Guam gu +غوام gu +Гуам gu +Гуам gu +গà§à§Ÿà¦¾à¦® gu +Gwam gu +Gw?m gu +Γκουάμ gu +Gvamo gu +گوام gu +גו×× gu +गà¥à¤µà¤¾à¤® gu +Gvam gu +グァム gu +ហ្គាំម gu +ê´Œ gu +à»àºàº¡àº¡àº² gu +Guama gu +Гвам gu +Гуам gu +Gwam gu +ਗà©à¨†à¨® gu +Гуам gu +Gwamu gu +Гуам gu +காம௠gu +Гуамма gu +à¸à¸§à¸¡ gu +Гуам gu +Гуам gu +Gwam gu +关岛 gu +關島 gu +Guinea-Bissau gw +غينيا-بيساو gw +ГвінÑÑ-БіÑаў gw +Ð“Ð²Ð¸Ð½ÐµÑ Ð‘Ð¸Ñау gw +গিনি-বিসো gw +Gine-Biso gw +Gvineja-Bisau gw +Gini-Bisaw gw +Γουινέα-Μπισσάου gw +Gvineo BisaÅ­a gw +Ginea-Bissau gw +گینه بیسائو gw +Guinée-Bissau gw +Guine-Bhissau gw +×’×™× ××” ביס×ו gw +गà¥à¤à¤¨à¤¾-बिसाऊ gw +Bissau-Guinea gw +Gínea-Bissá gw +ギニアビサオ gw +ហ្គីណáŸáž”៊ីសៅ gw +기니비사 gw +ລັດເຊີຠgw +Gvineja-Bisava gw +Гвинеја БиÑао gw +Гуйнеа-БиÑÑау gw +Ginea-Bissaw gw +ਗà©à¨‡à¨¨à¨¿à¨†-ਬਿਸ਼ਾਉ gw +Gwinea-Bissau gw +Guiné Bissau gw +Guiné-Bissau gw +ГвинеÑ-БиÑау gw +Gineya-Bisawu gw +Гвинеја БиÑао gw +Gvineja Bisao gw +கà¯à®¯à¯à®©à®¿à®¯à®¾-பிஸà¯à®¸à®¾ gw +Гвинеи БиÑÑои gw +à¸à¸´à¸™à¸µ - บิสซอ gw +Gine-Bissau gw +ГвінеÑ-БіÑау gw +ГвинеÑ-БиÑÑау gw +Guinêye-Bissaw gw +å‡ å†…äºšæ¯”ç» gw +幾內亞比紹 gw +Guyana gy +غيانا gy +ГвіÑна gy +Гуайана gy +গায়ানা gy +Gwiana gy +Gvajana gy +Giana gy +Γουιάνα gy +Gujano gy +گویان gy +Guyane gy +An Ghuáin gy +Guiana gy +גוי×× ×” gy +गà¥à¤¯à¤¾à¤¨à¤¾ gy +Gvæjana gy +ガイアナ gy +ហ្គីយ៉ាណា gy +ê°€ì´ì•„나 gy +ຈີນ gy +Gviana gy +Gajana gy +Гвајана gy +ГуÑна gy +Gujana gy +ਗà©à¨†à¨¨à¨¾ gy +Gujana gy +Guiana gy +Guiana gy +Guiana gy +Гайана gy +Giyana gy +Gvajana gy +Гвајана gy +Gvajana gy +கானா gy +Гуана gy +à¸à¸¹à¸¢à¸²à¸™à¹ˆà¸² gy +Guana gy +ГайÑна gy +Гвиана gy +圭亚那 gy +è“‹äºžç´ gy +Hong Kong SAR(China) hk +Hong Kong SAR (China) hk +Хонг Конг (Китай) hk +হং কং SAR(চীন) hk +Hong Kong SAR(Sina) hk +Hong Kong SAR(Xina) hk +Hong Kong SAR (Čína) hk +Hongkong SAR(Kina) hk +Χονγκ Κονγκ SAR (Κίνα) hk +Hongkong hk +Hong Kong SAR(Txina) hk +Hong Kong SAR (Kiina) hk +Hong Kong SAR (Chine) hk +Hong Cong SAR(An tSín) hk +Hong Kong hk +הונג קונג SAR (סין) hk +Hongkong (Kína) hk +Hong Kong (sjálfstjórnarhérað í Kína) hk +Hong Kong SAR(Cina) hk +香港(中国) hk +ហុងចិន (áž…áž·áž“) hk +Hong Kongas SAR(Kinija) hk +Хонг Конг СÐР(Кина) hk +Hongkong SAR(Kina) hk +Hong Kong hk +Hongkong SAR(Kina) hk +ਹਾਂਗ-ਕਾਂਗ SAR(ਚੀਨ) hk +Hong Kong SAR (Chiny) hk +Hong Kong SAR (China) hk +Гонконг hk +Hong Kong SAR (Ubushinwa) hk +Hongkong SAR(Kiinná) hk +Hong Kong SAR (Kitajska) hk +SAR Hong Kong (Кина) hk +SAR Hong Kong (Kina) hk +Hong Kong (Kina) hk +ஹாஙà¯à®•ாங௠SAR(சீனா) hk +ฮ่องà¸à¸‡ hk +Hong Kong (Çin) hk +Гонконг SAR (Китай) hk +Гонконг (Хитой) hk +中国香港特别行政区 hk +香港 SAR(中國) hk +Honduras hn +هندوراس hn +Ð“Ð°Ð½Ð´ÑƒÑ€Ð°Ñ hn +Ð¥Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn +হণà§à¦¡à§à¦°à¦¾à¦¸ hn +Hondures hn +Hondwras hn +ΟνδοÏÏα hn +Honduro hn +هندوراس hn +Hondúras hn +הונדורס hn +होंडà¥à¤°à¤¾à¤¸ hn +Hondúras hn +ホンジュラス hn +ហុងឌូរ៉ាស់ hn +온ë‘ë¼ìФ hn +ຫອນດູລັດ hn +HondÅ«ras hn +Hondurasa hn +Ð¥Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn +Ð¥Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn +Ħonduras hn +Hondures hn +ਹੰਨਡੂਰਸ hn +Ð“Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn +Hondirasi hn +Ð¥Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn +I-Honduras hn +ஆணà¯à®Ÿà¯à®°à®¾à®¸à¯ hn +Ò²Ð¸Ð½Ð´ÑƒÑ€Ð¾Ñ hn +ฮอนดูรัส hn +Ð“Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn +Ð“Ð¾Ð½Ð´ÑƒÑ€Ð°Ñ hn +洪都拉斯 hn +å®éƒ½æ‹‰æ–¯ hn +Croatia hr +Kroasië hr +كرواتيا hr +Xırvatıstan hr +Ð¥Ð°Ñ€Ð²Ð°Ñ‚Ñ‹Ñ hr +ХърватÑка hr +কà§à¦°à§‹à§Ÿà¦¾à¦¶à¦¿à§Ÿà¦¾ hr +Kroatia hr +Hrvatska hr +Croàcia hr +Chorvatsko hr +Kroatien hr +Kroatien hr +ΚÏοατία hr +Kroatio hr +Croacia hr +Horvaatia hr +Kroazia hr +کرواسی hr +Kroatia hr +Kroatia hr +Croatie hr +Kroatië hr +An Chróit hr +Croácia hr +קרו×טיה hr +कà¥à¤°à¥‹à¤à¤¶à¤¿à¤¯à¤¾ hr +Hrvatska hr +Horvátország hr +Kroasia hr +Króatía hr +Croazia hr +クロアãƒã‚¢ hr +ក្រូអាហhr +í¬ë¡œì•„í‹°ì•„ hr +ໂຄເອເທີຠhr +Kroatija hr +HorvÄtija hr +ХрватÑка hr +Кроати hr +Kroazja hr +Kroatia hr +Kroatien hr +Kroatië hr +Kroatia hr +Croacia hr +ਕਰੋਆਟਿਆ hr +Chorwacja hr +Croácia hr +Croácia hr +CroaÅ£ia hr +Ð¥Ð¾Ñ€Ð²Ð°Ñ‚Ð¸Ñ hr +Korowasiya hr +Kroátia hr +Chorvátsko hr +HrvaÅ¡ka hr +ХрватÑка hr +Hrvatska hr +I-Croatia hr +Kroatien hr +கà¯à®°à¯‹à®Ÿà®¿à®¯à®¾ hr +Хорватӣ hr +โครเอเธีย hr +Hırvatistan hr +Kroatia hr +Ð¥Ð¾Ñ€Ð²Ð°Ñ‚Ñ–Ñ hr +Ð¥Ð¾Ñ€Ð²Ð°Ñ‚Ð¸Ñ hr +CrowÃ¥ceye hr +克罗地亚 hr +克羅埃西亞 hr +Haiti ht +Haïti ht +هايتي ht +Гаіці ht +Хаити ht +হাইতি ht +Haití ht +Αϊτή ht +Haitio ht +Haití ht +هاییتی ht +Haïti ht +Háítí ht +×”×יטי ht +हैती ht +Haítí ht +ãƒã‚¤ãƒ ht +ហែទី ht +ì•„ì´í‹° ht +ວາດຮູບ - K ht +Haitis ht +Хаити ht +Хайти ht +Ħaiti ht +ਹਾਇਟੀ ht +Гаити ht +Hayiti ht +Хаити ht +ஹைதி ht +Ҳаити ht +ไฮติ ht +Гаїті ht +Гаити ht +Hayiti ht +海地 ht +海地 ht +Hungary hu +Hongarye hu +هنغاريا hu +Macarıstan hu +Вугоршчына hu +Ð£Ð½Ð³Ð°Ñ€Ð¸Ñ hu +হাঙà§à¦—েরী hu +Hungaria hu +MaÄ‘arska hu +Hongria hu +MaÄarsko hu +Hwngari hu +Ungarn hu +Ungarn hu +ΟυγγαÏία hu +Hungario hu +Hungría hu +Ungari hu +Hungaria hu +مجارستان hu +Unkari hu +Ungarn hu +Hongrie hu +Hongarije hu +An Ungáir hu +Hungria hu +הונגריה hu +हंगरी hu +MaÄ‘jarska hu +Magyarország hu +Hungaria hu +Ungverjaland hu +Ungheria hu +ãƒãƒ³ã‚¬ãƒªãƒ¼ hu +ហុងគ្រី hu +í—가리 hu +ຫັງàºàº²àº¥àºµ hu +Vengrija hu +UngÄrija hu +Унгарија hu +Унгар hu +Ungerija hu +Ungarn hu +Ungarn hu +Hongarije hu +Ungarn hu +Hongria hu +ਹੰਗਰੀ hu +WÄ™gry hu +Hungria hu +Hungria hu +Ungaria hu +Ð’ÐµÐ½Ð³Ñ€Ð¸Ñ hu +Hongiriya hu +Ungár hu +MaÄarsko hu +Madžarska hu +МађарÑка hu +MaÄ‘arska hu +I-Hungary hu +Ungern hu +ஹஙà¯à®•ேரி hu +МаҷориÑтон hu +ฮังà¸à¸²à¸£à¸µ hu +Macaristan hu +Macarstan hu +Угорщина hu +Ð’ÐµÐ½Ð³Ñ€Ð¸Ñ hu +Hongreye hu +匈牙利 hu +匈牙利 hu +Indonesia id +Indonesië id +إندونيسيا id +İndoneziya id +ІнданÑÐ·Ñ–Ñ id +Ð˜Ð½Ð´Ð¾Ð½ÐµÐ·Ð¸Ñ id +ইনà§à¦¦à§‹à¦¨à§‡à¦¶à¦¿à§Ÿà¦¾ id +Indonezi id +Indonezija id +Indonèsia id +Indonésie id +Indonesien id +Indonesien id +Ινδονησία id +Indonezio id +Indoneesia id +اندونزی id +Indonésie id +Indonesië id +An Indinéis id +Indonésia id +×ינדונזיה id +इंडोनेशिया id +Indonezija id +Indonézia id +Indónesía id +インドãƒã‚·ã‚¢ id +ឥណ្ឌូនáŸážŸáŸŠáž¸ id +ì¸ë„네시아 id +ອີàºà»‚ດນີເຊີຠid +Indonezija id +IndonÄ“zija id +Индонезија id +Индонез id +Indoneżja id +Indonesien id +Indonesië id +ਇੰਡੋਨੇਸ਼ੀਆ id +Indonezja id +Indonésia id +Indonésia id +Indonezia id +Ð˜Ð½Ð´Ð¾Ð½ÐµÐ·Ð¸Ñ id +Indonesiya id +Indonézia id +Indonezija id +Индонезија id +Indonezija id +I-Indonesia id +Indonesien id +இநà¯à®¤à¯‹à®©à¯€à®šà®¿à®¯à®¾ id +Индонезӣ id +อินโดนีเซีย id +İndonezya id +İndonesia id +Ð†Ð½Ð´Ð¾Ð½ÐµÐ·Ñ–Ñ id +Ð˜Ð½Ð´Ð¾Ð½ÐµÐ·Ð¸Ñ id +Indonezeye id +å°åº¦å°¼è¥¿äºš id +å°å°¼ id +Ireland ie +Ierland ie +أيرلندا ie +İrlandiya ie +ІрлÑÐ½Ð´Ñ‹Ñ ie +Ð˜Ñ€Ð»Ð°Ð½Ð´Ð¸Ñ ie +আয়ারলà§à¦¯à¦¾à¦£à§à¦¡ ie +Iwerzhon ie +Irska ie +Irlanda ie +Irsko ie +Iwerddon ie +Irland ie +Irland ie +ΙÏλανδία ie +Islando ie +Irlanda ie +Iirimaa ie +Irlanda ie +ایرلند ie +Irlanti ie +Ãrland ie +Irlande ie +Ierlân ie +Éire ie +Irlanda ie +×ירלנד ie +आयरलैंड ie +Irska ie +Ãrország ie +Irlandia ie +Ãrland ie +Irlanda ie +アイルランド ie +អៀរឡង់ ie +ì•„ì¼ëžœë“œ ie +ໄອà»àº¥àº™ ie +Airija ie +Īrija ie +ИрÑка ie +Ирланд ie +Irlanda ie +Irland ie +Irland ie +Ierland ie +Irland ie +Irlanda ie +ਆਇਰਲੈਂਡ ie +Irlandia ie +Irlanda ie +Irlanda ie +Irlanda ie +Ð˜Ñ€Ð»Ð°Ð½Ð´Ð¸Ñ ie +Irilande ie +Irlánda ie +Ãrsko ie +Irska ie +ИрÑка ie +Irska ie +I-Ireland ie +Irland ie +அயரà¯à®²à®¾à®¨à¯à®¤à¯ ie +Ирлонд ie +ไอร์à¹à¸¥à¸™à¸”์ ie +İrlanda ie +İreland, İrlandia ie +Ð†Ñ€Ð»Ð°Ð½Ð´Ñ–Ñ ie +Ð˜Ñ€Ð»Ð°Ð½Ð´Ð¸Ñ ie +Irlande ie +伊朗 ie +愛爾蘭 ie +Israel il +اسرائيل il +İzrail il +Ізраіль il +Израел il +ইসরাইল il +Izrael il +Izrael il +ΙσÏαήλ il +Israelo il +Iisrael il +اسراییل il +Ãsrael il +Israël il +Iosrael il +ישר×ל il +इज़राइल il +Izrael il +Izrael il +Ãsrael il +Israele il +イスラエル il +អ៊ីស្រាអែល il +ì´ìФë¼ì—˜ il +ອິດສະລະເອລ il +Izraelis il +IzraÄ“la il +Израел il +Изриал il +Iżrael il +ਇਜ਼ਰਾਈਲ il +Izrael il +Израиль il +Isirayeli il +Izrael il +Izrael il +Израел il +Izrael il +I-Israel il +இசà¯à®°à¯‡à®²à¯ il +ИÑроил il +อิสราเอล il +İsrail il +İsrael il +Ізраїль il +ИÑроил il +Israyel il +USirayeli il +以色列 il +以色列 il +India in +Indië in +الهند in +Hindistan in +Ð†Ð½Ð´Ñ‹Ñ in +Ð˜Ð½Ð´Ð¸Ñ in +ভারত in +Indez in +Indija in +Ãndia in +Indie in +Indien in +Indien in +Ινδία in +Hindujo in +هندوستان in +Intia in +Inde in +An India in +Ãndia in +הודו in +भारत in +Indija in +Indland in +インド in +ឥណ្ឌា in +ì¸ë„ in +ອິນເດີຠin +Indija in +Indija in +Индија in +ЭнÑтхÑг in +Indja in +Indien in +ਭਾਰਤ in +Indie in +Ãndia in +Ãndia in +Ð˜Ð½Ð´Ð¸Ñ in +Ubuhinde in +Indija in +Индија in +Indija in +I-India in +Indien in +இநà¯à®¤à®¿à®¯à®¾ in +ҲиндуÑтон in +อินเดีย in +Hindistan in +Hindstan in +Ð†Ð½Ð´Ñ–Ñ in +ҲиндиÑтон in +Ấn Äá»™ in +Inde in +å°åº¦ in +å°åº¦ in +Endiya in +Iraq iq +Irak iq +العراق iq +İraq iq +Ірак iq +Ирак iq +ইরাক iq +Irak iq +Irak iq +Irák iq +Irac iq +Irak iq +Irak iq +ΙÏάκ iq +Irako iq +Irak iq +Iraak iq +Irak iq +عراق iq +Irak iq +Irak iq +Irak iq +Irak iq +An Iaráic iq +עיר××§ iq +इराक iq +Irak iq +Irak iq +Ãrak iq +イラク iq +អ៊ីរ៉ាក់ iq +ì´ë¼í¬ iq +ອີລັຠiq +Irakas iq +IrÄka iq +Ирак iq +Ирак iq +Irak iq +Irak iq +Irak iq +Irak iq +ਇਰਾਕ iq +Irak iq +Iraque iq +Iraque iq +Irak iq +Ирак iq +Iraki iq +Iráka iq +Irák iq +Irak iq +Ирак iq +Irak iq +I-Iraq iq +Irak iq +ஈராக௠iq +Ироқ iq +อิรัภiq +Irak iq +Ğíraq iq +Ірак iq +Ироқ iq +Irak iq +伊拉克 iq +伊拉克 iq +Iran ir +أيران ir +Іран ir +Иран ir +ইরান ir +Ãrán ir +ΙÏάν ir +Irano ir +Iraan ir +ایران ir +An Iaráin ir +Irán ir +×יר×ן ir +इरान ir +Irán ir +Ãran ir +イラン ir +អ៊ីរ៉ង់ ir +ì´ëž€ ir +ອີລັຠir +Iranas ir +IrÄna ir +Иран ir +Иран ir +ਈਰਾਨ ir +Irão ir +Irã ir +Иран ir +Irani ir +Irána ir +Irán ir +Иран ir +I-Iran ir +ஈரான௠ir +Эрон ir +อิหร่าน ir +İran ir +İran ir +Іран ir +Эрон ir +伊朗 ir +伊朗 ir +Iceland is +Ysland is +أيسلندا is +İslandiya is +ІÑьлÑÐ½Ð´Ñ‹Ñ is +ИÑÐ»Ð°Ð½Ð´Ð¸Ñ is +আইসলà§à¦¯à¦¾à¦£à§à¦¡ is +Island is +Island is +Islàndia is +Island is +Ynys yr I? is +Island is +Island is +Ισλανδία is +Islando is +Islandia is +Island is +Islandia is +ایسلند is +Islanti is +Ãsland is +Islande is +Yslân is +An Ãoslainn is +Islándia is +×יסלנד is +आयरलैंड is +Island is +Izland is +Islandia is +Ãsland is +Islanda is +アイスランド is +អ៊ីស្លង់ is +ì•„ì´ìŠ¬ëž€ë“œ is +ໄອຊà»àº¥àº™ is +Islandija is +Islande is +ИÑланд is +ИÑланд is +Islandja is +Island is +Island is +IJsland is +Island is +Islandia is +ਆਈਸਲੈਂਡ is +Islandia is +Islândia is +Islândia is +Islanda is +ИÑÐ»Ð°Ð½Ð´Ð¸Ñ is +Isilande is +Islánda is +Island is +Islandija is +ИÑланд is +Island is +I-Iceland is +Island is +தீவ௠is +ИÑлонд is +ไอซ์à¹à¸¥à¸™à¸”์ is +İzlanda is +İsland is +ІÑÐ»Ð°Ð½Ð´Ñ–Ñ is +ИÑÐ»Ð°Ð½Ð´Ð¸Ñ is +Izlande is +冰岛 is +冰島 is +Icelandi is +Italy it +Italië it +ايطاليا it +İtalyia it +Ð†Ñ‚Ð°Ð»Ñ–Ñ it +Ð˜Ñ‚Ð°Ð»Ð¸Ñ it +ইতালী it +Italia it +Italija it +Itàlia it +Itálie it +Yr Eidal it +Italien it +Italien it +Ιταλία it +Italio it +Italia it +Itaalia it +Italia it +ایتالیا it +Italia it +Italia it +Italie it +Italië it +An Iodáil it +Itália it +×יטליה it +इटली it +Italija it +Olaszország it +Italia it +Ãtalía it +Italia it +イタリア it +អ៊ីážáž¶áž›áž¸ it +ì´íƒˆë¦¬ì•„ it +ອີຕາລີ it +Italija it +ItÄlija it +Италија it +Итали it +Itali it +Italja it +Italia it +Italien it +Italië it +Italia it +Italia it +ਇਟਲੀ it +WÅ‚ochy it +Itália it +Itália it +Italia it +Ð˜Ñ‚Ð°Ð»Ð¸Ñ it +Ubutaliyani it +Itália it +Taliansko it +Italija it +Италија it +Italija it +I-Italy it +Italien it +இதà¯à®¤à®¾à®²à®¿ it +Итолиё it +อิตาลี it +İtalya it +İtalia it +Ð†Ñ‚Ð°Ð»Ñ–Ñ it +Ð˜Ñ‚Ð°Ð»Ð¸Ñ it +à it +ItÃ¥leye it +Ithali it +æ„大利 it +義大利 it +Jamaica jm +Jamaika jm +جامايكا jm +Yamayka jm +Ямайка jm +Ямайка jm +জামাইকা jm +Jamaika jm +Jamajka jm +Jamajka jm +Jamaika jm +Τζαμάικα jm +Jamajko jm +Jamaika jm +جاماییکا jm +Jamaika jm +Jamaïque jm +An Iamáice jm +Xamaica jm +×’'מייקה jm +जमैका jm +Jamajka jm +Jamaika jm +Jamaika jm +Jamaíka jm +Giamaica jm +ジャマイカ jm +ហ្សាម៉ាអ៊ិគ jm +ìžë©”ì´ì¹´ jm +ຈາໄມàºàº² jm +Jamaika jm +Jamaika jm +Јамајка jm +Ямайк jm +Ä amajka jm +Jamaika jm +ਜੈਮੇਕਾ jm +Jamajka jm +Ямайка jm +Jamayika jm +Jamajka jm +Jamajka jm +Јамајка jm +Jamajka jm +I-Jamaica jm +சமெயà¯à®•à¯à®•ா jm +Ҷомойко jm +จาไมà¸à¹‰à¸² jm +Jamaika jm +Jamayka jm +Ямайка jm +Ямайка jm +Djamayike jm +牙买加 jm +牙買加 jm +Jordan jo +Jordaan jo +الأردن jo +İordaniya jo +Ð¯Ñ€Ð´Ð°Ð½Ñ–Ñ jo +Ð™Ð¾Ñ€Ð´Ð°Ð½Ð¸Ñ jo +জরà§à¦¡à¦¾à¦¨ jo +Jordani jo +Jordània jo +Jordán jo +Gwlad Iorddonen jo +Jordanien jo +ΙοÏδανία jo +Jordanio jo +Jordania jo +Jordaania jo +Jordania jo +اردن jo +Jordania jo +Jordanie jo +Jordanië jo +An Iordáin jo +Xordánia jo +ירדן jo +जॉरà¥à¤¡à¤¨ jo +Jordánia jo +Jórdanía jo +Giordania jo +ヨルダン jo +ហ្ស៊កដានី jo +요르단 jo +ຈà»à»àº”ນ jo +Jordanija jo +JordÄnija jo +Јордан jo +Ðрдан jo +Ä ordan jo +Jordanien jo +Jordanië jo +ਜਾਰਡਨ jo +Jordania jo +Jordânia jo +Jordânia jo +Iordania jo +Ð˜Ð¾Ñ€Ð´Ð°Ð½Ð¸Ñ jo +Yorudani jo +Jordánia jo +Jordánsko jo +Jordanija jo +Јордан jo +I-Jordan jo +Jordanien jo +ஜோரà¯à®Ÿà®¾à®©à¯ jo +Урдон jo +จอร์à¹à¸”น jo +Ürdün jo +Ð™Ð¾Ñ€Ð´Ð°Ð½Ñ–Ñ jo +Иордан jo +Djordaneye jo +约旦 jo +ç´„æ—¦ jo +Ijolidani jo +Japan jp +اليابان jp +Yaponiya jp +Ð¯Ð¿Ð¾Ð½Ñ–Ñ jp +Ð¯Ð¿Ð¾Ð½Ð¸Ñ jp +জাপান jp +Japon jp +Japó jp +Japonsko jp +Siapan jp +Ιαπωνία jp +Japanio jp +Japón jp +Jaapan jp +Japonia jp +ژاپن jp +Japani jp +Japon jp +An tSeapáin jp +Xapón jp +יפן jp +जापान jp +Japán jp +Jepang jp +Giappone jp +日本 jp +ជប៉ុន jp +ì¼ë³¸ jp +àºàºµà»ˆàº›àº¸à»ˆàº™ jp +Japonija jp +JapÄna jp +Јапонија jp +Япон jp +Jepun jp +Ä appun jp +Japon jp +ਜਾਪਾਨ jp +Japonia jp +Japão jp +Japão jp +Japonia jp +Ð¯Ð¿Ð¾Ð½Ð¸Ñ jp +Ubuyapani jp +Japána jp +Japonsko jp +Japonska jp +Јапан jp +I-Japan jp +சபà¯à®ªà®¾à®©à¯ jp +Ҷопон jp +à¸à¸µà¹ˆà¸›à¹ˆà¸¸à¸™ jp +Japonya jp +Japan, Yaponia jp +Ð¯Ð¿Ð¾Ð½Ñ–Ñ jp +Ð¯Ð¿Ð¾Ð½Ð¸Ñ jp +Nhật bản jp +Djapon jp +日本 jp +日本 jp +Kenya ke +Kenië ke +كينيا ke +ÐšÐµÐ½Ñ–Ñ ke +ÐšÐµÐ½Ð¸Ñ ke +কেনিয়া ke +Kenija ke +Keňa ke +Cenia ke +Kenia ke +Κένυα ke +Kenjo ke +Kenia ke +کنیا ke +Kenia ke +An Chéinia ke +Kenia ke +×§× ×™×” ke +केनà¥à¤¯à¤¾ ke +Kenija ke +Kenía ke +ケニア ke +កáŸáž“យ៉ា ke +ì¼€ëƒ ke +ເວນດາ ke +Kenija ke +Kenija ke +Кенија ke +ÐšÐµÐ½Ð¸Ñ ke +Kenja ke +Kenia ke +ਕੀਨੀਆ ke +Kenia ke +Quénia ke +Quênia ke +Kenia ke +ÐšÐµÐ½Ð¸Ñ ke +Keňa ke +Kenija ke +Кенија ke +Kenija ke +கெனà¯à®¯à®¾ ke +Куниё ke +เคนยา ke +Kenia ke +ÐšÐµÐ½Ñ–Ñ ke +ÐšÐµÐ½Ð¸Ñ ke +Kenia ke +肯尼亚 ke +肯亞 ke +Kyrgyzstan kg +قيرغيزستان kg +КыргызÑтан kg +КиргизÑтан kg +কিরà§à¦—িজসà§à¦¤à¦¾à¦¨ kg +Kirgistan kg +Kirgistan kg +Kyrgigstan kg +Kyrgyzstán kg +Cyrgystan kg +Kirgizistan kg +Kirgisien kg +ΚιÏγιζιστάν kg +Kirgizujo kg +Kyrgyzstán kg +Kõrgõzstan kg +قرقیزستان kg +Kirghizstan kg +An Chirgeastáin kg +Kirguizistán kg +קירגיסטן kg +किरà¥à¤—िजिसà¥à¤¤à¤¾à¤¨ kg +Kirgizisztán kg +Kirgisistan kg +Kirghizistan kg +キルギスタン kg +គៀរហ្គីស្ážáž„់ kg +키르기스스탄 kg +ຄສິຕັລ kg +Kirgistanas kg +KirgizstÄna kg +КиргиÑтан kg +КиргизÑтан kg +Kirgiżstan kg +Kirgisistan kg +Kirgisien kg +Kirgizië kg +Kirgisistan kg +ਕਿਰਗਸਤਾਨ kg +Kigistan kg +Quirguistão kg +Quirguistão kg +Kirgiztan kg +КиргизÑтан kg +Kirigizisitani kg +Kirgisistan kg +Kirgizstan kg +КиргиÑтан kg +Kirgistan kg +Kirgizistan kg +கிரà¯à®•ிஸà¯à®¤à®¾à®©à¯ kg +ҚирғизиÑтон kg +คีจิสถาน kg +Kırgızistan kg +Qırğızstan kg +КиргизÑтан kg +ҚирғизиÑтон kg +Kirguiztan kg +å‰å°”剿–¯æ–¯å¦ kg +å‰çˆ¾å‰æ–¯ kg +Cambodia kh +Kambodië kh +كمبوديا kh +Камбоджа kh +Камбоджа kh +কামবোডিয়া kh +Kambodj kh +KamboÄ‘a kh +Cambodja kh +Kambodža kh +Kambodscha kh +Καμπότζη kh +KamboÄo kh +Kambodža kh +Canbodia kh +کامبوج kh +Kambodza kh +Cambodge kh +Cambodja kh +An Chambóid kh +Camboia kh +קמבודיה kh +कमà¥à¤¬à¥‹à¤¡à¤¿à¤¯à¤¾ kh +KamboÄ‘a kh +Kambodzsa kh +Kambódía kh +Cambogia kh +カンボジア kh +កម្ពុជា kh +캄보디아 kh +ໂຄລຳເບີຠkh +Kambodža kh +Kambodža kh +Камбоџа kh +Камбодиа kh +Kemboja kh +Kambodja kh +Kambodsja kh +Kambodscha kh +Cambodja kh +Kambodsja kh +ਕੰਬੋਡੀਆ kh +Kambodża kh +Cambodja kh +Cambodja kh +Cambogia kh +Камбоджа kh +Kamboji kh +Kamboža kh +Kambodža kh +Kambodža kh +Камбоџа kh +Kambodža kh +Kambodja kh +கமà¯à®ªà¯‹à®Ÿà®¿à®¯à®¾ kh +Камбуҷа kh +à¸à¸±à¸¡à¸žà¸¹à¸Šà¸² kh +Kamboçya kh +Kambodia kh +Камбоджа kh +Камбоджа kh +Cam pu chia kh +Cambodje kh +柬埔寨 kh +柬埔寨 kh +Kiribati ki +كيريباتي ki +Кiрыбацi ki +Кирибати ki +কিরিবাটি ki +Ciribati ki +ΚιÏιμπάτι ki +Kiribato ki +کیریباتی ki +Ciribeas ki +קיריב×טי ki +किरीबाती ki +Kíribatí ki +キリãƒã‚¹ ki +គិរិបាទី ki +키리바시 ki +à»àºŸàº„ທັລ - K ki +Кирибати ki +Крибати ki +ਕਿਰਿਬਟੀ ki +Кирибати ki +Кирибати ki +கிரிபடி ki +Карибот ki +คิริบาติ ki +Кірібаті ki +Кирибати ki +基里巴斯 ki +å‰é‡Œå·´æ–¯ ki +Comoros km +جزر القمر km +Каморы km +КоморÑки оÑтрови km +কমোরস km +Komoros km +Komori km +Komory km +Ynysoedd Y Comoros km +Comorerne km +Komoren km +ΚομόÏες km +Komoroj km +Komoorid km +کوموروس km +Komorit km +Comores km +Na Comóir km +קומורוס km +कोमोरो km +Kómoreyjar km +Comore km +コモロ km +កុំម៉ូរ៉ូស km +코모로 km +ສີ km +Komoru salas km +КоморÑки оÑтрови km +Ð¡Ð¾Ð¼Ð¾Ñ€Ð¾Ñ km +Komoros km +Komorene km +Komoren km +Komorane km +ਕੋਮੋਰੋਸ km +Komory km +КоморÑкие оÑтрова km +Komore km +Komorot km +Komori km +Комора km +Komora km +Komorerna km +காமாரோஸ௠km +ÐšÐ¾Ð¼Ð¾Ñ€Ð¾Ñ km +โคโมรอส km +Komoros km +Komorlar km +КоморÑькі оÑтрови km +ÐšÐ¾Ð¼Ð¾Ñ€Ð¾Ñ km +Comores km +ç§‘æ‘©ç½— km +葛摩 km +St. Kitts and Nevis kn +St. Kitts en Nevis kn +سانت كيتس Ùˆ نيÙيس kn +St. Kitts vÉ™ Nevis kn +СÑнт-КрыÑтофер Ñ– ÐÑÐ²Ñ–Ñ kn +Св. ÐšÐ¸Ñ‚Ñ Ð¸ ÐÐµÐ²Ð¸Ñ kn +সেনà§à¦Ÿ কিটস à¦à¦¬à¦‚ নেভিস kn +S. Kitts ha Nevis kn +St. Kitts i Nevis kn +Sv. Kitts a Nevis kn +Ynysoedd St. Kitts a Nevis kn +St. Kitts-Nevis kn +St. Kitts und Nevis kn +Άγιος ΧÏιστόφοÏος (Σαιντ Κιτς) και Îέβις kn +Sent-Kristofo kaj Neviso kn +St. Kitts y Nevis kn +St. Kitts ja Nevis kn +St. Kitts eta Nevis kn +سن کیتس Ùˆ نویس kn +St. Kitts ja Nevis kn +St Kitts et Nevis kn +St. Kitts en Nevis kn +San Críostóir Nimheas kn +Saint Kitts e Nevis kn +סנט קיטס ונביס kn +सेंट किटà¥à¤¸ तथा नेविस kn +St. Kitts és Nevis kn +St. Kitts dan Nevis kn +Sankti Kristófer og Nevis kn +Saint Kitts e Nevis kn +セントクリストファーãƒã‚¤ãƒ“ス kn +សង់ឃីហនិង áž“áŸážœáž¸ážŸ kn +세ì¸íЏ 키츠 네비스 kn +Å v. Kitts ir Nevis kn +Senkitsa un Nevisa kn +Св. ÐšÐ¸Ñ‚Ñ Ð¸ ÐÐµÐ²Ð¸Ñ kn +St. ÐšÐ¸Ñ‚Ñ‚Ñ Ð±Ð° ÐÐµÐ²Ð¸Ñ kn +St. Kitts u Nevis kn +St. Kitts og Nevis kn +St. Kitts un Nevis kn +St. Kitts en Nevis kn +St. Kitts og Nevis kn +St. Kitts le Nevis kn +St. Kitts e Nevis kn +ਸੇਂਟ ਕਿਟਸ ਤੇ ਨਿਵੀਸ kn +St. Kitts e Nevis kn +St Kitts e Nevis kn +Sf. Kitts ÅŸi Nevis kn +Сент-ÐšÐ¸Ñ‚Ñ Ð¸ ÐÐµÐ²Ð¸Ñ kn +Mutagatifu Kitsi na Nevisi kn +St. Kitts ja Nevis kn +St. Kitts a Nevis kn +St. Kitts in Nevis kn +Св. ÐšÐ¸Ñ‚Ñ Ð¸ ÐÐµÐ²Ð¸Ñ kn +Sv. Kits i Nevis kn +I-St. Kitts and Nevis kn +St. Kitts och Nevis kn +செயினà¯à®Ÿà¯ கிடà¯à®šà¯ & நெவிச௠kn +Синт ÐšÐ¸Ñ‚Ñ‚Ñ Ð²Ð° ÐÐµÐ²Ð¸Ñ kn +เซนต์à¸à¸´à¸•ส์à¹à¸¥à¸°à¹€à¸™à¸§à¸´à¸ª kn +St. Kitts ve Nevis kn +Santa Kitts wä Nevis kn +Ð¤ÐµÐ´ÐµÑ€Ð°Ñ†Ñ–Ñ Ð¡ÐµÐ½Ñ‚-ÐšÑ–Ñ‚Ñ Ñ– ÐÐµÐ²Ñ–Ñ kn +Сент-КриÑтофер ва ÐÐµÐ²Ð¸Ñ kn +St. Kitts na Nevis kn +St. Kitts và Nevis kn +St. Kitts neNevis kn +圣基茨和尼维斯 kn +è–å…‹ç†æ–¯å¤šç¦åŠå°¼ç¶­æ–¯ kn +St. Kitts kanye no-Nevis kn +North Korea kp +Noord Korea kp +كوريا الشمالية kp +Åžimali Koreya kp +ÐŸÐ°ÑžÐ½Ð¾Ñ‡Ð½Ð°Ñ ÐšÐ°Ñ€ÑÑ kp +Северна ÐšÐ¾Ñ€ÐµÑ kp +উতà§à¦¤à¦° কোরিয়া kp +Norzh-Korea kp +Sjeverna Koreja kp +Corea del Nord kp +Severní Korea kp +Gogledd Corea kp +Nordkorea kp +Nord-Korea kp +Î’ÏŒÏεια ΚοÏέα kp +Nordkoreo kp +Corea del Norte kp +Põhja-Korea kp +Ipar Korea kp +کره شمالی kp +Pohjois-Korea kp +Norðurkorea kp +Corée du nord kp +Noard-Korea kp +An Chóiré Thuaidh kp +Corea do Norte kp +צפון קורי××” kp +उतà¥à¤¤à¤°à¥€ कोरिया kp +Sjeverna Koreja kp +Észak-Korea kp +Korea Utara kp +Norður-Kórea kp +Corea del Nord kp +æœé®®æ°‘主主義人民共和国 kp +កូរ៉áŸâ€‹ážáž¶áž„​ជើង kp +ì¡°ì„ ë¯¼ì£¼ì£¼ì˜ ì¸ë¯¼ê³µí™”êµ­ kp +ເàºàº»àº²àº¥àºµà»€àº«àº™àº·àº­ kp +Å iaurÄ—s KorÄ—ja kp +ZiemeļKoreja kp +Северна Кореја kp +Хойд ÑÐ¾Ð»Ð¾Ð½Ð³Ð¾Ñ kp +Korea ta' Fuq kp +Nord-Korea kp +Noordkorea kp +Noord-Korea kp +Nord-Korea kp +Lebowa la Korea kp +Corea dèu Nord kp +ਉੱਤਰੀ ਕੋਰੀਆ kp +Korea Północna kp +Coreia do Norte kp +Coréia do Norte kp +Coreea de Nord kp +Ð¡ÐµÐ²ÐµÑ€Ð½Ð°Ñ ÐšÐ¾Ñ€ÐµÑ kp +Koreya y'Amajyaruguru kp +Davvi-Korea kp +severná Kórea kp +Severna Koreja kp +Северна Кореја kp +Severna Koreja kp +I-North Korea kp +Nordkorea kp +வட கொரியா kp +КореÑи Шимолӣ kp +เà¸à¸²à¸«à¸¥à¸µà¹€à¸«à¸™à¸·à¸­ kp +Kuzey Kore kp +Tönyaq Korea kp +Північна ÐšÐ¾Ñ€ÐµÑ kp +Шимолий ÐšÐ¾Ñ€ÐµÑ kp +Devhula ha Korea kp +Bắc Triá»u Tiên kp +Bijhe Corêye kp +Umntla Korea kp +æœé²œ kp +北韓 kp +Enyakatho ne-Korea kp +South Korea kr +Suid Korea kr +كوريا الجنوبية kr +CÉ™nubi Koreya kr +ÐŸÐ°ÑžÐ´Ð½Ñ‘Ð²Ð°Ñ ÐšÐ°Ñ€ÑÑ kr +Южна ÐšÐ¾Ñ€ÐµÑ kr +দকà§à¦·à¦¿à¦£ কোরিয়া kr +Su-Korea kr +Južna Koreja kr +Corea del Sud kr +Jižní Korea kr +De Corea kr +Sydkorea kr +Süd-Korea kr +Îότια ΚοÏέα kr +Sudkoreo kr +Corea del Sur kr +Lõuna-Korea kr +Hego Korea kr +کره جنوبی kr +Etelä-Korea kr +Suðurkorea kr +Corée du sud kr +Sûd-Korea kr +An Chóiré Theas kr +Corea do Sur kr +×“×¨×•× ×§×•×¨×™××” kr +दकà¥à¤·à¤¿à¤£à¥€ कोरिया kr +Južna Koreja kr +Dél-Korea kr +Korea Selatan kr +Suður-Kórea kr +Corea del Sud kr +大韓民国 kr +កូរ៉áŸâ€‹ážáž¶áž„​ážáŸ’បូង kr +대한민국 kr +ເàºàº»àº²àº¥àºµà»ƒàº•້ kr +Pietų KorÄ—ja kr +DievidKoreja kr +Јужна Кореја kr +Өмнөд ÑÐ¾Ð»Ð¾Ð½Ð³Ð¾Ñ kr +Korea t'Isfel kr +Sør-Korea kr +Söödkorea kr +Zuid-Korea kr +Sør-Korea kr +Borwa bja Korea kr +Corea dèu Sud kr +ਦੱਖਣੀ ਕੋਰੀਆ kr +Korea PoÅ‚udniowa kr +Coreia do Sul kr +Coréia do Sul kr +Coreea de Sud kr +Ð®Ð¶Ð½Ð°Ñ ÐšÐ¾Ñ€ÐµÑ kr +Koreya y'Amajyepfo kr +Lulli-Korea kr +Južná Kórea kr +Južna Koreja kr +Јужна Кореја kr +Južna Koreja kr +I-South Korea kr +Sydkorea kr +தென௠கொரியா kr +КореÑи Ҷанубӣ kr +เà¸à¸²à¸«à¸¥à¸µà¹ƒà¸•้ kr +Güney Kore kr +Könyaq Korea kr +Південна ÐšÐ¾Ñ€ÐµÑ kr +Жанубий ÐšÐ¾Ñ€ÐµÑ kr +Korea tshipembe kr +Hàn Quốc kr +Nonne Corêye kr +Umzantsi Korea kr +韩国 kr +å—韓 kr +Emzansi Korea kr +Kuwait kw +Kuwaït kw +الكويت kw +КувÑйт kw +Кувейт kw +কà§à§Ÿà§‡à¦¤ kw +Kowaet kw +Kuvajt kw +Kuvajt kw +Coweit kw +Κουβέιτ kw +Kuvajto kw +Kuveit kw +کویت kw +Kuvait kw +Kowait kw +Koeweit kw +Cuáit kw +כווית kw +कà¥à¤µà¥ˆà¤¤ kw +Kuvajt kw +Kuvait kw +Kúveit kw +クェート kw +គុយវ៉ែហkw +쿠웨ì´íЏ kw +à»àº•້ມຮູບ- K kw +Kuveitas kw +Kuveita kw +Кувајт kw +Кувейт kw +Koeweit kw +ਕà©à¨µà©ˆà¨¤ kw +Koweit kw +Kuveit kw +Кувейт kw +Koweti kw +Kuvajt kw +Kuvajt kw +Кувајт kw +Kuvajt kw +I-Kuwait kw +கà¯à®µà¯ˆà®¤à¯ kw +Қувейт kw +คูเวต kw +Küwäyt kw +KКувейт kw +Кувайт kw +Kuweyt kw +ç§‘å¨ç‰¹ kw +ç§‘å¨ç‰¹ kw +Cayman Islands ky +Cayman Eilande ky +جزر الكايمان ky +Кайманови оÑтрови ky +কেমà§à¦¯à¦¾à¦¨ দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ ky +Inizi Kaeman ky +Kajmanska ostrva ky +Illes Caimà ky +Kajmanské ostrovy ky +Ynysoedd Caiman ky +Cayman-øerne ky +Kaiman-Inseln ky +Îησιά Κάυμαν ky +Kejmanoj ky +Islas Caimán ky +Kaimanisaared ky +Kaiman Irlak ky +جزایر Ú©Ùیمن ky +Cayman-saaret ky +ÃŽles Caïman ky +Kaaiman Eilannen ky +Oileáin na gCadhman ky +Illas Caimán ky +××™×™ קיימן ky +केमन आइलैंड ky +Kajmanski Otoci ky +Kajmán-szigetek ky +Cayman-eyjar ky +Isole Cayman ky +英領ケイマン諸島 ky +កោះ​កៃម៉ាន ky +ì¼€ì´ë§¨ ì œë„ ky +ຄາຕາລັນ ky +Kaimanų salos ky +Kaimanu salas ky +КајманÑки ОÑтрови ky +Cayman арлууд ky +Gżejjer Cayman ky +Caymanøyene ky +Kayman-Inseln ky +Kaaiman Eilanden ky +Caymanøyane ky +ਕਾਅਮਾਨ ਟਾਪੂ ky +Kajmany ky +Ilhas Caimão ky +Ilhas Cayman ky +Insulele Cayman ky +Каймановы оÑтрова ky +Ibirwa bya Kayimani ky +Caymansullot ky +Kajmanske Ostrovy ky +Kajmanski otoki ky +КајманÑка оÑтрва ky +Kajmanska ostrva ky +Caymanöarna ky +கேமான௠தீவà¯à®•ள௠ky +Ҷазираи Кайман ky +หมู่เà¸à¸²à¸°à¹€à¸„ย์à¹à¸¡à¸™ ky +Cayman Adaları ky +Kayman Utrawları ky +Кайман оÑтрів ky +Кайман Ороллари ky +Iyes Cayman ky +开曼群岛 ky +開曼群島 ky +Kazakhstan kz +كازاخستان kz +КазахÑтан kz +КазахÑтан kz +কাজাকসà§à¦¤à¦¾à¦¨ kz +Kazakstan kz +Kazahstan kz +Kazachstán kz +Casacstan kz +Kasachstan kz +Καζακστάν kz +KazaÄ¥ujo kz +Kazakhstán kz +Kasahstan kz +قزاقستان kz +Kazakstan kz +Kazachstan kz +An Chasacstáin kz +Kazaxistán kz +קזחסט×ן kz +कज़ाखिसà¥à¤¤à¤¾à¤¨ kz +Kazahstan kz +Kazahsztán kz +Kasakstan kz +Kazakistan kz +カザフスタン kz +កាហ្សាក់ស្ážáž„់ kz +ì¹´ìží스탄 kz +à»àºà»àº¥àºàº•ິຠ- K kz +Kazachstanas kz +KazahstÄna kz +КазакÑтан kz +Казак kz +Każakstan kz +Kasakhstan kz +Kasachstan kz +Kazachstan kz +Kasakhstan kz +ਕਾਜ਼ਾਕਸਤਾਨ kz +Kazachstan kz +Cazaquistão kz +Cazaquistão kz +Cazahstan kz +КазахÑтан kz +Kazakisitani kz +Kasakhstan kz +Kazachstan kz +Kazahstan kz +КазахÑтан kz +Kazahstan kz +Kazakstan kz +கஜஸà¯à®¤à®¾à®©à¯` kz +ҚазоқиÑтон kz +คาซัคสถาน kz +Kazakistan kz +Qazaqstan kz +КазахÑтан kz +ҚозоғиÑтон kz +Kazaxhtan kz +哈è¨å…‹æ–¯å¦ kz +哈薩克 kz +Laos la +لاوس la +Ð›Ð°Ð¾Ñ la +Ð›Ð°Ð¾Ñ la +লাওস la +Λάος la +Laoso la +لائوس la +Láós la +ל×וס la +लाओस la +Laosz la +ラオス la +ឡាវ la +ë¼ì˜¤ìФ la +ລາວ la +Laosas la +Laosa la +Ð›Ð°Ð¾Ñ la +Ð›Ð°Ð¾Ñ la +ਲਿਉਸ la +Ð›Ð°Ð¾Ñ la +Lawosi la +Ð›Ð°Ð¾Ñ la +லாஸ௠la +Ð›Ð°Ð¾Ñ la +ลาว la +Ð›Ð°Ð¾Ñ la +Ð›Ð°Ð¾Ñ la +Lào la +Lawosse la +è€æŒ la +寮國 la +Lebanon lb +Libanon lb +لبنان lb +Ліван lb +Ливан lb +লেবানন lb +Liban lb +Liban lb +Líban lb +Libanon lb +Libanus lb +Libanon lb +Libanon lb +Λίβανος lb +Libano lb +Líbano lb +Liibanon lb +Libano lb +لبنان lb +Libanon lb +Libanon lb +Liban lb +Libanon lb +An Liobáin lb +Líbano lb +לבנון lb +लेबनान lb +Libanon lb +Libanon lb +Líbanon lb +Libano lb +レãƒãƒŽãƒ³ lb +លីបង់ lb +레바논 lb +ເດນ່ງນ lb +Libanas lb +LibÄna lb +Либан lb +Либанон lb +Lubnan lb +Libanu lb +Libanon lb +Libanon lb +Libanon lb +Libanon lb +ਲਿਬਨਾਨ lb +Liban lb +Líbano lb +Líbano lb +Liban lb +Ливан lb +Libani lb +Libanon lb +Libanon lb +Libanon lb +Либан lb +Liban lb +I-Lebanon lb +Libanon lb +லெபனான௠lb +Лубнон lb +เลบานอน lb +Ліван lb +Лебанон lb +Li Băng lb +Liban lb +黎巴嫩 lb +黎巴嫩 lb +St. Lucia lc +سانت لوسيا lc +СÑнт-ЛюÑÑ–Ñ lc +Св. Ð›ÑƒÑ‡Ð¸Ñ lc +সেনà§à¦Ÿ লà§à¦¸à¦¿à§Ÿà¦¾ lc +S. Lucia lc +Svatá Lucie lc +St. Lwsia lc +Σάντα Λουτσία lc +Sent-Lucio lc +Santa Lucía lc +سن لوسیا lc +Sankta Lusia lc +Sainte Lucie lc +San Lúisia lc +Santa Lucia lc +סנטה לוסיה lc +सेंट लूसिया lc +Sankti Lúsía lc +Santa Lucia lc +セントルシア lc +សង់លូស៊ីយ៉ា lc +세ì¸íЏ 루시아 lc +ເຊັນລູເຊີຠlc +Å v Liucija lc +Sv. LÅ«cija lc +Св. Луција lc +St. ЛуÑиа lc +St. LuÄ‹ija lc +ਸੇਂਟ ਲੂਉਸ lc +Santa Lúcia lc +Santa Lúcia lc +Sf. Lucia lc +Сент-ЛюÑÐ¸Ñ lc +Mutagatifu Lusiya lc +Sv. Júlia lc +Sv. Lucija lc +Св. Луција lc +Sv. Lucija lc +I-St. Lucia lc +செனà¯à®Ÿà¯ லூசியா lc +Синт ЛуÑиё lc +เซนต์ลูเซีย lc +Santa Lüçiä lc +Сент-ЛюÑÑ–Ñ lc +Сент-ЛюÑÐ¸Ñ lc +Ste Luceye lc +圣å¢è¥¿äºš lc +è–露西亞 lc +Liechtenstein li +ليشتنشتاين li +ЛіхтÑнштÑйн li +Лихтенщайн li +লিখটেনসà§à¦Ÿà¦¾à¦‡à¦¨ li +LihtenÅ¡tajn li +LichtenÅ¡tejnsko li +Λίχτενσταϊν li +LiÄ¥tenÅtejno li +Liechtestein li +لیختن اشتاین li +An Lichtinstéin li +ליכטנשטין li +लिचटेनसà¥à¤Ÿà¥€à¤¨ li +LihtenÅ¡tajn li +リヒテンシュタイン li +លិចទáŸáž“ស្ážáŸ‚áž“ li +리히í…ìŠˆíƒ€ì¸ li +ຟ້າà»àº¡àºš li +LichtenÅ¡teinas li +LihtenÅ¡teina li +Лихтенштајн li +ЛихтÑнштайн li +Liechtensteen li +ਲੀਚਟੀਨਸਟੀਨ li +Lichtensztajn li +Лихтенштейн li +Liyeshitensiteyini li +Лихтенштајн li +LihtenÅ¡tajn li +லசà¯à®šà¯†à®©à¯à®¸à¯à®Ÿà¯†à®©à¯ li +Лихтанштоин li +ลิชเทนสไตน์ li +LihtenÅŸtayn li +Lihtenstein li +Ліхтенштейн li +Лихтенштейн li +Lîchtensteyn li +列支敦士登 li +列支敦斯登 li +Sri Lanka lk +سريلانكا lk +Шры-Ланка lk +Шри Ланка lk +শà§à¦°à§€à¦²à¦™à§à¦•া lk +Å ri Lanka lk +Srí Lanka lk +Sri Lanca lk +ΣÏι Λάνκα lk +Sri-Lanko lk +سریلانکا lk +Srí Lanca lk +סרי לנקה lk +शà¥à¤°à¥€ लंका lk +Å ri Lanka lk +Srí Lanka lk +スリランカ lk +ស្រីលង្កា lk +스리랑카 lk +ເຊີເບີຠlk +Å ri Lanka lk +Å rilanka lk +Шри Ланка lk +Шириланк lk +ਸà©à¨°à©€à¨²à©°à¨•ਾ lk +Шри-Ланка lk +Siri Lanka lk +Å ri Lanka lk +Шри Ланка lk +Å ri Lanka lk +இலஙà¯à®•ை lk +Сри Лонко lk +ศรีลังà¸à¸² lk +Åžri Lanka lk +Шрі-Ланка lk +Шри Ланка lk +æ–¯é‡Œå…°å¡ lk +æ–¯é‡Œè˜­å¡ lk +Liberia lr +Liberië lr +ليبيريا lr +ЛібÑÑ€Ñ‹Ñ lr +Ð›Ð¸Ð±ÐµÑ€Ð¸Ñ lr +লাইবেরিয়া lr +Liberija lr +Libèria lr +Libérie lr +ΛιβεÏία lr +Liberio lr +Libeeria lr +لیبریا lr +Libéria lr +An Libéir lr +Libéria lr +לוב lr +लाइबेरिया lr +Liberija lr +Libéria lr +Líbería lr +リベリア lr +លីបáŸážšáž¸áž™áŸ‰áž¶ lr +ë¼ì´ë² ë¦¬ì•„ lr +ລິຊາ lr +LibÄ“rija lr +Либерија lr +Либери lr +Liberja lr +ਲੀਬਿਰੀਆ lr +Libéria lr +Libéria lr +Ð›Ð¸Ð±ÐµÑ€Ð¸Ñ lr +Liberiya lr +Lýbia lr +Liberija lr +Либерија lr +Liberija lr +லிபிரியா lr +Либериё lr +ไลบีเรีย lr +Liberya lr +Ð›Ñ–Ð±ÐµÑ€Ñ–Ñ lr +Ð›Ð¸Ð±ÐµÑ€Ð¸Ñ lr +利比里亚 lr +賴比瑞亞 lr +Lesotho ls +ليسوتو ls +ЛеÑота ls +ЛеÑото ls +লেসোথো ls +Lesoto ls +Lesoto ls +Λεσόθο ls +Lesoto ls +Lesoto ls +لسوتو ls +Leosóta ls +Lesoto ls +לסוטו ls +लेसोथो ls +Lesótó ls +レソト ls +áž¡áŸážŸáž¼ážáž¼ ls +레소토 ls +ທົດສອບ ls +Lesoto ls +ЛеÑото ls +ЛиÑото ls +Leżoto ls +ਲਿਉਥੂ ls +Lesoto ls +Lesoto ls +Lesoto ls +ЛеÑото ls +Lesoto ls +Lesoto ls +ЛеÑото ls +Lesoto ls +லஸொதோ ls +ЛиÑуту ls +เลโซโต ls +Lesoto ls +Lesoto ls +ЛеÑото ls +ЛеÑото ls +Lessoto ls +莱索托 ls +賴索扥 ls +Lithuania lt +Lithuanië lt +ليتوانيا lt +Litvaniya lt +Літва lt +Литва lt +লিথà§à§Ÿà§‡à¦¨à¦¿à§Ÿà¦¾ lt +Lituani lt +Litvanija lt +Lituània lt +Litva lt +Lithwania lt +Litauen lt +Litauen lt +Λιθουανία lt +Litovio lt +Lituania lt +Leedu lt +Lituania lt +لیتوانی lt +Liettua lt +Lituanie lt +Litouwen lt +An Liotuáin lt +Lituánia lt +×œ×™×˜× lt +लिथà¥à¤†à¤¨à¤¿à¤¯à¤¾ lt +Litva lt +Litvánia lt +Litháen lt +Lituania lt +リトアニア lt +លីទុយអានី lt +리투아니아 lt +ລິທົ່ວເນີຠlt +Lietuva lt +Lietuva lt +Литванија lt +Литва lt +Litwanja lt +Litauen lt +Litauen lt +Litouwen lt +Litauen lt +ਲੀਥੂਨੀਆ lt +Litwa lt +Lituânia lt +Lituânia lt +Lituania lt +Литва lt +Litwaniya lt +Lietuva lt +Litva lt +Litva lt +Литванија lt +Litvanija lt +I-Lithuania lt +Litauen lt +லிதà¯à®¤à¯à®µà¯‡à®©à®¿à®¯à®¾ lt +Литвониё lt +ลิธัวเนีย lt +Litvanya lt +Lituania lt +Литва lt +Литва lt +Litwaneye lt +ç«‹é™¶å®› lt +ç«‹é™¶å®› lt +Luxembourg lu +Luxenburg lu +لوكسمبورغ lu +Lüksemburq lu +ЛюкÑÑмбург lu +ЛюкÑембург lu +লাকà§à¦¸à§‡à¦®à¦¬à§à¦°à§à¦— lu +Luksembourg lu +Luksemburg lu +Luxemburg lu +Lucembursko lu +Lwcsembwrg lu +Luxemburg lu +ΛουξεμβοÏÏγο lu +Luksemburgo lu +Luxemburgo lu +Luksemburg lu +Luxenburgo lu +لوگزامبورگ lu +Luxemburg lu +Luksemborg lu +Luxemburg lu +Lucsamburg lu +Luxemburgo lu +לוקסמבורג lu +लकà¥à¤¸à¤®à¤¬à¤°à¥à¤— lu +Luksemburg lu +Luxemburg lu +Lúxemborg lu +Lussemburgo lu +ルクセンブルグ lu +លុចហ្សំបួរ lu +ë£©ì…ˆë¶€ë¥´í¬ lu +ລັàºà»àºŠàº¡à»€àºšàºµàº lu +Liuksemburgas lu +Luksemburga lu +ЛукÑембург lu +ЛюкÑембүрг lu +Lussemburgu lu +Luxemborg lu +Luxemburg lu +ਲਕਸ਼ਮਬਰਗ lu +Luksemburg lu +Luxemburgo lu +Luxemburgo lu +Luxemburg lu +ЛюкÑембург lu +Lugizamburu lu +Luxemburg lu +Luxemburg lu +Luksemburg lu +ЛукÑембург lu +Luksemburg lu +I-Luxembourg lu +Luxemburg lu +லகà¯à®šà®®à¯à®ªà¯‹à®°à¯à®•௠lu +Лукзамбург lu +ลัà¸à¹€à¸‹à¸¡à¹€à¸šà¸­à¸£à¹Œà¸ lu +Lüksemburg lu +Lüksemburg lu +ЛюкÑембург lu +ЛюкÑембург lu +Lussimbork lu +墿£®å ¡ lu +盧森堡 lu +Latvia lv +لاتÙيا lv +Latviya lv +Ð›Ð°Ñ‚Ð²Ñ–Ñ lv +Ð›Ð°Ñ‚Ð²Ð¸Ñ lv +লাতভিয়া lv +Latvija lv +Letònia lv +LotyÅ¡sko lv +Latfia lv +Letland lv +Lettland lv +Λεττονία lv +Latvio lv +Letonia lv +Läti lv +لاتویا lv +Lettonie lv +Letland lv +An Laitvia lv +Letónia lv +לטביה lv +लाटविया lv +Latvija lv +Lettország lv +Lettland lv +Lettonia lv +ラトビア lv +ឡាážážœáž¸áž™áŸ‰áž¶ lv +ë¼íŠ¸ë¹„ì•„ lv +ລັດເວີຠlv +Latvija lv +Latvija lv +Латвија lv +Латви lv +Latvja lv +Lettland lv +Letland lv +ਲਾਟਵੀਆ lv +Åotwa lv +Letónia lv +Ð›Ð°Ñ‚Ð²Ð¸Ñ lv +Lativiya lv +Látvia lv +LotyÅ¡sko lv +Latvija lv +Латвија lv +Latvija lv +I-Latvia lv +Lettland lv +லடà¯à®µà®¿à®¯à®¾ lv +Латвонӣ lv +ลัธเวีย lv +Litvanya lv +Ð›Ð°Ñ‚Ð²Ñ–Ñ lv +Ð›Ð°Ñ‚Ð²Ð¸Ñ lv +Lativia lv +Letoneye lv +拉脱维亚 lv +拉脫維亞 lv +Libya ly +Libië ly +ليبيا ly +Ð›Ñ–Ð²Ñ–Ñ ly +Ð›Ð¸Ð±Ð¸Ñ ly +লিবিয়া ly +Julia ly +Libija ly +Líbia ly +Lýbie ly +Libia ly +Libyen ly +Libyen ly +ΛιβÏη ly +Libio ly +Libia ly +Liibüa ly +Libia ly +لیبی ly +Lybie ly +Libië ly +An Libia ly +Líbia ly +לוב ly +लीबिया ly +Libija ly +Líbia ly +Líbía ly +Libia ly +リビア ly +លីប៊ី ly +리비아 ly +ລິຊາ ly +Libija ly +LÄ«bija ly +Либија ly +Ð›Ð¸Ð±Ñ ly +Libja ly +Libyen ly +Libië ly +ਲੀਬੀਆ ly +Libia ly +Líbia ly +Líbia ly +Libia ly +Ð›Ð¸Ð²Ð¸Ñ ly +Libiya ly +Lýbia ly +Libija ly +Либија ly +Libija ly +I-Libya ly +Libyen ly +லிபியா ly +Ð›Ð¸Ð±Ð¸Ñ ly +ลิเบีย ly +Libia ly +Ð›Ñ–Ð²Ñ–Ñ ly +Ð›Ð¸Ð±Ð¸Ñ ly +Libeye ly +利比亚 ly +利比亞 ly +Morocco ma +Morokko ma +المغرب ma +Марока ma +Мароко ma +মরকà§à¦•à§‹ ma +Marok ma +Maroko ma +Marroc ma +Maroko ma +Moroco ma +Marokko ma +Marokko ma +ΜαÏόκο ma +Maroko ma +Marruecos ma +Maroko ma +Maroko ma +مراکش ma +Marokko ma +Marokko ma +Maroc ma +Marokko ma +Maracó ma +Marrocos ma +מרוקו ma +मोरकà¥à¤•ो ma +Maroko ma +Marokkó ma +Marokkó ma +Marocco ma +モロッコ ma +ម៉ារ៉ុក ma +모로코 ma +ເມົາລິ ma +Marokas ma +Maroka ma +Мароко ma +Морокко ma +Marokk ma +Marokko ma +Marokko ma +Marokko ma +Marokko ma +ਮੋਰਕੋ ma +Maroko ma +Marrocos ma +Marrocos ma +Maroc ma +Марокко ma +Maroke ma +Marokko ma +Maroko ma +Maroko ma +Мароко ma +Maroko ma +I-Morocco ma +Marocko ma +மோராகோ ma +Марокко ma +โมร็อคโค ma +Morokko ma +Марокко ma +Марокаш ma +Ma rốc ma +Marok ma +摩洛哥 ma +摩洛哥 ma +Monaco mc +Monako mc +موناكو mc +Манака mc +Монако mc +মোনাকো mc +Monako mc +Monako mc +Mònaco mc +Monako mc +Μονακό mc +Monako mc +Mónaco mc +موناکو mc +Monacó mc +Mónaco mc +מונקו mc +मोनेको mc +Monako mc +Mónakó mc +モナコ mc +ម៉ូណាកូ mc +모나코 mc +ເມົາລິ mc +Monakas mc +Monako mc +Монако mc +Монако mc +Monako mc +ਮੋਨਕੋ mc +Monako mc +Mónaco mc +Mônaco mc +Монако mc +Monako mc +Monako mc +Monako mc +Монако mc +Monako mc +மனாகோ mc +Монако mc +โมนาโค mc +Monako mc +Manako mc +Монако mc +Монако mc +摩纳哥 mc +æ‘©ç´å“¥ mc +Moldova md +Ù…ÙˆÙ„Ø¯ÙˆÙØ§ md +Малдова md +ÐœÐ¾Ð»Ð´Ð°Ð²Ð¸Ñ md +মলডোভা md +Moldavi md +Moldàvia md +Moldávie md +Moldofa md +Moldawien md +Μολδαβία md +Moldavujo md +Moldavia md +Moldavia md +مولداوی md +Moldavie md +An Mholdóiv md +Moldávia md +מולדובה md +मॉलà¥à¤¦à¥‹à¤µà¤¾ md +Moldóva md +Moldavia md +モルドムmd +ម៉ុលដូវ៉ា md +몰ë„ë°” md +ສະໂລວັຠmd +MoldÄvija md +Молдавија md +Молдав md +Moldavja md +Moldawien md +Moldavië md +ਮੋਡੋਵਾ md +MoÅ‚dawia md +Moldávia md +Молдова md +Molidova md +Moldávsko md +Молдавија md +Moldavija md +Moldavien md +மாலà¯à®Ÿà¯‹à®µà®¾ md +Молдавӣ md +มอลโดวา md +Молдова md +Молдова md +摩尔多瓦 md +摩爾多瓦 md +Madagascar mg +Madagaskar mg +مدغشقر mg +МадагаÑкар mg +МадагаÑкар mg +মাদাগাসà§à¦•ার mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +ΜαδαγασκάÏη mg +Madagaskaro mg +Madagaskar mg +ماداگاسکار mg +Madagaskar mg +מדגסקר mg +मेडागासà¥à¤•र mg +Madagaskar mg +Madagaszkár mg +Madagaskar mg +マダガスカル mg +ម៉ាដាហ្កាស្ការ mg +마다카스카르 mg +ຄາສະບາລ - K mg +Madagaskaras mg +Madagaskara mg +МадаÑкар mg +МадагаÑкар mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +ਮੈਡਾਗਾਸਕਰ mg +Madagaskar mg +Madagáscar mg +МадагаÑкар mg +Madagasikari mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +МадагаÑкар mg +Madagaskar mg +Madagaskar mg +மடகஸà¯à®•ார௠mg +МадогоÑкор mg +มาดาà¸à¸±à¸ªà¸à¸² mg +Madagaskar mg +Madagaskar mg +МадагаÑкар mg +МадагаÑкар mg +马达加斯加 mg +馬é”加斯加 mg +Marshall Islands mh +Marshall EIlande mh +جزر مارشال mh +Маршалавы аÑтравы mh +МаршалÑки оÑтрови mh +মারশাল দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ mh +Inizi Marshall mh +MarÅ¡alova ostrva mh +Illes Marshall mh +Marshallovy ostrovy mh +Ynysoedd Marshall mh +Marshall-øerne mh +Marshall-Inseln mh +Îησιά ΜάÏσαλ mh +MarÅaloj mh +Islas Marshall mh +Marshalli saared mh +Marshall Irlak mh +جزایر مارشال mh +Marshallinsaaret mh +ÃŽles Marshall mh +Marshall Eilânen mh +Oileáin Mharshall mh +Illas Marshall mh +××™×™ מרשל mh +मारà¥à¤¶à¤² आइलैंड mh +Marshall Otoci mh +Marshall-szigetek mh +Marshall-eyjar mh +Isole Marshall mh +米自由連åˆãƒžãƒ¼ã‚·ãƒ£ãƒ«è«¸å³¶ mh +កោះ Marshall mh +마샬 ì œë„ mh +ລາດສະອານາຈັàºà»„ທຠmh +Marshalo salos mh +MÄrÅ¡alu salas mh +Маршалови ОÑтрови mh +Маршаллын арлууд mh +Gżejjer Marshall mh +Marshalløyene mh +Marshallinseln mh +Marshall Eilanden mh +Marshalløyane mh +ਮਾਰਸ਼ਲ ਟਾਪੂ mh +Wyspy Marshalla mh +Ilhas Marshall mh +Ilhas Marshall mh +Insulele Marshall mh +Маршалловы оÑтрова mh +Ibirwa bya Marishali mh +Marshallsullot mh +Maršálove ostrovy mh +Marshallovi otoki mh +Маршалова оÑтрва mh +MarÅ¡alova ostrva mh +Marshallöarna mh +மாரà¯à®·à®²à¯ தீவà¯à®•ள௠mh +Ҷазираи Маршал mh +หมู่เà¸à¸²à¸°à¸¡à¸²à¹à¸Šà¸¥ mh +MarÅŸal Adaları mh +MarÅŸal Utrawları mh +МаршальÑькі оÑтрови mh +Маршалл Ороллари mh +Iyes Marshall mh +马ç»ç¾¤å²› mh +馬紹爾群島 mh +Macedonia mk +Makedoniese mk +مقدونيا mk +Makedonya mk +ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ñ–Ñ mk +ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ð¸Ñ mk +মà§à¦¯à¦¾à¦¸à¦¿à¦¡à§‹à¦¨à¦¿à§Ÿà¦¾ mk +Makedonia mk +Makedonija mk +Macedònia mk +Makedonie mk +Makedonien mk +Makedonien mk +Σλαβομακεδονία mk +Makedonujo mk +Makedoonia mk +Mazedonia mk +مقدونیه mk +Makedonia mk +Macédoine mk +Macedonië mk +An Mhacadóin (IPIM) mk +Macedónia mk +מקדוניה mk +मकदूनिया mk +Makedonija mk +Macedónia mk +Masedonia mk +Makedónía mk +マケドニア mk +ម៉ាសáŸážŠáž“ mk +마케ë„니아 mk +ມາເຊໂດເນີຠmk +Makedonija mk +MaÄ·edonija mk +Македонија mk +Макидон mk +MaÄ‹edonja mk +Makedonia mk +Makedonien mk +Macedonië mk +Makedonia mk +Macedònian mk +ਮੈਕਡੋਨੀਆ mk +Macedónia mk +Macedônia mk +ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ð¸Ñ mk +Masedoniya mk +Makedonia mk +Macedónsky mk +Makedonija mk +Македонија mk +Makedonija mk +I-Macedonia mk +Makedonien mk +மாசிடோ னியா mk +Мақдуниё mk +มาเซโดเนีย mk +Makedonya mk +Makedonia mk +ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ñ–Ñ mk +ÐœÐ°ÐºÐµÐ´Ð¾Ð½Ð¸Ñ mk +Masedonia mk +Macedoneye mk +马其顿 mk +馬其頓 mk +Mali ml +مالي ml +Малі ml +Мали ml +মালি ml +Μαλί ml +Malio ml +مالی ml +Mailí ml +מ×לי ml +माली ml +Malí ml +マリ ml +ម៉ាលី ml +ë§ë¦¬ ml +ຈົດຫມາຠml +Мали ml +Мали ml +ਮਾਲੀ ml +Мали ml +Мали ml +மாலி ml +Молӣ ml +มาลี ml +Малі ml +Мали ml +马里 ml +馬利 ml +Myanmar mm +ميانمار mm +М'Ñнма mm +Мианмар mm +মিয়ানমার mm +Mjanmar mm +Mianmar mm +Burma mm +Burma (Myanmar) mm +ÎœÎ¹Î±Î½Î¼Î¬Ï mm +Mjanmao mm +Birmania mm +میانمار mm +Maenmar mm +מינמר mm +मà¥à¤¯à¤¨à¤®à¤¾à¤° mm +Mianmar mm +Mjanmar mm +ミャンマー mm +មីយ៉ាន់ម៉ា mm +미얀마 mm +ຕົວຮງàºàºžàºµàº·à»‰àº™àº—ີ່ທຳງານ - K mm +Mjanma mm +Мијанмар mm +МÑнмар mm +Mjanmar mm +Myanmar (Birma) mm +ਮਿਆਂਮਾਰ mm +Mianmar mm +МьÑнма (Бирма) mm +Mjanmar mm +Мијанмар mm +Mijanmar mm +மயனà¯à®®à®¾à®°à¯ mm +Миёнмор mm +เมียนมาร์ mm +Mianmar mm +М'Ñнма mm +МÑнмар mm +Miến Äiện mm +Birmaneye mm +缅甸 mm +緬甸 mm +Mongolia mn +Mongolië mn +منغوليا mn +ÐœÐ°Ð½Ð³Ð¾Ð»Ñ–Ñ mn +ÐœÐ¾Ð½Ð³Ð¾Ð»Ð¸Ñ mn +মোঙà§à¦—োলিয়া mn +Mongoli mn +Mongolija mn +Mongòlia mn +Mongolsko mn +Mongoliet mn +Mongolei mn +Μογγολία mn +Mongolio mn +Mongoolia mn +مغولستان mn +Mongolie mn +Mongolië mn +An Mhongóil mn +Mongólia mn +מונגוליה mn +मंगोलिया mn +Mongolija mn +Mongólia mn +Mongólía mn +モンゴル mn +ម៉ុងហ្គោលី mn +몽골 mn +ລອàºàº­àº´àº™ mn +Mongolija mn +Mongolija mn +Монголија mn +МОÐГОЛ mn +Mongolja mn +Mongolei mn +Mongolië mn +ਮੰਗੋਲੀਆ mn +Mongólia mn +Mongólia mn +ÐœÐ¾Ð½Ð³Ð¾Ð»Ð¸Ñ mn +Mongoliya mn +Mongolsko mn +Mongolija mn +Монголија mn +Mongolija mn +Mongoliet mn +மாஙà¯à®•ோலியா mn +МуғулиÑтон mn +มองโà¸à¹€à¸¥à¸µà¸¢ mn +MoÄŸolistan mn +MoÄŸolstan mn +ÐœÐ¾Ð½Ð³Ð¾Ð»Ñ–Ñ mn +МуғилиÑтон mn +Mông cổ mn +Mongoleye mn +è’™å¤ mn +è’™å¤ mn +Macau SAR(China) mo +Macau SAR (China) mo +Макао (Китай) mo +মাকাউ SAR(চীন) mo +Makav SAR(Sina) mo +Macau SAR(Xina) mo +Macau SAR (Čína) mo +Macau SAR(Kina) mo +Macao SAR (China) mo +Μακάο SAR (Κίνα) mo +Macau mo +Macau SAR(Txina) mo +Makao SAR(Kiina) mo +Macao SAR (Chine) mo +Macao SAR(An tSín) mo +מק×ו SAR (סין) mo +Makaó (Kína) mo +Makaó (sjálfstjórnarhérað í Kína) mo +Macau SAR(Cina) mo +マカオ(中国) mo +ម៉ាកាវ (áž…áž·áž“) mo +Macau SAR(Kinija) mo +Макао СÐР(Кина) mo +Macao SAR (Kina) mo +Macao mo +Macao SAR (Kina) mo +ਮੈਕਿਉ SAR(ਚੀਨ) mo +Makao SAR (Chiny) mo +Macau (China) mo +Macao SAR(China) mo +Макао mo +Makawu SAR (Ubushinwa) mo +Macau SAR (Kiinná) mo +Macau SAR (Kitajska) mo +SAR Macau (Кина) mo +SAR Macau (Kina) mo +Macao (Kina) mo +Macau SAR(சீனா) mo +มาเà¸à¹Šà¸² mo +Makau (Çin) mo +Macau SAR(Китай) mo +Макау (Хитой) mo +中国澳门特别行政区 mo +澳門 SAR(中國) mo +Martinique mq +مارتينيك mq +Мартыніка mq +Мартиника mq +মারà§à¦Ÿà¦¿à¦¨à¦¿à¦•à§ mq +Martinik mq +Martinik mq +Martinica mq +Martinik mq +Martin?c mq +ΜαÏτινίκα mq +Martiniko mq +Martinica mq +Martinika mq +مارتینیک mq +Martainíc mq +Martinica mq +מרטיניק mq +मारà¥à¤Ÿà¥€à¤¨à¥€à¤• mq +Martiník mq +Martinica mq +フランス海外県マルãƒãƒ‹ãƒ¼ã‚¯ mq +ម៉ារទីនីគ mq +ë§ˆë¥´í‹°ë‹ˆí¬ mq +ເມົາລິ mq +Martinika mq +Martinika mq +Мартиник mq +Мартиники mq +Martinik mq +ਮਾਰਟੀਨਿਕਿਉ mq +Martynika mq +Martinica mq +Martinica mq +Martinica mq +Мартиника mq +Maritinike mq +Martinik mq +Мартиник mq +Martinik mq +மாரà¯à®¤à®¿à®©à®¿à®•à¯à®¯à¯ mq +Мартиник mq +มาทินิค mq +Martinik mq +Martinik mq +Мартініка mq +Мартиника mq +Martinike mq +马æå°¼å…‹ mq +馬æå°¼å…‹ mq +Mauritania mr +Mauritanië mr +موريتانيا mr +ÐœÐ°ÑžÑ€Ñ‹Ñ‚Ð°Ð½Ñ–Ñ mr +ÐœÐ°Ð²Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ mr +মরিটানিয়া mr +Maouritani mr +Mauritanija mr +Mauritània mr +Mauretánie mr +Mawritania mr +Mauretanien mr +Mauretanien mr +ΜαυÏιτανία mr +MaÅ­ritanujo mr +Mauritaania mr +موراتانی mr +Mauritanie mr +Mauritanië mr +An Mháratáin mr +Mauritánia mr +מ×וריטניה mr +मारीतानिया mr +Mauritanija mr +Mauritánia mr +Máritanía mr +モーリタニア mr +ម៉ូរីážáž¶áž“ី mr +모리타니 mr +ລິທົວເນີຠmr +Mauritanija mr +MauritÄnija mr +Мавританија mr +Мауритани mr +Mawritanja mr +Mauretanien mr +Mauritanië mr +ਮਾਉਰੀਟਨਿਆ mr +Mauretania mr +Mauritânia mr +Mauritânia mr +ÐœÐ°Ð²Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ mr +Moritaniya mr +Mavretanija mr +Мауританија mr +Mauritanija mr +Mauretanien mr +மௌரிடானியா mr +Мавритонӣ mr +มอริทาเนีย mr +Mauritanya mr +ÐœÐ°Ð²Ñ€Ð¸Ñ‚Ð°Ð½Ñ–Ñ mr +ÐœÐ°Ð²Ñ€Ð¸Ñ‚Ð°Ð½Ð¸Ñ mr +Moritanreye mr +毛里塔尼亚 mr +茅利塔尼亞 mr +Montserrat ms +مونتسيرات ms +МонÑерат ms +মনà§à¦Ÿà¦¸à§‡à¦°à¦¾à¦Ÿ ms +Monsera ms +ΜοντσεÏάτ ms +Moncerato ms +مون‌سرات ms +Montsarat ms +מונטסרט ms +मॉटसेरट ms +Monserrat ms +英領モントセラト ms +ម៉ុងសáŸážšáŸ‰áž¶ ms +몬트세ë¼íЏ ms +ຈà»àºžàº²àºš ms +Monserata ms +МонÑерат ms +МонтÑеррат ms +ਮੋਨਟਸੀਰਾਟ ms +МонтÑеррат ms +Monserati ms +МонÑерат ms +Monserat ms +மானà¯à®Ÿà¯à®šà¯†à®°à¯à®°à®Ÿà¯ ms +МунтеÑирот ms +มอนต์เซอร์รัท ms +МонтÑеррат ms +Монцеррат ms +蒙特塞拉特 ms +蒙的塞拉特 ms +Malta mt +مالطة mt +Мальта mt +Малта mt +মলটা mt +Malt mt +Μάλτα mt +Malto mt +مالت mt +Malte mt +Málta mt +מלטה mt +मालà¥à¤Ÿà¤¾ mt +Málta mt +マルタ mt +ម៉ាល់ážáž¶ mt +몰타 mt +ມອລຕາ mt +Малта mt +Малта mt +ਮਾਲਟਾ mt +Мальта mt +Malita mt +Малта mt +I-Malta mt +மாலà¯à®Ÿà®¾ mt +Молет mt +มอลตา mt +Мальта mt +Малта mt +Male mt +马耳他 mt +馬爾他 mt +Mauritius mu +موريشيوس mu +Маўрыцы mu +ОÑтров Мавриций mu +মরিশাস mu +Mauris mu +Mauricijus mu +Maurici mu +Mauricius mu +Mawrisiws mu +ΜαυÏίκιος mu +MaÅ­ricio mu +Mauricio mu +Maurizio mu +موریتیس mu +ÃŽle Maurice mu +Oileán Mhuirís mu +Maurício mu +מ×וריציוס mu +मॉरीशस mu +Mauricijus mu +Máritíus mu +モーリシャス mu +ម៉ូរីទុស mu +모리셔스 mu +ພາທິຊັ້ນ mu +MaurÄ«cija mu +ÐœÐ°Ð²Ñ€Ð¸Ñ†Ð¸ÑƒÑ mu +ÐœÐ°Ð²Ñ€Ð¸Ñ‚ÑƒÑ mu +Mawriju mu +ਮਾਉਰੀਟਿਸ mu +Mauritânia mu +Ilhas Maurício mu +MauriÅ£ius mu +Маврикий mu +Ibirwa bya Morise mu +Maurícius mu +Mavricij mu +ÐœÐ°ÑƒÑ€Ð¸Ñ†Ð¸Ñ˜ÑƒÑ mu +Mauricijus mu +மௌரிடியஸ௠mu +Мавритӣ mu +มอริเชียส mu +Mauritus mu +Маврікій mu +Маврикий mu +Iye Môrice mu +毛里求斯 mu +毛里求斯 mu +Maldives mv +جزر المالدي٠mv +Мальдывы mv +МалдивÑки оÑтрови mv +মালদà§à¦¬à§€à¦ª mv +Inizi Maldiv mv +Maldivi mv +Maledivy mv +Ynysoedd y Mald?f mv +Maldiverne mv +Malediven mv +Μαλδίβες mv +Maldivoj mv +Maldivas mv +Maldiivid mv +Maldibak mv +مالدیو mv +Malediivit mv +Malediven mv +Na Maildiví mv +Maldivas mv +מולדבה mv +मालदीव mv +Maldivi mv +Maldív-szigetek mv +Maldíveyjar mv +Maldive mv +モルジブ mv +ម៉ាល់ឌីវ mv +몰디브 mv +ມັລດິສ mv +Maldyvai mv +Maldivu salas mv +Малдиви mv +Малдив mv +Maldivene mv +Malediven mv +Malediven mv +Maldivane mv +ਮਾਲਦੀਵ mv +Malediwy mv +Maldivas mv +Maldivas mv +Maldive mv +МальдивÑкие оÑтрова mv +Malidive mv +Maldiivat mv +Maldiv mv +Малдиви mv +Maldivi mv +Maldiverna mv +மாலà¯à®¤à¯€à®µà¯à®•ள௠mv +Молдивӣ mv +มัลดิฟ mv +Maldivler mv +Maldivlar mv +Мальдіви mv +Малдив Ороллари mv +马尔代夫 mv +馬爾地夫 mv +Malawi mw +مالاوي mw +Малаві mw +Малави mw +মালাওয়ি mw +Malavi mw +Μαλάουι mw +Malavio mw +مالاوی mw +An Mhaláiv mw +Malavi mw +מל×ווי mw +मलावी mw +Malavi mw +Malaví mw +マラウイ mw +ម៉ាឡាវី mw +ë§ë¼ìœ„ mw +ມອລຕາ mw +Malavi mw +Малави mw +Малави mw +ਮਾਲਾਵੀ mw +Малави mw +Малави mw +Malavi mw +மலவி mw +Моловӣ mw +มาลาวี mw +Malavi mw +Малаві mw +Малави mw +马拉维 mw +é¦¬æ‹‰å¨ mw +Mexico mx +Meksiko mx +المكسيك mx +Meksika mx +МÑкÑыка mx +МекÑико mx +মেকà§à¦¸à¦¿à¦•à§‹ mx +Mec'hiko mx +Meksiko mx +Mèxic mx +Mexiko mx +Mecsico mx +Mexiko mx +Μεξικό mx +Meksiko mx +México mx +Mehhiko mx +Mexiko mx +مکزیک mx +Meksiko mx +Meksiko mx +Mexique mx +Meicsiceo mx +México mx +מקסיקו mx +मेकà¥à¤¸à¤¿à¤•ो mx +Meksiko mx +Mexikó mx +Meksiko mx +Mexíkó mx +Messico mx +メキシコ mx +ម៉ិចស៊ិក mx +멕시코 mx +ເມັàºàºŠàºµà»‚ຠmx +Meksika mx +Meksika mx +МекÑико mx +МекÑико mx +Messiku mx +Mexiko mx +Mèxic mx +ਮੈਕਸਿਕੋ mx +Meksyk mx +México mx +México mx +Mexic mx +МекÑика mx +Megizike mx +Mexiko mx +Mehika mx +МекÑико mx +Meksiko mx +I-Mexico mx +மெகà¯à®šà®¿à®•ோ mx +МекÑико mx +เม็à¸à¸‹à¸´à¹‚ภmx +Meksika mx +Meksiko mx +МекÑика mx +МекÑика mx +Mê hi cô mx +Mecsike mx +墨西哥 mx +墨西哥 mx +Malaysia my +Malysië my +ماليزيا my +ÐœÐ°Ð»Ð°Ð¹Ð·Ñ‹Ñ my +ÐœÐ°Ð»Ð°Ð¹Ð·Ð¸Ñ my +মালয়েশিয়া my +Malezia my +Malezija my +Malàsia my +Malajsie my +Maleisia my +Μαλαισία my +Malajzio my +Malasia my +Malaisia my +Malasia my +مالزی my +Malesia my +Malaisie my +Maleisië my +An Mhalaeisia my +Malásia my +מלזיה my +मलेशिया my +Malezija my +Malajzia my +Malasía my +マレーシア my +ម៉ាឡáŸážŸáŸŠáž¸ my +ë§ë ˆì´ì‹œì•„ my +ມອລຕາ my +Malaizija my +Malaizija my +Малезија my +Малайз my +Malażja my +Maleisië my +ਮਲੇਸ਼ੀਆ my +Malezja my +Malásia my +Malásia my +Malaezia my +ÐœÐ°Ð»Ð°Ð¹Ð·Ð¸Ñ my +Maleziya my +Malajzia my +Malezija my +Малезија my +Malezija my +மலேசியா my +Малайзӣ my +มาเลเซีย my +Malezya my +ÐœÐ°Ð»Ð°Ð¹Ð·Ñ–Ñ my +ÐœÐ°Ð»Ð°Ð¹Ð·Ð¸Ñ my +Malaizeye my +马æ¥è¥¿äºš my +馬來西亞 my +Mozambique mz +Mosambiek mz +موزمبيق mz +Мазамбік mz +Мозамбик mz +মোজামবিক mz +Mozambik mz +Mozambik mz +Moçambic mz +Mozambik mz +Mosamb?c mz +Μοζαμβίκη mz +Mozambiko mz +Mosambiik mz +Mozanbike mz +موزامبیک mz +Mosambik mz +Mósaimbíc mz +מוזמביק mz +मोज़ामà¥à¤¬à¥€à¤• mz +Mozambik mz +Mozambik mz +Mósambík mz +Mozambico mz +モザンビーク mz +ម៉ូហ្សាំប៊ិក mz +ëª¨ìž ë¹„í¬ mz +ຫນ່ວàºàº„ວາມຈຳ mz +Mozambikas mz +Mozambika mz +Мозамбик mz +Мозамбайк mz +Możambik mz +Mosambik mz +Mosambik mz +Mosambik mz +ਮੋਜ਼ਾਨਬਿਕਿਉ mz +Mozambik mz +Moçambique mz +Moçambique mz +Mozambic mz +Мозамбик mz +Mosambik mz +Mozambik mz +Mozambik mz +Мозамбик mz +Mozambik mz +Moçambique mz +மோசாமà¯à®ªà®¿à®•௠mz +Мозамбик mz +โมà¹à¸‹à¸¡à¸šà¸´à¸ mz +Mozambik mz +Mozambik mz +Мозамбік mz +Мозамбик mz +Mozambike mz +莫桑比克 mz +莫三比克 mz +Namibia na +Namibië na +ناميبيا na +ÐÐ°Ð¼Ñ–Ð±Ñ–Ñ na +ÐÐ°Ð¼Ð¸Ð±Ð¸Ñ na +নামিবিয়া na +Namibi na +Namibija na +Namíbia na +Namíbie na +Îαμίμπια na +Namibio na +Namiibia na +نامیبیا na +Namibie na +Namibië na +An Namaib na +Namíbia na +נמיביה na +नामीबिया na +Namibija na +Namíbia na +Namibía na +ナミビア na +ណាមីប៊ី na +나미비아 na +ຈາໄມàºàº² na +Namibija na +NamÄ«bija na +Ðамибија na +Ðамиби na +Namibja na +Namibië na +ਨਾਮੀਬੀਆ na +Namíbia na +Namíbia na +ÐÐ°Ð¼Ð¸Ð±Ð¸Ñ na +Namibiya na +Namíbia na +Namibija na +Ðамибија na +Namibija na +நாமிபியா na +Ðамибиё na +นามิเบีย na +Namibya na +ÐÐ°Ð¼Ñ–Ð±Ñ–Ñ na +ÐÐ°Ð¼Ð¸Ð±Ð¸Ñ na +Namibeye na +纳米比亚 na +那米比亞 na +New Caledonia nc +Nuwe Caledonië nc +كاليدونيا الجديدة nc +ÐÐ¾Ð²Ð°Ñ ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ñ–Ñ nc +Ðова ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ð¸Ñ nc +নিউ কà§à¦¯à¦¾à¦²à¦¿à¦¡à§‹à¦¨à¦¿à§Ÿà¦¾ nc +Kaledoni-nevez nc +Nova Kaledonija nc +Nova Caledònia nc +Nová Kaledonie nc +Caledonia Newydd nc +Ny Caledonien nc +Neukaledonien nc +Îέα Καληδονία nc +Nov-Kaledonio nc +Nueva Caledonia nc +Uus-Kaledoonia nc +Kaledonia Berria nc +کالدونیا نو nc +Uusi-Kaledonia nc +Nouvelle Calédonie nc +Nij Caledonië nc +An Nua-Chaladóin nc +Nova Caledónia nc +קלדוניה החדשה nc +नà¥à¤¯à¥‚ केलेदूनिया nc +Nova Kaledonija nc +Új-Kaledónia nc +Nýja-Kaledónía nc +Nuova Caledonia nc +ニューカレドニア nc +នូវែលកាលáŸážŠáž¼áž“ី nc +뉴 칼레ë„니아 nc +ມາເຊໂດເນີຠnc +Naujoji Kaledonija nc +Jaunkaledonija nc +Ðова Каледонија nc +Ð¨Ð¸Ð½Ñ ÐºÐ°Ð»ÐµÐ´Ð¾Ð½Ð¸ nc +Kaledonja Ä dida nc +Ny-Caledonia nc +Nieg Kaledonien nc +Nieuw Caledonië nc +Ny-Caledonia nc +ਨਵਾਂ ਕਾਲੀਡੋਨਾ nc +Nowa Kaledonia nc +Nova Caledónia nc +Nova Caledônia nc +Noua Caledonie nc +ÐÐ¾Ð²Ð°Ñ ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ð¸Ñ nc +Kaledoniya nc +Ođđa Kaledonia nc +Nová Kaledónia nc +Nova Kaledonija nc +Ðова Каледонија nc +Nova Kaledonija nc +Nya Caledonien nc +நியூ கலடோனியா nc +КаледониÑи Ðав nc +นิวคาเลโดเนีย nc +Yeni Kaledonya nc +Yaña Kaledonia nc +Ðова ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ñ–Ñ nc +Янги ÐšÐ°Ð»ÐµÐ´Ð¾Ð½Ð¸Ñ nc +Nouve Caledonreye nc +新喀里多尼亚 nc +新喀里多尼亞 nc +Niger ne +النيجر ne +Ðігер ne +Ðигер ne +নাইজের ne +Nijer ne +Níger ne +ÎίγηÏας ne +NiÄero ne +نیجر ne +Nigeria ne +An Nígir ne +Níxer ne +× ×™×’'ר ne +निगर ne +Níger ne +ニジェール ne +នីហ្សáŸážš ne +니제르 ne +ຕົວຮງàºàºžàº·à»‰àº™àº—ີ່ທຳງານ ne +NigÄ“ra ne +Ðигер ne +Ðигер ne +NiÄ¡er ne +ਨਿਜੀਰ ne +Nigéria ne +Nigéria ne +Ðигер ne +Nijeri ne +Nigéria ne +Ðигер ne +நிஜர௠ne +Ðигерӣ ne +ไนเจอร์ ne +Nijerya ne +Ðігер ne +Ðигер ne +Nidjer ne +尼日尔 ne +尼日 ne +Norfolk Island nf +Norfolk Eiland nf +جزيرة نورÙولك nf +Ðорфалк nf +ОÑтров Ðорфолк nf +নরফোক দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ nf +Enez Norfolk nf +Norfolk ostrvo nf +Illa Norfolk nf +Ynys Norffolc nf +Norfolk-øerne (Australien) nf +Norfolk-Insel nf +Îήσος ÎÏŒÏφοκ nf +Norfolkinsulo nf +Isla Norfolk nf +Norfolki saar nf +Norfok Irla nf +جزایر نورÙولک nf +Norfolkinsaari nf +ÃŽle Norfolk nf +Norfolk Eilân nf +Oileán Norfolc nf +Illa Norfolk nf +××™×™ נורפולק nf +नॉरफाक आइलैंड nf +Otok Norfolk nf +Norfolk-szigetek nf +Norfolkeyja nf +Isola Norfolk nf +オーストラリア領ノーフォーク諸島 nf +កោះ Norfolk nf +ë…¸í¬í¬ ì œë„ nf +ໂປà»àº¥àº™ nf +Norfolko sala nf +Norfolka nf +Ðорфолшки ОÑтров nf +Norfolk арлууд nf +Gżira ta' Norfolk nf +Norfolkøya nf +Norfolkinsel nf +Norfolk Eiland nf +Norfolkøya nf +ਨੋਰਫੋਲਕ ਟਾਪੂ nf +Wyspy Norfolk nf +Ilha Norfolk nf +Ilhas Norfolk nf +Insulele Norfolk nf +ОÑтров Ðорфолк nf +Ikirwa cya Norufolika nf +Norfolksuolu nf +Ostrov Norfolk nf +Otok Norfolk nf +Ðорфолкшко оÑтрво nf +NorfolkÅ¡ko ostrvo nf +Norfolkön nf +நாரà¯à®ªà¯‹à®•௠தீவ௠nf +Ҷазираи Ðурфолк nf +เà¸à¸²à¸°à¸™à¸­à¸£à¹Œà¸Ÿà¸­à¸¥à¹Œà¸„ nf +Norfolk Adaları nf +Norfolk Utrawları nf +ОÑтрів Ðорфолк nf +Ðорфолк Ороли nf +Iye di Norfolk nf +诺ç¦å…‹å²› nf +諾ç¦å…‹å³¶ nf +Nigeria ng +Nigerië ng +نيجيريا ng +ÐÑ–Ð³ÐµÑ€Ñ‹Ñ ng +ÐÐ¸Ð³ÐµÑ€Ð¸Ñ ng +নাইজেরিয়া ng +Nijeria ng +Nigerija ng +Nigèria ng +Nigérie ng +ÎιγηÏία ng +NiÄerio ng +Nigeeria ng +نیجریه ng +Nigéria ng +An Nigéir ng +Nixéria ng +ניגריה ng +नाइजीरिया ng +Nigerija ng +Nigéria ng +Nígería ng +ナイジェリア ng +នីហ្សáŸážšáž¸áž™áŸ‰áž¶ ng +나ì´ì§€ë¦¬ì•„ ng +ບັນà»àºà»€àº¥àºµàº ng +Nigerija ng +NigÄ“rija ng +Ðигерија ng +Ðигери ng +NiÄ¡erja ng +ਨੀਜੀਰਿਆ ng +Nigéria ng +Nigéria ng +ÐÐ¸Ð³ÐµÑ€Ð¸Ñ ng +Nigeriya ng +Nigéria ng +Nigerija ng +Ðигерија ng +Nigerija ng +நிஜேரியா ng +Ðигерӣ ng +ไนจีเรีย ng +Nijerya ng +ÐÑ–Ð³ÐµÑ€Ñ–Ñ ng +ÐÐ¸Ð³ÐµÑ€Ð¸Ñ ng +Nidjeria ng +尼日利亚 ng +奈åŠåˆ©äºž ng +Nicaragua ni +Nikaragua ni +نيكاراغوا ni +Ðікарагуа ni +Ðикарагуа ni +নিকারাগà§à§Ÿà¦¾ ni +Nikwaraga ni +Nikaragva ni +Nikaragua ni +Nicaragwa ni +ÎικαÏάγουα ni +Nikaragvo ni +Nikaraagua ni +Nikaragua ni +نیکاراگویه ni +Nikaragua ni +Nikaragua ni +Nicearagua ni +ניקרגווה ni +निकारागà¥à¤† ni +Nikaragva ni +Níkaragva ni +ニカラグア ni +នីការ៉ាហ្គáŸážš ni +니카ë¼ê³¼ ni +ປາລາàºàºàº§àº ni +Nikaragva ni +Nikaragva ni +Ðикарагва ni +Ðикрагуа ni +Nikaragwa ni +ਨਿਕਾਰਗà©à¨† ni +Nikaragua ni +Nicarágua ni +Nicarágua ni +Ðикарагуа ni +Nikaragwa ni +Nikaragua ni +Nikaragva ni +Ðикарагва ni +Nikaragva ni +I-Nicaragua ni +நிகராகà¯à®µà¯‡ ni +Ðикарагуа ni +นิคาราà¸à¸±à¸§ ni +Nikaragua ni +Nikaragua ni +Ðікарагуа ni +Ðикарагуа ni +Nicaragwa ni +尼加拉瓜 ni +尼加拉瓜 ni +Netherlands nl +Nederland nl +هولندا nl +Hollandiya nl +ГалÑÐ½Ð´Ñ‹Ñ nl +Ð¥Ð¾Ð»Ð°Ð½Ð´Ð¸Ñ nl +হলà§à¦¯à¦¾à¦£à§à¦¡ nl +Izelvroioù nl +Nizozemska nl +Holanda nl +Nizozemí nl +Yr Iseldiroedd nl +Holland nl +Niederlande nl +Κάτω ΧώÏες nl +Nederlando nl +Países Bajos nl +Holland nl +Holanda nl +هلند nl +Alankomaat nl +Háland nl +Pays bas nl +Nederlân nl +An Ãsiltír nl +Países Baixos nl +הולנד nl +नीदरलैंडà¥à¤¸ nl +Nizozemska nl +Hollandia nl +Belanda nl +Holland nl +Paesi Bassi nl +オランダ nl +ហុល្លង់ nl +네ëœëž€ë“œ nl +ເນເທີà»àº¥àº™à¹Œ nl +Olandija nl +NÄ«derlande nl +Холандија nl +Ðедерланд nl +Nederland nl +Nedderlanne nl +Nederland nl +Nederland nl +Holanda nl +ਨੀਂਦਰਲੈਂਡ nl +Holandia nl +Holanda nl +Holanda nl +Olanda nl +Ðидерланды nl +Ubuholandi nl +Hollánda nl +Holandsko nl +Nizozemska nl +Холандија nl +Holandija nl +I-Netherlands nl +Nederländerna nl +நெதரà¯à®²à®¾à®¨à¯à®¤à¯ nl +Ҳуланд nl +เนเธอร์à¹à¸¥à¸™à¸”์ nl +Hollanda nl +Niderlandlar nl +Ð“Ð¾Ð»Ð»Ð°Ð½Ð´Ñ–Ñ nl +Ðидерландлар nl +Hà Lan nl +Bas Payis nl +è·å…° nl +è·è˜­ nl +Norway no +Noorweë no +النرويج no +Norveç no +ÐарвÑÐ³Ñ–Ñ no +ÐÐ¾Ñ€Ð²ÐµÐ³Ð¸Ñ no +নরওয়ে no +Norvegia no +NorveÅ¡ka no +Noruega no +Norsko no +Norwy no +Norge no +Norwegen no +ÎοÏβηγία no +Norvegio no +Noruega no +Norra no +Norvegia no +نروژ no +Norja no +Norra no +Norvège no +Noorwegen no +An Iorua no +Noruega no +נורבגיה no +नारà¥à¤µà¥‡ no +NorveÅ¡ka no +Norvégia no +Norwegia no +Noregur no +Norvegia no +ノルウェー no +áž“áŸážšážœáŸ‚ស no +ë…¸ë¥´ì›¨ì´ no +ນà»à»€àº§ no +Norvegija no +Norvēģija no +Ðорвешка no +Ðорвеги no +NorveÄ¡ja no +Norge no +Norwegen no +Noorwegen no +Noreg no +Noruega no +ਨਾਰਵੇ no +Norwegia no +Noruega no +Noruega no +Norvegia no +ÐÐ¾Ñ€Ð²ÐµÐ³Ð¸Ñ no +Noruveje no +Norga no +Nórsko no +NorveÅ¡ka no +Ðорвешка no +NorveÅ¡ka no +I-Norway no +Norge no +நாரà¯à®µà¯‡ no +Ðорвегӣ no +นอร์เวย์ no +Norveç no +ÐÐ¾Ñ€Ð²ÐµÐ³Ñ–Ñ no +ÐÐ¾Ñ€Ð²ÐµÐ³Ð¸Ñ no +Na uy no +Norvedje no +æŒªå¨ no +æŒªå¨ no +Nepal np +نيبال np +ÐÑпал np +Ðепал np +নেপাল np +Nepál np +Îεπάλ np +Nepalo np +نپال np +Népal np +Neipeal np +נפ×ל np +नेपाल np +Nepál np +ãƒãƒ‘ール np +áž“áŸáž”៉ាល់ np +네팔 np +ເວນດາ np +Nepalas np +NepÄla np +Ðепал np +Ðепал np +ਨੇਪਾਲ np +Ðепал np +Nepali np +Ðепал np +நேபாளம௠np +Ðипол np +เนปาล np +Ðепал np +Ðепал np +尼泊尔 np +尼泊爾 np +Nauru nr +ناورو nr +Ðауру nr +Ðауру nr +নাউরৠnr +Naurueg nr +Nawrw nr +ÎαουÏÎ¿Ï nr +NaÅ­ro nr +Naurú nr +نائورو nr +Naurusaaret nr +Nárúis nr +× ×ורו nr +नौरू nr +Naurski nr +Nárú nr +ナウル nr +ណូរូ nr +나우루 nr +ປາລາàºàºàº§àº nr +Ðауру nr +Ðауру nr +Nawru nr +ਨਾਉਰੂ nr +Ðауру nr +Ikinawuru nr +Ðауру nr +நௌர௠nr +Ðауру nr +นาวรู nr +Ðауру nr +Ðауру nr +Nawouro nr +ç‘™é² nr +諾魯 nr +Niue nu +Nieu nu +نيوي nu +ÐÑ–ÑžÑ nu +Ðиуе nu +নিউই nu +Niwe nu +ÎιοÏε nu +Niuo nu +نیئو nu +ניווה nu +नियू nu +ニュージーランド自治領ニウエ nu +នីវ nu +ë‹ˆìš°ì— nu +ເນ໊ຕ nu +Ðије nu +Ðиуе nu +Niwe nu +ਨੀਉਈ nu +Ðиуе nu +Ðиуе nu +நீய௠nu +Ðиу nu +นิอุเอ nu +Nive nu +Niu nu +Ðіуе nu +Ðиуе nu +Niuwé nu +纽埃 nu +ç´é„‚å³¶ nu +New Zealand nz +Nuwe Seeland nz +نيوزيلاندا nz +Yeni Zellandiya nz +ÐÐ¾Ð²Ð°Ñ Ð—ÑлÑÐ½Ð´Ñ‹Ñ nz +Ðова Ð—ÐµÐ»Ð°Ð½Ð´Ð¸Ñ nz +নিউজিলà§à¦¯à¦¾à¦£à§à¦¡ nz +Zeland nevez nz +Novi Zeland nz +Nova Zelanda nz +Nový Zéland nz +Seland Newydd nz +Neuseeland nz +Îέα Ζηλανδία nz +Nov-Zelando nz +Nueva Zelanda nz +Uus-Meremaa nz +Zelanda Berria nz +زلاندنو nz +Uusi-Seelanti nz +Nýsæland nz +Nouvelle Zélande nz +Nij Seelân nz +An Nua-Shéalainn nz +Nova Celándia nz +ניו זילנד nz +नà¥à¤¯à¥‚जीलैंड nz +Novi Zeland nz +Új-Zéland nz +Selandia Baru nz +Nýja-Sjáland nz +Nuova Zelanda nz +ニュージーランド nz +នូវែលហ្សáŸáž¡áž„់ nz +뉴질랜드 nz +ນີວຊີà»àº¥àº™ nz +Naujoji Zelandija nz +JaunZÄ“lande nz +Ðов Зеланд nz +Ð¨Ð¸Ð½Ñ Ð·ÐµÐ°Ð»Ð°Ð½Ð´ nz +Nieg Seeland nz +Nieuw Zeeland nz +Navera Zelanda nz +ਨਿਊਜ਼ੀਲੈਂਡ nz +Nowa Zelandia nz +Nova Zelândia nz +Nova Zelândia nz +Noua Zeelandă nz +ÐÐ¾Ð²Ð°Ñ Ð—ÐµÐ»Ð°Ð½Ð´Ð¸Ñ nz +Nuveli Zelande nz +Ođđa Zealánda nz +Nový Zéland nz +Nova Zelandija nz +Ðови Зеланд nz +Novi Zeland nz +I-New Zealand nz +Nya Zeeland nz +நியூசிலாநà¯à®¤à¯ nz +Зилонди Ðав nz +นิวซีà¹à¸¥à¸™à¸”์ nz +Yeni Zelanda nz +Yaña Zealand nz +Ðова Ð—ÐµÐ»Ð°Ð½Ð´Ñ–Ñ nz +Янги Ð—ÐµÐ»Ð°Ð½Ð´Ð¸Ñ nz +Nouve Zelande nz +新西兰 nz +ç´è¥¿è˜­ nz +Oman om +عÙمان om +Ðман om +Оман om +ওমান om +Omán om +Ομάν om +Omano om +Omán om +Omaan om +عمان om +Omán om +עומן om +ओमन om +Omán om +Óman om +オマーン om +អូម៉ង់ om +오만 om +ເàºàºµàºàº¥àº°àº¡àº±àº™ om +Omanas om +OmÄna om +Оман om +Оман om +ਓਮਾਨ om +Omã om +Omã om +Оман om +Omani om +Omán om +Оман om +I-Oman om +ஓமன௠om +Оман om +โอมาน om +Umman om +Оман om +Уммон om + Oman om +阿曼 om +阿曼 om +Panama pa +بنما pa +Панама pa +Панама pa +পানামা pa +Panamà pa +Παναμάς pa +Panamo pa +Panamá pa +پاناما pa +Panamá pa +פנמה pa +पनामा pa +パナマ pa +ប៉ាណាម៉ា pa +파나마 pa +ປານາມາ pa +Панама pa +Панама pa +ਪੈਨਾਮਾ pa +Panamá pa +Panamá pa +Панама pa +Панама pa +I-Panama pa +பனாமா pa +Панама pa +ปานามา pa +Панама pa +Панама pa +巴拿马 pa +巴拿馬 pa +Peru pe +البيرو pe +ПÑру pe +Перу pe +পেরৠpe +Perou pe +Perú pe +Periw pe +ΠεÏÎ¿Ï pe +Peruo pe +Perú pe +Peruu pe +پرو pe +Pérou pe +Peiriú pe +Perú pe +פרו pe +पेरू pe +Perú pe +Perù pe +ペルー pe +ប៉áŸážšáž¼ pe +페루 pe +ເປລູ pe +Перу pe +Перу pe +Pero pe +ਪੇਰੂ pe +Перу pe +Перу pe +I-Peru pe +பெர௠pe +Перу pe +เปรู pe +Перу pe +Перу pe +Perou pe +ç§˜é² pe +秘魯 pe +French Polynesia pf +Fraans Polynesië pf +بولينيزيا Ø§Ù„ÙØ±Ù†Ø³ÙŠØ© pf +ФранцуÑÐºÐ°Ñ ÐŸÐ°Ð»Ñ–Ð½ÑÐ·Ñ–Ñ pf +ÐŸÐ¾Ð»Ð¸Ð½ÐµÐ·Ð¸Ñ pf +ফরাসী পলিনেশিয়া pf +Polinezi galleg pf +Francuska Polinezija pf +Polinèsia francessa pf +Francouzská Polynésie pf +Polynesia Ffrengig pf +Fransk Polynesien pf +Französisch Polynesien pf +Γαλλική Πολυνησία pf +Franca Polinezio pf +Polinesia francesa pf +Prantsuse Polüneesia pf +Polinesia Frantziarra pf +پولونزی ÙØ±Ø§Ù†Ø³Ù‡ pf +Ranskan Polynesia pf +Polynésie française pf +Frânsk Polinesië pf +Polainéis na Fraince pf +Polinésia Francesa pf +פולינזיה הצרפתית pf +फà¥à¤°à¥‡à¤‚च पॉलीनेसिया pf +Francuska Polinezija pf +Francia-Polinézia pf +Franska Pólýnesía pf +Polinesia Francese pf +フランス領ãƒãƒªãƒã‚·ã‚¢ pf +ប៉ូលីនáŸážŸáŸŠáž¸â€‹áž”ារាំង pf +프랑스령 í´ë¦¬ë„¤ì‹œì•„ pf +àºàº£àº±à»ˆàº‡à»€àºªàº” pf +PrancÅ«zų Polinezija pf +FranÄu PolinÄ“zija pf +ФранцуÑка Полинезија pf +Франц полинеÑи pf +Polineżja FranÄ‹iża pf +Fransk Polynesia pf +Franzöösch Polynesien pf +Frans Polinesië pf +Fransk Polynesia pf +ਫਰੈਂਚ ਪੋਲੀਂਸੀਆ pf +Polinezja Francuska pf +Polinésia Francesa pf +Polinésia Francesa pf +Polinezia Franceză pf +ФранцузÑÐºÐ°Ñ ÐŸÐ¾Ð»Ð¸Ð½ÐµÐ·Ð¸Ñ pf +Polinesiya Mfaransa pf +FránskkalaÅ¡ Polynesia pf +Francúzska Polynézia pf +Francoska Polinezija pf +ФранцуÑка Полинезија pf +Francuska Polinezija pf +Franska Polynesien pf +பிரனà¯à®šà¯ போலினேசியா pf +ПулинезиÑи ФаронÑа pf +à¸à¸£à¸±à¹ˆà¸‡à¹€à¸¨à¸ªà¹‚พลีนีเซีย pf +Fransız Polinezyası pf +Frans Polinesia pf +Французька ÐŸÐ¾Ð»Ñ–Ð½ÐµÐ·Ñ–Ñ pf +Француз ÐŸÐ¾Ð»Ð¸Ð½ÐµÐ·Ð¸Ñ pf +Polynesia thuá»™c Pháp pf +Polinezeye francesse pf +法属波利尼西亚 pf +法屬波利尼西亞 pf +Papua New Guinea pg +بابوا غينيا الجديدة pg +Papua Yeni Gvineya pg +Папуа–ÐÐ¾Ð²Ð°Ñ Ð“Ð²Ñ–Ð½ÑÑ pg +Папуа Ðова Ð“Ð²Ð¸Ð½ÐµÑ pg +পাপà§à§Ÿà¦¾ নিউ গিনি pg +Papouazi Gine Nevez pg +Papua Nova Gvineja pg +Papua Nova Guinea pg +Papua - Nová Guinea pg +Papwa Gini Newydd pg +Papua Neu-Guinea pg +ΠαποÏα Îέα Γουινέα pg +Papuo-Nov-Gvineo pg +Papua Nueva Guinea pg +Paapua Uus-Guinea pg +Papua Ginea Berria pg +پاپوا گینه نو pg +Papua-Uusi-Guinea pg +Papouasie-Nouvelle-Guinée pg +Papua Nij Guinea pg +Nua-Ghuine Phapua pg +Papúa Nova Guiné pg +פפו××” ניו ×’×™× ×™ pg +पापà¥à¤† नà¥à¤¯à¥‚ गियाना pg +Papua Nova Gvineja pg +Pápua Új-Guinea pg +Papúa Nýja-Gínea pg +Papua Nuova Guinea pg +パプアニューギニア pg +ប៉ាពូញូវហ្គីណ០pg +파푸아뉴기니 pg +ເທົາອ່ອນ pg +Papua Naujoji GvinÄ—ja pg +Papua Jaungvineja pg +Папуа Ðова Гвинеја pg +Папуа ÑˆÐ¸Ð½Ñ Ð“ÑƒÐ¹Ð½ÐµÐ° pg +Papwa Ginea pg +Papua Ny-Guinea pg +Papua-Niegguinea pg +Papua Ny-Guinea pg +ਪਾਪੂਆ ਨਵਾਂ ਗੂਈਆ pg +Papua Nowa Gwinea pg +Papua Nova Guiné pg +Papua Nova Guiné pg +Papua Noua Guinee pg +Папуа-ÐÐ¾Ð²Ð°Ñ Ð“Ð²Ð¸Ð½ÐµÑ pg +Papuwa Gineya Nshya pg +Papua Ođđa-Guinea pg +Papua Nová Guinea pg +Papua Nova Gvineja pg +Папуа Ðова Гвинеја pg +Papua Nova Gvineja pg +Papua Nya Guinea pg +பாபà¯à®ªà®¾ நியூ ஜினியா pg +Папуа ГвинеиÑи Ðав pg +ปาปัวนิวà¸à¸´à¸™à¸µ pg +Papua Yeni Gine pg +Papua Yaña Guinea pg +Папуа Ðова Ð“Ð²Ñ–Ð½ÐµÑ pg +Папуа Янги Ð“Ð²Ð¸Ð½ÐµÑ pg +Papouwazeye Nouve Guinêye pg +巴布亚新几内亚 pg +巴布ç´å¹¾å…§äºž pg +Philippines ph +Fillipyne ph +الÙلبين ph +FillipinlÉ™r ph +Філіпіны ph +Филипини ph +ফিলিপিনস ph +Filipin ph +Filipini ph +Filipines ph +Filipíny ph +Ynysoedd Y Philipinau ph +Filippinerne ph +Philippinen ph +Φιλιππίνες ph +Filipinoj ph +Filipinas ph +Filipiinid ph +Filipinak ph +Ùیلیپین ph +Filippiinit ph +Filippijnen ph +Na hOileáin Fhilipíneacha ph +Filipinas ph +×¤×™×œ×™×¤×™× ×™× ph +फिलिपà¥à¤ªà¥€à¤¨à¥à¤¸ ph +Filipini ph +Fülöp-szigetek ph +Filippseyjar ph +Filippine ph +フィリピン ph +ហ្វ៊ីលីពីន ph +필리핀 ph +ອາລະປະໂຫàºàº” ph +Filipinai ph +FilipÄ«nas ph +Филипини ph +Плиппин ph +Filippini ph +Filippinene ph +Philippinen ph +Filippijnen ph +Filippinane ph +ਫਿਲੀਪੀਨਜ਼ ph +Filipiny ph +Filipinas ph +Filipinas ph +Filipine ph +Филиппины ph +Filipine ph +Filippiinat ph +Filipíny ph +Filipini ph +Филипини ph +Filipini ph +Filippinerna ph +பிலிபà¯à®ªà¯ˆà®©à¯à®¸à¯ ph +Филипин ph +ฟิลิปปินส์ ph +Filipinler ph +Filippinnär ph +Філіппіни ph +Филиппин ph +Filipenes ph +è²å¾‹å®¾ ph +è²å¾‹è³“ ph +Pakistan pk +باكستان pk +ПакіÑтан pk +ПакиÑтан pk +পাকিসà§à¦¤à¦¾à¦¨ pk +Paquistà pk +Pákistán pk +Pacistan pk +Πακιστάν pk +Pakistano pk +پاکستان pk +An Phacastáin pk +Paquistán pk +פ×קיסטן pk +पाकिसà¥à¤¤à¤¾à¤¨ pk +Pakisztán pk +パキスタン pk +ប៉ាគីស្ážáž¶áž“ pk +파키스탄 pk +ລງບ pk +Pakistanas pk +PakistÄna pk +ПакиÑтан pk +ПакиÑтан pk +ਪਾਕਿਸਤਾਨ pk +Paquistão pk +Paquistão pk +ПакиÑтан pk +Pakisitani pk +ПакиÑтан pk +பாகிஸà¯à®¤à®¾à®©à¯ pk +ПокиÑтон pk +ปาà¸à¸µà¸ªà¸–าน pk +Päqstan pk +ПакиÑтан pk +ПокиÑтон pk +å·´åŸºæ–¯å¦ pk +å·´åŸºæ–¯å¦ pk +Poland pl +بولندا pl +PolÅŸa pl +Польшча pl +Полша pl +পোলà§à¦¯à¦¾à¦£à§à¦¡ pl +Polonia pl +Poljska pl +Polònia pl +Polsko pl +Gwlad Pwyl pl +Polen pl +Polen pl +Πολωνία pl +Pollando pl +Polonia pl +Poola pl +Polonia pl +لهستان pl +Puola pl +Pólland pl +Pologne pl +Polen pl +An Pholainn pl +Polónia pl +פולין pl +पोलैंड pl +Poljska pl +Lengyelország pl +Polandia pl +Pólland pl +Polonia pl +ãƒãƒ¼ãƒ©ãƒ³ãƒ‰ pl +ប៉ូឡូញ pl +í´ëž€ë“œ pl +ໂປà»àº¥àº™ pl +Lenkija pl +Polija pl +ПолÑка pl +Польш pl +Polonja pl +Polen pl +Polen pl +Polen pl +Polen pl +Polònia pl +ਪੋਲੈਂਡ pl +Polska pl +Polónia pl +Polônia pl +Polonia pl +Польша pl +Polonye pl +Polska pl +Poľsko pl +Poljska pl +ПољÑка pl +Poljska pl +I-Poland pl +Polen pl +போலாநà¯à®¤à¯ pl +ÐŸÐ¾Ð»Ð°Ð½Ð´Ð¸Ñ pl +โปà¹à¸¥à¸™à¸”์ pl +Polonya pl +Polonia, PolÅŸa pl +Польща pl +Полша pl +Pholandi pl +Ba Lan pl +Pologne pl +波兰 pl +波蘭 pl +Saint Pierre and Miquelon pm +St Pierre en Miquelon pm +سانت بيير Ùˆ ميكيلون pm +Saint Pierre vÉ™ Miquelon pm +СÑн-П'ер Ñ– Мікелон pm +Св. Пиер и Магелан pm +সেনà§à¦Ÿ পিয়ের à¦à¦¬à¦‚ মিকেলন pm +Sant Per ha Mikelon pm +Sveti Pjer i Migelon pm +Saint Pierre i Miquelon pm +Saint Pierre a Miquelon pm +Ynysoedd Sant Pierre a Micwelon pm +Saint Pierre og Miquelon pm +Saint Pierre und Miquelon pm +Σαιν Î Î¹Î­Ï (Άγιος ΠέτÏος) και Μικελόν pm +Sent-Piero kaj Mikelono pm +Saint Pierre y Miquelon pm +Saint Pierre ja Miquelon pm +Saint Pierre eta Miquelon pm +سنت Ù¾ÛŒÙØ± Ùˆ میکولئون pm +Saint-Pierre ja Miquelon pm +Saint-Pierre-et-Miquelon pm +Saint Pierre en Miquelon pm +Peadar Naofa agus Micilín pm +Saint Pierre e Miquelon pm +ס×ן פייר ומיקלון pm +सेंट पियरे तथा मिकà¥à¤µà¥‡à¤²à¤¨ pm +Saint Pierre i Miquelon pm +Saint Pierre és Miquelon pm +Sankti Pierre og Miquelon pm +Saint Pierre e Miquelon pm +フランス海外領土サンピエールミクロン諸島 pm +세ì¸íЏ 피ì—르 미쿠엘론 pm +SenpjÄ“ra un Mikelona pm +Свети Пјер и Микелон pm +Сайнт пиерре ба микуелон pm +Saint Pierre u Miquelon pm +Saint-Pierre-et-Miquelon pm +Sankt Pierre un Miquelon pm +Saint Pierre en Miquelon pm +Saint-Pierre-et-Miquelon pm +ਸੇਂਟ ਪੀਈਰੀ ਤੇ ਮਾਕਿਉਲੋਨ pm +Saint Pierre i Miquelon pm +S. Pedro e Miquelão pm +Saint Pierre e Miquelon pm +Saint Pierre ÅŸi Miquelon pm +Сен-Пьер и Микелон pm +Mutagatifu Petero na Mikelo pm +Saint-Pierre-et-Miquelon pm +Saint Pierre a Miquelon pm +Sveti Pierre in Miquelon pm +Св. Пјер и Микелон pm +Sv. Pjer i Mikelon pm +Saint Pierre och Miquelon pm +செயினà¯à®Ÿà¯ பியரி மறà¯à®±à¯à®®à¯ மிகà¯à®¯à¯à®²à®©à¯ pm +Синт Пир Миколеюн pm +เซนต์ปิà¹à¸­à¸£à¹Œ à¹à¸¥à¸°à¸¡à¸´à¹€à¸„อลอน pm +Saint Pierre ve Miquelon pm +Saint Pierre wä Miquelon pm +Сент-П'єр Ñ– Мікелон pm +Сент-Пер ва Микелон pm +Sint Pire et Miquelon pm +圣皮埃尔和密克隆 pm +è–皮埃爾島åŠå¯†å…‹éš†å³¶ pm +Pitcairn pn +بيتكايرن pn +ПіткÑрн pn +ОÑтрови Питкерн pn +পিটকেম pn +Pitkern pn +Ynys Pitcairn pn +ΠίτκαιÏν pn +Pitkarna Insulo pn +پیت Ú©ÙØ±Ù† pn +פיטקרן pn +पिटकैरà¥à¤¨ pn +英領ピトケアン諸島 pn +í•케언 pn +ລງບ pn +PitkÄ“rna pn +Питкерн pn +Питкайрн pn +ਪੀਟਕਾਰਨ pn +Питкаирн pn +பிடà¯à®•ாயà¯à®©à¯ pn +Питкорин pn +เà¸à¸²à¸°à¸žà¸´à¸•à¹à¸„ร์น pn +Pitkairn pn +Питкерн pn +çš®ç‰¹å¼€æ© pn +匹特開æ©å³¶ pn +Puerto Rico pr +بورتوريكو pr +Puerto Riko pr +ПуÑрта Рыка pr +Порто Рико pr +পà§à§Ÿà§‡à¦°à§à¦¤à§‹ রিকো pr +Porto Rico pr +Portoriko pr +Portoriko pr +Pwerto Rico pr +ΠουέÏτο Ρίκο pr +Puerto-Riko pr +پورتوریکو pr +Porto Rico pr +Portó Ríce pr +Porto Rico pr +פורטו ריקו pr +पà¥à¤¯à¥‚रà¥à¤Ÿà¥‹ रिको pr +Portoriko pr +Púertó Ríkó pr +Portorico pr +プエルトリコ pr +áž–áŸážšážáž¼ážšáž¸áž€áž¼ pr +푸ì—르토리코 pr +ໂປຣໂຕຄອນ pr +Puerto Rikas pr +Puertoriko pr +Порто Рико pr +Пуерто Рико pr +ਰੂਇਰਟੂ ਰੀਕੋ pr +Porto Rico pr +Porto Rico pr +ПуÑрто-Рико pr +Porito Riko pr +Portoriko pr +Порторико pr +Portoriko pr +பà¯à®¯à¯à®°à¯à®Ÿà¯‹ ரிகோ pr +Пурто Рико pr +เปอร์โตริโภpr +Porta Riko pr +Puerto Riko pr +Пуерто-Ріко pr +ПуÑрто-Рико pr +Porto Rico pr +æ³¢å¤šé»Žå„ pr +æ³¢å¤šé»Žå„ pr +Palestinian Territory ps +Palesteinse Gebied ps +السلطة الÙلسطينية ps +FÉ™lÉ™stin SahÉ™si ps +ПалеÑтынÑÐºÐ°Ñ Ñ‚ÑÑ€Ñ‹Ñ‚Ð¾Ñ€Ñ‹Ñ ps +ПалеÑтина ps +পà§à¦¯à¦¾à¦²à§‡à¦¸à§à¦Ÿà¦¿à¦¨à¦¿à§Ÿà¦¾à¦¨ টেরিটরি ps +Palestinska teritorija ps +Territori Palestí ps +Palestinské území ps +Tiriogaeth Palesteina ps +Palæstinensiske selvstyreomrÃ¥der ps +Palästinensisches Gebiet ps +Παλαιστίνη ps +Palestina Teritorio ps +Territorio palestino ps +Palestiina ps +Palestina ps +Ùلسطین ps +Palestiinalaisalue ps +Palestinensiska økið ps +Territoire palestinien ps +Palestijnsk territorium ps +Críoch na bPalaistíneach ps +Território Palestino ps +×”×©×˜×—×™× ×”×¤×œ×¡×˜×™× ×™×™× ps +फिलीसà¥à¤¤à¥€à¤¨à¥€ टेरिटरी ps +Palestinski teritorij ps +Palesztin területek ps +Palestína ps +Palestina ps +パレスãƒãƒŠè‡ªæ²»åŒº ps +ប៉ាលáŸážŸáŸ’ទីន ps +íŒ”ë ˆìŠ¤íƒ€ì¸ ìžì¹˜êµ¬ ps +àºàº²àº™àºžàº´àº¡àºœàº´àº”ພາດ ps +Palestinos teritorija ps +PalestÄ«nieÅ¡u treitorija ps +ПалеÑтинÑки територии ps +ПалеÑтины газар нутаг ps +Palestina ps +Palestinske territorier ps +De palästinensche sülvenregeerte Regioon ps +Palestijns territorium ps +Palestinske territorium ps +Bohwa bja Palestina ps +ਫਲਾਸਤੀਨ ਖੇਤਰ ps +Palestyna ps +Território Palestiniano ps +Território Palestino ps +Teritoriul Palestinian ps +ПалеÑтинÑкие территории ps +Igihugu cya Palesitina ps +PalestiinnalaÅ¡ territoria ps +Palestínske územia ps +Palestinski teritorij ps +ПалеÑтина ps +Palestina ps +I-Palestinian Territory ps +Palestina ps +பாலஸà¯à®¤à¯€à®© ஆணையம௠ps +ФалаÑтин ps +เขตปà¸à¸„รองปาเลสไตน์ ps +Filistin Bölgesi ps +Fälestin ps +ПалеÑтинÑька Ñ‚ÐµÑ€Ð¸Ñ‚Ð¾Ñ€Ñ–Ñ ps +ФалаÑтин Ерлари ps +Mukano wa maphalesitina ps +Lãnh thổ cá»§a Palestine ps +Palestene ps +Umhlaba wePalestina ps +å·´å‹’æ–¯å¦åœ°åŒº ps +å·´å‹’æ–¯å¦é ˜åœ° ps +Indawo yama-Phalesitina ps +Portugal pt +البرتغال pt +Portuqaliya pt +ÐŸÐ°Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ñ–Ñ pt +ÐŸÐ¾Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ð¸Ñ pt +পোরà§à¦¤à§à¦—াল pt +Portugalsko pt +Portiwgal pt +ΠοÏτογαλία pt +Portugalo pt +پرتغال pt +Portugali pt +An Phortaingéil pt +פורטוגל pt +पà¥à¤°à¥à¤¤à¤—ाल pt +Portugália pt +Portúgal pt +Portogallo pt +ãƒãƒ«ãƒˆã‚¬ãƒ« pt +áž–áŸážšáž‘ុយហ្គាល់ pt +í¬ë¥´íˆ¬ê°ˆ pt +ໂປຣຕຸເàºàºª pt +Portugalija pt +PortugÄle pt +Португалија pt +Португал pt +Portugall pt +ਪà©à¨°à¨¤à¨—ਾਲ pt +Portugalia pt +Portugalia pt +ÐŸÐ¾Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ð¸Ñ pt +Poritigali pt +Portugalsko pt +Portugalska pt +Португал pt +I-Portugal pt +போரà¯à®¤à¯à®¤à¯à®•ல௠pt +Пуртуқол pt +โปรตุเà¸à¸ª pt +Portekiz pt +Portugalia pt +ÐŸÐ¾Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ñ–Ñ pt +ÐŸÐ¾Ñ€Ñ‚ÑƒÐ³Ð°Ð»Ð¸Ñ pt +Bồ Äào Nha pt +è‘¡è„牙 pt +è‘¡è„牙 pt +Palau pw +بالاو pw +Палау pw +Палау pw +পালাউ pw +Palaw pw +Παλάου pw +Palao pw +پالائو pw +פל×ו pw +पलाऊ pw +Palá pw +パラオ pw +ប៉ាឡូ pw +팔ë¼ìš° pw +ມອລຕາ pw +Палау pw +Палау pw +ਪਾਲਾਉ pw +Палау pw +Palawu pw +Палау pw +பலாவ௠pw +Палау pw +เà¸à¸²à¸°à¸žà¸²à¹€à¸¥à¸² pw +Палау pw +Палау pw +Palawou pw +帕劳 pw +å¸›ç‰ pw +Paraguay py +Paraguaai py +باراغواي py +Paraqvay py +Парагвай py +Парагвай py +পà§à¦¯à¦¾à¦°à¦¾à¦—à§à§Ÿà§‡ py +Paragwae py +Paragvaj py +Paraguai py +Paragw?i py +ΠαÏαγουάη py +Paragvajo py +Paraguai py +پاراگویه py +Paragua py +Paraguai py +פרגו××™ py +पैरागà¥à¤ py +Paragvaj py +Paragvæ py +パラグアイ py +ប៉ារ៉ាហ្គាយ py +파ë¼ê³¼ì´ py +ປາລາàºàºàº§àº py +Paragvajus py +Paragvaja py +Парагвај py +Парагвай py +Paragwaj py +Paraguai py +ਪਾਰਾਗà©à¨† py +Paragwaj py +Paraguai py +Paraguai py +Paraguai py +Парагвай py +Paragwe py +Portugalsko py +Paragvaj py +Парагвај py +Paragvaj py +I-Paraguay py +பராகà¯à®µà¯‡ py +Порогвие py +ปาราà¸à¸§à¸±à¸¢ py +Парагвай py +Парагвай py +Paragway py +巴拉圭 py +巴拉圭 py +Qatar qa +قطر qa +Катар qa +Катар qa +কাতার qa +Kwatar qa +Katar qa +Katar qa +Catar qa +Katar qa +ÎšÎ±Ï„Î¬Ï qa +Kataro qa +Katar qa +قطر qa +Katar qa +Catar qa +קטר qa +क़तर qa +Katar qa +Katar qa +Katar qa +カタール qa +កាážáž¶ážš qa +카타르 qa +ມອລຕາ qa +Kataras qa +Katara qa +Катар qa +Катар qa +Katar qa +ਕਤਰ qa +Katar qa +Катар qa +Katari qa +Katar qa +Katar qa +Катар qa +Katar qa +I-Qatar qa +கதார௠qa +Қатар qa +ควาตาร์ qa +Katar qa +Катар qa +Қатар qa +Katar qa +å¡å¡”å°” qa +å¡é” qa +Romania ro +Romenië ro +رومانيا ro +Rumıniya ro +Ð ÑƒÐ¼Ñ‹Ð½Ñ–Ñ ro +Ð ÑƒÐ¼ÑŠÐ½Ð¸Ñ ro +রà§à¦®à§‡à¦¨à¦¿à§Ÿà¦¾ ro +Roumani ro +Rumunija ro +Rumunsko ro +Rumænien ro +Rumänien ro +Ρουμανία ro +Rumanio ro +Rumanía ro +Rumeenia ro +Errumania ro +رومانی ro +Rumenia ro +Roumanie ro +Roemenië ro +An Rómáin ro +Románia ro +רומניה ro +रोमानिया ro +Rumunjska ro +Románia ro +Rumania ro +Rúmenía ro +ルーマニア ro +រូម៉ានី ro +루마니아 ro +ໂລມາເນີຠro +Rumunija ro +RumÄnija ro +Романија ro +Румын ro +Rumanija ro +Rumänien ro +Roemenië ro +ਰੋਮਾਨੀਆ ro +Rumunia ro +Roménia ro +Romênia ro +România ro +Ð ÑƒÐ¼Ñ‹Ð½Ð¸Ñ ro +Romaniya ro +Románia ro +Rumunsko ro +Romunija ro +Румунија ro +Rumunija ro +I-Romania ro +Rumänien ro +à®°à¯à®®à¯‡à®©à®¿à®¯à®¾ ro +Ð ÑƒÐ¼Ð¸Ð½Ð¸Ñ ro +โรมาเนีย ro +Romanya ro +Ð ÑƒÐ¼ÑƒÐ½Ñ–Ñ ro +Ð ÑƒÐ¼Ð¸Ð½Ð¸Ñ ro +Roumaneye ro +罗马尼亚 ro +羅馬尼亞 ro +Russia ru +Rusland ru +روسيا ru +Rusiya ru +РаÑÐµÑ ru +РуÑÐ¸Ñ ru +রাশিয়া ru +Rusia ru +Rusija ru +Rússia ru +Rusko ru +Rwsia ru +Rusland ru +Russland ru +Ρωσία ru +Ruslando ru +Rusia ru +Venemaa ru +Errusia ru +روسیه ru +Venäjä ru +Russland ru +Russie ru +Rusland ru +An Rúis ru +Rúsia ru +רוסיה ru +रà¥à¤¸ ru +Rusija ru +Oroszország ru +Rusia ru +Rússland ru +ロシア ru +រូស្ស៊ី ru +러시아 ru +ລັດເຊີຠru +Rusija ru +Krievija ru +РуÑија ru +ÐžÑ€Ð¾Ñ ru +Russja ru +Russland ru +Russland ru +Rusland ru +Russland ru +ਰੂਸ ru +Rosja ru +Rússia ru +Rússia ru +Rusia ru +РоÑÑÐ¸Ñ ru +Uburusiya ru +Ruošša ru +Rusko ru +Rusija ru +РуÑија ru +Rusija ru +I-Russia ru +Ryssland ru +ரசியா ru +РуÑÑÐ¸Ñ ru +รัสเซีย ru +Rusya ru +Urısia, Räsäy ru +РоÑÑ–Ñ ru +РоÑÑÐ¸Ñ ru +Rashia ru +Nga ru +Rûsseye ru +Rashiya ru +ä¿„ç½—æ–¯ ru +ä¿„ç¾…æ–¯ ru +Rwanda rw +رواندا rw +Ruanda rw +Руанда rw +Руанда rw +রোয়ানà§à¦¡à¦¾ rw +Ruanda rw +Ruanda rw +Ruanda rw +Ρουάντα rw +Ruando rw +Ruanda rw +رواندا rw +Ruanda rw +Ruanda rw +Ruanda rw +רו×נדה rw +रवांडा rw +Ruanda rw +Ruanda rw +Rúanda rw +Ruanda rw +ルワンダ rw +រវ៉ាន់ដា rw +르완다 rw +à»àºžàº™àº”້າ rw +Ruanda rw +Ruanda rw +Руанда rw +Рванда rw +Ruanda rw +ਰਵਾਂਡਾ rw +Ruanda rw +Ruanda rw +Ruanda rw +Ruanda rw +Руанда rw +Ruanda rw +Руанда rw +Ruanda rw +வானà¯à®Ÿà®¾ rw +Руондо rw +รวันด้า rw +Ruanda rw +Руанда rw +Рванда rw +墿—ºè¾¾ rw +ç›§å®‰é” rw +Saudi Arabia sa +Saudi Arabië sa +السعودية sa +SÉ™udi ÆrÉ™bistan sa +СаудаўÑÐºÐ°Ñ ÐÑ€Ð°Ð±Ñ–Ñ sa +СаудитÑка ÐÑ€Ð°Ð±Ð¸Ñ sa +সৌদি আরব sa +Arabi Saudiet sa +Saudijska Arabija sa +Aràbia Saurí sa +Saúdská Arábie sa +Sawdi Arabia sa +Saudi Arabien sa +Saudi-Arabien sa +Σαουδική ΑÏαβία sa +SaÅ­da Arabio sa +Arabia Saudí sa +Saudi Araabia sa +عربستان سعودی sa +Saudi-Arabia sa +Arabie Saoudite sa +Saudi-Arabië sa +An Araib Shádach sa +Arabia Saudita sa +ערב הסעודית sa +सऊदी अरब sa +Saudijska Arabija sa +Szaúd-Arábia sa +Sádi-Arabía sa +Arabia Saudita sa +サウジアラビア sa +អារ៉ាប៊ីសាអ៊ូឌីហsa +사우디 ì•„ë¼ë¹„ì•„ sa +ອາລະບິຠsa +Saudo Arabija sa +SaÅ«da ArÄbija sa +СаудиÑка Ðрабија sa +Саудын араб sa +Għarabja Sawdita sa +Saudi-Arabia sa +Saudi Arabien sa +Saudi-Arabië sa +Saudi-Arabia sa +ਸਾਊਦੀ ਅਰਬ sa +Arabia Saudyjska sa +Arábia Saudita sa +Arábia Saudita sa +Arabia Saudită sa +СаудовÑÐºÐ°Ñ ÐÑ€Ð°Ð²Ð¸Ñ sa +Arabiya Sawudite sa +Saudi Arábia sa +Saudská arábia sa +Saudova Arabija sa +СаудијÑка Ðрабија sa +Saudijska Arabija sa +I-Saudi Arabia sa +Saudiarabien sa +சவà¯à®¤à®¿ அரேபியா sa +ÐрабиÑтони Саудӣ sa +ซาอุดิอาระเบีย sa +Suudi Arabistan sa +Söğüd Ğäräbstan sa +СаудівÑька ÐÑ€Ð°Ð²Ñ–Ñ sa +Ð¡Ð°ÑƒÐ´Ð¸Ñ ÐрабиÑтони sa +Ẩrập Saudi sa +Arabeye Sawoudite sa +沙特阿拉伯 sa +æ²™çƒåœ°é˜¿æ‹‰ä¼¯ sa +Solomon Islands sb +Solomon Eilande sb +جزر سليمان sb +Solomon Adaları sb +Саламонавы аÑтравы sb +Соломонови оÑтрови sb +সলোমন দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ sb +Inizi Salaun sb +Solomonska ostrva sb +Illes Solomon sb +Å alamounovy ostrovy sb +Ynysoedd Solomon sb +Salomon-øerne sb +Salomon-Inseln sb +Îήσοι Σολομώντος sb +Salomonoj sb +Islas Salomón sb +Saalomoni saared sb +Solomon Irlak sb +جزایر سلیمان sb +Solomon-saaret sb +ÃŽles Salomon sb +Solomon Eilannen sb +Oileáin Sholamón sb +Illas Salomón sb +××™×™ שלמה sb +सोलोमन आइलैंड sb +Solomonova otoÄja sb +Salamon-szigetek sb +Salómonseyjar sb +Isole Salomone sb +ソロモン諸島 sb +កោះ​សូឡូម៉ូន sb +솔로몬 ì œë„ sb +ສະໂລວະເນີຠsb +Saliamono salos sb +Solomonu salas sb +СоломонÑки ОÑтрови sb +Соломоны арлууд sb +Gżejjer Solomon sb +Salomonøyene sb +Salomonen sb +Solomon Eilanden sb +Salomonøyane sb +ਸੋਲੋਮੋਨ ਆਈਸਲੈਂਡ sb +Wyspy Salomona sb +Ilhas Salomão sb +Ilhas Salomão sb +Insulele Solomon sb +Соломоновы оÑтрова sb +Ibirwa bya Salomo sb +Salomonsullot sb +Å alamúnove ostrovy sb +Solomonovi otoki sb +Соломонова оÑтрва sb +Solomonova ostrva sb +Salomonöarna sb +சாலமன௠தீவà¯à®•ள௠sb +Ҷазираи Сулаймон sb +หมู่เà¸à¸²à¸°à¹‚ซโลมอน sb +Solomon Adaları sb +Solomon Utrawları sb +Соломонові оÑтрови sb +Соломон Ороллари sb +Quần đảo Solomon sb +Iyes Salomon sb +所罗门群岛 sb +索羅門群島 sb +Seychelles sc +سيشل sc +СÑйшÑлы sc +СейшелÑки оÑтрови sc +সীচিলিস sc +Sechell sc +SejÅ¡eli sc +Ynysoedd y Seisi?l sc +Seychellerne sc +Seychellen sc +Σεϋχέλλες sc +SejÅeloj sc +SeiÅ¡ellid sc +سیشل sc +Seychellit sc +Seychellen sc +Na Séiséil sc +Seicheles sc +××™×™ סיישל sc +शेसेलà¥à¤¸ sc +SejÅ¡eli sc +Seychelles-eyjar sc +セイシェル sc +សីស្ហែល sc +세ì´ì…¸ sc +ເຊລ sc +SeiÅ¡eļu salas sc +Сејшели sc +Ð¡ÐµÐ¹Ñ‡ÐµÐ»Ð»Ð¸Ñ sc +Seychellene sc +Seychellen sc +Seychellen sc +Seychellane sc +ਸੀਲਚੀਲੀਸ sc +Seszele sc +Ilhas Seychelles sc +СейшельÑкие оÑтрова sc +Seyishele sc +SeyÅ¡ellat sc +SejÅ¡eli sc +Сејшели sc +SejÅ¡eli sc +Seychellerna sc +சேசெலà¯à®²à®¸à¯ sc +Сейшелӣ sc +ซีเชลล์ sc +SeyÅŸeller sc +SeyÅŸellär sc +СейшельÑькі оÑтрови sc +Сейшел Ороллари sc +Seycheles sc +塞舌尔 sc +塞席爾 sc +Sudan sd +السودان sd +Судан sd +Судан sd +সà§à¦¦à¦¾à¦¨ sd +Sondan sd +Sudán sd +Swdan sd +Σουδάν sd +Sudano sd +Sudán sd +Sudaan sd +سودان sd +Sudania sd +Soudan sd +An tSúdáin sd +Sudán sd +סודן sd +सूडान sd +Szudán sd +Súdan sd +スーダン sd +ស៊ូដង់ sd +수단 sd +ຊູດານ sd +Sudanas sd +SudÄna sd +Судан sd +Судан sd +ਸੂਡਾਨ sd +Sudão sd +Sudão sd +Судан sd +Sudani sd +Sudán sd +Судан sd +I-Sudan sd +சூடான௠sd +Судон sd +ซูดาน sd +Судан sd +Судан sd +Sudani sd +Soudan sd +è‹ä¸¹ sd +蘇丹 sd +Sweden se +Swede se +السويد se +İsveç se +ШвÑÑ†Ñ‹Ñ se +Ð¨Ð²ÐµÑ†Ð¸Ñ se +সà§à¦‡à¦¡à§‡à¦¨ se +Å vedska se +Suècia se +Å védsko se +Sverige se +Schweden se +Σουηδία se +Svedio se +Suecia se +Rootsi se +Suedia se +سوئد se +Ruotsi se +Svøriki se +Suède se +Zweden se +An tSualainn se +Suécia se +שבדיה se +सà¥à¤µà¥€à¤¡à¤¨ se +Å vedska se +Svédország se +Swedia se +Svíþjóð se +Svezia se +スウェーデン se +ស៊ុយអែដ se +ìŠ¤ì›¨ë´ se +ສະວີເດນ se +Å vedija se +Zviedrija se +ШведÑка se +Швед se +Svezja se +Sverige se +Zweden se +Sverige se +Suècia se +ਸਵੀਡਨ se +Szwecja se +Suécia se +Suécia se +Suedia se +Ð¨Ð²ÐµÑ†Ð¸Ñ se +Suwede se +Ruoŧŧa se +Å védsko se +Å vedska se +ШведÑка se +Å vedska se +I-Sweden se +Sverige se +சà¯à®µà¯€à®Ÿà®©à¯ se +Шведӣ se +สวีเดน se +İsveç se +İswäc, Åžwedsia se +Ð¨Ð²ÐµÑ†Ñ–Ñ se +Ð¨Ð²ÐµÑ†Ð¸Ñ se +Swidene se +Thuỵ Äiển se +Suwede se +瑞典 se +瑞典 se +Singapore sg +سنغاÙورة sg +Sinqapur sg +Сынгапур sg +Сингапур sg +সিঙà§à¦—াপà§à¦° sg +Singapour sg +Singapur sg +Singapur sg +Singapur sg +Singap?r sg +Singapur sg +ΣινγκαποÏÏη sg +Singapuro sg +Singapur sg +Singapur sg +سنگاپور sg +Singapour sg +Singeapór sg +Singapur sg +סינגפור sg +सिंगापोर sg +Singapur sg +Szingapúr sg +Singapúr sg +シンガãƒãƒ¼ãƒ« sg +សិង្ហបុរី sg +싱가í¬ë¥´ sg +ໂຊນາ sg +SingapÅ«ras sg +SingapÅ«ra sg +Сингапур sg +Сингафур sg +Singapura sg +Singapor sg +Singapur sg +ਸਿੰਘਾਪà©à¨° sg +Singapur sg +Singapura sg +Singapura sg +Сингапур sg +Singapur sg +Singapur sg +Сингапур sg +Singapur sg +சிஙà¯à®•பà¯à®ªà¯‚ர௠sg +Сингопур sg +สิงคโปร์ sg +Singapur sg +Singapur sg +Сінгапур sg +Сингапур sg +Singapour sg +æ–°åŠ å¡ sg +æ–°åŠ å¡ sg +Saint Helena sh +St Helena sh +سانت هيلانة sh +ВоÑтраў СьвÑтой Ðлены sh +Св. Елена sh +সেনà§à¦Ÿ হেলেনা sh +Sant Lena sh +Sveta Helena sh +Santa Helena sh +Svatá Helena sh +Ynys Santes Helena sh +St. Helena sh +St. Helena sh +Αγία Ελένη sh +Sent-Heleno sh +Santa Helena sh +سنت هلن sh +Sainte-Hélène sh +Sint Helena sh +San Héilin sh +Santa Helena sh +סט. הלנה sh +सेंट हेलेना sh +Sveta Helena sh +Szent Heléna sh +Sankti Helena sh +Sant'Elena sh +英領セントヘレナ島 sh +សង់ហáŸáž¡áŸážŽáž¶ sh +세ì¸íŠ¸í—¬ë ˆë‚˜ sh +ຫົວເລື່ອງ sh +Å v. Elenos sala sh +Sv. HelÄ“nas sala sh +Света Елена sh +Сайнт Хелена sh +St. Helena sh +Sankt Helena sh +St. Helena sh +ਸੇਂਟ ਹੀਲੀਨਆ sh +ÅšwiÄ™ta Helena sh +Santa Helena sh +Santa Helena sh +Sfînta Elena sh +оÑтров СвÑтой Елены sh +Mutagatifu Helena sh +St. Helena sh +Svätá Helena sh +Sveta Helena sh +Света Јелена sh +Sveta Jelena sh +செயினà¯à®Ÿà¯ ஹேலேனா sh +Синт Ҳилин sh +เซนต์เฮเลน่า sh +ОÑтрів СвÑтої Єлени sh +Ðвлиё Елена Ороли sh +Sint Elene sh +圣赫勒拿 sh +è–赫勒拿島 sh +Slovenia si +Slovenië si +سلوÙينيا si +Sloveniya si +Ð¡Ð»Ð°Ð²ÐµÐ½Ñ–Ñ si +Ð¡Ð»Ð¾Ð²ÐµÐ½Ð¸Ñ si +সà§à¦²à§‹à¦­à§‡à¦¨à¦¿à§Ÿà¦¾ si +Sloveni si +Slovenija si +Eslovènia si +Slovinsko si +Slofenia si +Slovenien si +Slowenien si +Σλοβενία si +Slovenio si +Eslovenia si +Sloveenia si +Eslovenia si +اسلوانی si +Slovénie si +Slowenië si +An tSlóivéin si +Eslovénia si +סלובניה si +सà¥à¤²à¥‹à¤µà¥‡à¤¨à¤¿à¤¯à¤¾ si +Slovenija si +Szlovénia si +Slóvenía si +スロベニア si +ស្លូវ៉ានី si +슬로베니아 si +ສະໂລວະເນີຠsi +SlovÄ—nija si +SlovÄ“nija si +Словенија si +Слован si +Slovenja si +Slowenien si +Slowenië si +Eslovenia si +ਸਲੋਵੀਨੀਆ si +SÅ‚owenia si +Eslovénia si +Eslovênia si +Ð¡Ð»Ð¾Ð²ÐµÐ½Ð¸Ñ si +Siloveniya si +Slovinsko si +Slovenija si +Словенија si +Slovenija si +I-Slovenia si +Slovenien si +சà¯à®²à¯‹à®µà®¿à®©à®¿à®¯à®¾ si +УÑлувонӣ si +สโลเวเนีย si +Slovenya si +Ð¡Ð»Ð¾Ð²ÐµÐ½Ñ–Ñ si +Ð¡Ð»Ð¾Ð²ÐµÐ½Ð¸Ñ si +Esloveneye si +斯洛文尼亚 si +斯洛維尼亞 si +Slovakia sk +Slovakië sk +Ø³Ù„ÙˆÙØ§ÙƒÙŠØ§ sk +Slovakiya sk +Ð¡Ð»Ð°Ð²Ð°ÐºÑ–Ñ sk +Ð¡Ð»Ð¾Ð²Ð°ÐºÐ¸Ñ sk +সà§à¦²à§‹à¦­à¦¾à¦•িয়া sk +Slovaki sk +SlovaÄka sk +Eslovàquia sk +Slovensko sk +Slofacia sk +Slovakiet sk +Slowakien sk +Σλοβακία sk +Slovakujo sk +Eslovaquia sk +Slovakkia sk +Eslovakia sk +اسلواکی sk +Slovaquie sk +Slowakije sk +An tSlóvaic sk +Eslováquia sk +סלובקיה sk +सà¥à¤²à¥‹à¤µà¤¾à¤•िया sk +SlovaÄka sk +Szlovákia sk +Slóvakía sk +Slovacchia sk +スロãƒã‚­ã‚¢ sk +ស្លូវ៉ាគី sk +슬로바키아 sk +ສະໂລວັຠsk +Slovakija sk +SlovÄkija sk +Словачка sk +Словак sk +Slovakja sk +Slowakei sk +Slowakije sk +ਸਲੋਵਾਕਿਆ sk +SÅ‚owacja sk +Eslováquia sk +Eslováquia sk +Slovacia sk +Ð¡Ð»Ð¾Ð²Ð°ÐºÐ¸Ñ sk +Silovakiya sk +Slovákia sk +Slovensko sk +SlovaÅ¡ka sk +Словачка sk +SlovaÄka sk +I-Slovakia sk +Slovakien sk +சà¯à®²à¯‹à®µà®¾à®•à¯à®•ிய sk +УÑлувок sk +สโลวาเà¸à¸µà¸¢ sk +Slovakya sk +Ð¡Ð»Ð¾Ð²Ð°ÐºÑ–Ñ sk +Ð¡Ð»Ð¾Ð²Ð°ÐºÐ¸Ñ sk +Eslovakeye sk +斯洛ä¼å…‹ sk +斯洛ä¼å…‹ sk +San Marino sm +سان مارينو sm +Сан-Марына sm +Сан Марино sm +সান মারিনো sm +Σαν ΜαÏίνο sm +San-Marino sm +سن‌مارینو sm +Saint-Marin sm +San Mairíne sm +סן מרינו sm +सेन मेरिनो sm +San Marínó sm +サンマリノ sm +សាន់ម៉ារីណូ sm +산마리노 sm +ໂຊນາ sm +San Marinas sm +SanmarÄ«no sm +Сан Марино sm +Сан Марино sm +ਸਨ ਮਰੀਨੋ sm +São Marino sm +Сан-Марино sm +Mutagatifu Marini sm +Сан Марино sm +சான௠மரினோ sm +Сан Морину sm +ซานมาริโน sm +Сан-Маріно sm +Сан-Марино sm +Sint Marin sm +圣马力诺 sm +è–馬力諾 sm +Senegal sn +السنغال sn +Seneqal sn +СÑнÑгал sn +Сенегал sn +সেনেগল sn +Σενεγάλη sn +Senegalo sn +سنگال sn +Senegali sn +Sénégal sn +An tSeineagáil sn +סנגל sn +सेनेगल sn +Szenegál sn +ã‚»ãƒã‚¬ãƒ« sn +សáŸáž“áŸáž áŸ’គាល់ sn +세네갈 sn +ທົ່ວໄປ sn +Senegalas sn +SenegÄla sn +Сенегал sn +Сенегал sn +Senegall sn +ਸੈਨੇਗਾਲ sn +Сенегал sn +Senegali sn +Сенегал sn +சீனேகல௠sn +Синегол sn +เซนีà¸à¸±à¸¥ sn +Сенегал sn +Сенегал sn +SenegÃ¥l sn +塞内加尔 sn +塞內加爾 sn +Somalia so +Somalië so +صومال so +Somali so +Самалі so +Ð¡Ð¾Ð¼Ð°Ð»Ð¸Ñ so +সোমালিয়া so +Somali so +Somalija so +Somàlia so +Somálsko so +Σομαλία so +Somalio so +Somaalia so +سومالی so +Somalie so +Somalie so +An tSomáil so +Somália so +סומליה so +सोमालिया so +Somalija so +Szomália so +Sómalía so +ソマリア so +សូម៉ាលី so +소ë§ë¦¬ì•„ so +ໂລມາເນີຠso +Somalis so +SomÄlija so +Сомалија so +Сомали so +Somalija so +Somalien so +Somalie so +ਸੋਮਾਲੀਆ so +Somália so +Somália so +Сомали so +Somaliya so +Somália so +Somálsko so +Somalija so +Сомалија so +Somalija so +I-Somalia so +சோமாலியா so +Сумалӣ so +โซมาเลีย so +Somali so +Сомалі so +Сомали so +Somaleye so +索马里 so +索馬利亞 so +Suriname sr +سورينام sr +Surinam sr +Сурынам sr +Суринам sr +সà§à¦°à¦¿à¦¨à¦¾à¦® sr +Surinam sr +Surinam sr +Surinam sr +Swrinam sr +Surinam sr +ΣουÏινάμ sr +Surinamo sr +Surinam sr +Surinam sr +سورینام sr +Surinam sr +Suranam sr +סורינ×× sr +सूरीनाम sr +Surinam sr +Súrínam sr +スリナム sr +ស៊ូរីណាមី sr +수리남 sr +ເຊີເບີຠsr +Surinamas sr +Surinama sr +Суринам sr +Суринам sr +Surinam sr +Surinam sr +Surinam sr +Surinam sr +ਸੂਰੀਨਾਮੀ sr +Surinam sr +Surinam sr +Суринам sr +Surinamu sr +Surinam sr +Surinam sr +Surinam sr +Суринам sr +Surinam sr +Surinam sr +சà¯à®°à®¿à®¨à¯‡à®®à¯ sr +Суринам sr +ซูรีนามิ sr +Surinam sr +Surinam sr +Сурінам sr +Суринам sr +è‹é‡Œå— sr +è˜‡åˆ©å— sr +Sao Tome and Principe st +Sao Tome en Principe st +ساو تومي Ùˆ البرنسيب st +Sao Tome vÉ™ Principe st +Сан-Ð¢Ð°Ð¼Ñ Ñ– ПрынÑіпі st +Сао Томе и ПринÑипи st +সাও টোম à¦à¦¬à¦‚ পà§à¦°à¦¿à¦¨à§à¦¸à¦¿à¦ª st +Sao Tome ha Principe st +Sao Tome i Principe st +Sao Tome i Principe st +Sao Tome a Principe st +Ynysoedd Sao Tome a Principe st +Sao Tomé og Principe st +Sao Tome und Principe st +Σάο Τομέ και ΠÏίνσιπε st +Sao-Tomeo kaj Principeo st +Sao Tome y Príncipe st +Sao Tome ja Principe st +Sao Tome eta Principe st +سائوتومه Ùˆ پرینسیپه st +São Tomé ja Príncipe st +Sao Tomé et Principe st +Sao Tome en Principe st +São Tomé agus Príncipe st +Santo Tomé e Príncipe st +साओ टोम तथा पà¥à¤°à¤¿à¤‚सिपी st +Sv. Toma i Princip st +Sao Tome és Principe st +Saó Tóme og Prinsípe st +São Tomé e Príncipe st +サントメプリンシペ st +ìƒíˆ¬ë©” 프린시페 st +ບà»àº¥àº´àºàº²àº™ st +Santome un Prinsipi st +Сао Томе и ПринÑипе st +Сао Ð¢Ð¾Ð¼Ñ Ð±Ð° Принцип st +Sao Tome u Principe st +São Tomé og Príncipe st +São Tomé un Príncipe st +Sao Tome en Principe st +São Tomé og Príncipe st +ਸਾਓ ਟੋਮੀ ਤੇ ਪਰੀਸਿਪੀ st +Sao Tome i Principe st +São Tomé and Príncipe st +São Tome e Príncipe st +Sao Tome ÅŸi Principe st +Сан-Томе и ПринÑипи st +Sawo Tome na Purencipe st +São Tomé ja Príncipe st +Sao Tome a Principe st +Sao Tome in Principe st +Св. Тома и Принцип st +Sv. Toma i Princip st +São Tomé och Príncipe st +சயோ டோம௠மறà¯à®±à¯à®®à¯ பிரினà¯à®¸à®¿à®ªà®¿ st +Синт Том ва ПринÑип st +ซาวโทม à¹à¸¥à¸° พรินซิป st +Sao Tome ve Principe st +Sao Tome wä Principe st +Сан-Томе Ñ– ПрінÑіпі st +Сан-Томе ва ПринÑипи st +São Tomé et Prince st +圣多美和普林西比 st +è–å¤šç¾ŽåŠæ™®æž—西比 st +El Salvador sv +Ø§Ù„Ø³Ù„ÙØ§Ø¯ÙˆØ± sv +Сальвадор sv +Салвадор sv +à¦à¦² সালভাডোর sv +Ar Salvador sv +Salvador sv +El Salfador sv +Ελ Î£Î±Î»Î²Î±Î½Ï„ÏŒÏ sv +Salvadoro sv +Salvador sv +السالوادور sv +Salvador sv +An tSalvadóir sv +O Salvador sv +×ל סלבדור sv +अल सलà¥à¤µà¤¾à¤¡à¥‹à¤° sv +Salvador sv +エルサルãƒãƒ‰ãƒ« sv +អែលសាល់វ៉ាឌáŸážš sv +엘살바ë„르 sv +ເອລຊັນວາດດ໠sv +Salvadoras sv +Salvadora sv +Ел Салвадор sv +Эл Салвадор sv +ਈਲ ਸਾਲਵੇਡੋਰ sv +Salwador sv +Salvador sv +Сальвадор sv +Eli Salivadoro sv +Salvádor sv +Salvador sv +Ел Салвадор sv +I-El Salvador sv +எல௠சாலà¯à®µà®Ÿà¯‹ ர௠sv +Ðл Салвадур sv +เอลซัลวาดอร์ sv +Ель-Сальвадор sv +Салвадор sv +è¨å°”瓦多 sv +薩爾瓦多 sv +Syria sy +Sirië sy +سوريا sy +SuriyÉ™ sy +Ð¡Ñ‹Ñ€Ñ‹Ñ sy +Ð¡Ð¸Ñ€Ð¸Ñ sy +সিরিয়া sy +Siri sy +Sirija sy +Síria sy +Sýrie sy +Syrien sy +Syrien sy +ΣυÏία sy +Sirio sy +Siria sy +Süüria sy +Siria sy +سوریه sy +Syyria sy +Syrie sy +Syrië sy +An tSiria sy +Síria sy +סוריה sy +सीरिया sy +Sirija sy +Szíria sy +Sýrland sy +Siria sy +シリア sy +ស៊ីរី sy +시리아 sy +ເຊີເບີຠsy +Sirija sy +SÄ«rija sy +Сирија sy +Сири sy +Siria sy +Syrien sy +Syrië sy +ਸੀਰੀਆ sy +Síria sy +Síria sy +Siria sy +Ð¡Ð¸Ñ€Ð¸Ñ sy +Siriya sy +Sýria sy +Sirija sy +Сирија sy +Sirija sy +I-Syria sy +Syrien sy +சிரியா sy +Ð¡ÑƒÑ€Ð¸Ñ sy +ซีเรีย sy +Suriye sy +Süriä sy +Ð¡Ð¸Ñ€Ñ–Ñ sy +Ð¡ÑƒÑ€Ð¸Ñ sy +Sireye sy +å™åˆ©äºš sy +敘利亞 sy +Swaziland sz +Swasiland sz +سوازيلاند sz +Svaziland sz +СвазылÑнд sz +Свазиленд sz +সোয়াজিলà§à¦¯à¦¾à¦£à§à¦¡ sz +Svazilend sz +Neozelàndia sz +Gwlad y Swasi sz +Swasiland sz +Σουαζιλάνδη sz +Svazilando sz +Swazilandia sz +Svaasimaa sz +Swazilandia sz +سووازیلند sz +Swazimaa sz +An tSuasalainn sz +Suacilándia sz +סוו×זילנד sz +सà¥à¤µà¤¾à¤œà¥€à¤²à¥ˆà¤‚ड sz +Svazilend sz +Szváziföld sz +Svasíland sz +スワジランド sz +ស្វាហ្ស៊ីឡង់ sz +스와질란드 sz +ລາດສະນາຈັàºà»„ທຠsz +Svazilenda sz +Свазиленд sz +Свациланд sz +Sważilandja sz +Swasiland sz +ਸਵਾਜ਼ੀਲੈਂਡ sz +Suazi sz +Suazilândia sz +Suazilândia sz +Suaziland sz +Свазиленд sz +Swazilande sz +Swazijsko sz +Svazi sz +Свазиленд sz +Svazilend sz +ஸà¯à®µà®¾à®šà®¿à®²à®¾à®©à¯à®Ÿà¯ sz +Свозиланд sz +สวาซิà¹à¸¥à¸™à¸”์ sz +Свазіленд sz +Свазиленд sz +Suwazilande sz +æ–¯å¨å£«å…° sz +å²ç“¦æ¿Ÿè˜­ sz +Turks and Caicos Islands tc +Turks en Caicos Eilande tc +جزر الترك Ùˆ الكايكوس tc +Türk vÉ™ Caicos Adaları tc +ÐÑтравы ТÑÑ€ÐºÑ Ñ– ÐšÐ°Ð¹ÐºÐ°Ñ tc +ОÑтрови Ð¢ÑŠÑ€ÐºÑ Ð¸ ÐšÐ°Ð¹ÐºÐ¾Ñ tc +টারà§à¦•স à¦à¦¬à¦‚ কাইকোস দà§à¦¬à§€à¦ªà¦ªà§à¦žà§à¦œ tc +Inizi Turks ha Kaikos tc +Turks i Kaikos ostrva tc +Illes Turks i Caicos tc +Turks a Caicos ostrovy tc +Ynysoedd Twrc a Chaicos tc +Turks- og Caicosøerne tc +Turks- und Caicos-Inseln tc +Îήσοι ΤεÏκς και Κάικος tc +Turkoj kaj Kajkoj tc +Islas Turcos y Caicos tc +Turks ja Caicos tc +Turks eta Caicos Irlak tc +جزایر تورکس Ùˆ کایکوس tc +Turks- ja Caicos-saaret tc +ÃŽles Turks et Caicos tc +Turks en Caicos Eilânen tc +Na hOileáin Turks agus Caicos tc +Illas Caicos e Turks tc +××™×™ ×§×יקוס וטורקס tc +तà¥à¤°à¥à¤• तथा कैकोस आइलैंड tc +Turks i Caicos otoÄje tc +Turks- és Caicos-szigetek tc +Turks- og Caicos-eyjar tc +Isole Turks e Caicos tc +英領タークス諸島 カイコス諸島 tc +កោះ​ទួក និង​ កៃកូស tc +í„°í¬ìФ ì¼€ì´ì»¤ìФ ì œë„ tc +TÄ“rksa un Kaikosa tc +ОÑтрови Турк и ÐšÐ°Ð¸ÐºÐ¾Ñ tc +Турк ба Кайкогийн арлууд tc +Gżejjer Turks u Caicos tc +Turks- og Caicosøyene tc +Turks- un Caicosinseln tc +Turks en Caicos Eilanden tc +Turks- og Caicosøyane tc +ਤà©à¨°à¨•ਸ ਤੇ ਕਾਇਕੋਸ ਟਾਪੂ tc +Wyspy Turks i Caicos tc +Ilhas Turks e Caicos tc +Ilhas Caicos e Turca tc +Insulele Turks ÅŸi Caicos tc +ОÑтрова Ð¢ÐµÑ€ÐºÑ Ð¸ ÐšÐ°Ð¹ÐºÐ¾Ñ tc +Ibirwa bya Turike na Kayikosi tc +Turks- ja Kaikossullot tc +Turks a Caicos ostrovy tc +Otoka Turks in Caicos tc +Турка и Кајкошка оÑтрва tc +Turka i KajkoÅ¡ka ostrva tc +Turks- och Caicosöarna tc +தà¯à®°à¯à®•à¯à®•ிகள௠மறà¯à®±à¯à®®à¯ காயà¯à®•ோஸ௠தீவà¯à®•ள௠tc +Ҷазираи Турк ва ÐšÐ¾Ð¹ÐºÑƒÑ tc +เà¸à¸²à¸°à¸”ติร์à¸à¹à¸¥à¸°à¹€à¸„คอส tc +Turks ve Caicos Adaları tc +Türks wä Caicos Utrawları tc +ОÑтрови Ð¢ÐµÑ€ÐºÑ Ñ– ÐšÐ°Ð¹ÐºÐ¾Ñ tc +Ð¢ÑƒÑ€ÐºÑ Ð²Ð° ÐšÐ°Ð¸ÐºÐ¾Ñ ÐžÑ€Ð¾Ð»Ð»Ð°Ñ€Ð¸ tc +Quần đảo Turks và Caicos tc +Iyes Turks et Caicos tc +特克斯和凯科斯群岛 tc +åœŸå…‹æ–¯å’Œé–‹å¡æ–¯ç¾¤å³¶ tc +Chad td +تشاد td +Çad td +Чад td +Чад td +চà§à¦¯à¦¾à¦¡ td +Tchad td +ÄŒad td +Txad td +ÄŒad td +Tsiad td +Tchad td +Tschad td +Τσαντ td +Ĉado td +TÅ¡aad td +Txad td +چاد td +Tchad td +Tsjaad td +Sead td +Chade td +צ'×ד td +चाड td +Äad td +Csád td +Tsjad td +Ciad td +ãƒãƒ£ãƒ‰ td +ឆាដ td +차드 td +ເàºàº¡à»„ພ່ td +ÄŒada td +Чад td +Чад td +ÄŠad td +Tsjad td +Tschad td +Tsjaad td +Tsjad td +ਚਾਂਦ td +Czad td +Chade td +Chade td +Ciad td +Чад td +Cade td +ÄŒad td +ÄŒad td +ÄŒad td +Чад td +ÄŒad td +Tchad td +சாட௠td +Чод td +ชาด td +Çad td +Çad td +Чад td +Чад td +Tchad td +ä¹å¾— td +查德 td +Togo tg +توغو tg +Тога tg +Того tg +টোগো tg +Τόγκο tg +توگو tg +Tógó tg +טוגו tg +टोगो tg +Tógó tg +トーゴ tg +ážáž¼áž áŸ’គោ tg +토고 tg +ຂອງເລ່ນສະນຸຠtg +Того tg +Того tg +ਤੋਗੋ tg +Того tg +Того tg +டோகோ tg +Того tg +โตโภtg +Того tg +Того tg +多哥 tg +多哥 tg +Thailand th +تايلاند th +Tayland th +ТайлÑнд th +Тайланд th +থাইলà§à¦¯à¦¾à¦£à§à¦¡ th +Tajland th +Tailàndia th +Thajsko th +Gwlad y Tai th +Ταϊλάνδη th +Tajlando th +Tailandia th +Tai th +Thailandia th +تایلند th +Thaimaa th +Tailand th +Thaïlande th +Thailân th +An Téalainn th +Tailándia th +ת×ילנד th +थाइलैंड th +Tajland th +Thaiföld th +Taíland th +Tailandia th +タイ th +ážáŸƒ th +태국 th +ລາດສະນາຈັàºà»„ທຠth +Tailandas th +Taizeme th +Тајланд th +Тайланд th +Tajlandja th +Tailandia th +ਥਾਈਲੈਂਡ th +Tajlandia th +Tailândia th +Tailândia th +Tailanda th +Таиланд th +Tayilande th +Thajsko th +Tajska th +Тајланд th +Tajland th +I-Thailand th +தாயà¯à®²à®¾à®¨à¯à®¤à¯ th +Тойлонд th +ราชอาณาจัà¸à¸£à¹„ทย th +Tayland th +Tayland th +Таїланд th +Таиланд th +Thái Lan th +Taylande th +泰国 th +泰國 th +Tajikistan tj +طاجيكستان tj +Tacikistan tj +ТаджыкіÑтан tj +ТаджикиÑтан tj +তাজিকিসà§à¦¤à¦¾à¦¨ tj +Tadjikistan tj +Tadžikistan tj +Tadjikistan tj +Tádžikistán tj +Tajicistan tj +Tadschikistan tj +Τατζικιστάν tj +TaÄikujo tj +Tajikistán tj +Tadžikistan tj +تاجیکستان tj +Tadjikistan tj +An Táidsíceastáin tj +Taxiquistán tj +טג'קיסטן tj +ताजिकिसà¥à¤¤à¤¾à¤¨ tj +Tadžikistan tj +Tadzsikisztán tj +Tadsjikistan tj +Tagikistan tj +タジキスタン tj +ážáž¶áž áŸ’ស៊ីគីស្ážáž„់ tj +타지키스탄 tj +ໃຕ້ຫວັນ tj +Tadžikistanas tj +TadžikistÄna tj +ТаџикиÑтан tj +ТажикÑтан tj +TaÄ¡ikistan tj +Tadsjikistan tj +Tadschikistan tj +Tadjikistan tj +Tadsjikistan tj +ਤਜ਼ਾਕਸਤਾਨ tj +Tadżykistan tj +Tajiquistão tj +Tajiquistão tj +ТаджикиÑтан tj +Tajikisitani tj +Tažikistan tj +Tadžikistan tj +Tadžikistan tj +ТаџикиÑтан tj +Tadžikistan tj +Tadzjikistan tj +தஜிகிஸà¯à®¤à®¾à®©à¯ tj +ТоҷикиÑтон tj +ธาจีà¸à¸´à¸ªà¸–าน tj +Tacikistan tj +Tajıqstan tj +ТаджикиÑтан tj +ТожикиÑтон tj +Tadjikistan tj +å¡”å‰å…‹æ–¯å¦ tj +å¡”å‰å…‹ tj +Tokelau tk +توكيلاو tk +Такелау tk +Токело tk +টোকেলো tk +Tokelo tk +Tocelaw tk +Τοκελάου tk +Tokelao tk +توکلائو tk +Na hOileáin Tócala tk +טוקל×ו tk +तोकेलाऊ tk +Tókelá tk +ニュージーランド自治領トケラウ tk +ážáž¼áž€áŸáž¡áž¼ tk +토켈로 tk +ເບລາລັສ tk +Токелау tk +Токелау tk +Tokelaw tk +ਤੋਕੀਲਾਉ tk +Токелау tk +Tokelawu tk +Токелау tk +டோகேலா tk +Токилау tk +โทเคเลา tk +Tokelauça tk +Токелау tk +Токелау tk +托克劳 tk +托克勞 tk +Turkmenistan tm +تركمانستان tm +TürkmÉ™nistan tm +ТуркмÑніÑтан tm +ТуркмениÑтан tm +তà§à¦°à§à¦•মেনিসà§à¦¤à¦¾à¦¨ tm +Turcmenistan tm +Turkmenistán tm +Twrcmenistan tm +ΤουÏκμενιστάν tm +Turkmenujo tm +Turkmenistán tm +Türkmenistan tm +ترکمنستان tm +Turkménistan tm +An Tuircméanastáin tm +Turkmenistán tm +טורקמניסטן tm +तà¥à¤°à¥à¤•मेनिसà¥à¤¤à¤¾à¤¨ tm +Türkmenisztán tm +Túrkmenistan tm +トルクメニスタン tm +ទួគមáŸáž“ីស្ážáž„់ tm +투르í¬ë©”니스탄 tm +ຕຸລະàºàºµ tm +TurkmenistÄna tm +ТуркмениÑтан tm +ТуркменÑтан tm +ਤà©à¨°à¨•ੇਮਸਤਾਨ tm +Turquemenistão tm +Turcomenistão tm +Turcmenistan tm +ТуркмениÑтан tm +Turikimenisitani tm +ТуркмениÑтан tm +தà¯à®°à¯à®•à¯à®®à¯†à®©à®¿à®¸à¯à®¤à®¾à®©à¯ tm +ТуркманиÑтон tm +เตอร์à¸à¹€à¸¡à¸™à¸´à¸ªà¸–าน tm +Türkmenistan tm +ТуркменіÑтан tm +ТуркманиÑтон tm +Turcmenistan tm +åœŸåº“æ›¼æ–¯å¦ tm +土庫曼 tm +Tunisia tn +Tunisië tn +تونس tn +Tunis tn +Ð¢ÑƒÐ½Ñ–Ñ tn +Ð¢ÑƒÐ½Ð¸Ñ tn +টিউনিসিয়া tn +Tunizi tn +Tunis tn +Tunísia tn +Tunisko tn +Tiwnisia tn +Tunesien tn +Tunesien tn +Τυνησία tn +Tunizio tn +Túnez tn +Tuneesia tn +تونس tn +Tunesia tn +Tunisie tn +Tunisie tn +An Túinéis tn +Túnez tn +תוניסיה tn +टà¥à¤¯à¥‚नीशिया tn +Tunis tn +Tunézia tn +Túnis tn +ãƒãƒ¥ãƒ‹ã‚¸ã‚¢ tn +ទុយនáŸážŸáŸŠáž¸ tn +튀니지 tn +ລັດເຊີຠtn +Tunisas tn +Tunisija tn +Ð¢ÑƒÐ½Ð¸Ñ tn +Ð¢ÑƒÐ½Ð¸Ñ tn +Tuneżija tn +Tunesien tn +Tunisie tn +ਟà©à¨¨à©€à¨¶à©€à¨† tn +Tunezja tn +Tunísia tn +Tunísia tn +Ð¢ÑƒÐ½Ð¸Ñ tn +Tuniziya tn +Tunisko tn +Tunizija tn +Ð¢ÑƒÐ½Ð¸Ñ tn +Tunis tn +I-Tunisia tn +Tunisien tn +தà¯à®©à®¿à®šà®¿à®¯à®¾ tn +Ð¢ÑƒÐ½Ð¸Ñ tn +ตูนีเซีย tn +Tunus tn +Ð¢ÑƒÐ½Ñ–Ñ tn +Ð¢ÑƒÐ½Ð¸Ñ tn +Tunizeye tn +çªå°¼æ–¯ tn +çªå°¼è¥¿äºž tn +Tonga to +تونغا to +Tonqa to +Тонга to +Тонга to +টোংগা to +Inizi Tonga to +Τόνγκα to +Tongo to +تونگو to +טונגה to +टोंगा to +トンガ to +ážáž»áž„ហ្គោ to +통가 to +ໂຊນາ to +Тонга to +Тонга to +ਟਾਂਗਾ to +Тонга to +Тонга to +டோஙà¯à®•ா to +Тонго to +ตองà¸à¹‰à¸² to +Тонга to +Тонга to +汤加 to +æ±åŠ  to +East Timor tp +Oos Timor tp +تيمور الشرقية tp +Şərqi Timor tp +УÑходні Тымор tp +Източен Тимор tp +পূরà§à¦¬ টিমর tp +Timor reter tp +IstoÄni Timor tp +Timor Est tp +Východní Timor tp +Dwyrain Timor tp +Østtimor tp +Ost-Timor tp +Ανατολικό Î¤Î¹Î¼ÏŒÏ tp +Orienta Timoro tp +Timor oriental tp +Ida-Timor tp +Ekialdeko Timor tp +تیمور شرقی tp +Itä-Timor tp +Timor oriental tp +Oost Timor tp +Tíomór Thoir tp +Timor do Leste tp +מזרח טימור tp +पूरà¥à¤µà¥€ तिमोर tp +IstoÄni Timor tp +Kelet-Timor tp +Austur-Tímor tp +Timor Est tp +æ±ãƒ†ã‚£ãƒ¢ãƒ¼ãƒ« tp +ទីមáŸážšâ€‹ážáž¶áž„​កើហtp +ë™í‹°ëª¨ë¥´ tp +ວັນà»àº¥àº°à»€àº§àº¥àº² tp +Rytų Timoras tp +Austrumtimora tp +ИÑточен Тимор tp +Зүүн тимор tp +Timor Timur tp +Timor tal-Lvant tp +Øst-Timor tp +Oosttimor tp +Oost Timor tp +Aust-Timor tp +ਪੂਰਬੀ ਤਾਮੋਰ tp +Timor Wschodni tp +Timor Leste tp +Timor Leste tp +Timorul de Est tp +ВоÑточный Тимор tp +Timoro y'Uburasirazuba tp +Nuorta-Timor tp +Východný Timor tp +Vzhodni Timor tp +ИÑточни Тимор tp +IstoÄni Timor tp +Östtimor tp +கிழகà¯à®•௠திமார௠tp +Тимури Шарқ tp +ติมอร์ตะวันออภtp +DoÄŸu Timur tp +Çığış Timor tp +Східний Тімор tp +Шарқий Тимур tp +Äông Timo tp +Timor Ess tp +ä¸œå¸æ±¶ tp +æ±å¸æ±¶ tp +Turkey tr +Turkeye tr +تركيا tr +TürkiyÉ™ tr +Ð¢ÑƒÑ€Ñ†Ñ‹Ñ tr +Ð¢ÑƒÑ€Ñ†Ð¸Ñ tr +তà§à¦°à§à¦•à§€ tr +Turkia tr +Turska tr +Turquia tr +Turecko tr +Twrci tr +Tyrkiet tr +Türkei tr +ΤουÏκία tr +Turkujo tr +Turquía tr +Türgi tr +Turkia tr +ترکیه tr +Turkki tr +Turkaland tr +Turquie tr +Turkije tr +An Tuirc tr +Turquia tr +טורקיה tr +तà¥à¤°à¥à¤•ी tr +Turska tr +Törökország tr +Turki tr +Tyrkland tr +Turchia tr +トルコ tr +ទួរគី tr +터키 tr +ຕຸລະàºàºµ tr +Turkija tr +Turcija tr +Турција tr +Турк tr +Turki tr +Turkija tr +Tyrkia tr +Törkei tr +Turkije tr +Tyrkia tr +Turquia tr +ਤà©à¨°à¨•à©€ tr +Turcja tr +Turquia tr +Turquia tr +Turcia tr +Ð¢ÑƒÑ€Ñ†Ð¸Ñ tr +Turukiya tr +Durka tr +Turecko tr +TurÄija tr +ТурÑка tr +Turska tr +I-Turkey tr +Turkiet tr +தà¯à®°à¯à®•à¯à®•ி tr +Туркиё tr +ตุรà¸à¸µ tr +Türkiye tr +Törkiä tr +Туреччина tr +Ð¢ÑƒÑ€ÐºÐ¸Ñ tr +Thổ NhÄ© Kì tr +Turkeye tr +土耳其 tr +土耳其 tr +Trinidad and Tobago tt +Trinidad en Tobago tt +ترينيداد Ùˆ توباغو tt +Trinidad vÉ™ Tabaqo tt +Трынідад Ñ– Табага tt +Тринидад и Тобаго tt +তà§à¦°à¦¿à¦¨à¦¿à¦¦à¦¾à¦¦ à¦à¦¬à¦‚ টোবাগো tt +Trinidad ha Tobago tt +Trinidad i Tobago tt +Trinidad i Tobago tt +Trinidad a Tobago tt +Ynysoedd Trinidad a Thobago tt +Trinidad og Tobago tt +Trinidad und Tobago tt +ΤÏίνινταντ και Τομπάγκο tt +Trinidado kaj Tobago tt +Trinidad y Tobago tt +Trinidad ja Tobago tt +Trinidad eta Tobago tt +ترینیداد Ùˆ ØªÙØ¨Ø§Ú¯Ùˆ tt +Trinidad ja Tobago tt +Trinidad og Tobago tt +Trinidad et Tobago tt +Trinidad en Tobago tt +Oileán na Tríonóide agus Tobága tt +Trinidade e Tobago tt +טרינידד וטובגו tt +टà¥à¤°à¤¿à¤¨à¤¿à¤¡à¤¾à¤¡ और टोबैगो tt +Trinidad i Tobago tt +Trinidad és Tobago tt +Trinidad dan Tobago tt +Trínidad og Tóbagó tt +Trinidad e Tobago tt +トリニダードトãƒã‚³ tt +ទ្រីនីដាដ និង​​ ážáž¼áž”ាហ្គោ tt +트리니다드 토바고 tt +ຕີນິà»àº”ດà»àº¥àº°à»‚ທບາໂຠtt +Trinidadas ir Tobagas tt +Trinidada un Tobago tt +Тринидад и Тобаго tt +Тринида ба Тобаго tt +Trinidad dan Tobago tt +Trinidad u Tobago tt +Trinidad og Tobago tt +Trinidad un Tobago tt +Trinidad en Tobago tt +Trinidad og Tobago tt +Trinidad le Tobago tt +Trinidad e Tobago tt +ਤਰੀਨੀਡਾਡ ਤੇ ਤੋਬਾਗੋ tt +Trinidad i Tobago tt +Trindade e Tobago tt +Trinidad e Tobago tt +Trinidad ÅŸi Tobago tt +Тринидад и Тобаго tt +Tirinida na Tobago tt +Trinidad ja Tobago tt +Trinidad a Tobago tt +Trinidad in Tabago tt +Тринидад и Тобаго tt +Trinidad i Tobago tt +I-Trinidad kanye neTobago tt +Trinidad och Tobago tt +டà¯à®°à®¿à®©à®¿à®Ÿà®¾à®Ÿà¯ & டொபாகோ tt +Туриндод ва Тубогу tt +ตรีนิà¹à¸”ดà¹à¸¥à¸°à¹‚ทบาโภtt +Trinidad veTabago tt +Trinidad wä Tobago tt +РеÑпубліка Трінідад та Тобаго tt +Тринидад ва Тобаго tt +Trinidad na Tobago tt +Trinidad và Tobago tt +Trinité et Tobago tt +Trinidad ne Tobago tt +特立尼达和多巴哥 tt +åƒé‡Œé”åŠæ‰˜è²å“¥ tt +Trinidad knaye ne-Tobago tt +Tuvalu tv +ØªÙˆÙØ§Ù„Ùˆ tv +Тувалу tv +Тувалу tv +টà§à¦­à¦¾à¦²à§ tv +Twfalw tv +Î¤Î¿Ï…Î²Î±Î»Î¿Ï tv +Tuvalo tv +توالو tv +טוב×לו tv +तà¥à¤µà¤¾à¤²à¥‚ tv +Túvalú tv +ツãƒãƒ« tv +ទុយវ៉ាលុយ tv +투발루 tv +ຊູລູ tv +Тувалу tv +Тувалу tv +ਤà©à¨µà¨¾à¨²à©‚ tv +Тувалу tv +Тувалу tv +தà¯à®µà®²à¯ tv +Тувалу tv +ตูวาลู tv +Tuvaluça tv +Тувалу tv +Тувалу tv +Touvalou tv +å›¾ç“¦å¢ tv +å瓦魯 tv +Taiwan tw +تايوان tw +Tayvan tw +Тайвань tw +Тайван tw +তাইওয়ান tw +Tajvan tw +Ταϊβάν tw +Tajvano tw +Taiwán tw +تایوان tw +Taivan tw +Taïwan tw +An Téaváin tw +Taiwán tw +טיוו×ן tw +ताईवान tw +Tajvan tw +Tajvan tw +Taívan tw +å°æ¹¾ tw +ážáŸƒážœáŸ‰áž¶áž“់ tw +대만 tw +ໃຕ້ຫວັນ tw +Taivanis tw +TaivÄna tw +Тајван tw +Тайван tw +Tajwan tw +ਤਾਈਵਾਨ tw +Tajwan tw +Formosa tw +Taivan tw +Тайвань tw +Tayiwani tw +Tajvan tw +Тајван tw +Tajvan tw +I-Taiwan tw +தாயà¯à®µà®¾à®©à¯ tw +Тойвон tw +ไต้หวัน tw +Tayvan tw +Taywan tw +Тайвань tw +Тайван tw +Äài Loan tw +䏭国尿¹¾ tw +å°ç£ tw +Tanzania, United Republic of tz +Tanzanië, Vereenigde Republiek van tz +جمهورية تنزانيا المتحدة tz +Tanzaniya tz +Ð—Ð»ÑƒÑ‡Ð°Ð½Ð°Ñ Ð ÑÑпубліка Ð¢Ð°Ð½Ð·Ð°Ð½Ñ–Ñ tz +Ð¢Ð°Ð½Ð·Ð°Ð½Ð¸Ñ tz +তানজানিয়া tz +Tanzanija, Ujedinjena Republika tz +Tanzània, República Unida de tz +Tanzánie tz +Tansania, Gweriniaeth Unedig tz +Tanzania tz +Tansania, vereinigte Republik tz +Τανζανία, Ενωμένη δημοκÏατία της tz +Tanzanio, UnuiÄinta Respubliko de tz +Tanzania, Republica de tz +Tansaania tz +Tanaziar Errepublika Batua tz +جمهوری متحده تانزانیا tz +Tansanian yhdistäytynyt tasavalta tz +Tanzanie, République unie de tz +Tanzanië, Ferienigd republyk fan tz +An Tansáin tz +República Unida de Tanzánia tz +טנזניה, הרפובליקה המ×וחדת של tz +तंजानिया यूनाइटेड रिपबà¥à¤²à¤¿à¤• tz +Ujedinjena Republika Tanzanija tz +Tanzánia tz +Tansanía tz +Tanzania tz +タンザニア,共和国連邦 tz +ážáž„់ហ្សានី tz +탄ìžë‹ˆì•„ 합중국 tz +ໂດມິນິàºàº±àº™ tz +Tanzanijos Respublika tz +TanzÄnija tz +Танзанија, Обединета Република tz +Танканы нÑгдÑÑн ÑƒÐ»Ñ tz +Republik Bersatu Tanzania tz +Tanżania tz +Tanzania tz +Tansania tz +Tanzania, Verenigde republiek van tz +Tanzania tz +ਤਾਨਜ਼ੂਈਆ, ਸੰਯà©à¨•ਤ ਗਣਰਾਜ tz +Zjednoczna Republika Tanzanii tz +República da União da Tanzânia tz +República da Tanzânia tz +Tanzania, Republica Unită tz +Ð¢Ð°Ð½Ð·Ð°Ð½Ð¸Ñ tz +Tanzaniya, Repubulika Yunze Ubumwe ya tz +Tanzania tz +Tanzánia, Spojená republika tz +Tanzanija, Združena republika tz +Танзанија, Уједињена Република tz +Tanzanija, Ujedinjena Republika tz +Förenade republiken Tanzania tz +டானà¯à®œà®¾à®¨à®¿à®¯à®¾, à®à®•à¯à®•ிய கà¯à®Ÿà®¿à®¯à®°à®šà¯ tz +Ҷумҳурии Муттаҳидаи Тонзониё tz +สาธารณรัà¸à¹à¸—นซาเนีย tz +Tanzanya tz +Tanzania, Berläşkän Cömhüriätläre tz +ТанзаніÑ, об'єднана реÑпубліка tz +Ð¢Ð°Ð½Ð·Ð°Ð½Ð¸Ñ Ð‘Ð¸Ñ€Ð»Ð°ÑˆÐ³Ð°Ð½ РеÑпубликаÑи tz +Tanzania, Cá»™ng hoà thống nhât tz +Tanzaneye tz +妿¡‘尼亚è”åˆå…±å’Œå›½ tz +å¦å°šå°¼äºž tz +Ukraine ua +Ukraïne ua +أوكرانيا ua +Ukrayna ua +Украіна ua +Украйна ua +ইউকà§à¦°à§‡à¦¨ ua +Ukraina ua +Ukrajina ua +Ucraïna ua +Ukrajina ua +Wcr?in ua +ΟυκÏανία ua +Ukrainio ua +Ucrania ua +Ukraina ua +Ukrania ua +اکراین ua +Ukraina ua +Ukraina ua +Oekraïne ua +An Úcráin ua +Ucrania ua +×וקר××™× ×” ua +उकà¥à¤°à¥‡à¤¨ ua +Ukrajina ua +Ukrajna ua +Ukraina ua +Úkraína ua +Ucraina ua +ウクライナ ua +អ៊ុយក្រែន ua +ìš°í¬ë¼ì´ë‚˜ ua +àºàº¹à»€àº„ຣນ ua +Ukraina ua +Ukraina ua +Украина ua +Украйн ua +Ukranja ua +Ukraina ua +Oekraïne ua +Ukraina ua +Ucraina ua +ਯੂਕਰੇਨ ua +Ukraina ua +Ucrânia ua +Ucrânia ua +Ucraina ua +Украина ua +Ukerene ua +Ukraina ua +Ukrajina ua +Ukrajina ua +Украјина ua +Ukrajina ua +I-Ukraine ua +Ukraina ua +உகà¯à®°à¯†à®¯à¯à®©à¯ ua +Украина ua +ยูเครน ua +Ukrayna ua +Ukrain ua +Україна ua +Украина ua +Ukraina ua +Oucrinne ua +乌克兰 ua +çƒå…‹è˜­ ua +Uganda ug +أوغندا ug +Uqanda ug +Уганда ug +Уганда ug +ইউগাণà§à¦¡à¦¾ ug +Ouganda ug +Wganda ug +Ουγκάντα ug +Ugando ug +اوگاندا ug +Ouganda ug +×וגנדה ug +उगांडा ug +Úganda ug +ウガンダ ug +អ៊ូហ្គង់ដា ug +우간다 ug +à»àºžàº™àº”້າ ug +Уганда ug +Уганда ug +ਯੂਗਾਂਡਾ ug +Уганда ug +Уганда ug +உகானà¯à®Ÿà®¾ ug +Угондо ug +ยูà¸à¸±à¸™à¸”า ug +Уганда ug +Уганда ug +Ouganda ug +乌干达 ug +çƒå¹²é” ug +United States of America us +Vereenigde State van Amerika us +الولايات المتحدة الأمريكية us +Amerika BirləşmiÅŸ Åžtatları us +Ð—Ð»ÑƒÑ‡Ð°Ð½Ñ‹Ñ Ð¨Ñ‚Ð°Ñ‚Ñ‹ ÐмÑрыкі us +СÐЩ us +মারà§à¦•িন যà§à¦•à§à¦¤à¦°à¦¾à¦·à§à¦Ÿà§à¦° us +Stadoù-Unanet Amerika us +Sjedinjene AmeriÄke Države us +Estats Units d'Amèrica us +Spojené státy americké us +Unol Daleithau America us +USA us +USA us +Ηνωμένες Πολιτείες της ΑμεÏικής us +Usono us +Estados Unidos de América us +Ameerika Ühendriigid us +Ameriketako Estatu Batuak us +ایالات متحده‌ی آمریکا us +Yhdysvallat us +Sambandsríki Amerika (USA) us +États Unis d'Amérique us +Ferienigde Staten fan Amerika us +Stáit Aontaithe Mheiriceá us +Estados Unidos de América us +×רצות הברית us +संयà¥à¤•à¥à¤¤ राजà¥à¤¯ अमेरिका us +Sjedinjene AmeriÄke Države us +Amerikai Egyesült Ãllamok us +Amerika Serikat us +Bandaríkin us +Stati Uniti d'America us +アメリカåˆè¡†å›½ us +សហរដ្ឋអាមáŸážšáž·áž€ us +미 합중국 us +ສະຫະລັດອາເມລິàºàº² us +JungtinÄ—s Amerikos Valstijos us +Amerikas SavienotÄs Valstis us +Соединети ÐмериканÑки Држави us +ÐÐУ us +Amerika Syarikat us +Stati Uniti us +USA us +Vereenigte Staten vun Amerika us +Verenigde Staten van Amerika us +USA us +Estats Units d'Amèrica us +ਸੰਯà©à¨•ਤ ਰਾਜ ਅਮਰੀਕਾ us +Stany Zjednoczone Ameryki us +Estados Unidos da América us +Estados Unidos da América us +Statele Unite ale Americii us +Соединённые Штаты Ðмерики us +Leta Zunze Ubumwe z'Amerika us +Amerihká ovttastuvvan stáhtat us +USA us +Združene države Amerike us +Сједињене америчке државе us +Sjedinjene ameriÄke države us +I-United States of America us +Amerikas förenta stater us +à®à®•à¯à®•ிய அமெரிகà¯à®•ா us +Иёлоти Муттаҳидаи Ðмрико us +สหรัà¸à¸­à¹€à¸¡à¸£à¸´à¸à¸² us +Amerika BirleÅŸik Devletleri us +Amerika QuÅŸma Åžtatları us +СШРus +Ðмерика Қўшма Штатлари us +mashango o tangananaho a America us +Hợp chá»§ng quốc Hoa Kỳ us +Estats Unis us +United States ye Melika us +美国 us +美利堅åˆçœ¾åœ‹ us +Uruguay uy +الأوروغواي uy +Uruqvay uy +Уругвай uy +Уругвай uy +উরà§à¦—à§à§Ÿà§‡ uy +Urugvaj uy +Uruguai uy +Wrwgw?i uy +ΟυÏουγουάη uy +Urugvajo uy +Uruguai uy +اروگویه uy +Uragua uy +Uruguai uy +×ורוגו××™ uy +उरूगà¥à¤µà¥‡ uy +Urugvaj uy +Úrúgvæ uy +ウルグアイ uy +អ៊ុយរុយហ្គាយ uy +ìš°ë£¨ê³¼ì´ uy +ອຸລຸàºàºàº§àº uy +Urugvajus uy +Urugvaja uy +Уругвај uy +Уругвай uy +Urugwaj uy +Uruguai uy +ਉਰੂਗਵੇ uy +Urugwaj uy +Uruguai uy +Uruguai uy +Uruguai uy +Уругвай uy +Irigwe uy +Uruguaj uy +Urugvaj uy +Уругвај uy +Urugvaj uy +I-Uruguay uy +உரà¯à®•à¯à®µà¯‡ uy +Уругвай uy +อุรุà¸à¸§à¸±à¸¢ uy +Уругвай uy +Уругвай uy +Ourougway uy +乌拉圭 uy +çƒæ‹‰åœ­ uy +Uzbekistan uz +أوزبكستان uz +ÖzbÉ™kistan uz +УзбÑкіÑтан uz +УзбекиÑтан uz +উজবেকিসà§à¦¤à¦¾à¦¨ uz +Ouzbekistan uz +Uzbekistán uz +Wsbecist?n uz +Usbekistan uz +Ουζμπεκιστάν uz +Uzbekujo uz +Uzbekistán uz +Usbekistan uz +ازبکستان uz +Ouzbékistan uz +Úisbéiceastáin uz +Uzbekistán uz +×וזבקיסטן uz +उजà¥à¤¬à¥‡à¤•िसà¥à¤¤à¤¾à¤¨ uz +Üzbegisztán uz +Úsbekistan uz +ウズベキスタン uz +អ៊ូហ្សបáŸáž‚ីស្ážáž„់ uz +우즈베키스탄 uz +ເດນ່ງນ uz +UzbekistÄna uz +УзбекиÑтан uz +УзбекÑтан uz +Użbekistan uz +Usbekistan uz +Usbekistan uz +Usbekistan uz +ਉਜ਼ੇਬਕਸਤਾਨ uz +Uzbequistão uz +Uzbequistão uz +УзбекиÑтан uz +Uzibekisitani uz +Usbekistan uz +УзбекиÑтан uz +உஸà¯à®ªà¯†à®•ிஸà¯à®¤à®¾à®©à¯ uz +ӮзбекиÑтон uz +อุซเบà¸à¸´à¸ªà¸–าน uz +Özbekistan uz +Özbäkstan uz +УзбекиÑтан uz +ЎзбекиÑтон uz +Ouzbekistan uz +ä¹Œå…¹åˆ«å…‹æ–¯å¦ uz +çƒèŒ²åˆ¥å…‹ uz +Vatican City va +Vatikaan Stad va +مدينة Ø§Ù„ÙØ§ØªÙŠÙƒØ§Ù† va +Vatican ŞəhÉ™ri va +Ватыкан va +Ватикана va +ভà§à¦¯à¦¾à¦Ÿà¦¿à¦•ান সিটি va +Ker Vatikan va +Vatikan va +Ciutat del Vaticà va +Vatikán va +Dinas y Fatican va +Vatikanstaten va +Vatikanstadt va +Βατικανό va +Vatikano va +Vaticano va +Vatikan va +Batikano Hiria va +شهر واتیکان va +Vatikaani va +Vatican va +Vaticaanstad va +An Chathaoir Naofa va +Cidade do Vaticano va +הוותיקן va +वेटिकन सिटी va +Vatikan va +Vatikán va +Vatíkanið va +Città del Vaticano va +ãƒãƒã‚«ãƒ³å¸‚国 va +ក្រុង​វ៉ាទីកង់ va +바티칸 시티 va +ລັດເວີຠva +VatikÄns va +Ватикан va +Ватикан Ñити va +Vatikan va +Vatikanstaten va +Vatikaan va +Vaticaanstad va +Vatikanstaten va +ਵਾਟੀਕੇਨ ਸਿਟੀ va +Watykan va +Cidade do Vaticano va +Cidade do Vaticano va +Vatican, OraÅŸul va +Ватикан va +Umujyi wa Vatikani va +Vatikanstáhta va +Vatikán va +Vatikan va +Ватикан va +Vatikan va +Vatikanstaten va +வாடிகன௠நகரம௠va +Шаҳри Ватикан va +นครรัà¸à¸§à¸²à¸•ิà¸à¸±à¸™ va +Vatikan va +Vatikan va +Ватікан va +Ватикан Шаҳри va +Thành phố Vatican va +Vatican va +梵蒂冈 va +梵諦岡城 va +St. Vincent and the Grenadines vc +St. Vincent en die Grenadene vc +سانت Ùينسنت Ùˆ الغرينادين vc +St. Vincent vÉ™ Grenadines vc +СÑнт-ВінÑÑнт Ñ– ГрÑнадыны vc +Св. ВинÑет и Гренадините vc +সেনà§à¦Ÿ ভিনসেনà§à¦Ÿ ও গà§à¦°à§‡à¦¨à¦¾à¦¡à¦¿à¦¨ vc +S. Visant hag ar Grenadinez vc +Sveti Vincent i Grenadini vc +St. Vincent i les Granadines vc +St. Vincent a Grenadiny vc +Ynysoedd St. Finsent a'r Grenadinau vc +St. Vincent og Grenadinerne vc +St. Vincent und Grenadinen vc +Άγιος Βικέντιος και ΓÏεναδίνες vc +Sent-Vincento kaj la Grenadinoj vc +San Vicente y las Granadinas vc +St. Vincent ja Grenadiinid vc +St. Vincent eta Grenadines vc +سن وینسن Ùˆ گرادینس vc +St. Vincent ja Grenadiinit vc +Sankta Vinsent og Grenadinoyggjar vc +St Vincent et les Grenadines vc +St. Vincent en de Grenadines vc +St. Vincent agus Grenadines vc +Santo Vicente e as Granadinas vc +סנט וינסנט ×•×”×’×¨× ×“×™× ×™× vc +सेंट विंसेंट तथा गà¥à¤°à¥‡à¤¨à¥‡à¤¡à¤¾à¤‡à¤¨à¥à¤¸ vc +St. Vincent és Grenadines vc +St. Vincent dan the Grenadines vc +Sankti Vinsent og Grenadíneyjar vc +Saint Vincent e Grenadines vc +セントヴィンセントグレナディン vc +សង់វាំងសង់ និង ​ហ្គ្រីណាឌីន vc +세ì¸íЏ 빈센트 그레나딘 vc +ເຊີນວິນà»àºŠàº™ à»àº¥àº°à»€àºàº™àº²àº”ີນ vc +Å v. Vincentas ir Grenadinai vc +Sentvinsenta un GrenadÄ«nes vc +Св. ВинÑент и Гренадите vc +St. ВинÑент ба Гренадин vc +St. Vincent dan Grenadines vc +St. VinÄ‹enz u l-Grenadini vc +St. Vincent og Grenadinene vc +St. Vincent un de Grenadinen vc +St. Vincent en de Grenadines vc +St. Vincent og Grenadinane vc +St. Vincent le Grenadines vc +St. Vincent e les Granadines vc +ਸੇਂਟ ਵੀਨਸੈਂਟ ਤੇ ਗਰੀਨਾਜੀਨਸ vc +St. Vincent i Grenadyny vc +São Vicente e Granadinas vc +São Vicente e Grenadines vc +Sf. Vincent ÅŸi Grenadines vc +Сент-ВинÑент и Гренадины vc +Mutagatifu Visenti na Gerenadine vc +St. Vincent ja the Grenadiinnat vc +St. Vincent a Grenadines vc +Sv. Vincent in Grenadini vc +Св. ВинÑент и Гренадини vc +Sv. Vinsent i Grenadini vc +I-St. Vincent and the Grenadines vc +St. Vincent och Grenadinerna vc +செயினà¯à®Ÿà¯ வினà¯à®šà¯†à®©à¯à®Ÿà¯ மறà¯à®±à¯à®®à¯ கà¯à®°à¯€à®©à®¾à®Ÿà¯ˆà®©à¯à®¸à¯ vc +Синт ВинÑент ва Гренадина vc +เà¸à¸²à¸°à¹€à¸‹à¸™à¸•์วินเซนต์ vc +St. Vincent ve Grenadines vc +Sain Vinsent wä Grenadinnär vc +Сент-ВінÑент Ñ– Гренадіни vc +Сент-ВинÑент ва Гренадина vc +St. Vincent na Grenadines vc +St. Vincent và Grenadines vc +St. Vincint et les Grenadines vc +St. Vincent ne Grenadines vc +åœ£æ–‡æ£®ç‰¹å’Œæ ¼æž—çº³ä¸æ–¯ vc +è–æ–‡æ£®åŠæ ¼ç´é‚£ä¸ vc +I-St. Vincent kanye ne-Grenadines vc +Venezuela ve +Ùنزويلا ve +Venesuella ve +Ð’ÑнÑÑуÑла ve +ВенеÑуела ve +ভেনেজà§à§Ÿà§‡à¦²à¦¾ ve +Venecuela ve +Veneçuela ve +Feneswela ve +Βενεζουέλα ve +Venezuelo ve +Venetsueela ve +ونزویلا ve +Venesuela ve +Vénézuela ve +Veiniséala ve +ונצו×לה ve +वेनेजà¥à¤à¤²à¤¾ ve +Venecuela ve +Venesúela ve +ベãƒã‚ºã‚§ãƒ© ve +ážœáŸážŽáŸáž áŸ’សុ៊យអáŸáž¡áž¶ ve +ë² ë„¤ìˆ˜ì—˜ë¼ ve +ເວເນຊຸເອລາ ve +Venesuela ve +VenecuÄ“la ve +Венецуела ve +ВинеÑÑуел ve +Veneżwela ve +ਵੈਂਨਜ਼ੂà¨à¨²à¨¾ ve +Wenezuela ve +ВенеÑуÑла ve +Venezuwela ve +Венецуела ve +Venecuela ve +I-Venezuela ve +வெனிசà¯à®²à®¾ ve +ВинизуÑлло ve +เวเนซุเอลา ve +ВенеÑуела ve +ВенеÑуÑла ve +Venezwela ve +委内瑞拉 ve +委內瑞拉 ve +Virgin Islands, British vg +Virgin Eilande, Brits vg +الجزر العذراء, بريطانيا vg +Virgin Adaları, Britanya vg +БрытанÑÐºÑ–Ñ Ð’Ñ–Ñ€Ð³Ñ–Ð½ÑÐºÑ–Ñ Ð°Ñтравы vg +БританÑки ВирджинÑки оÑтрови vg +ভারà§à¦œà¦¿à¦¨ আইলà§à¦¯à¦¾à¦£à§à¦¡à¦¸, বà§à¦°à¦¿à¦Ÿà¦¿à¦¶ vg +DjeviÄanska ostrva, Britanska vg +Illes Verges, Angleses vg +Ynysoedd yr Wyryf, Prydeinig vg +Britiske jomfruøer vg +Virgin-Inseln, britisch vg +ΠαÏθένοι Îήσοι, Î’Ïετανικές vg +Virgininsuloj, Britaj vg +Islas Vírgenes Británicas vg +Briti Neitsisaared vg +Britaniar Irla Birjinak vg +جزایر ویرجین انگلیسی vg +Brittien Neitsytsaaret vg +ÃŽles Vierges britanniques vg +Virgin Eilannen, Britse vg +Oileáin Bhriotanacha na Maighdean vg +Illas Virxes, Británicas vg +××™×™ הבתולה, בריטי vg +वरà¥à¤œà¤¿à¤¨ आइलैंड, बà¥à¤°à¤¿à¤Ÿà¤¿à¤¶ vg +DjeviÄansko otoÄje, Britanski vg +Virgin-szigetek (brit) vg +Bresku Jómfrúareyjar vg +Isole Vergini Britanniche vg +英領ãƒãƒ¼ã‚¸ãƒ³è«¸å³¶ vg +កោះ​ស្មោង អង់គ្លáŸážŸ vg +ì˜êµ­ë ¹ 버진 ì œë„ vg +Britu Virdžinu salas vg +ДевÑтвени ОÑтрови, БританÑки vg +Виржин арлууд, британи vg +Kepulauan Virgin, British vg +Jomfruøyene (Storbritannia) vg +Britsche Jumferninseln vg +Virgin Eilanden, Britse vg +Jomfruøyane (Storbritannia) vg +ਵੀਰਗੀਨ ਟਾਪੂ, ਬਰਤਾਨੀਆ vg +Wyspy Dziewicze (Brytyjskie) vg +Ilhas Virgens, Inglaterra vg +Ilhas Virgens, Inglaterra vg +Insulele Virgine, Anglia vg +ВиргинÑкие БританÑкие оÑтрова vg +Ibirwa by'Isugi, Nyongereza vg +Panenské Ostrovy, Britské vg +DeviÅ¡ki otoki, Britanski vg +ДевичанÑка оÑтрва, БританÑка vg +DeviÄanska ostrva, Britanska vg +Brittiska Jungfruöarna vg +விரà¯à®œà®¿à®©à¯ தீவà¯à®•ளà¯, பிரிடà¯à®Ÿà®¿à®·à¯ vg +Ҷазираи ВирҷиниÑ, Бритониё vg +หมู่เà¸à¸²à¸°à¹€à¸§à¸­à¸£à¹Œà¸ˆà¸´à¸™, อังà¸à¸¤à¸© vg +Virgin Adaları (İngiltere) vg +Virgin Utrawları, Britan vg +ВіргінÑькі оÑтрови (БританіÑ) vg +ÐÐ½Ð³Ð»Ð¸Ñ Ð’Ð¸Ñ€Ð¶Ð¸Ð½ Ороллари vg +Quần đảo Trinh nữ, Vưong quốc Anh vg +Iyes Viedjes, britanikes vg +英属维京群岛 vg +英屬維爾京群島 vg +Virgin Islands, U.S. vi +Virgin Eilande, VSA vi +الجزر العذراء, الولايات المتحدة vi +Virgin Adaları, ABÅž vi +ÐмÑрыканÑÐºÑ–Ñ Ð’Ñ–Ñ€Ð³Ñ–Ð½ÑÐºÑ–Ñ Ð°Ñтравы vi +ÐмериканÑки ВирджинÑки оÑтрови vi +ভারà§à¦œà¦¿à¦¨ আইলà§à¦¯à¦¾à¦£à§à¦¡à¦¸, মারà§à¦•িন যà§à¦•à§à¦¤à¦°à¦¾à¦·à§à¦Ÿà§à¦° vi +DjeviÄanska ostrva, AmeriÄka vi +Illes Verges, Americanes vi +Panenské ostrovy, U.S. vi +Ynysoedd yr Wyryf, Americanaidd vi +Jomfruøerne vi +Virgin-Inseln, amerikanisch vi +ΠαÏθένοι Îήσοι, Η.Π.A. vi +Virgininsuloj, Usonaj vi +Islas Vírgenes Americanas vi +USA Neitsisaared vi +Estatu Batuar Irla Birjinak vi +جزایر ویرجین امریکا. vi +USA:n Neitsytsaaret vi +ÃŽles Vierges américaines vi +Virgin Eilannen, U.S. vi +Oileáin na Maighdean S.A.M. vi +Illas Virxes, U.S. vi +××™×™ הבתולה, ×רצות־הברית vi +वरà¥à¤œà¤¿à¤¨ आइलैंड, यू.à¤à¤¸. vi +DjeviÄansko otoÄje, SAD vi +Virgin-szigetek (USA) vi +Bandarísku Jómfrúareyjar vi +Isole Vergini Americane vi +米領ãƒãƒ¼ã‚¸ãƒ³è«¸å³¶ vi +កោះ​ស្មោង អាមáŸážšáž·áž€ vi +미국령 버진 ì œë„ vi +Virdžinu salas, ASV. vi +ДевÑтвени ОÑтрови, СÐД vi +Виржин арлууд, ÐÐУ vi +Kepulauan Virgin, U.S. vi +Jomfruøyene (USA) vi +Jumferninseln, U.S. vi +Virgin Eilanden, U.S. vi +Jomfruøyane (USA) vi +ਵੀਰਗੀਨ ਟਾਪੂ, ਅਮਰੀਕਾ vi +Wyspy Dziewicze (USA) vi +Ilhas Virgens, E.U.A. vi +Ilhas Virgens, EUA vi +Insulele Virgine, S.U.A. vi +ВиргинÑкие оÑтрова (СШÐ) vi +Ibirwa by'Isugi, U.S. vi +Panenské Ostrovy, Americké vi +DeviÅ¡ki otoki, ZDA vi +ДевичанÑка оÑтрва, СÐД vi +DeviÄanska ostrva, SAD vi +Amerikanska Jungfruöarna vi +விரà¯à®œà®¿à®©à¯ தீவà¯à®•ளà¯, U.S. vi +Ҷазираи ВирҷиниÑ, Ш.М.Ð vi +หมู่เà¸à¸²à¸°à¹€à¸§à¸­à¸£à¹Œà¸ˆà¸´à¸™, สหรัà¸à¸­à¹€à¸¡à¸£à¸´à¸à¸² vi +Virgin Adaları (ABD) vi +Virgin Utrawları, AQÅž vi +ВіргінÑькі оÑтрови (СШÐ) vi +ÐҚШ Виржин Ороллари vi +Quần đảo Trinh nữ, Hoa Kỳ vi +Iyes Viedjes, etazunyinnes vi +美属维京群岛 vi +美屬維爾京群島 vi +Vietnam vn +Viëtnam vn +Ùييتنام vn +Vyetnam vn +Віетнам vn +Виетнам vn +ভিয়েতনাম vn +Vijetnam vn +Panenské ostrovy, U.K. vn +Fiet-nam vn +Βιετνάμ vn +Vjetnamio vn +ویتنام vn +Viëtnam vn +Vítneam vn +וייטנ×× vn +विà¤à¤¤à¤¨à¤¾à¤® vn +Vijetnam vn +Víetnam vn +ベトナム vn +វៀážážŽáž¶áž˜ vn +베트남 vn +ຫວງດນາມ vn +Vietnamas vn +Vjetnama vn +Виетнам vn +Витнам vn +Vjetnam vn +Viëtnam vn +ਵੀਅਤਨਾਮ vn +Wietnam vn +Vietname vn +Vietnã vn +Вьетнам vn +Viyetinamu vn +Вијетнам vn +Vijetnam vn +I-Vietnam vn +வியடà¯à®¨à®¾à®®à¯ vn +Ветнам vn +เวียตนาม vn +Ð’'єтнам vn +Ветнам vn +Việt Nam vn +è¶Šå— vn +è¶Šå— vn +Vanuatu vu +ÙØ§Ù†ÙˆØ§ØªÙˆ vu +Вануату vu +Вануату vu +ভানà§à§Ÿà¦¾à¦Ÿà§ vu +Fanwatw vu +Βανουάτου vu +Vanuatuo vu +وانواتو vu +Vanuatú vu +ונו×טו vu +वनौतू vu +Vanúatú vu +ãƒãƒŒã‚¢ãƒ„ vu +វ៉ានុយអាទុយ vu +바누아투 vu +ຈີນ vu +Вануату vu +Вануату vu +ਵਾਨà©à¨†à¨Ÿà©‚ vu +Vanatu vu +Вануату vu +Vanuwatu vu +Вануату vu +வனட௠vu +Вануату vu +à¹à¸§à¸™à¸±à¸§à¸•ู vu +Вануату vu +Вануату vu +瓦努阿图 vu +è¬é‚£æœ vu +Wallis and Futuna wf +Wallis en Futuna wf +واليس Ùˆ Ùوتونا wf +Vallis vÉ™ Futuna wf +ÐŽÐ¾Ð»Ñ–Ñ Ñ– Футуна wf +ОÑтрови Ð£Ð¾Ð»Ð¸Ñ Ð¸ Футина wf +ওয়ালিস à¦à¦¬à¦‚ ফà§à¦Ÿà§à¦¨à¦¾ wf +Wallis ha Futuna wf +Valis i Futuna wf +Wallis i Futuna wf +Wallis a Futuna wf +Ynysoedd Walis a Ffwtwna wf +Wallis- og Futuna-øerne wf +Wallis und Futuna wf +Βαλίς και ΦουτοÏνα wf +Valiso kaj Futuno wf +Wallis y Futuna wf +Wallis ja Futuna wf +Wallis eta Futuna wf +والیس Ùˆ Ùوتونا wf +Wallis ja Futuna wf +Wallis et Futuna wf +Wallis en Futuna wf +Bhailís agus Futúna wf +Wallis e Futuna wf +ו×ליס ופוטונה wf +वालिस तथा फà¥à¤¤à¥à¤¨à¤¾ wf +Wallis i Futuna wf +Wallis és Futuna wf +Wallis- og Fútúnaeyjar wf +Wallis e Futuna wf +ä»é ˜ãƒ¯ãƒªã‚¹ãƒ•ツナ諸島 wf +월리스 후투나 ì œë„ wf +ປັàºàº­àº´àº™àºžàº²àºš wf +Volisa salas un Futuna wf +Ð’Ð°Ð»Ð¸Ñ Ð¸ Футуна wf +ВилÑÐ¼Ñ Ð±Ð° футуна wf +Wallis dan Futuna wf +Wallis u Futuna wf +Wallis og Futuna wf +Wallis un Futuna wf +Wallis en Futuna wf +Wallis og Futuna wf +ਵਾਲਿਸ਼ ਤੇ ਫੂਟੂਨਾ wf +Wallis i Futuna wf +Wallis e Futuna wf +Wallis e Futuna wf +Wallis ÅŸi Futuna wf +ОÑтрова Ð£Ð¾Ð»Ð»Ð¸Ñ Ð¸ Футуна wf +Walisi na Futuna wf +Wallis ja Futuna wf +Wallis a Futuna wf +Wallis in Futuna wf +Ð’Ð°Ð»Ð¸Ñ Ð¸ Футуна wf +Valis i Futuna wf +Wallis och Futuna wf +வாலிஸ௠மறà¯à®±à¯à®®à¯ பà¯à®¯à¯à®Ÿà®©à®¾ wf +УÑÐ»Ñ Ð²Ð° Футуна wf +วอลลิสà¹à¸¥à¸°à¸Ÿà¸¹à¸—ูนา wf +Wallis ve Futuna wf +Wallis wä Futuna wf +Ð£Ð¾Ð»Ð»Ð¸Ñ Ñ– Футуна wf +Ð£Ð¾Ð»Ð»Ð¸Ñ Ð²Ð° Футуна Ороллари wf +Wallis và Futuna wf +Wallis et Futuna wf +瓦利斯和富图纳群岛 wf +瓦利斯群島和富圖ç´ç¾¤å³¶ wf +Samoa ws +ساموا ws +Самоа ws +Самоа ws +সামোয়া ws +Inizi Samoe ws +Σαμόα ws +Samoo ws +ساموآ ws +Samó ws +סמו××” ws +सामोआ ws +Szamoa ws +Samóa ws +サモア ws +សាមូអា ws +사모아 ì œë„ ws +ໂຊນາ ws +Самоа ws +Самолоа ws +ਸਾਮੋਆ ws +Самоа ws +Samowa ws +Самоа ws +சாமோயா ws +Самоа ws +ซามัว ws +Самоа ws +Самоа ws +Samowa ws +è¨æ‘©äºšç¾¤å²› ws +薩摩亞 ws +Yemen ye +اليمن ye +YÉ™mÉ™n ye +Емен ye +Йемен ye +ইয়েমেন ye +Ihlemeñ ye +Jemen ye +Iemen ye +Jemen ye +Yr Iemen ye +Jemen ye +Υεμένη ye +Jemeno ye +Jeemen ye +یمن ye +Jemen ye +Jemen ye +Jemen ye +Éimin ye +Iemen ye +תימן ye +यमन ye +Jemen ye +Jemen ye +Jemen ye +イエメン ye +áž™áŸáž˜áŸ‚áž“ ye +예멘 ye +ເດມອນ ye +Jemenas ye +Jemena ye +Јемен ye +Емен ye +Yaman ye +Jemen ye +Jemen ye +Jemen ye +Jemen ye +Jemen ye +ਯਮਨ ye +Jemen ye +Iémen ye +Йемен ye +Yemeni ye +Jemen ye +Jemen ye +Jemen ye +Јемен ye +Jemen ye +I-Yemen ye +Jemen ye +யேமன௠ye +Яман ye +เยเมน ye +Ємен ye +Яман ye +也门 ye +葉門 ye +Serbia and Montenegro yu +Serbië en Montenegro yu +Ð¡ÑŠÑ€Ð±Ð¸Ñ Ð¸ Черна гора yu +সারà§à¦¬à¦¿à§Ÿà¦¾ à¦à¦¬à¦‚ মনà§à¦Ÿà§‡à¦¨à¦¿à¦—à§à¦°à§‹ yu +Serbi ha Montenegro yu +Sèrbia i Montenegro yu +Srbsko a ÄŒerná hora yu +Serbien og Montenegro yu +Serbien und Montenegro yu +ΣεÏβία - ΜαυÏοβοÏνιο yu +Serbia y Montenegro yu +Serbia ja TÅ¡ernogooria yu +Serbia eta Montenegro yu +Serbia ja Montenegro yu +Serbie and Monténégro yu +Servië en Montenegro yu +Sérbia e Montenegro yu +Szerbia és Montenegró yu +Serbía og Svartfjallaland yu +Serbia e Montenegro yu +セルビアモンテãƒã‚°ãƒ­ yu +សែប៊ី និង ម៉ុងážáŸážŽáŸáž áŸ’ក្រូ yu +Serbija ir Juodkalnija yu +Србија и Црна Гора yu +Serbia og Montenegro yu +Serbien un Montenegro yu +Servië en Montenegro yu +Serbia og Montenegro yu +ਸਰਬੀਆ ਅਤੇ ਮਾਂਤਾਂਗਰੋ yu +Serbia i Czarnogóra yu +Sérvia e Montenegro yu +Sérvia e Montenegro yu +Ð¡ÐµÑ€Ð±Ð¸Ñ Ð¸ Ð§ÐµÑ€Ð½Ð¾Ð³Ð¾Ñ€Ð¸Ñ yu +Seribiya na Montenegoro yu +Serbia ja Montenegro yu +Srbija in ÄŒrna gora yu +Србија и Црна Гора yu +Srbija i Crna Gora yu +Serbien och Montenegro yu +เซอร์เบีย à¹à¸¥à¸°à¸¡à¸­à¸™à¸•ิเนโà¸à¸£ yu +Sırbistan KaradaÄŸ yu +Serbia wä Montenegro yu +Ð¡ÐµÑ€Ð±Ñ–Ñ Ñ– Ð§Ð¾Ñ€Ð½Ð¾Ð³Ð¾Ñ€Ñ–Ñ yu +Ð¡ÐµÑ€Ð±Ð¸Ñ Ð²Ð° Монтенегро yu +塞尔维亚和黑山 yu +塞爾維亞和黑山 yu +South Africa za +Suid-Afrika za +جنوب Ø£ÙØ±ÙŠÙ‚يا za +CÉ™nubi Afrika za +ÐŸÐ°ÑžÐ´Ð½Ñ‘Ð²Ð°Ñ Ðфрыка za +Южна Ðфрика za +দকà§à¦·à¦¿à¦£ আফà§à¦°à¦¿à¦•া za +Suafrika za +Južna Afrika za +Sudàfrica za +Jižní Afrika za +De Affrica za +Sydafrikanske republik za +Südafrika za +Îότια ΑφÏική za +Sudafriko za +Sudáfrica za +Lõuna-Aafrika za +Hego Afrika za +Ø¢ÙØ±ÛŒÙ‚ای جنوبی za +Etelä-Afrikka za +Suðurafrika za +Afrique du sud za +Sûd-Afrika za +An Afraic Theas za +Ãfrica do Sur za +×“×¨×•× ×פריקה za +दकà¥à¤·à¤¿à¤£à¥€ अफà¥à¤°à¥€à¤•ा za +Južna Afrika za +Dél-Afrika za +Afrika Selatan za +Suður-Afríka za +Sud Africa za +å—アフリカ za +អាហ្វ្រិក​ážáž¶áž„​ážáŸ’បូង za +남 아프리카 공화국 za +à»àº­àºšàºžàº´àºàº²à»ƒàº•້ za +Afrika, Pietų za +DienvidÄfrika za +Јужна Ðфрика za +Өмнөд африк za +Afrika Selatan za +Afrika t'Isfel za +Sør-Afrika za +Söödafrika za +Zuid-Afrika za +Sør-Afrika za +Afrika Borwa za +Sudafrica za +ਦੱਖਣੀ ਅਫਰੀਕਾ za +Afryka PoÅ‚udniowa za +Ãfrica do Sul za +Ãfrica do Sul za +Africa de Sud za +Ð®Ð¶Ð½Ð°Ñ Ðфрика za +Afurika Yepfo za +Lulli-Afrihká za +Južná Afrika za +Južna Afrika za +Јужна Ðфрика za +Južna Afrika za +I-South Africa za +Sydafrika za +தென௠ஆபà¯à®°à®¿à®•à¯à®•ா za +Ðфриқои Ҷанубӣ za +à¹à¸­à¸Ÿà¸£à¸´à¸à¸²à¹ƒà¸•้ za +Güney Afrika za +Könyaq Afrika za +Південна Ðфрика za +Жанубий Ðфрика za +Afurika tshipembe za +Nam Phi za +Nonne Afrike za +Mzantsi Afrika za +å—éž za +å—éž za +Emzantsi Afrika za +Zambia zm +Zambië zm +زامبيا zm +Zambiya zm +Ð—Ð°Ð¼Ð±Ñ–Ñ zm +Ð—Ð°Ð¼Ð±Ð¸Ñ zm +জামবিয়া zm +Zambi zm +Zàmbia zm +Zambie zm +Sambia zm +Sambia zm +Ζάμπια zm +Zambio zm +Sambia zm +زامبیا zm +Sambia zm +Zambie zm +An tSaimbia zm +Zámbia zm +זמביה zm +ज़ामà¥à¤¬à¤¿à¤¯à¤¾ zm +Zambija zm +Sambía zm +ザンビア zm +ហ្សាំប៊ី zm +잠비아 zm +ຈາໄມàºàº²à»‰ zm +Zambija zm +Замбија zm +Замби zm +Å»ambia zm +Sambia zm +ਜੈਂਬੀਆ zm +Zâmbia zm +Zâmbia zm +Ð—Ð°Ð¼Ð±Ð¸Ñ zm +Zambiya zm +Zambija zm +Замбија zm +Zambija zm +ஜாமà¯à®ªà®¿à®¯à®¾ zm +Зомбиё zm +à¹à¸‹à¸¡à¹€à¸šà¸µà¸¢ zm +Ð—Ð°Ð¼Ð±Ñ–Ñ zm +Ð—Ð°Ð¼Ð±Ð¸Ñ zm +Zambeye zm +赞比亚 zm +尚比亞 zm +Zimbabwe zw +زيمبابوي zw +Zimbabve zw +Ð—Ñ‹Ð¼Ð±Ð°Ð±Ð²Ñ zw +Зимбабве zw +জিমà§à¦¬à¦¾à¦¬à§‹à§Ÿà§‡ zw +Zimbabve zw +Simbabwe zw +Simbabwe zw +Ζιμπάμπουε zw +Zimbabvo zw +زیمبابوه zw +An tSiombáib zw +Zimbabué zw +זימבבווה zw +जिमà¥à¤¬à¤¾à¤¬à¤µà¥‡ zw +Zimbabve zw +Simbabve zw +ジンãƒãƒ–エ zw +ហ្ស៊ីមបាបវ៉០zw +ì§ë°”브웨 zw +ລິຊາ zw +Zimbabve zw +Зимбабве zw +Замбабив zw +Å»imbabwe zw +Simbabwe zw +ਜਿੰਬਾਬਵੇਂ zw +Zimbabue zw +Зимбабве zw +Zimbabve zw +Зимбабве zw +Zimbabve zw +ஜிமà¯à®ªà®¾à®ªà¯‡ zw +Зимбобве zw +ซิมบับเว zw +Зімбабве zw +Зимбабве zw +Zimbabwè zw +津巴布韦 zw +è¾›å·´å¨ zw +Czech Republic cz diff --git a/tdeabc/distributionlist.cpp b/tdeabc/distributionlist.cpp new file mode 100644 index 000000000..ee058ecdf --- /dev/null +++ b/tdeabc/distributionlist.cpp @@ -0,0 +1,298 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqapplication.h> +#include <tqpair.h> +#include <tqvaluelist.h> + +#include <ksimpleconfig.h> +#include <kstandarddirs.h> +#include <kdebug.h> + +#include "distributionlist.h" + +using namespace KABC; + +DistributionList::DistributionList( DistributionListManager *manager, + const TQString &name ) : + mManager( manager ), mName( name ) +{ + mManager->insert( this ); +} + +DistributionList::~DistributionList() +{ + mManager->remove( this ); +} + +void DistributionList::setName( const TQString &name ) +{ + mName = name; +} + +TQString DistributionList::name() const +{ + return mName; +} + +void DistributionList::insertEntry( const Addressee &a, const TQString &email ) +{ + Entry e( a, email ); + + TQValueList<Entry>::Iterator it; + for( it = mEntries.begin(); it != mEntries.end(); ++it ) { + if ( (*it).addressee.uid() == a.uid() ) { + /** + We have to check if both email addresses contains no data, + a simple 'email1 == email2' wont work here + */ + if ( ( (*it).email.isNull() && email.isEmpty() ) || + ( (*it).email.isEmpty() && email.isNull() ) || + ( (*it).email == email ) ) { + *it = e; + return; + } + } + } + mEntries.append( e ); +} + +void DistributionList::removeEntry( const Addressee &a, const TQString &email ) +{ + TQValueList<Entry>::Iterator it; + for( it = mEntries.begin(); it != mEntries.end(); ++it ) { + if ( (*it).addressee.uid() == a.uid() && (*it).email == email ) { + mEntries.remove( it ); + return; + } + } +} + +TQStringList DistributionList::emails() const +{ + TQStringList emails; + + Entry::List::ConstIterator it; + for( it = mEntries.begin(); it != mEntries.end(); ++it ) { + Addressee a = (*it).addressee; + TQString email = (*it).email.isEmpty() ? a.fullEmail() : + a.fullEmail( (*it).email ); + + if ( !email.isEmpty() ) { + emails.append( email ); + } + } + + return emails; +} + +DistributionList::Entry::List DistributionList::entries() const +{ + return mEntries; +} + +typedef TQValueList< QPair<TQString, TQString> > MissingEntryList; + +class DistributionListManager::DistributionListManagerPrivate +{ + public: + AddressBook *mAddressBook; + TQMap< TQString, MissingEntryList > mMissingEntries; +}; + +DistributionListManager::DistributionListManager( AddressBook *ab ) + : d( new DistributionListManagerPrivate ) +{ + d->mAddressBook = ab; + mLists.setAutoDelete( true ); +} + +DistributionListManager::~DistributionListManager() +{ + mLists.clear(); + + delete d; + d = 0; +} + +DistributionList *DistributionListManager::list( const TQString &name ) +{ + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + if ( list->name() == name ) return list; + } + + return 0; +} + +void DistributionListManager::insert( DistributionList *l ) +{ + if ( !l ) + return; + + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + if ( list->name() == l->name() ) { + mLists.remove( list ); + break; + } + } + mLists.append( l ); +} + +void DistributionListManager::remove( DistributionList *l ) +{ + if ( !l ) + return; + + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + if ( list->name() == l->name() ) { + mLists.remove( list ); + return; + } + } +} + +TQStringList DistributionListManager::listNames() +{ + TQStringList names; + + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + names.append( list->name() ); + } + + return names; +} + +bool DistributionListManager::load() +{ + KSimpleConfig cfg( locateLocal( "data", "tdeabc/distlists" ) ); + + TQMap<TQString,TQString> entryMap = cfg.entryMap( "DistributionLists" ); + cfg.setGroup( "DistributionLists" ); + + // clear old lists + mLists.clear(); + d->mMissingEntries.clear(); + + TQMap<TQString,TQString>::ConstIterator it; + for( it = entryMap.constBegin(); it != entryMap.constEnd(); ++it ) { + TQString name = it.key(); + TQStringList value = cfg.readListEntry( name ); + + kdDebug(5700) << "DLM::load(): " << name << ": " << value.join(",") << endl; + + DistributionList *list = new DistributionList( this, name ); + + MissingEntryList missingEntries; + TQStringList::ConstIterator entryIt = value.constBegin(); + while( entryIt != value.constEnd() ) { + TQString id = *entryIt++; + TQString email = *entryIt; + + kdDebug(5700) << "----- Entry " << id << endl; + + Addressee a = d->mAddressBook->findByUid( id ); + if ( !a.isEmpty() ) { + list->insertEntry( a, email ); + } else { + missingEntries.append( qMakePair( id, email ) ); + } + + if ( entryIt == value.end() ) + break; + ++entryIt; + } + + d->mMissingEntries.insert( name, missingEntries ); + } + + return true; +} + +bool DistributionListManager::save() +{ + kdDebug(5700) << "DistListManager::save()" << endl; + + KSimpleConfig cfg( locateLocal( "data", "tdeabc/distlists" ) ); + + cfg.deleteGroup( "DistributionLists" ); + cfg.setGroup( "DistributionLists" ); + + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + kdDebug(5700) << " Saving '" << list->name() << "'" << endl; + + TQStringList value; + const DistributionList::Entry::List entries = list->entries(); + DistributionList::Entry::List::ConstIterator it; + for( it = entries.begin(); it != entries.end(); ++it ) { + value.append( (*it).addressee.uid() ); + value.append( (*it).email ); + } + + if ( d->mMissingEntries.find( list->name() ) != d->mMissingEntries.end() ) { + const MissingEntryList missList = d->mMissingEntries[ list->name() ]; + MissingEntryList::ConstIterator missIt; + for ( missIt = missList.begin(); missIt != missList.end(); ++missIt ) { + value.append( (*missIt).first ); + value.append( (*missIt).second ); + } + } + + cfg.writeEntry( list->name(), value ); + } + + cfg.sync(); + + return true; +} + +DistributionListWatcher* DistributionListWatcher::mSelf = 0; + +DistributionListWatcher::DistributionListWatcher() + : TQObject( tqApp, "DistributionListWatcher" ) +{ + mDirWatch = new KDirWatch; + mDirWatch->addFile( locateLocal( "data", "tdeabc/distlists" ) ); + + connect( mDirWatch, TQT_SIGNAL( dirty( const TQString& ) ), TQT_SIGNAL( changed() ) ); + mDirWatch->startScan(); +} + +DistributionListWatcher::~DistributionListWatcher() +{ + delete mDirWatch; + mDirWatch = 0; +} + +DistributionListWatcher *DistributionListWatcher::self() +{ + kdWarning( !tqApp ) << "No TQApplication object available, you'll get a memleak!" << endl; + + if ( !mSelf ) + mSelf = new DistributionListWatcher(); + + return mSelf; +} + +#include "distributionlist.moc" diff --git a/tdeabc/distributionlist.h b/tdeabc/distributionlist.h new file mode 100644 index 000000000..78d182467 --- /dev/null +++ b/tdeabc/distributionlist.h @@ -0,0 +1,217 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_DISTRIBUTIONLIST_H +#define KABC_DISTRIBUTIONLIST_H + +#include <kdirwatch.h> + +#include "addressbook.h" + +namespace KABC { + +class DistributionListManager; + +/** + @short Distribution list of email addresses + + This class represents a list of email addresses. Each email address is + associated with an address book entry. If the address book entry changes, the + entry in the distribution list is automatically updated. +*/ +class KABC_EXPORT DistributionList +{ + public: + /** + @short Distribution List Entry + + This class represents an entry of a distribution list. It consists of an + addressee and an email address. If the email address is null, the + preferred email address of the addressee is used. + */ + struct Entry + { + typedef TQValueList<Entry> List; + + Entry() {} + Entry( const Addressee &_addressee, const TQString &_email ) : + addressee( _addressee ), email( _email ) {} + + Addressee addressee; + TQString email; + }; + + /** + Create distribution list object. + + @param manager Managing object of this list. + @param name Name of this list. + */ + DistributionList( DistributionListManager *manager, const TQString &name ); + + /** + Destructor. + */ + ~DistributionList(); + + /** + Set name of this list. The name is used as key by the + DistributinListManager. + */ + void setName( const TQString & ); + + /** + Get name of this list. + */ + TQString name() const; + + /** + Insert an entry into this distribution list. If the entry already exists + nothing happens. + */ + void insertEntry( const Addressee &, const TQString &email=TQString::null ); + + /** + Remove an entry from this distribution list. If the entry doesn't exist + nothing happens. + */ + void removeEntry( const Addressee &, const TQString &email=TQString::null ); + + /** + Return list of email addresses, which belong to this distributon list. + These addresses can be directly used by e.g. a mail client. + */ + TQStringList emails() const; + + /** + Return list of entries belonging to this distribution list. This function + is mainly useful for a distribution list editor. + */ + Entry::List entries() const; + + private: + DistributionListManager *mManager; + TQString mName; + + Entry::List mEntries; +}; + +/** + @short Manager of distribution lists + + This class represents a collection of distribution lists, which are associated + with a given address book. +*/ +class KABC_EXPORT DistributionListManager +{ + public: + /** + Create manager for given address book. + */ + DistributionListManager( AddressBook * ); + + /** + Destructor. + */ + ~DistributionListManager(); + + /** + Return distribution list with given name. + */ + DistributionList *list( const TQString &name ); // KDE4: add bool caseSensitive = true + + /** + Insert distribution list. If a list with this name already exists, nothing + happens. The passed object is deleted by the manager. + */ + void insert( DistributionList * ); + + /** + Remove distribution list. If a list with this name doesn't exist, nothing + happens. + */ + void remove( DistributionList * ); + + /** + Return names of all distribution lists managed by this manager. + */ + TQStringList listNames(); + + /** + Load distribution lists form disk. + */ + bool load(); + + /** + Save distribution lists to disk. + */ + bool save(); + + private: + class DistributionListManagerPrivate; + DistributionListManagerPrivate *d; + + TQPtrList<DistributionList> mLists; +}; + +/** + @short Watchdog for distribution lists + + This class provides a changed() signal that i emitted when the + distribution lists has changed in some way. + + Exapmle: + + \code + KABC::DistributionListWatcher *watchdog = KABC::DistributionListWatcher::self() + + connect( watchdog, TQT_SIGNAL( changed() ), TQT_SLOT( doSomething() ) ); + \endcode +*/ + +class KABC_EXPORT DistributionListWatcher : public TQObject +{ + Q_OBJECT + + public: + /** + * Returns the watcher object. + */ + static DistributionListWatcher *self(); + + signals: + /** + * This signal is emmitted whenever the distribution lists has + * changed (if a list was added or removed, when a list was + * renamed or the entries of the list changed). + */ + void changed(); + + protected: + DistributionListWatcher(); + ~DistributionListWatcher(); + + private: + static DistributionListWatcher* mSelf; + KDirWatch *mDirWatch; +}; + +} +#endif diff --git a/tdeabc/distributionlistdialog.cpp b/tdeabc/distributionlistdialog.cpp new file mode 100644 index 000000000..8cd22e8fd --- /dev/null +++ b/tdeabc/distributionlistdialog.cpp @@ -0,0 +1,399 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqlistview.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqpushbutton.h> +#include <tqcombobox.h> +#include <kinputdialog.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> + +#include <tdelocale.h> +#include <kdebug.h> +#include <tdemessagebox.h> + +#include "addressbook.h" +#include "addresseedialog.h" +#include "distributionlist.h" + +#include "distributionlistdialog.h" +#include "distributionlistdialog.moc" + +using namespace KABC; + +DistributionListDialog::DistributionListDialog( AddressBook *addressBook, TQWidget *parent) + : KDialogBase( parent, "", true, i18n("Configure Distribution Lists"), Ok, Ok, true) +{ + mEditor = new DistributionListEditorWidget( addressBook, this ); + setMainWidget( mEditor ); + + connect( this, TQT_SIGNAL( okClicked() ), mEditor, TQT_SLOT( save() ) ); +} + +DistributionListDialog::~DistributionListDialog() +{ +} + +// TODO KDE4: Add d-pointer to EmailSelector, make sEmailMap a member variable +static TQMap<TQWidget*,TQString> *sEmailMap = 0; + +EmailSelector::EmailSelector( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ) : + KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, + parent ) +{ + if (!sEmailMap) + sEmailMap = new TQMap<TQWidget*,TQString>(); + TQFrame *topFrame = plainPage(); + TQBoxLayout *topLayout = new TQVBoxLayout( topFrame ); + + mButtonGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), + topFrame ); + topLayout->addWidget( mButtonGroup ); + + TQStringList::ConstIterator it; + for( it = emails.begin(); it != emails.end(); ++it ) { + TQRadioButton *button = new TQRadioButton( *it, mButtonGroup ); + sEmailMap->insert( button, *it ); + if ( (*it) == current ) { + mButtonGroup->setButton(mButtonGroup->id(button)); + } + } +} + +TQString EmailSelector::selected() +{ + TQButton *button = mButtonGroup->selected(); + if ( button ) return (*sEmailMap)[button]; + return TQString::null; +} + +TQString EmailSelector::getEmail( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ) +{ + EmailSelector *dlg = new EmailSelector( emails, current, parent ); + dlg->exec(); + + TQString result = dlg->selected(); + + delete dlg; + + return result; +} + +class EntryItem : public TQListViewItem +{ + public: + EntryItem( TQListView *parent, const Addressee &addressee, + const TQString &email=TQString::null ) : + TQListViewItem( parent ), + mAddressee( addressee ), + mEmail( email ) + { + setText( 0, addressee.realName() ); + if( email.isEmpty() ) { + setText( 1, addressee.preferredEmail() ); + setText( 2, i18n("Yes") ); + } else { + setText( 1, email ); + setText( 2, i18n("No") ); + } + } + + Addressee addressee() const + { + return mAddressee; + } + + TQString email() const + { + return mEmail; + } + + private: + Addressee mAddressee; + TQString mEmail; +}; + +DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *addressBook, TQWidget *parent) : + TQWidget( parent ), + mAddressBook( addressBook ) +{ + kdDebug(5700) << "DistributionListEditor()" << endl; + + TQBoxLayout *topLayout = new TQVBoxLayout( this ); + topLayout->setSpacing( KDialog::spacingHint() ); + + TQBoxLayout *nameLayout = new TQHBoxLayout( topLayout) ; + + mNameCombo = new TQComboBox( this ); + nameLayout->addWidget( mNameCombo ); + connect( mNameCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateEntryView() ) ); + + mNewButton = new TQPushButton( i18n("New List..."), this ); + nameLayout->addWidget( mNewButton ); + connect( mNewButton, TQT_SIGNAL( clicked() ), TQT_SLOT( newList() ) ); + + mEditButton = new TQPushButton( i18n("Rename List..."), this ); + nameLayout->addWidget( mEditButton ); + connect( mEditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editList() ) ); + + mRemoveButton = new TQPushButton( i18n("Remove List"), this ); + nameLayout->addWidget( mRemoveButton ); + connect( mRemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeList() ) ); + + TQGridLayout *gridLayout = new TQGridLayout( topLayout, 3, 3 ); + gridLayout->setColStretch(1, 1); + + TQLabel *listLabel = new TQLabel( i18n("Available addresses:"), this ); + gridLayout->addWidget( listLabel, 0, 0 ); + + mListLabel = new TQLabel( this ); + gridLayout->addMultiCellWidget( mListLabel, 0, 0, 1, 2 ); + + mAddresseeView = new TQListView( this ); + mAddresseeView->addColumn( i18n("Name") ); + mAddresseeView->addColumn( i18n("Preferred Email") ); + mAddresseeView->setAllColumnsShowFocus( true ); + gridLayout->addWidget( mAddresseeView, 1, 0 ); + connect( mAddresseeView, TQT_SIGNAL( selectionChanged() ), + TQT_SLOT( slotSelectionAddresseeViewChanged() ) ); + connect( mAddresseeView, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + TQT_SLOT( addEntry() ) ); + + mAddEntryButton = new TQPushButton( i18n("Add Entry"), this ); + mAddEntryButton->setEnabled(false); + gridLayout->addWidget( mAddEntryButton, 2, 0 ); + connect( mAddEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addEntry() ) ); + + mEntryView = new TQListView( this ); + mEntryView->addColumn( i18n("Name") ); + mEntryView->addColumn( i18n("Email") ); + mEntryView->addColumn( i18n("Use Preferred") ); + mEntryView->setEnabled(false); + mEntryView->setAllColumnsShowFocus( true ); + gridLayout->addMultiCellWidget( mEntryView, 1, 1, 1, 2 ); + connect( mEntryView, TQT_SIGNAL( selectionChanged() ), + TQT_SLOT( slotSelectionEntryViewChanged() ) ); + + mChangeEmailButton = new TQPushButton( i18n("Change Email..."), this ); + gridLayout->addWidget( mChangeEmailButton, 2, 1 ); + connect( mChangeEmailButton, TQT_SIGNAL( clicked() ), TQT_SLOT( changeEmail() ) ); + + mRemoveEntryButton = new TQPushButton( i18n("Remove Entry"), this ); + gridLayout->addWidget( mRemoveEntryButton, 2, 2 ); + connect( mRemoveEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeEntry() ) ); + + mManager = new DistributionListManager( mAddressBook ); + mManager->load(); + + updateAddresseeView(); + updateNameCombo(); +} + +DistributionListEditorWidget::~DistributionListEditorWidget() +{ + kdDebug(5700) << "~DistributionListEditor()" << endl; + + delete mManager; +} + +void DistributionListEditorWidget::save() +{ + mManager->save(); +} + +void DistributionListEditorWidget::slotSelectionEntryViewChanged() +{ + EntryItem *entryItem = static_cast<EntryItem *>( mEntryView->selectedItem() ); + bool state=entryItem; + + mChangeEmailButton->setEnabled(state); + mRemoveEntryButton->setEnabled(state); +} + +void DistributionListEditorWidget::newList() +{ + bool ok; + TQString name = KInputDialog::getText( i18n( "New Distribution List" ), + i18n( "Please enter &name:" ), TQString::null, &ok ); + if (!ok) return; + + new DistributionList( mManager, name ); + + mNameCombo->clear(); + mNameCombo->insertStringList( mManager->listNames() ); + mNameCombo->setCurrentItem( mNameCombo->count() - 1 ); + + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditorWidget::editList() +{ + TQString oldName = mNameCombo->currentText(); + bool ok; + TQString name = KInputDialog::getText( i18n( "Distribution List" ), + i18n( "Please change &name:" ), oldName, &ok ); + if (!ok) return; + + DistributionList *list = mManager->list( oldName ); + list->setName( name ); + + mNameCombo->clear(); + mNameCombo->insertStringList( mManager->listNames() ); + mNameCombo->setCurrentItem( mNameCombo->count() - 1 ); + + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditorWidget::removeList() +{ + int result = KMessageBox::warningContinueCancel( this, + i18n("Delete distribution list '%1'?") .arg( mNameCombo->currentText() ), + TQString::null, KStdGuiItem::del() ); + + if ( result != KMessageBox::Continue ) return; + + mManager->remove( mManager->list( mNameCombo->currentText() ) ); + mNameCombo->removeItem( mNameCombo->currentItem() ); + + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditorWidget::addEntry() +{ + AddresseeItem *addresseeItem = + static_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); + + if( !addresseeItem ) { + kdDebug(5700) << "DLE::addEntry(): No addressee selected." << endl; + return; + } + + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) { + kdDebug(5700) << "DLE::addEntry(): No dist list '" << mNameCombo->currentText() << "'" << endl; + return; + } + + list->insertEntry( addresseeItem->addressee() ); + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditorWidget::removeEntry() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + EntryItem *entryItem = + static_cast<EntryItem *>( mEntryView->selectedItem() ); + if ( !entryItem ) return; + + list->removeEntry( entryItem->addressee(), entryItem->email() ); + delete entryItem; +} + +void DistributionListEditorWidget::changeEmail() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + EntryItem *entryItem = + static_cast<EntryItem *>( mEntryView->selectedItem() ); + if ( !entryItem ) return; + + TQString email = EmailSelector::getEmail( entryItem->addressee().emails(), + entryItem->email(), this ); + list->removeEntry( entryItem->addressee(), entryItem->email() ); + list->insertEntry( entryItem->addressee(), email ); + + updateEntryView(); +} + +void DistributionListEditorWidget::updateEntryView() +{ + if ( mNameCombo->currentText().isEmpty() ) { + mListLabel->setText( i18n("Selected addressees:") ); + } else { + mListLabel->setText( i18n("Selected addresses in '%1':") + .arg( mNameCombo->currentText() ) ); + } + + mEntryView->clear(); + + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) { + mEditButton->setEnabled(false); + mRemoveButton->setEnabled(false); + mChangeEmailButton->setEnabled(false); + mRemoveEntryButton->setEnabled(false); + mAddresseeView->setEnabled(false); + mEntryView->setEnabled(false); + return; + } else { + mEditButton->setEnabled(true); + mRemoveButton->setEnabled(true); + mAddresseeView->setEnabled(true); + mEntryView->setEnabled(true); + } + + DistributionList::Entry::List entries = list->entries(); + DistributionList::Entry::List::ConstIterator it; + for( it = entries.begin(); it != entries.end(); ++it ) { + new EntryItem( mEntryView, (*it).addressee, (*it).email ); + } + + EntryItem *entryItem = static_cast<EntryItem *>( mEntryView->selectedItem() ); + bool state=entryItem; + + mChangeEmailButton->setEnabled(state); + mRemoveEntryButton->setEnabled(state); +} + +void DistributionListEditorWidget::updateAddresseeView() +{ + mAddresseeView->clear(); + + AddressBook::Iterator it; + for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { + new AddresseeItem( mAddresseeView, *it ); + } +} + +void DistributionListEditorWidget::updateNameCombo() +{ + mNameCombo->insertStringList( mManager->listNames() ); + + updateEntryView(); +} + +void DistributionListEditorWidget::slotSelectionAddresseeViewChanged() +{ + AddresseeItem *addresseeItem = + static_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); + bool state=addresseeItem; + mAddEntryButton->setEnabled( state && !mNameCombo->currentText().isEmpty()); +} diff --git a/tdeabc/distributionlistdialog.h b/tdeabc/distributionlistdialog.h new file mode 100644 index 000000000..1bd6fc788 --- /dev/null +++ b/tdeabc/distributionlistdialog.h @@ -0,0 +1,139 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_DISTRIBUTIONLISTDIALOG_H +#define KABC_DISTRIBUTIONLISTDIALOG_H + +#include <tqwidget.h> + +#include <kdialogbase.h> + +class TQListView; +class TQComboBox; +class TQButtonGroup; + +namespace KABC { + +class AddressBook; +class DistributionListEditorWidget; +class DistributionListManager; + +/** + @short Frontend to create distribution lists + + Creating a new DistributionListDialog does automatically + load all addressees and distribution lists from the config + files. The changes will be saved when clicking the 'OK' + button. + + Example: + + \code + KABC::DistributionListDialog *dlg = new + KABC::DistributionListDialog( KABC::StdAddressBook::self(), this ); + + dlg->exec(); + \endcode +*/ +class KABC_EXPORT DistributionListDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + Constructor. + + @param ab The addressbook, the addressees should be used from + @param parent The parent widget + */ + DistributionListDialog( AddressBook *ab, TQWidget *parent ); + + /** + Destructor. + */ + virtual ~DistributionListDialog(); + + private: + DistributionListEditorWidget *mEditor; + + struct Data; + Data *d; +}; + +/** + @short Helper class +*/ +class KABC_EXPORT EmailSelector : public KDialogBase +{ + public: + EmailSelector( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ); + + TQString selected(); + + static TQString getEmail( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ); + + private: + TQButtonGroup *mButtonGroup; +}; + +/** + @short Helper class +*/ +class KABC_EXPORT DistributionListEditorWidget : public TQWidget +{ + Q_OBJECT + + public: + DistributionListEditorWidget( AddressBook *, TQWidget *parent ); + virtual ~DistributionListEditorWidget(); + + private slots: + void newList(); + void editList(); + void removeList(); + void addEntry(); + void removeEntry(); + void changeEmail(); + void updateEntryView(); + void updateAddresseeView(); + void updateNameCombo(); + void slotSelectionEntryViewChanged(); + void slotSelectionAddresseeViewChanged(); + void save(); + + private: + TQComboBox *mNameCombo; + TQLabel *mListLabel; + TQListView *mEntryView; + TQListView *mAddresseeView; + + AddressBook *mAddressBook; + DistributionListManager *mManager; + TQPushButton *mNewButton, *mEditButton, *mRemoveButton; + TQPushButton *mChangeEmailButton, *mRemoveEntryButton, *mAddEntryButton; + + struct Data; + Data *d; +}; + +} +#endif diff --git a/tdeabc/distributionlisteditor.cpp b/tdeabc/distributionlisteditor.cpp new file mode 100644 index 000000000..5c26c8121 --- /dev/null +++ b/tdeabc/distributionlisteditor.cpp @@ -0,0 +1,310 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqlistview.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqcombobox.h> +#include <tqbuttongroup.h> +#include <tqradiobutton.h> + +#include <kinputdialog.h> +#include <tdelocale.h> +#include <kdebug.h> + +#include "addressbook.h" +#include "addresseedialog.h" +#include "distributionlist.h" + +#include "distributionlisteditor.h" +#include "distributionlisteditor.moc" + +using namespace KABC; + +EmailSelectDialog::EmailSelectDialog( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ) : + KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, + parent ) +{ + TQFrame *topFrame = plainPage(); + TQBoxLayout *topLayout = new TQVBoxLayout( topFrame ); + + mButtonGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), + topFrame ); + mButtonGroup->setRadioButtonExclusive( true ); + topLayout->addWidget( mButtonGroup ); + + TQStringList::ConstIterator it; + for( it = emails.begin(); it != emails.end(); ++it ) { + TQRadioButton *button = new TQRadioButton( *it, mButtonGroup ); + if ( (*it) == current ) { + button->setDown( true ); + } + } +} + +TQString EmailSelectDialog::selected() +{ + TQButton *button = mButtonGroup->selected(); + if ( button ) return button->text(); + return TQString::null; +} + +TQString EmailSelectDialog::getEmail( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ) +{ + EmailSelectDialog *dlg = new EmailSelectDialog( emails, current, parent ); + dlg->exec(); + + TQString result = dlg->selected(); + + delete dlg; + + return result; +} + +class EditEntryItem : public TQListViewItem +{ + public: + EditEntryItem( TQListView *parent, const Addressee &addressee, + const TQString &email=TQString::null ) : + TQListViewItem( parent ), + mAddressee( addressee ), + mEmail( email ) + { + setText( 0, addressee.realName() ); + if( email.isEmpty() ) { + setText( 1, addressee.preferredEmail() ); + setText( 2, i18n("Yes") ); + } else { + setText( 1, email ); + setText( 2, i18n("No") ); + } + } + + Addressee addressee() const + { + return mAddressee; + } + + TQString email() const + { + return mEmail; + } + + private: + Addressee mAddressee; + TQString mEmail; +}; + +DistributionListEditor::DistributionListEditor( AddressBook *addressBook, TQWidget *parent) : + TQWidget( parent ), + mAddressBook( addressBook ) +{ + kdDebug(5700) << "DistributionListEditor()" << endl; + + TQBoxLayout *topLayout = new TQVBoxLayout( this ); + topLayout->setMargin( KDialog::marginHint() ); + topLayout->setSpacing( KDialog::spacingHint() ); + + TQBoxLayout *nameLayout = new TQHBoxLayout( topLayout) ; + + mNameCombo = new TQComboBox( this ); + nameLayout->addWidget( mNameCombo ); + connect( mNameCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateEntryView() ) ); + + newButton = new TQPushButton( i18n("New List"), this ); + nameLayout->addWidget( newButton ); + connect( newButton, TQT_SIGNAL( clicked() ), TQT_SLOT( newList() ) ); + + removeButton = new TQPushButton( i18n("Remove List"), this ); + nameLayout->addWidget( removeButton ); + connect( removeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeList() ) ); + + mEntryView = new TQListView( this ); + mEntryView->addColumn( i18n("Name") ); + mEntryView->addColumn( i18n("Email") ); + mEntryView->addColumn( i18n("Use Preferred") ); + topLayout->addWidget( mEntryView ); + connect(mEntryView,TQT_SIGNAL(selectionChanged ()),this, TQT_SLOT(slotSelectionEntryViewChanged())); + + changeEmailButton = new TQPushButton( i18n("Change Email"), this ); + topLayout->addWidget( changeEmailButton ); + connect( changeEmailButton, TQT_SIGNAL( clicked() ), TQT_SLOT( changeEmail() ) ); + + removeEntryButton = new TQPushButton( i18n("Remove Entry"), this ); + topLayout->addWidget( removeEntryButton ); + connect( removeEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeEntry() ) ); + + addEntryButton = new TQPushButton( i18n("Add Entry"), this ); + topLayout->addWidget( addEntryButton ); + connect( addEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addEntry() ) ); + + mAddresseeView = new TQListView( this ); + mAddresseeView->addColumn( i18n("Name") ); + mAddresseeView->addColumn( i18n("Preferred Email") ); + topLayout->addWidget( mAddresseeView ); + + + connect(mAddresseeView,TQT_SIGNAL(selectionChanged ()),this, TQT_SLOT(slotSelectionAddresseeViewChanged())); + + mManager = new DistributionListManager( mAddressBook ); + mManager->load(); + + updateAddresseeView(); + updateNameCombo(); + removeButton->setEnabled(!mManager->listNames().isEmpty()); +} + +DistributionListEditor::~DistributionListEditor() +{ + kdDebug(5700) << "~DistributionListEditor()" << endl; + + mManager->save(); + delete mManager; +} + +void DistributionListEditor::slotSelectionEntryViewChanged() +{ + EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); + bool state = (entryItem != 0L); + + changeEmailButton->setEnabled(state); + removeEntryButton->setEnabled(state); +} + +void DistributionListEditor::newList() +{ + bool ok = false; + TQString name = KInputDialog::getText( i18n("New Distribution List"), + i18n("Please enter name:"), + TQString::null, &ok, this ); + if ( !ok ) + return; + + new DistributionList( mManager, name ); + + mNameCombo->insertItem( name ); + removeButton->setEnabled(true); + updateEntryView(); +} + +void DistributionListEditor::removeList() +{ + mManager->remove( mManager->list( mNameCombo->currentText() ) ); + mNameCombo->removeItem( mNameCombo->currentItem() ); + removeButton->setEnabled(!mManager->listNames().isEmpty()); + addEntryButton->setEnabled( !mNameCombo->currentText().isEmpty()); + updateEntryView(); +} + +void DistributionListEditor::addEntry() +{ + AddresseeItem *addresseeItem = + dynamic_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); + + if( !addresseeItem ) { + kdDebug(5700) << "DLE::addEntry(): No addressee selected." << endl; + return; + } + + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) { + kdDebug(5700) << "DLE::addEntry(): No dist list '" << mNameCombo->currentText() << "'" << endl; + return; + } + + list->insertEntry( addresseeItem->addressee() ); + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditor::removeEntry() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + EditEntryItem *entryItem = + dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); + if ( !entryItem ) return; + + list->removeEntry( entryItem->addressee(), entryItem->email() ); + delete entryItem; +} + +void DistributionListEditor::changeEmail() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + EditEntryItem *entryItem = + dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); + if ( !entryItem ) return; + + TQString email = EmailSelectDialog::getEmail( entryItem->addressee().emails(), + entryItem->email(), this ); + list->removeEntry( entryItem->addressee(), entryItem->email() ); + list->insertEntry( entryItem->addressee(), email ); + + updateEntryView(); +} + +void DistributionListEditor::updateEntryView() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + mEntryView->clear(); + DistributionList::Entry::List entries = list->entries(); + DistributionList::Entry::List::ConstIterator it; + for( it = entries.begin(); it != entries.end(); ++it ) { + new EditEntryItem( mEntryView, (*it).addressee, (*it).email ); + } + EditEntryItem *entryItem = dynamic_cast<EditEntryItem *>( mEntryView->selectedItem() ); + bool state = (entryItem != 0L); + + changeEmailButton->setEnabled(state); + removeEntryButton->setEnabled(state); +} + +void DistributionListEditor::updateAddresseeView() +{ + mAddresseeView->clear(); + + AddressBook::Iterator it; + for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { + new AddresseeItem( mAddresseeView, *it ); + } +} + +void DistributionListEditor::updateNameCombo() +{ + mNameCombo->insertStringList( mManager->listNames() ); + + updateEntryView(); +} + +void DistributionListEditor::slotSelectionAddresseeViewChanged() +{ + AddresseeItem *addresseeItem = + dynamic_cast<AddresseeItem *>( mAddresseeView->selectedItem() ); + bool state = (addresseeItem != 0L); + addEntryButton->setEnabled( state && !mNameCombo->currentText().isEmpty()); +} diff --git a/tdeabc/distributionlisteditor.h b/tdeabc/distributionlisteditor.h new file mode 100644 index 000000000..faec280e6 --- /dev/null +++ b/tdeabc/distributionlisteditor.h @@ -0,0 +1,86 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_DISTRIBUTIONLISTEDITOR_H +#define KABC_DISTRIBUTIONLISTEDITOR_H + +#include <tqwidget.h> + +#include <kdialogbase.h> + +class TQListView; +class TQComboBox; +class TQButtonGroup; + +namespace KABC { + +class AddressBook; +class DistributionListManager; + +class KABC_EXPORT EmailSelectDialog : public KDialogBase +{ + public: + EmailSelectDialog( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ); + + TQString selected(); + + static TQString getEmail( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ); + + private: + TQButtonGroup *mButtonGroup; +}; + +/** + @obsolete +*/ +class DistributionListEditor : public TQWidget +{ + Q_OBJECT + public: + DistributionListEditor( AddressBook *, TQWidget *parent ); + virtual ~DistributionListEditor(); + + private slots: + void newList(); + void removeList(); + void addEntry(); + void removeEntry(); + void changeEmail(); + void updateEntryView(); + void updateAddresseeView(); + void updateNameCombo(); + void slotSelectionEntryViewChanged(); + void slotSelectionAddresseeViewChanged(); + + private: + TQComboBox *mNameCombo; + TQListView *mEntryView; + TQListView *mAddresseeView; + + AddressBook *mAddressBook; + DistributionListManager *mManager; + TQPushButton *newButton, *removeButton; + TQPushButton *changeEmailButton,*removeEntryButton,*addEntryButton; +}; + +} + +#endif diff --git a/tdeabc/errorhandler.cpp b/tdeabc/errorhandler.cpp new file mode 100644 index 000000000..d2245e44f --- /dev/null +++ b/tdeabc/errorhandler.cpp @@ -0,0 +1,55 @@ +/* + This file is part of libkabc. + + Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> + Copyright (c) 2003 Cornelius Schumacher <schumacher@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 <kdebug.h> +#include <tdelocale.h> +#include <tdemessagebox.h> + +#include <tqapplication.h> + +#include "errorhandler.h" + +using namespace KABC; + +void ConsoleErrorHandler::error( const TQString &msg ) +{ + // no debug area is ok here + kdError() << msg << endl; +} + + +void GUIErrorHandler::error( const TQString &msg ) +{ + KMessageBox::error( 0, msg, i18n( "Error in libkabc" ) ); +} + + +GuiErrorHandler::GuiErrorHandler( TQWidget *parent ) + : mParent( parent ) +{ +} + +void GuiErrorHandler::error( const TQString &msg ) +{ + if (tqApp) + KMessageBox::error( mParent, msg ); +} diff --git a/tdeabc/errorhandler.h b/tdeabc/errorhandler.h new file mode 100644 index 000000000..9a316541d --- /dev/null +++ b/tdeabc/errorhandler.h @@ -0,0 +1,95 @@ +/* + This file is part of libkabc. + + Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> + Copyright (c) 2003 Cornelius Schumacher <schumacher@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 KABC_ERRORHANDLER_H +#define KABC_ERRORHANDLER_H + +#include <tqstring.h> + +#include <tdelibs_export.h> + +class TQWidget; + +namespace KABC { + +/** + Abstract class that provides displaying of error messages. + We need this to make libkabc gui independent on the one side + and provide user friendly error messages on the other side. + Use @p ConsoleErrorHandler or @p GuiErrorHandler in your + application or provide your own ErrorHandler. +*/ +class KABC_EXPORT ErrorHandler +{ + public: + /** + Show error message. + */ + virtual void error( const TQString &msg ) = 0; +}; + +/** + This class prints the error messages to stderr via kdError(). +*/ +class KABC_EXPORT ConsoleErrorHandler : public ErrorHandler +{ + public: + virtual void error( const TQString &msg ); +}; + +/** + This class shows messages boxes for every + error message. + + \deprecated Use GuiErrorHandler instead. +*/ +class KABC_EXPORT GUIErrorHandler : public ErrorHandler +{ + public: + virtual void error( const TQString &msg ); +}; + +/** + This class shows messages boxes for every + error message. +*/ +class KABC_EXPORT GuiErrorHandler : public ErrorHandler +{ + public: + /** + Create error handler. + + \param parent Widget which is used as parent for the error dialogs. + */ + GuiErrorHandler( TQWidget *parent ); + + virtual void error( const TQString &msg ); + + private: + TQWidget *mParent; + + class Private; + Private *d; +}; + +} + +#endif diff --git a/tdeabc/field.h b/tdeabc/field.h new file mode 100644 index 000000000..118ce2d51 --- /dev/null +++ b/tdeabc/field.h @@ -0,0 +1,176 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Cornelius Schumacher <schumacher@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 KABC_FIELD_H +#define KABC_FIELD_H + +#include <tqstring.h> +#include <tqvaluelist.h> + +#include "addressee.h" + +class TDEConfig; + +namespace KABC { + +class KABC_EXPORT Field +{ + class FieldImpl; + friend class FieldImpl; + +public: + typedef TQValueList<Field *> List; + + /** + * @li @p All - + * @li @p Frequent - + * @li @p Address - + * @li @p Email - + * @li @p Personal - + * @li @p Organization - + * @li @p CustomCategory - + */ + enum FieldCategory + { + All = 0x0, + Frequent = 0x01, + Address = 0x02, + Email = 0x04, + Personal = 0x08, + Organization = 0x10, + CustomCategory = 0x20 + }; + + /** + * Returns the translated label for this field. + */ + virtual TQString label(); + + /** + * Returns the ored categories the field belongs to. + */ + virtual int category(); + + /** + * Returns the translated label for field category. + */ + static TQString categoryLabel( int category ); + + /** + * Returns a string representation of the value the field has in the given + * Addressee. Returns TQString::null, if it is not possible to convert the + * value to a string. + */ + virtual TQString value( const KABC::Addressee & ); + + /** + * Sets the value of the field in the given Addressee. Returns true on success + * or false, if the given string couldn't be converted to a valid value. + */ + virtual bool setValue( KABC::Addressee &, const TQString & ); + + /** + * Returns a string, that can be used for sorting. + */ + TQString sortKey( const KABC::Addressee & ); + + /** + * Returns, if the field is a user-defined field. + */ + virtual bool isCustom(); + + /** + * Returns, if the field is equal with @a field. + */ + virtual bool equals( Field *field ); + + /** + * Returns a list of all fields. + */ + static Field::List allFields(); + + /** + * Returns a list of the default fields. + */ + static Field::List defaultFields(); + + /** + * Creates a custom field. + * + * @param label The label for this field + * @param category The category of this field + * @param key Unique key for this field + * @param app Unique app name for this field + */ + static Field *createCustomField( const TQString &label, int category, + const TQString &key, const TQString &app ); + + /** + * Delete all fields from list. + */ + static void deleteFields(); + + /** + * Save the field settings to a config file. + * + * @param cfg The config file object + * @param identifier The unique identifier + * @param fields The list of the fields + */ + static void saveFields( TDEConfig *cfg, const TQString &identifier, + const Field::List &fields ); + /** + * This is the same as above, with the difference, that + * the list is stored in TDEGlobal::config() in group "KABCFields". + */ + static void saveFields( const TQString &identifier, + const Field::List &fields ); + + /** + * Load the field settings from a config file. + * + * @param cfg The config file object + * @param identifier The unique identifier + */ + static Field::List restoreFields( TDEConfig *cfg, const TQString &identifier ); + + /** + * This is the same as above, with the difference, that + * the list is loaded from TDEGlobal::config() from group "KABCFields". + */ + static Field::List restoreFields( const TQString &identifier ); + +protected: + static void createField( int id, int category = 0 ); + static void createDefaultField( int id, int category = 0 ); + +private: + Field( FieldImpl * ); + virtual ~Field(); + + FieldImpl *mImpl; + + static Field::List mAllFields; + static Field::List mDefaultFields; + static Field::List mCustomFields; +}; + +} +#endif diff --git a/tdeabc/format.h b/tdeabc/format.h new file mode 100644 index 000000000..ed036673c --- /dev/null +++ b/tdeabc/format.h @@ -0,0 +1,49 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_FORMAT_H +#define KABC_FORMAT_H + +#include <tqstring.h> + +#include <tdelibs_export.h> + +namespace KABC { + +class AddressBook; + +/** + @deprecated use FormatPlugin instead +*/ +class KABC_EXPORT_DEPRECATED Format +{ + public: + /** + Load addressbook from file. + */ + virtual bool load( AddressBook *, const TQString &fileName ) = 0; + /** + Save addressbook to file. + */ + virtual bool save( AddressBook *, const TQString &fileName ) = 0; +}; + +} + +#endif diff --git a/tdeabc/formatfactory.cpp b/tdeabc/formatfactory.cpp new file mode 100644 index 000000000..0795957a2 --- /dev/null +++ b/tdeabc/formatfactory.cpp @@ -0,0 +1,168 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <kdebug.h> +#include <tdelocale.h> +#include <ksimpleconfig.h> +#include <kstandarddirs.h> +#include <kstaticdeleter.h> + +#include <tqfile.h> + +#include "vcardformatplugin.h" + +#include "formatfactory.h" + +using namespace KABC; + +FormatFactory *FormatFactory::mSelf = 0; +static KStaticDeleter<FormatFactory> factoryDeleter; + +FormatFactory *FormatFactory::self() +{ + kdDebug(5700) << "FormatFactory::self()" << endl; + + if ( !mSelf ) + factoryDeleter.setObject( mSelf, new FormatFactory ); + + return mSelf; +} + +FormatFactory::FormatFactory() +{ + mFormatList.setAutoDelete( true ); + + // dummy entry for default format + FormatInfo *info = new FormatInfo; + info->library = "<NoLibrary>"; + info->nameLabel = i18n( "vCard" ); + info->descriptionLabel = i18n( "vCard Format" ); + mFormatList.insert( "vcard", info ); + + const TQStringList list = TDEGlobal::dirs()->findAllResources( "data" ,"tdeabc/formats/*.desktop", true, true ); + for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + KSimpleConfig config( *it, true ); + + if ( !config.hasGroup( "Misc" ) || !config.hasGroup( "Plugin" ) ) + continue; + + info = new FormatInfo; + + config.setGroup( "Plugin" ); + TQString type = config.readEntry( "Type" ); + info->library = config.readEntry( "X-TDE-Library" ); + + config.setGroup( "Misc" ); + info->nameLabel = config.readEntry( "Name" ); + info->descriptionLabel = config.readEntry( "Comment", i18n( "No description available." ) ); + + mFormatList.insert( type, info ); + } +} + +FormatFactory::~FormatFactory() +{ + mFormatList.clear(); +} + +TQStringList FormatFactory::formats() +{ + TQStringList retval; + + // make sure 'vcard' is the first entry + retval << "vcard"; + + TQDictIterator<FormatInfo> it( mFormatList ); + for ( ; it.current(); ++it ) + if ( it.currentKey() != "vcard" ) + retval << it.currentKey(); + + return retval; +} + +FormatInfo *FormatFactory::info( const TQString &type ) +{ + if ( type.isEmpty() ) + return 0; + else + return mFormatList[ type ]; +} + +FormatPlugin *FormatFactory::format( const TQString& type ) +{ + FormatPlugin *format = 0; + + if ( type.isEmpty() ) + return 0; + + if ( type == "vcard" ) { + format = new VCardFormatPlugin; + format->setType( type ); + format->setNameLabel( i18n( "vCard" ) ); + format->setDescriptionLabel( i18n( "vCard Format" ) ); + return format; + } + + FormatInfo *fi = mFormatList[ type ]; + if (!fi) + return 0; + TQString libName = fi->library; + + KLibrary *library = openLibrary( libName ); + if ( !library ) + return 0; + + void *format_func = library->symbol( "format" ); + + if ( format_func ) { + format = ((FormatPlugin* (*)())format_func)(); + format->setType( type ); + format->setNameLabel( fi->nameLabel ); + format->setDescriptionLabel( fi->descriptionLabel ); + } else { + kdDebug( 5700 ) << "'" << libName << "' is not a format plugin." << endl; + return 0; + } + + return format; +} + + +KLibrary *FormatFactory::openLibrary( const TQString& libName ) +{ + KLibrary *library = 0; + + TQString path = KLibLoader::findLibrary( TQFile::encodeName( libName ) ); + + if ( path.isEmpty() ) { + kdDebug( 5700 ) << "No format plugin library was found!" << endl; + return 0; + } + + library = KLibLoader::self()->library( TQFile::encodeName( path ) ); + + if ( !library ) { + kdDebug( 5700 ) << "Could not load library '" << libName << "'" << endl; + return 0; + } + + return library; +} diff --git a/tdeabc/formatfactory.h b/tdeabc/formatfactory.h new file mode 100644 index 000000000..ff9da5504 --- /dev/null +++ b/tdeabc/formatfactory.h @@ -0,0 +1,101 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_FORMATFACTORY_H +#define KABC_FORMATFACTORY_H + +#include <tqdict.h> +#include <tqstring.h> + +#include <tdeconfig.h> +#include <klibloader.h> + +#include "formatplugin.h" + +namespace KABC { + +struct FormatInfo +{ + TQString library; + TQString nameLabel; + TQString descriptionLabel; +}; + +/** + * Class for loading format plugins. + * + * Example: + * + * \code + * KABC::FormatFactory *factory = KABC::FormatFactory::self(); + * + * TQStringList list = factory->formats(); + * TQStringList::Iterator it; + * for ( it = list.begin(); it != list.end(); ++it ) { + * KABC::FormatPlugin *format = factory->format( (*it) ); + * // do something with format + * } + * \endcode + */ +class KABC_EXPORT FormatFactory +{ + public: + + /** + Destructor. + */ + ~FormatFactory(); + + /** + * Returns the global format factory. + */ + static FormatFactory *self(); + + /** + * Returns a pointer to a format object or a null pointer + * if format type doesn't exist. + * + * @param type The type of the format, returned by formats() + */ + FormatPlugin *format( const TQString &type ); + + /** + * Returns a list of all available format types. + */ + TQStringList formats(); + + /** + * Returns the info structure for a special type. + */ + FormatInfo *info( const TQString &type ); + + protected: + FormatFactory(); + + private: + KLibrary *openLibrary( const TQString& libName ); + + static FormatFactory *mSelf; + + TQDict<FormatInfo> mFormatList; +}; + +} +#endif diff --git a/tdeabc/formatplugin.h b/tdeabc/formatplugin.h new file mode 100644 index 000000000..33f4beea0 --- /dev/null +++ b/tdeabc/formatplugin.h @@ -0,0 +1,73 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_FORMATPLUGIN_H +#define KABC_FORMATPLUGIN_H + +#include <tqfile.h> + +#include "plugin.h" +#include "resource.h" + +namespace KABC { + +class AddressBook; +class Addressee; + +/** + * @short Base class for address book formats. + * + * This class provides an abstract interface for ResourceFile and + * ResourceDir formats. + * + * @internal + */ +class KABC_EXPORT FormatPlugin : public Plugin +{ +public: + + /** + * Load single addressee from file. + */ + virtual bool load( Addressee &, TQFile *file ) = 0; + + /** + * Load whole addressbook from file. + */ + virtual bool loadAll( AddressBook *, Resource *, TQFile *file ) = 0; + + /** + * Save a single Addressee to file. + */ + virtual void save( const Addressee &, TQFile *file ) = 0; + + /** + * Save whole addressbook to file. + */ + virtual void saveAll( AddressBook *, Resource *, TQFile *file ) = 0; + + /** + * Checks if given file contains the right format + */ + virtual bool checkFormat( TQFile *file ) const = 0; +}; + +} +#endif diff --git a/tdeabc/formats/CMakeLists.txt b/tdeabc/formats/CMakeLists.txt new file mode 100644 index 000000000..d7a9e0fc9 --- /dev/null +++ b/tdeabc/formats/CMakeLists.txt @@ -0,0 +1,47 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES binary.desktop DESTINATION ${DATA_INSTALL_DIR}/tdeabc/formats ) + + +##### kabcformat_binary ######################### + +set( target kabcformat_binary ) + +set( ${target}_SRCS + binaryformat.cpp +) + +tde_add_kpart( ${target} AUTOMOC + SOURCES ${${target}_SRCS} + LINK tdeabc-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/formats/Makefile.am b/tdeabc/formats/Makefile.am new file mode 100644 index 000000000..d769d88d7 --- /dev/null +++ b/tdeabc/formats/Makefile.am @@ -0,0 +1,22 @@ +INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) + +kde_module_LTLIBRARIES = kabcformat_binary.la + +kabcformat_binary_la_SOURCES = binaryformat.cpp +kabcformat_binary_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) \ + -no-undefined +kabcformat_binary_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(LIB_TDECORE) +kabcformat_binary_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +# these are the headers for your project +noinst_HEADERS = binaryformat.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabcformat_binary.pot + +linkdir = $(kde_datadir)/tdeabc/formats +link_DATA = binary.desktop +EXTRA_DIST = $(link_DATA) diff --git a/tdeabc/formats/binary.desktop b/tdeabc/formats/binary.desktop new file mode 100644 index 000000000..993286ad5 --- /dev/null +++ b/tdeabc/formats/binary.desktop @@ -0,0 +1,89 @@ +[Misc] +Name=Binary +Name[af]=Binêre +Name[ar]=ثنائي +Name[az]=İcraçı +Name[be]=Двайковы +Name[bg]=Двоичен +Name[bn]=বাইনারি +Name[br]=Binarel +Name[bs]=Binarno +Name[ca]=Binari +Name[cs]=Binární +Name[csb]=Binarny +Name[cy]=Deuaidd +Name[da]=Binær +Name[de]=Binär +Name[el]=Δυαδικό +Name[eo]=Duuma +Name[es]=Binario +Name[et]=Binaar +Name[eu]=Bitarra +Name[fa]=دوگانی +Name[fi]=Binääri +Name[fr]=Binaire +Name[fy]=Binêr +Name[ga]=Dénártha +Name[gl]=Binário +Name[he]=בינרית +Name[hi]=दà¥à¤µà¤¿à¤šà¤° +Name[hr]=Binarno +Name[hsb]=Binarny +Name[hu]=Bináris +Name[id]=Biner +Name[is]=Tvíunda +Name[it]=Binario +Name[ja]=ãƒã‚¤ãƒŠãƒª +Name[ka]=áƒáƒ áƒáƒ‘ითი +Name[kk]=Бинарлық +Name[km]=គោលពីរ +Name[ko]=ë°”ì´ë„ˆë¦¬ +Name[lb]=Binär +Name[lt]=Dvejetainis +Name[lv]=BinÄrs +Name[mk]=Бинарен +Name[mn]=Бинар +Name[ms]=Binari +Name[mt]=Binarju +Name[nb]=Binær +Name[nds]=Bineer +Name[ne]=बाइनरी +Name[nl]=Binair +Name[nn]=Binær +Name[nso]=Tselapedi +Name[pa]=ਬਾਈਨਰੀ +Name[pl]=Binarny +Name[pt]=Binário +Name[pt_BR]=Binário +Name[ro]=Binar +Name[ru]=Двоичный +Name[rw]=Nyabibiri +Name[se]=Binára +Name[sk]=Binárny +Name[sl]=DvojiÅ¡ko +Name[sq]=Binarë +Name[sr]=Бинарни +Name[sr@Latn]=Binarni +Name[ss]=Lokuhamab ngakubili +Name[sv]=Binär +Name[ta]=இரà¯à®®à®®à¯ +Name[te]=à°¦à±à°µà°¿à°¯à°¾à°¶à°‚ +Name[tg]=Дутартиба +Name[th]=ไบนารี +Name[tr]=İkili +Name[tt]=Binar +Name[uk]=Двійковий +Name[uz]=Binar +Name[uz@cyrillic]=Бинар +Name[ven]=Zwivhili +Name[vi]=Nhị phân +Name[wa]=Binaire +Name[xh]=Ephindwe kabini +Name[zh_CN]=二进制 +Name[zh_HK]=äºŒé€²ä½ +Name[zh_TW]=äºŒé€²ä½ +Name[zu]=Okuhambisana ngambili + +[Plugin] +Type=binary +X-TDE-Library=kabcformat_binary diff --git a/tdeabc/formats/binaryformat.cpp b/tdeabc/formats/binaryformat.cpp new file mode 100644 index 000000000..f37146e57 --- /dev/null +++ b/tdeabc/formats/binaryformat.cpp @@ -0,0 +1,221 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqdatastream.h> +#include <tqimage.h> + +#include <kdebug.h> +#include <tdelocale.h> +#include <kstandarddirs.h> + +#include "addressbook.h" +#include "addressee.h" +#include "picture.h" +#include "sound.h" + +#include "binaryformat.h" + +#define BINARY_FORMAT_VERSION 1 + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT FormatPlugin *format() + { + return new BinaryFormat; + } +} + +bool BinaryFormat::load( Addressee &addressee, TQFile *file ) +{ + kdDebug(5700) << "BinaryFormat::load()" << endl; + TQDataStream stream( file ); + + if ( !checkHeader( stream ) ) + return false; + + loadAddressee( addressee, stream ); + + return true; +} + +bool BinaryFormat::loadAll( AddressBook*, Resource *resource, TQFile *file ) +{ + kdDebug(5700) << "BinaryFormat::loadAll()" << endl; + + TQDataStream stream( file ); + + if ( !checkHeader( stream ) ) + return false; + + TQ_UINT32 entries; + + stream >> entries; + + for ( uint i = 0; i < entries; ++i ) { + Addressee addressee; + loadAddressee( addressee, stream ); + addressee.setResource( resource ); + addressee.setChanged( false ); + resource->insertAddressee( addressee ); + } + + return true; +} + +void BinaryFormat::save( const Addressee &addressee, TQFile *file ) +{ + kdDebug(5700) << "BinaryFormat::save()" << endl; + + TQDataStream stream( file ); + + writeHeader( stream ); + + TQ_UINT32 entries = 1; + stream << entries; + saveAddressee( addressee, stream ); +} + +void BinaryFormat::saveAll( AddressBook*, Resource *resource, TQFile *file ) +{ + kdDebug(5700) << "BinaryFormat::saveAll()" << endl; + + TQ_UINT32 counter = 0; + TQDataStream stream( file ); + + writeHeader( stream ); + // set dummy number of entries + stream << counter; + + Resource::Iterator it; + for ( it = resource->begin(); it != resource->end(); ++it ) { + saveAddressee( (*it), stream ); + counter++; + (*it).setChanged( false ); + } + + // set real number of entries + stream.device()->at( 2 * sizeof( TQ_UINT32 ) ); + stream << counter; +} + +bool BinaryFormat::checkFormat( TQFile *file ) const +{ + kdDebug(5700) << "BinaryFormat::checkFormat()" << endl; + + TQDataStream stream( file ); + + return checkHeader( stream ); +} + +bool BinaryFormat::checkHeader( TQDataStream &stream ) const +{ + TQ_UINT32 magic, version; + + stream >> magic >> version; + + TQFile *file = dynamic_cast<TQFile*>( stream.device() ); + + if ( !file ) { + kdError() << i18n("Not a file?") << endl; + return false; + } + + if ( magic != 0x2e93e ) { + kdError() << TQString(i18n("File '%1' is not binary format.").arg( file->name() )) << endl; + return false; + } + + if ( version != BINARY_FORMAT_VERSION ) { + kdError() << TQString(i18n("File '%1' is the wrong version.").arg( file->name() )) << endl; + return false; + } + + return true; +} + +void BinaryFormat::writeHeader( TQDataStream &stream ) +{ + TQ_UINT32 magic, version; + + magic = 0x2e93e; + version = BINARY_FORMAT_VERSION; + + stream << magic << version; +} + +void BinaryFormat::loadAddressee( Addressee &addressee, TQDataStream &stream ) +{ + stream >> addressee; +/* + // load pictures + Picture photo = addressee.photo(); + Picture logo = addressee.logo(); + + if ( photo.isIntern() ) { + TQImage img; + if ( !img.load( locateLocal( "data", "tdeabc/photos/" ) + addressee.uid() ) ) + kdDebug(5700) << "No photo available for '" << addressee.uid() << "'." << endl; + + addressee.setPhoto( img ); + } + + if ( logo.isIntern() ) { + TQImage img; + if ( !img.load( locateLocal( "data", "tdeabc/logos/" ) + addressee.uid() ) ) + kdDebug(5700) << "No logo available for '" << addressee.uid() << "'." << endl; + + addressee.setLogo( img ); + } + + // load sound + // TODO: load sound data from file +*/ +} + +void BinaryFormat::saveAddressee( const Addressee &addressee, TQDataStream &stream ) +{ + stream << addressee; +/* + // load pictures + Picture photo = addressee.photo(); + Picture logo = addressee.logo(); + + if ( photo.isIntern() ) { + TQImage img = photo.data(); + TQString fileName = locateLocal( "data", "tdeabc/photos/" ) + addressee.uid(); + + if ( !img.save( fileName, "PNG" ) ) + kdDebug(5700) << "Unable to save photo for '" << addressee.uid() << "'." << endl; + } + + if ( logo.isIntern() ) { + TQImage img = logo.data(); + TQString fileName = locateLocal( "data", "tdeabc/logos/" ) + addressee.uid(); + + if ( !img.save( fileName, "PNG" ) ) + kdDebug(5700) << "Unable to save logo for '" << addressee.uid() << "'." << endl; + } + + // save sound + // TODO: save the sound data to file +*/ +} diff --git a/tdeabc/formats/binaryformat.h b/tdeabc/formats/binaryformat.h new file mode 100644 index 000000000..09efde41a --- /dev/null +++ b/tdeabc/formats/binaryformat.h @@ -0,0 +1,69 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_BINARYFORMAT_H +#define KABC_BINARYFORMAT_H + +#include "formatplugin.h" + +namespace KABC { + +class AddressBook; +class Addressee; + +/** + @short binary file format for addressbook entries. +*/ +class BinaryFormat : public FormatPlugin +{ +public: + /** + * Load single addressee from file. + */ + bool load( Addressee &, TQFile *file ); + + /** + * Load whole addressee from file. + */ + bool loadAll( AddressBook *, Resource *, TQFile *file ); + + /** + * Save single addressee to file. + */ + void save( const Addressee &, TQFile *file ); + + /** + * Save all addressees to file. + */ + void saveAll( AddressBook *, Resource *, TQFile *file ); + + /** + * Check for valid format of a file. + */ + bool checkFormat( TQFile *file ) const; + +private: + void loadAddressee( Addressee &, TQDataStream & ); + void saveAddressee( const Addressee &, TQDataStream & ); + bool checkHeader( TQDataStream & ) const; + void writeHeader( TQDataStream & ); +}; + +} +#endif diff --git a/tdeabc/geo.cpp b/tdeabc/geo.cpp new file mode 100644 index 000000000..44f9851e4 --- /dev/null +++ b/tdeabc/geo.cpp @@ -0,0 +1,109 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqdatastream.h> + +#include "geo.h" + +using namespace KABC; + +Geo::Geo() + : mLatitude( 91 ), mLongitude( 181 ), mValidLat( false ), mValidLong( false ) +{ +} + +Geo::Geo( float latitude, float longitude ) +{ + setLatitude( latitude ); + setLongitude( longitude ); +} + +void Geo::setLatitude( float latitude ) +{ + if ( latitude >= -90 && latitude <= 90 ) { + mLatitude = latitude; + mValidLat = true; + } else { + mLatitude = 91; + mValidLat = false; + } +} + +float Geo::latitude() const +{ + return mLatitude; +} + +void Geo::setLongitude( float longitude) +{ + if ( longitude >= -180 && longitude <= 180 ) { + mLongitude = longitude; + mValidLong = true; + } else { + mLongitude = 181; + mValidLong = false; + } +} + +float Geo::longitude() const +{ + return mLongitude; +} + +bool Geo::isValid() const +{ + return mValidLat && mValidLong; +} + +bool Geo::operator==( const Geo &g ) const +{ + if ( !g.isValid() && !isValid() ) return true; + if ( !g.isValid() || !isValid() ) return false; + if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude ) return true; + return false; +} + +bool Geo::operator!=( const Geo &g ) const +{ + if ( !g.isValid() && !isValid() ) return false; + if ( !g.isValid() || !isValid() ) return true; + if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude ) return false; + return true; +} + +TQString Geo::asString() const +{ + return "(" + TQString::number(mLatitude) + "," + TQString::number(mLongitude) + ")"; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Geo &geo ) +{ + return s << (float)geo.mLatitude << (float)geo.mLongitude; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Geo &geo ) +{ + s >> geo.mLatitude >> geo.mLongitude; + + geo.mValidLat = true; + geo.mValidLong = true; + + return s; +} diff --git a/tdeabc/geo.h b/tdeabc/geo.h new file mode 100644 index 000000000..cac6abaff --- /dev/null +++ b/tdeabc/geo.h @@ -0,0 +1,101 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_GEO_H +#define KABC_GEO_H + +#include <tqstring.h> + +#include <tdelibs_export.h> + +namespace KABC { + +/** + @short Geographic position + + This class represents a geographic position. +*/ +class KABC_EXPORT Geo +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Geo & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Geo & ); + + public: + /** + Construct invalid geographics position object. + */ + Geo(); + + /** + Construct geographics position object. + + @param latitude Geographical latitude + @param longitude Geographical longitude + */ + Geo( float latitude, float longitude ); + + /** + Sets the latitude. + */ + void setLatitude( float ); + + /** + Returns the latitude. + */ + float latitude() const; + + /** + Sets the longitude. + */ + void setLongitude( float ); + + /** + Returns the longitude. + */ + float longitude() const; + + /** + Returns, if this object contains a valid geographical position. + */ + bool isValid() const; + + bool operator==( const Geo & ) const; + bool operator!=( const Geo & ) const; + + /** + Returns string representation of geographical position. + */ + TQString asString() const; + + private: + float mLatitude; + float mLongitude; + + bool mValid; + bool mValidLat; + bool mValidLong; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Geo & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Geo & ); + +} + +#endif diff --git a/tdeabc/kabc_manager.desktop b/tdeabc/kabc_manager.desktop new file mode 100644 index 000000000..0af910f52 --- /dev/null +++ b/tdeabc/kabc_manager.desktop @@ -0,0 +1,76 @@ +[Desktop Entry] +Name=Contacts +Name[af]=Kontakte +Name[ar]=المراسلين +Name[be]=Кантакты +Name[br]=Darempredoù +Name[bs]=Kontakti +Name[ca]=Contactes +Name[cs]=Kontakty +Name[csb]=ÅÄ…czbë +Name[cy]=Cysylltau +Name[da]=Kontakter +Name[de]=Kontakte +Name[el]=Επαφές +Name[eo]=Kontaktoj +Name[es]=Contactos +Name[et]=Kontaktid +Name[eu]=Kontaktuak +Name[fa]=تماسها +Name[fi]=Yhteystiedot +Name[fy]=Kontakten +Name[ga]=Teagmhálacha +Name[gl]=Contactos +Name[he]=×נשי קשר +Name[hi]=समà¥à¤ªà¤°à¥à¤• +Name[hr]=Kontakti +Name[hsb]=Adresy +Name[hu]=Névjegyek +Name[id]=Kontak +Name[is]=Tengiliðir +Name[it]=Contatti +Name[ja]=コンタクト +Name[ka]=კáƒáƒœáƒ¢áƒáƒ¥áƒ¢áƒ”ბი +Name[kk]=Контакттар +Name[km]=ទំនាក់ទំនង +Name[ku]=Tekilî +Name[lb]=Kontakter +Name[lt]=Kontaktai +Name[lv]=Kontakti +Name[mk]=Контакти +Name[ms]=Hubungan +Name[nb]=Kontakter +Name[nds]=Kontakten +Name[ne]=समà¥à¤ªà¤°à¥à¤• +Name[nl]=Contactpersonen +Name[nn]=Kontaktar +Name[pa]=ਸੰਪਰਕ +Name[pl]=Kontakty +Name[pt]=Contactos +Name[pt_BR]=Contatos +Name[ro]=Contacte +Name[ru]=Контакты +Name[rw]=Amaderesi +Name[se]=OktavuoÄ‘at +Name[sk]=Kontakty +Name[sl]=Stiki +Name[sr]=Контакти +Name[sr@Latn]=Kontakti +Name[sv]=Kontakter +Name[ta]=தொடரà¯à®ªà¯à®•ள௠+Name[te]=సంపà±à°°à°¦à°¿à°‚à°ªà±à°²à± +Name[tg]=Ðлоқаҳо +Name[th]=รายชื่อติดต่อ +Name[tr]=BaÄŸlantılar +Name[tt]=Elemtälär +Name[uk]=Контакти +Name[uz]=Aloqalar +Name[uz@cyrillic]=Ðлоқалар +Name[vi]=Liên lạc +Name[zh_CN]=è”系人 +Name[zh_HK]=è¯çµ¡äºº +Name[zh_TW]=è¯çµ¡äºº +Type=Service +ServiceTypes=KResources/Manager + +X-TDE-ResourceFamily=contact diff --git a/tdeabc/key.cpp b/tdeabc/key.cpp new file mode 100644 index 000000000..08d9c6872 --- /dev/null +++ b/tdeabc/key.cpp @@ -0,0 +1,153 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <tdeapplication.h> +#include <tdelocale.h> + +#include "key.h" + +using namespace KABC; + +Key::Key( const TQString &text, int type ) + : mTextData( text ), mIsBinary( false ), mType( type ) +{ + mId = TDEApplication::randomString(8); +} + +Key::~Key() +{ +} + +bool Key::operator==( const Key &k ) const +{ + if ( mIsBinary != k.mIsBinary ) return false; + if ( mIsBinary ) + if ( mBinaryData != k.mBinaryData ) return false; + else + if ( mTextData != k.mTextData ) return false; + if ( mType != k.mType ) return false; + if ( mCustomTypeString != k.mCustomTypeString ) return false; + + return true; +} + +bool Key::operator!=( const Key &k ) const +{ + return !( k == *this ); +} + +void Key::setId( const TQString &id ) +{ + mId = id; +} + +TQString Key::id() const +{ + return mId; +} + +void Key::setBinaryData( const TQByteArray &binary ) +{ + mBinaryData = binary; + mIsBinary = true; +} + +TQByteArray Key::binaryData() const +{ + return mBinaryData; +} + +void Key::setTextData( const TQString &text ) +{ + mTextData = text; + mIsBinary = false; +} + +TQString Key::textData() const +{ + return mTextData; +} + +bool Key::isBinary() const +{ + return mIsBinary; +} + +void Key::setType( int type ) +{ + mType = type; +} + +void Key::setCustomTypeString( const TQString &custom ) +{ + mCustomTypeString = custom; +} + +int Key::type() const +{ + return mType; +} + +TQString Key::customTypeString() const +{ + return mCustomTypeString; +} + +Key::TypeList Key::typeList() +{ + TypeList list; + list << X509; + list << PGP; + list << Custom; + + return list; +} + +TQString Key::typeLabel( int type ) +{ + switch ( type ) { + case X509: + return i18n( "X509" ); + break; + case PGP: + return i18n( "PGP" ); + break; + case Custom: + return i18n( "Custom" ); + break; + default: + return i18n( "Unknown type" ); + break; + } +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Key &key ) +{ + return s << key.mId << key.mIsBinary << key.mTextData << key.mBinaryData << + key.mCustomTypeString << key.mType; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Key &key ) +{ + s >> key.mId >> key.mIsBinary >> key.mTextData >> key.mBinaryData >> + key.mCustomTypeString >> key.mType; + + return s; +} diff --git a/tdeabc/key.h b/tdeabc/key.h new file mode 100644 index 000000000..08df0264d --- /dev/null +++ b/tdeabc/key.h @@ -0,0 +1,150 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_KEY_H +#define KABC_KEY_H + +#include <tqvaluelist.h> + +#include <tdelibs_export.h> + +namespace KABC { + +/** + * @short A class to store an encryption key. + */ +class KABC_EXPORT Key +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Key & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Key & ); + +public: + typedef TQValueList<Key> List; + typedef TQValueList<int> TypeList; + + /** + * Key types + * + * @li X509 - X509 key + * @li PGP - Pretty Good Privacy key + * @li Custom - Custom or IANA conform key + */ + enum Types { + X509, + PGP, + Custom + }; + + /** + * Constructor. + * + * @param text The text data. + * @param type The key type, see Types. + */ + Key( const TQString &text = TQString::null, int type = PGP ); + + /** + * Destructor. + */ + ~Key(); + + bool operator==( const Key & ) const; + bool operator!=( const Key & ) const; + + /** + * Sets the unique identifier. + */ + void setId( const TQString &id ); + + /** + * Returns the unique identifier. + */ + TQString id() const; + + /** + * Sets binary data. + */ + void setBinaryData( const TQByteArray &binary ); + + /** + * Returns the binary data. + */ + TQByteArray binaryData() const; + + /** + * Sets text data. + */ + void setTextData( const TQString &text ); + + /** + * Returns the text data. + */ + TQString textData() const; + + /** + * Returns whether the key contains binary or text data. + */ + bool isBinary() const; + + /** + * Sets the type, see Type. + */ + void setType( int type ); + + /** + * Sets custom type string. + */ + void setCustomTypeString( const TQString &custom ); + + /** + * Returns the type, see Type. + */ + int type() const; + + /** + * Returns the custom type string. + */ + TQString customTypeString() const; + + /** + * Returns a list of all available key types. + */ + static TypeList typeList(); + + /** + * Returns a translated label for a given key type. + */ + static TQString typeLabel( int type ); + +private: + TQByteArray mBinaryData; + TQString mId; + TQString mTextData; + TQString mCustomTypeString; + + int mIsBinary; + int mType; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Key & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Key & ); + +} +#endif diff --git a/tdeabc/ldapclient.cpp b/tdeabc/ldapclient.cpp new file mode 100644 index 000000000..1c2b2d833 --- /dev/null +++ b/tdeabc/ldapclient.cpp @@ -0,0 +1,427 @@ +/* kldapclient.cpp - LDAP access + * Copyright (C) 2002 Klarälvdalens Datakonsult AB + * + * Author: Steffen Hansen <hansen@kde.org> + * + * Ported to KABC by Daniel Molkentin <molkentin@kde.org> + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This file 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + + +#include <tqfile.h> +#include <tqimage.h> +#include <tqlabel.h> +#include <tqpixmap.h> +#include <tqtextstream.h> +#include <tqurl.h> + +#include <tdeapplication.h> +#include <tdeconfig.h> +#include <kdebug.h> +#include <kmdcodec.h> +#include <kprotocolinfo.h> + +#include "ldapclient.h" +#include "ldif.h" +#include "ldapurl.h" + +using namespace KABC; + +class LdapClient::LdapClientPrivate{ +public: + TQString bindDN; + TQString pwdBindDN; + LDIF ldif; +}; + +TQString LdapObject::toString() const +{ + TQString result = TQString::fromLatin1( "\ndn: %1\n" ).arg( dn ); + for ( LdapAttrMap::ConstIterator it = attrs.begin(); it != attrs.end(); ++it ) { + TQString attr = it.key(); + for ( LdapAttrValue::ConstIterator it2 = (*it).begin(); it2 != (*it).end(); ++it2 ) { + result += TQString::fromUtf8( LDIF::assembleLine( attr, *it2, 76 ) ) + "\n"; + } + } + + return result; +} + +void LdapObject::clear() +{ + dn = TQString::null; + attrs.clear(); +} + +void LdapObject::assign( const LdapObject& that ) +{ + if ( &that != this ) { + dn = that.dn; + attrs = that.attrs; + client = that.client; + } +} + +LdapClient::LdapClient( TQObject* parent, const char* name ) + : TQObject( parent, name ), mJob( 0 ), mActive( false ) +{ + d = new LdapClientPrivate; +} + +LdapClient::~LdapClient() +{ + cancelQuery(); + delete d; d = 0; +} + +void LdapClient::setHost( const TQString& host ) +{ + mHost = host; +} + +void LdapClient::setPort( const TQString& port ) +{ + mPort = port; +} + +void LdapClient::setBase( const TQString& base ) +{ + mBase = base; +} + +void LdapClient::setBindDN( const TQString& bindDN ) +{ + d->bindDN = bindDN; +} + +void LdapClient::setPwdBindDN( const TQString& pwdBindDN ) +{ + d->pwdBindDN = pwdBindDN; +} + +void LdapClient::setAttrs( const TQStringList& attrs ) +{ + mAttrs = attrs; +} + +void LdapClient::startQuery( const TQString& filter ) +{ + cancelQuery(); + LDAPUrl url; + + url.setProtocol( "ldap" ); + url.setUser( d->bindDN ); + url.setPass( d->pwdBindDN ); + url.setHost( mHost ); + url.setPort( mPort.toUInt() ); + url.setDn( mBase ); + url.setAttributes( mAttrs ); + url.setScope( mScope == "one" ? LDAPUrl::One : LDAPUrl::Sub ); + url.setFilter( "("+filter+")" ); + + kdDebug(5700) << "Doing query: " << url.prettyURL() << endl; + + startParseLDIF(); + mActive = true; + mJob = TDEIO::get( url, false, false ); + connect( mJob, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( slotData( TDEIO::Job*, const TQByteArray& ) ) ); + connect( mJob, TQT_SIGNAL( infoMessage( TDEIO::Job*, const TQString& ) ), + this, TQT_SLOT( slotInfoMessage( TDEIO::Job*, const TQString& ) ) ); + connect( mJob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( slotDone() ) ); +} + +void LdapClient::cancelQuery() +{ + if ( mJob ) { + mJob->kill(); + mJob = 0; + } + + mActive = false; +} + +void LdapClient::slotData( TDEIO::Job*, const TQByteArray& data ) +{ +#ifndef NDEBUG // don't create the QString +// TQString str( data ); +// kdDebug(5700) << "LdapClient: Got \"" << str << "\"\n"; +#endif + parseLDIF( data ); +} + +void LdapClient::slotInfoMessage( TDEIO::Job*, const TQString & ) +{ + //tqDebug("Job said \"%s\"", info.latin1()); +} + +void LdapClient::slotDone() +{ + endParseLDIF(); + mActive = false; +#if 0 + for ( TQValueList<LdapObject>::Iterator it = mObjects.begin(); it != mObjects.end(); ++it ) { + tqDebug( (*it).toString().latin1() ); + } +#endif + int err = mJob->error(); + if ( err && err != TDEIO::ERR_USER_CANCELED ) { + emit error( TDEIO::buildErrorString( err, TQString("%1:%2").arg( mHost ).arg( mPort ) ) ); + } + emit done(); +} + +void LdapClient::startParseLDIF() +{ + mCurrentObject.clear(); + mLastAttrName = 0; + mLastAttrValue = 0; + mIsBase64 = false; + d->ldif.startParsing(); +} + +void LdapClient::endParseLDIF() +{ +} + +void LdapClient::parseLDIF( const TQByteArray& data ) +{ + if ( data.size() ) { + d->ldif.setLDIF( data ); + } else { + d->ldif.endLDIF(); + } + + LDIF::ParseVal ret; + TQString name; + do { + ret = d->ldif.nextItem(); + switch ( ret ) { + case LDIF::Item: + { + name = d->ldif.attr(); + // Must make a copy! TQByteArray is explicitely shared + TQByteArray value = d->ldif.val().copy(); + mCurrentObject.attrs[ name ].append( value ); + break; + } + case LDIF::EndEntry: + mCurrentObject.dn = d->ldif.dn(); + mCurrentObject.client = this; + emit result( mCurrentObject ); + mCurrentObject.clear(); + break; + default: + break; + } + } while ( ret != LDIF::MoreData ); +} + +TQString LdapClient::bindDN() const +{ + return d->bindDN; +} + +TQString LdapClient::pwdBindDN() const +{ + return d->pwdBindDN; +} + +LdapSearch::LdapSearch() + : mActiveClients( 0 ), mNoLDAPLookup( false ) +{ + if ( !KProtocolInfo::isKnownProtocol( KURL("ldap://localhost") ) ) { + mNoLDAPLookup = true; + return; + } + + // stolen from KAddressBook + TDEConfig config( "kabldaprc", true ); + config.setGroup( "LDAP" ); + int numHosts = config.readUnsignedNumEntry( "NumSelectedHosts"); + if ( !numHosts ) { + mNoLDAPLookup = true; + return; + } else { + for ( int j = 0; j < numHosts; j++ ) { + LdapClient* ldapClient = new LdapClient( this ); + + TQString host = config.readEntry( TQString( "SelectedHost%1" ).arg( j ), "" ).stripWhiteSpace(); + if ( !host.isEmpty() ) + ldapClient->setHost( host ); + + TQString port = TQString::number( config.readUnsignedNumEntry( TQString( "SelectedPort%1" ).arg( j ) ) ); + if ( !port.isEmpty() ) + ldapClient->setPort( port ); + + TQString base = config.readEntry( TQString( "SelectedBase%1" ).arg( j ), "" ).stripWhiteSpace(); + if ( !base.isEmpty() ) + ldapClient->setBase( base ); + + TQString bindDN = config.readEntry( TQString( "SelectedBind%1" ).arg( j ) ).stripWhiteSpace(); + if ( !bindDN.isEmpty() ) + ldapClient->setBindDN( bindDN ); + + TQString pwdBindDN = config.readEntry( TQString( "SelectedPwdBind%1" ).arg( j ) ); + if ( !pwdBindDN.isEmpty() ) + ldapClient->setPwdBindDN( pwdBindDN ); + + TQStringList attrs; + attrs << "cn" << "mail" << "givenname" << "sn"; + ldapClient->setAttrs( attrs ); + + connect( ldapClient, TQT_SIGNAL( result( const KABC::LdapObject& ) ), + this, TQT_SLOT( slotLDAPResult( const KABC::LdapObject& ) ) ); + connect( ldapClient, TQT_SIGNAL( done() ), + this, TQT_SLOT( slotLDAPDone() ) ); + connect( ldapClient, TQT_SIGNAL( error( const TQString& ) ), + this, TQT_SLOT( slotLDAPError( const TQString& ) ) ); + + mClients.append( ldapClient ); + } + } + + connect( &mDataTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotDataTimer() ) ); +} + +void LdapSearch::startSearch( const TQString& txt ) +{ + if ( mNoLDAPLookup ) + return; + + cancelSearch(); + + int pos = txt.find( '\"' ); + if( pos >= 0 ) + { + ++pos; + int pos2 = txt.find( '\"', pos ); + if( pos2 >= 0 ) + mSearchText = txt.mid( pos , pos2 - pos ); + else + mSearchText = txt.mid( pos ); + } else + mSearchText = txt; + + TQString filter = TQString( "|(cn=%1*)(mail=%2*)(givenName=%3*)(sn=%4*)" ) + .arg( mSearchText ).arg( mSearchText ).arg( mSearchText ).arg( mSearchText ); + + TQValueList< LdapClient* >::Iterator it; + for ( it = mClients.begin(); it != mClients.end(); ++it ) { + (*it)->startQuery( filter ); + ++mActiveClients; + } +} + +void LdapSearch::cancelSearch() +{ + TQValueList< LdapClient* >::Iterator it; + for ( it = mClients.begin(); it != mClients.end(); ++it ) + (*it)->cancelQuery(); + + mActiveClients = 0; + mResults.clear(); +} + +void LdapSearch::slotLDAPResult( const KABC::LdapObject& obj ) +{ + mResults.append( obj ); + if ( !mDataTimer.isActive() ) + mDataTimer.start( 500, true ); +} + +void LdapSearch::slotLDAPError( const TQString& ) +{ + slotLDAPDone(); +} + +void LdapSearch::slotLDAPDone() +{ + if ( --mActiveClients > 0 ) + return; + + finish(); +} + +void LdapSearch::slotDataTimer() +{ + TQStringList lst; + LdapResultList reslist; + makeSearchData( lst, reslist ); + if ( !lst.isEmpty() ) + emit searchData( lst ); + if ( !reslist.isEmpty() ) + emit searchData( reslist ); +} + +void LdapSearch::finish() +{ + mDataTimer.stop(); + + slotDataTimer(); // emit final bunch of data + emit searchDone(); +} + +void LdapSearch::makeSearchData( TQStringList& ret, LdapResultList& resList ) +{ + TQString search_text_upper = mSearchText.upper(); + + TQValueList< KABC::LdapObject >::ConstIterator it1; + for ( it1 = mResults.begin(); it1 != mResults.end(); ++it1 ) { + TQString name, mail, givenname, sn; + + LdapAttrMap::ConstIterator it2; + for ( it2 = (*it1).attrs.begin(); it2 != (*it1).attrs.end(); ++it2 ) { + TQString tmp = TQString::fromUtf8( (*it2).first(), (*it2).first().size() ); + if ( it2.key() == "cn" ) + name = tmp; // TODO loop? + else if( it2.key() == "mail" ) + mail = tmp; + else if( it2.key() == "givenName" ) + givenname = tmp; + else if( it2.key() == "sn" ) + sn = tmp; + } + + if( mail.isEmpty()) + continue; // nothing, bad entry + else if ( name.isEmpty() ) + ret.append( mail ); + else { + kdDebug(5700) << "<" << name << "><" << mail << ">" << endl; + ret.append( TQString( "%1 <%2>" ).arg( name ).arg( mail ) ); + } + + LdapResult sr; + sr.clientNumber = mClients.findIndex( (*it1).client ); + sr.name = name; + sr.email = mail; + resList.append( sr ); + } + + mResults.clear(); +} + +bool LdapSearch::isAvailable() const +{ + return !mNoLDAPLookup; +} + + + +#include "ldapclient.moc" diff --git a/tdeabc/ldapclient.h b/tdeabc/ldapclient.h new file mode 100644 index 000000000..f43a644ce --- /dev/null +++ b/tdeabc/ldapclient.h @@ -0,0 +1,248 @@ +/* kldapclient.h - LDAP access + * Copyright (C) 2002 Klarälvdalens Datakonsult AB + * + * Author: Steffen Hansen <hansen@kde.org> + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This file 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef KABC_LDAPCLIENT_H +#define KABC_LDAPCLIENT_H + + +#include <tqobject.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqstringlist.h> +#include <tqmemarray.h> +#include <tqguardedptr.h> +#include <tqtimer.h> + +#include <tdeio/job.h> + +namespace KABC { + +class LdapClient; +typedef TQValueList<TQByteArray> LdapAttrValue; +typedef TQMap<TQString,LdapAttrValue > LdapAttrMap; + +/** + * This class is internal. Binary compatibiliy might be broken any time + * without notification. Do not use it. + * + * We mean it! + * + */ +class KABC_EXPORT LdapObject +{ + public: + LdapObject() + : dn( TQString::null ), client( 0 ) {} + explicit LdapObject( const TQString& _dn, LdapClient* _cl ) : dn( _dn ), client( _cl ) {} + LdapObject( const LdapObject& that ) { assign( that ); } + + LdapObject& operator=( const LdapObject& that ) + { + assign( that ); + return *this; + } + + TQString toString() const; + + void clear(); + + TQString dn; + LdapAttrMap attrs; + LdapClient* client; + + protected: + void assign( const LdapObject& that ); + + private: + //class LdapObjectPrivate* d; +}; + +/** + * This class is internal. Binary compatibiliy might be broken any time + * without notification. Do not use it. + * + * We mean it! + * + */ +class KABC_EXPORT LdapClient : public TQObject +{ + Q_OBJECT + + public: + LdapClient( TQObject* parent = 0, const char* name = 0 ); + virtual ~LdapClient(); + + /*! returns true if there is a query running */ + bool isActive() const { return mActive; } + + signals: + /*! Emitted when the query is done */ + void done(); + + /*! Emitted in case of error */ + void error( const TQString& ); + + /*! Emitted once for each object returned + * from the query + */ + void result( const KABC::LdapObject& ); + + public slots: + /*! + * Set the name or IP of the LDAP server + */ + void setHost( const TQString& host ); + TQString host() const { return mHost; } + + /*! + * Set the port of the LDAP server + * if using a nonstandard port + */ + void setPort( const TQString& port ); + TQString port() const { return mPort; } + + /*! + * Set the base DN + */ + void setBase( const TQString& base ); + TQString base() const { return mBase; } + + /*! + * Set the bind DN + */ + void setBindDN( const TQString& bindDN ); + TQString bindDN() const; + + /*! + * Set the bind password DN + */ + void setPwdBindDN( const TQString& pwdBindDN ); + TQString pwdBindDN() const; + + /*! Set the attributes that should be + * returned, or an empty list if + * all attributes are wanted + */ + void setAttrs( const TQStringList& attrs ); + TQStringList attrs() const { return mAttrs; } + + void setScope( const TQString scope ) { mScope = scope; } + + /*! + * Start the query with filter filter + */ + void startQuery( const TQString& filter ); + + /*! + * Abort a running query + */ + void cancelQuery(); + + protected slots: + void slotData( TDEIO::Job*, const TQByteArray &data ); + void slotInfoMessage( TDEIO::Job*, const TQString &info ); + void slotDone(); + + protected: + void startParseLDIF(); + void parseLDIF( const TQByteArray& data ); + void endParseLDIF(); + + TQString mHost; + TQString mPort; + TQString mBase; + TQString mScope; + TQStringList mAttrs; + + TQGuardedPtr<TDEIO::SimpleJob> mJob; + bool mActive; + + LdapObject mCurrentObject; + TQCString mBuf; + TQCString mLastAttrName; + TQCString mLastAttrValue; + bool mIsBase64; + + private: + class LdapClientPrivate; + LdapClientPrivate* d; +}; + +/** + * Structure describing one result returned by a LDAP query + */ +struct LdapResult { + TQString name; ///< full name + TQString email; ///< email + int clientNumber; ///< for sorting +}; +typedef TQValueList<LdapResult> LdapResultList; + + +/** + * This class is internal. Binary compatibiliy might be broken any time + * without notification. Do not use it. + * + * We mean it! + * + */ +class KABC_EXPORT LdapSearch : public TQObject +{ + Q_OBJECT + + public: + LdapSearch(); + + void startSearch( const TQString& txt ); + void cancelSearch(); + bool isAvailable() const; + + signals: + /// Results, assembled as "Full Name <email>" + /// (This signal can be emitted many times) + void searchData( const TQStringList& ); + /// Another form for the results, with separate fields + /// (This signal can be emitted many times) + void searchData( const KABC::LdapResultList& ); + void searchDone(); + + private slots: + void slotLDAPResult( const KABC::LdapObject& ); + void slotLDAPError( const TQString& ); + void slotLDAPDone(); + void slotDataTimer(); + + private: + void finish(); + void makeSearchData( TQStringList& ret, LdapResultList& resList ); + TQValueList< LdapClient* > mClients; + TQString mSearchText; + TQTimer mDataTimer; + int mActiveClients; + bool mNoLDAPLookup; + TQValueList< LdapObject > mResults; + + private: + class LdapSearchPrivate* d; +}; + +} +#endif // KABC_LDAPCLIENT_H diff --git a/tdeabc/ldapconfigwidget.cpp b/tdeabc/ldapconfigwidget.cpp new file mode 100644 index 000000000..fa092754e --- /dev/null +++ b/tdeabc/ldapconfigwidget.cpp @@ -0,0 +1,626 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> + + 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 <tqapplication.h> + +#include <tqobjectlist.h> +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> +#include <tqvgroupbox.h> +#include <tqhbuttongroup.h> +#include <tqradiobutton.h> + +#include <tdemessagebox.h> +#include <tdeaccelmanager.h> +#include <kdialogbase.h> +#include <tdelocale.h> +#include <klineedit.h> +#include <kcombobox.h> +#include <kprogress.h> + +#include <kdebug.h> + +#include "ldapconfigwidget.h" +#include "ldapconfigwidget.moc" + +using namespace KABC; + +LdapConfigWidget::LdapConfigWidget( TQWidget* parent, + const char* name, WFlags fl ) : TQWidget( parent, name, fl ) +{ + mProg = 0; + mFlags = 0; + mainLayout = new TQGridLayout( this, 12, 4, 0, + KDialog::spacingHint() ); +} + +LdapConfigWidget::LdapConfigWidget( int flags, TQWidget* parent, + const char* name, WFlags fl ) : TQWidget( parent, name, fl ) +{ + mFlags = flags; + mProg = 0; + mainLayout = new TQGridLayout( this, 12, 4, 0, + KDialog::spacingHint() ); + initWidget(); +} + +LdapConfigWidget::~LdapConfigWidget() +{ +} + +void LdapConfigWidget::initWidget() +{ + TQLabel *label; + + mUser = mPassword = mHost = mDn = mBindDN = mRealm = mFilter = 0; + mPort = mVer = mTimeLimit = mSizeLimit = 0; + mAnonymous = mSimple = mSASL = mSecNO = mSecTLS = mSecSSL = 0; + mEditButton = mQueryMech = 0; + mMech = 0; + int row = 0; + int col; + + if ( mFlags & W_USER ) { + label = new TQLabel( i18n( "User:" ), this ); + mUser = new KLineEdit( this, "kcfg_ldapuser" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mUser, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_BINDDN ) { + label = new TQLabel( i18n( "Bind DN:" ), this ); + mBindDN = new KLineEdit( this, "kcfg_ldapbinddn" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mBindDN, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_REALM ) { + label = new TQLabel( i18n( "Realm:" ), this ); + mRealm = new KLineEdit( this, "kcfg_ldaprealm" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mRealm, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_PASS ) { + label = new TQLabel( i18n( "Password:" ), this ); + mPassword = new KLineEdit( this, "kcfg_ldappassword" ); + mPassword->setEchoMode( KLineEdit::Password ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mPassword, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_HOST ) { + label = new TQLabel( i18n( "Host:" ), this ); + mHost = new KLineEdit( this, "kcfg_ldaphost" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mHost, row, row, 1, 3 ); + row++; + } + + col = 0; + if ( mFlags & W_PORT ) { + label = new TQLabel( i18n( "Port:" ), this ); + mPort = new TQSpinBox( 0, 65535, 1, this, "kcfg_ldapport" ); + mPort->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); + mPort->setValue( 389 ); + + mainLayout->addWidget( label, row, col ); + mainLayout->addWidget( mPort, row, col+1 ); + col += 2; + } + + if ( mFlags & W_VER ) { + label = new TQLabel( i18n( "LDAP version:" ), this ); + mVer = new TQSpinBox( 2, 3, 1, this, "kcfg_ldapver" ); + mVer->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); + mVer->setValue( 3 ); + mainLayout->addWidget( label, row, col ); + mainLayout->addWidget( mVer, row, col+1 ); + } + if ( mFlags & ( W_PORT | W_VER ) ) row++; + + col = 0; + if ( mFlags & W_SIZELIMIT ) { + label = new TQLabel( i18n( "Size limit:" ), this ); + mSizeLimit = new TQSpinBox( 0, 9999999, 1, this, "kcfg_ldapsizelimit" ); + mSizeLimit->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); + mSizeLimit->setValue( 0 ); + mSizeLimit->setSpecialValueText( i18n("Default") ); + mainLayout->addWidget( label, row, col ); + mainLayout->addWidget( mSizeLimit, row, col+1 ); + col += 2; + } + + if ( mFlags & W_TIMELIMIT ) { + label = new TQLabel( i18n( "Time limit:" ), this ); + mTimeLimit = new TQSpinBox( 0, 9999999, 1, this, "kcfg_ldaptimelimit" ); + mTimeLimit->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); + mTimeLimit->setValue( 0 ); + mTimeLimit->setSuffix( i18n(" sec") ); + mTimeLimit->setSpecialValueText( i18n("Default") ); + mainLayout->addWidget( label, row, col ); + mainLayout->addWidget( mTimeLimit, row, col+1 ); + } + if ( mFlags & ( W_SIZELIMIT | W_TIMELIMIT ) ) row++; + + if ( mFlags & W_DN ) { + label = new TQLabel( i18n( "Distinguished Name", "DN:" ), this ); + mDn = new KLineEdit( this, "kcfg_ldapdn" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mDn, row, row, 1, 1 ); + //without host query doesn't make sense + if ( mHost ) { + TQPushButton *dnquery = new TQPushButton( i18n( "Query Server" ), this ); + connect( dnquery, TQT_SIGNAL( clicked() ), TQT_SLOT( mQueryDNClicked() ) ); + mainLayout->addMultiCellWidget( dnquery, row, row, 2, 3 ); + } + row++; + } + + if ( mFlags & W_FILTER ) { + label = new TQLabel( i18n( "Filter:" ), this ); + mFilter = new KLineEdit( this, "kcfg_ldapfilter" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mFilter, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_SECBOX ) { + TQHButtonGroup *btgroup = new TQHButtonGroup( i18n( "Security" ), this ); + mSecNO = new TQRadioButton( i18n( "No" ), btgroup, "kcfg_ldapnosec" ); + mSecTLS = new TQRadioButton( i18n( "TLS" ), btgroup, "kcfg_ldaptls" ); + mSecSSL = new TQRadioButton( i18n( "SSL" ), btgroup, "kcfg_ldapssl" ); + mainLayout->addMultiCellWidget( btgroup, row, row, 0, 3 ); + + connect( mSecNO, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPPort() ) ); + connect( mSecTLS, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPPort() ) ); + connect( mSecSSL, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPSPort( ) ) ); + + mSecNO->setChecked( true ); + row++; + } + + if ( mFlags & W_AUTHBOX ) { + + TQButtonGroup *authbox = + new TQButtonGroup( 3, Qt::Horizontal, i18n( "Authentication" ), this ); + + mAnonymous = new TQRadioButton( i18n( "Anonymous" ), authbox, "kcfg_ldapanon" ); + mSimple = new TQRadioButton( i18n( "Simple" ), authbox, "kcfg_ldapsimple" ); + mSASL = new TQRadioButton( i18n( "SASL" ), authbox, "kcfg_ldapsasl" ); + + label = new TQLabel( i18n( "SASL mechanism:" ), authbox ); + mMech = new KComboBox( false, authbox, "kcfg_ldapsaslmech" ); + mMech->setEditable( true ); + mMech->insertItem( "DIGEST-MD5" ); + mMech->insertItem( "GSSAPI" ); + mMech->insertItem( "PLAIN" ); + + //without host query doesn't make sense + if ( mHost ) { + mQueryMech = new TQPushButton( i18n( "Query Server" ), authbox ); + connect( mQueryMech, TQT_SIGNAL( clicked() ), TQT_SLOT( mQueryMechClicked() ) ); + } + + mainLayout->addMultiCellWidget( authbox, row, row+1, 0, 3 ); + + connect( mAnonymous, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setAnonymous(int) ) ); + connect( mSimple, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setSimple(int) ) ); + connect( mSASL, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setSASL(int) ) ); + + mAnonymous->setChecked( true ); + } + +} + +void LdapConfigWidget::loadData( TDEIO::Job*, const TQByteArray& d ) +{ + LDIF::ParseVal ret; + + if ( d.size() ) { + mLdif.setLDIF( d ); + } else { + mLdif.endLDIF(); + } + do { + ret = mLdif.nextItem(); + if ( ret == LDIF::Item && mLdif.attr().lower() == mAttr ) { + mProg->progressBar()->advance( 1 ); + mQResult.push_back( TQString::fromUtf8( mLdif.val(), mLdif.val().size() ) ); + } + } while ( ret != LDIF::MoreData ); +} + +void LdapConfigWidget::loadResult( TDEIO::Job* job) +{ + int error = job->error(); + if ( error && error != TDEIO::ERR_USER_CANCELED ) + mErrorMsg = job->errorString(); + else + mErrorMsg = ""; + + mCancelled = false; + mProg->close(); +} + +void LdapConfigWidget::sendQuery() +{ + LDAPUrl _url; + + mQResult.clear(); + mCancelled = true; + + _url.setProtocol( ( mSecSSL && mSecSSL->isChecked() ) ? "ldaps" : "ldap" ); + if ( mHost ) _url.setHost( mHost->text() ); + if ( mPort ) _url.setPort( mPort->value() ); + _url.setDn( "" ); + _url.setAttributes( mAttr ); + _url.setScope( LDAPUrl::Base ); + if ( mVer ) _url.setExtension( "x-ver", TQString::number( mVer->value() ) ); + if ( mSecTLS && mSecTLS->isChecked() ) _url.setExtension( "x-tls", "" ); + + kdDebug(5700) << "sendQuery url: " << _url.prettyURL() << endl; + mLdif.startParsing(); + TDEIO::Job *job = TDEIO::get( _url, true, false ); + job->addMetaData("no-auth-prompt","true"); + connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( loadData( TDEIO::Job*, const TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( loadResult( TDEIO::Job* ) ) ); + + if ( mProg == NULL ) + mProg = new KProgressDialog( this, 0, i18n("LDAP Query"), _url.prettyURL(), true ); + else + mProg->setLabel( _url.prettyURL() ); + mProg->progressBar()->setValue( 0 ); + mProg->progressBar()->setTotalSteps( 1 ); + mProg->exec(); + if ( mCancelled ) { + kdDebug(5700) << "query cancelled!" << endl; + job->kill( true ); + } else { + if ( !mErrorMsg.isEmpty() ) KMessageBox::error( this, mErrorMsg ); + } +} + +void LdapConfigWidget::mQueryMechClicked() +{ + mAttr = "supportedsaslmechanisms"; + sendQuery(); + if ( !mQResult.isEmpty() ) { + mQResult.sort(); + mMech->clear(); + mMech->insertStringList( mQResult ); + } +} + +void LdapConfigWidget::mQueryDNClicked() +{ + mAttr = "namingcontexts"; + sendQuery(); + if ( !mQResult.isEmpty() ) mDn->setText( mQResult.first() ); +} + +void LdapConfigWidget::setAnonymous( int state ) +{ + if ( state == TQButton::Off ) return; + if ( mUser ) mUser->setEnabled(false); + if ( mPassword ) mPassword->setEnabled(false); + if ( mBindDN ) mBindDN->setEnabled(false); + if ( mRealm ) mRealm->setEnabled(false); + if ( mMech ) mMech->setEnabled(false); + if ( mQueryMech ) mQueryMech->setEnabled(false); +} + +void LdapConfigWidget::setSimple( int state ) +{ + if ( state == TQButton::Off ) return; + if ( mUser ) mUser->setEnabled(true); + if ( mPassword ) mPassword->setEnabled(true); + if ( mBindDN ) mBindDN->setEnabled(false); + if ( mRealm ) mRealm->setEnabled(false); + if ( mMech ) mMech->setEnabled(false); + if ( mQueryMech ) mQueryMech->setEnabled(false); +} + +void LdapConfigWidget::setSASL( int state ) +{ + if ( state == TQButton::Off ) return; + if ( mUser ) mUser->setEnabled(true); + if ( mPassword ) mPassword->setEnabled(true); + if ( mBindDN ) mBindDN->setEnabled(true); + if ( mRealm ) mRealm->setEnabled(true); + if ( mMech ) mMech->setEnabled(true); + if ( mQueryMech ) mQueryMech->setEnabled(true); +} + +void LdapConfigWidget::setLDAPPort() +{ + mPort->setValue( 389 ); +} + +void LdapConfigWidget::setLDAPSPort() +{ + mPort->setValue( 636 ); +} + + +LDAPUrl LdapConfigWidget::url() const +{ + LDAPUrl _url; + if ( mSecSSL && mSecSSL->isChecked() ) + _url.setProtocol( "ldaps" ); + else + _url.setProtocol( "ldap" ); + + if ( mUser ) _url.setUser( mUser->text() ); + if ( mPassword ) _url.setPass( mPassword->text() ); + if ( mHost ) _url.setHost( mHost->text() ); + if ( mPort ) _url.setPort( mPort->value() ); + if ( mDn ) _url.setDn( mDn->text() ); + if ( mVer ) _url.setExtension( "x-ver", TQString::number( mVer->value() ) ); + if ( mSizeLimit && mSizeLimit->value() != 0 ) + _url.setExtension( "x-sizelimit", TQString::number( mSizeLimit->value() ) ); + if ( mTimeLimit && mTimeLimit->value() != 0 ) + _url.setExtension( "x-timelimit", TQString::number( mTimeLimit->value() ) ); + if ( mSecTLS && mSecTLS->isChecked() ) _url.setExtension( "x-tls","" ); + if ( mFilter && !mFilter->text().isEmpty() ) + _url.setFilter( mFilter->text() ); + if ( mSASL && mSASL->isChecked() ) { + _url.setExtension( "x-sasl", "" ); + _url.setExtension( "x-mech", mMech->currentText() ); + if ( mBindDN && !mBindDN->text().isEmpty() ) + _url.setExtension( "bindname", mBindDN->text() ); + if ( mRealm && !mRealm->text().isEmpty() ) + _url.setExtension( "x-realm", mRealm->text() ); + } + return ( _url ); +} + +void LdapConfigWidget::setUser( const TQString &user ) +{ + if ( mUser ) mUser->setText( user ); +} + +TQString LdapConfigWidget::user() const +{ + return ( mUser ? mUser->text() : TQString::null ); +} + +void LdapConfigWidget::setPassword( const TQString &password ) +{ + if ( mPassword ) mPassword->setText( password ); +} + +TQString LdapConfigWidget::password() const +{ + return ( mPassword ? mPassword->text() : TQString::null ); +} + +void LdapConfigWidget::setBindDN( const TQString &binddn ) +{ + if ( mBindDN ) mBindDN->setText( binddn ); +} + +TQString LdapConfigWidget::bindDN() const +{ + return ( mBindDN ? mBindDN->text() : TQString::null ); +} + +void LdapConfigWidget::setRealm( const TQString &realm ) +{ + if ( mRealm ) mRealm->setText( realm ); +} + +TQString LdapConfigWidget::realm() const +{ + return ( mRealm ? mRealm->text() : TQString::null ); +} + +void LdapConfigWidget::setHost( const TQString &host ) +{ + if ( mHost ) mHost->setText( host ); +} + +TQString LdapConfigWidget::host() const +{ + return ( mHost ? mHost->text() : TQString::null ); +} + +void LdapConfigWidget::setPort( int port ) +{ + if ( mPort ) mPort->setValue( port ); +} + +int LdapConfigWidget::port() const +{ + return ( mPort ? mPort->value() : 389 ); +} + +void LdapConfigWidget::setVer( int ver ) +{ + if ( mVer ) mVer->setValue( ver ); +} + +int LdapConfigWidget::ver() const +{ + return ( mVer ? mVer->value() : 3 ); +} + +void LdapConfigWidget::setDn( const TQString &dn ) +{ + if ( mDn ) mDn->setText( dn ); +} + +TQString LdapConfigWidget::dn() const +{ + return ( mDn ? mDn->text() : TQString::null ); +} + +void LdapConfigWidget::setFilter( const TQString &filter ) +{ + if ( mFilter ) mFilter->setText( filter ); +} + +TQString LdapConfigWidget::filter() const +{ + return ( mFilter ? mFilter->text() : TQString::null ); +} + +void LdapConfigWidget::setMech( const TQString &mech ) +{ + if ( mMech == 0 ) return; + if ( !mech.isEmpty() ) { + int i = 0; + while ( i < mMech->count() ) { + if ( mMech->text( i ) == mech ) break; + i++; + } + if ( i == mMech->count() ) mMech->insertItem( mech ); + mMech->setCurrentItem( i ); + } +} + +TQString LdapConfigWidget::mech() const +{ + return ( mMech ? mMech->currentText() : TQString::null ); +} + +void LdapConfigWidget::setSecNO( bool b ) +{ + if ( mSecNO ) mSecNO->setChecked( b ); +} + +bool LdapConfigWidget::isSecNO() const +{ + return ( mSecNO ? mSecNO->isChecked() : true ); +} + +void LdapConfigWidget::setSecTLS( bool b ) +{ + if ( mSecTLS ) mSecTLS->setChecked( b ); +} + +bool LdapConfigWidget::isSecTLS() const +{ + return ( mSecTLS ? mSecTLS->isChecked() : false ); +} + +void LdapConfigWidget::setSecSSL( bool b ) +{ + if ( mSecSSL ) mSecSSL->setChecked( b ); +} + +bool LdapConfigWidget::isSecSSL() const +{ + return ( mSecSSL ? mSecSSL->isChecked() : false ); +} + +void LdapConfigWidget::setAuthAnon( bool b ) +{ + if ( mAnonymous ) mAnonymous->setChecked( b ); +} + +bool LdapConfigWidget::isAuthAnon() const +{ + return ( mAnonymous ? mAnonymous->isChecked() : true ); +} + +void LdapConfigWidget::setAuthSimple( bool b ) +{ + if ( mSimple ) mSimple->setChecked( b ); +} + +bool LdapConfigWidget::isAuthSimple() const +{ + return ( mSimple ? mSimple->isChecked() : false ); +} + +void LdapConfigWidget::setAuthSASL( bool b ) +{ + if ( mSASL ) mSASL->setChecked( b ); +} + +bool LdapConfigWidget::isAuthSASL() const +{ + return ( mSASL ? mSASL->isChecked() : false ); +} + +void LdapConfigWidget::setSizeLimit( int sizelimit ) +{ + if ( mSizeLimit ) mSizeLimit->setValue( sizelimit ); +} + +int LdapConfigWidget::sizeLimit() const +{ + return ( mSizeLimit ? mSizeLimit->value() : 0 ); +} + +void LdapConfigWidget::setTimeLimit( int timelimit ) +{ + if ( mTimeLimit ) mTimeLimit->setValue( timelimit ); +} + +int LdapConfigWidget::timeLimit() const +{ + return ( mTimeLimit ? mTimeLimit->value() : 0 ); +} + +int LdapConfigWidget::flags() const +{ + return mFlags; +} + +void LdapConfigWidget::setFlags( int flags ) +{ + mFlags = flags; + + // First delete all the child widgets. + // FIXME: I hope it's correct + const TQObjectList ch = childrenListObject(); + TQObjectList ch2 = ch; + TQObject *obj; + TQWidget *widget; + + obj = ch2.first(); + while ( obj != 0 ) { + widget = dynamic_cast<TQWidget*> (obj); + if ( widget && TQT_BASE_OBJECT(widget->parent()) == TQT_BASE_OBJECT(this) ) { + mainLayout->remove( widget ); + delete ( widget ); + } + obj = ch2.next(); + } + // Re-create child widgets according to the new flags + initWidget(); +} diff --git a/tdeabc/ldapconfigwidget.h b/tdeabc/ldapconfigwidget.h new file mode 100644 index 000000000..7071bce10 --- /dev/null +++ b/tdeabc/ldapconfigwidget.h @@ -0,0 +1,300 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> + + 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 LDAPCONFIGWIDGET_H +#define LDAPCONFIGWIDGET_H + +#include <tqwidget.h> +#include <tqmap.h> +#include <tqstring.h> + +#include <tdeabc/ldapurl.h> +#include <tdeabc/ldif.h> +#include <tdeio/job.h> + +class TQGridLayout; +class TQSpinBox; +class TQPushButton; +class TQCheckBox; +class TQRadioButton; +class KComboBox; +class KLineEdit; +class KProgressDialog; + +namespace KABC { + + /** + @short LDAP Configuration widget + + This class can be used to query the user for LDAP connection parameters. + It's TDEConfigXT compatible, using widget names starting with kcfg_ + */ + + class KABC_EXPORT LdapConfigWidget : public TQWidget + { + Q_OBJECT + + TQ_PROPERTY( LCW_Flags flags READ flagsProp WRITE setFlagsProp ) + TQ_PROPERTY( TQString user READ user WRITE setUser ) + TQ_PROPERTY( TQString password READ password WRITE setPassword ) + TQ_PROPERTY( TQString bindDN READ bindDN WRITE setBindDN ) + TQ_PROPERTY( TQString realm READ realm WRITE setRealm ) + TQ_PROPERTY( TQString host READ host WRITE setHost ) + TQ_PROPERTY( int port READ port WRITE setPort ) + TQ_PROPERTY( int ver READ ver WRITE setVer ) + TQ_PROPERTY( TQString dn READ dn WRITE setDn ) + TQ_PROPERTY( TQString filter READ filter WRITE setFilter ) + TQ_PROPERTY( TQString mech READ mech WRITE setMech ) + TQ_PROPERTY( bool secNO READ isSecNO WRITE setSecNO ) + TQ_PROPERTY( bool secSSL READ isSecSSL WRITE setSecSSL ) + TQ_PROPERTY( bool secTLS READ isSecSSL WRITE setSecTLS ) + TQ_PROPERTY( bool authAnon READ isAuthAnon WRITE setAuthAnon ) + TQ_PROPERTY( bool authSimple READ isAuthSimple WRITE setAuthSimple ) + TQ_PROPERTY( bool authSASL READ isAuthSASL WRITE setAuthSASL ) + TQ_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit ) + TQ_PROPERTY( int timeLimit READ timeLimit WRITE setTimeLimit ) + TQ_SETS ( LCW_Flags ) + + public: + + enum LCW_Flags { + W_USER = 0x1, + W_PASS = 0x2, + W_BINDDN = 0x4, + W_REALM = 0x8, + W_HOST = 0x10, + W_PORT = 0x20, + W_VER = 0x40, + W_DN = 0x80, + W_FILTER = 0x100, + W_SECBOX = 0x400, + W_AUTHBOX = 0x800, + W_TIMELIMIT = 0x1000, + W_SIZELIMIT = 0x2000, + W_ALL = 0xFFFFFFF + }; + + /** Constructs an empty configuration widget. + * You need to call setFlags() after this. + */ + LdapConfigWidget( TQWidget* parent = 0, + const char* name = 0, WFlags fl = 0 ); + /** Constructs a configuration widget */ + LdapConfigWidget( int flags, TQWidget* parent = 0, + const char* name = 0, WFlags fl = 0 ); + /** Destructs a configuration widget */ + virtual ~LdapConfigWidget(); + + /** Sets the user name. Kconfig widget name: kcfg_ldapuser */ + void setUser( const TQString &user ); + /** Gets the user name. Kconfig widget name: kcfg_ldapuser */ + TQString user() const; + + /** Sets the password. Kconfig widget name: kcfg_ldappassword */ + void setPassword( const TQString &password ); + /** Gets the password. Kconfig widget name: kcfg_ldappassword */ + TQString password() const; + + /** + * Sets the bind dn. Useful for SASL proxy auth. + * Kconfig widget name: kcfg_ldapbinddn + */ + void setBindDN( const TQString &binddn ); + /** Gets the bind dn. Kconfig widget name: kcfg_ldapbinddn*/ + TQString bindDN() const; + + /** Sets the SASL realm. Kconfig widget name: kcfg_ldaprealm */ + void setRealm( const TQString &realm ); + /** Gets the SASL realm. Kconfig widget name: kcfg_ldaprealm */ + TQString realm() const; + + /** Sets the host name. Kconfig widget name: kcfg_ldaphost */ + void setHost( const TQString &host ); + /** Gets the host name. Kconfig widget name: kcfg_ldaphost */ + TQString host() const; + + /** Sets the LDAP port. Kconfig widget name: kcfg_ldapport */ + void setPort( int port ); + /** Gets the LDAP port. Kconfig widget name: kcfg_ldapport */ + int port() const; + + /** Sets the LDAP protocol version. Kconfig widget name: kcfg_ldapver */ + void setVer( int ver ); + /** Gets the LDAP protocol version. Kconfig widget name: kcfg_ldapver */ + int ver() const; + + /** Sets the LDAP Base DN. Kconfig widget name: kcfg_ldapdn */ + void setDn( const TQString &dn ); + /** Gets the LDAP Base DN. Kconfig widget name: kcfg_ldapdn */ + TQString dn() const; + + /** Sets the LDAP Filter. Kconfig widget name: kcfg_ldapfilter */ + void setFilter( const TQString &filter ); + /** Gets the LDAP Filter. Kconfig widget name: kcfg_ldapfilter */ + TQString filter() const; + + /** Sets the SASL Mechanism. Kconfig widget name: kcfg_ldapsaslmech */ + void setMech( const TQString &mech ); + /** Gets the SASL Mechanism. Kconfig widget name: kcfg_ldapsaslmech */ + TQString mech() const; + + /** + * Sets the configuration to no transport security. + * Kconfig widget name: kcfg_ldapnosec + */ + void setSecNO( bool b = true ); + /** + * Returns true if no transport security selected. + * Kconfig widget name: kcfg_ldapnosec + */ + bool isSecNO() const; + + /** + * Sets the configuration to TLS. + * Kconfig widget name: kcfg_ldaptls + */ + void setSecTLS( bool b = true ); + /** + * Returns true if TLS selected. + * Kconfig widget name: kcfg_ldaptls + */ + bool isSecTLS() const; + + /** + * Sets the configuration to SSL. + * Kconfig widget name: kcfg_ldapssl + */ + void setSecSSL( bool b = true ); + /** + * Returns true if SSL selected. + * Kconfig widget name: kcfg_ldapssl + */ + bool isSecSSL() const; + + /** + * Sets the authentication to anonymous. + * Kconfig widget name: kcfg_ldapanon + */ + void setAuthAnon( bool b = true ); + /** + * Returns true if Anonymous authentication selected. + * Kconfig widget name: kcfg_ldapanon + */ + bool isAuthAnon() const; + + /** + * Sets the authentication to simple. + * Kconfig widget name: kcfg_ldapsimple + */ + void setAuthSimple( bool b = true ); + /** + * Returns true if Simple authentication selected. + * Kconfig widget name: kcfg_ldapsimple + */ + bool isAuthSimple() const; + + /** + * Sets the authentication to SASL. + * Kconfig widget name: kcfg_ldapsasl + */ + void setAuthSASL( bool b = true ); + /** + * Returns true if SASL authentication selected. + * Kconfig widget name: kcfg_ldapsasl + */ + bool isAuthSASL() const; + + /** + * Sets the size limit. + * TDEConfig widget name: kcfg_ldapsizelimit + */ + void setSizeLimit( int sizelimit ); + /** + * Returns the size limit. + * TDEConfig widget name: kcfg_ldapsizelimit + */ + int sizeLimit() const; + + /** + * Sets the time limit. + * TDEConfig widget name: kcfg_ldaptimelimit + */ + void setTimeLimit( int timelimit ); + /** + * Returns the time limit. + * TDEConfig widget name: kcfg_ldaptimelimit + */ + int timeLimit() const; + + int flags() const; + void setFlags( int flags ); + inline LCW_Flags flagsProp() const { return (LCW_Flags)flags(); } + inline void setFlagsProp( LCW_Flags flags ) { setFlags((int)flags); } + + /** + * Returns a LDAP Url constructed from the settings given. + * Extensions are filled for use in the LDAP ioslave + */ + KABC::LDAPUrl url() const; + + private slots: + void setLDAPPort(); + void setLDAPSPort(); + void setAnonymous( int state ); + void setSimple( int state ); + void setSASL( int state ); + void mQueryDNClicked(); + void mQueryMechClicked(); + void loadData( TDEIO::Job*, const TQByteArray& ); + void loadResult( TDEIO::Job* ); + private: + + int mFlags; + LDIF mLdif; + TQStringList mQResult; + TQString mAttr; + + KLineEdit *mUser; + KLineEdit *mPassword; + KLineEdit *mHost; + TQSpinBox *mPort, *mVer, *mSizeLimit, *mTimeLimit; + KLineEdit *mDn, *mBindDN, *mRealm; + KLineEdit *mFilter; + TQRadioButton *mAnonymous,*mSimple,*mSASL; + TQCheckBox *mSubTree; + TQPushButton *mEditButton; + TQPushButton *mQueryMech; + TQRadioButton *mSecNO,*mSecTLS,*mSecSSL; + KComboBox *mMech; + + TQString mErrorMsg; + bool mCancelled; + KProgressDialog *mProg; + + TQGridLayout *mainLayout; + class LDAPConfigWidgetPrivate; + LDAPConfigWidgetPrivate *d; + + void sendQuery(); + void initWidget(); + }; +} + +#endif diff --git a/tdeabc/ldapurl.cpp b/tdeabc/ldapurl.cpp new file mode 100644 index 000000000..9032c16d3 --- /dev/null +++ b/tdeabc/ldapurl.cpp @@ -0,0 +1,201 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> + + 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 <kdebug.h> +#include <tqstringlist.h> +#include <tqdir.h> + +#include "ldapurl.h" + +using namespace KABC; + +LDAPUrl::LDAPUrl() +{ + m_scope = Base; +} + +LDAPUrl::LDAPUrl(const KURL &_url) + : KURL(_url), m_extensions() +{ + m_dn = path(); + if ( !TQDir::isRelativePath(m_dn) ) +#ifdef Q_WS_WIN + m_dn.remove(0,3); // e.g. "c:/" +#else + m_dn.remove(0,1); +#endif + parseQuery(); +} + +void LDAPUrl::setDn( const TQString &dn) +{ + m_dn = dn; + if ( !TQDir::isRelativePath(m_dn) ) +#ifdef Q_WS_WIN + m_dn.remove(0,3); // e.g. "c:/" +#else + m_dn.remove(0,1); +#endif + setPath(m_dn); +} + +bool LDAPUrl::hasExtension( const TQString &key ) const +{ + return m_extensions.contains( key ); +} + +LDAPUrl::Extension LDAPUrl::extension( const TQString &key ) const +{ + TQMap<TQString, Extension>::const_iterator it; + + it = m_extensions.find( key ); + if ( it != m_extensions.constEnd() ) + return (*it); + else { + Extension ext; + ext.value = ""; + ext.critical = false; + return ext; + } +} + +TQString LDAPUrl::extension( const TQString &key, bool &critical ) const +{ + Extension ext; + + ext = extension( key ); + critical = ext.critical; + return ext.value; +} + +void LDAPUrl::setExtension( const TQString &key, const LDAPUrl::Extension &ext ) +{ + m_extensions[ key ] = ext; + updateQuery(); +} + +void LDAPUrl::setExtension( const TQString &key, const TQString &value, bool critical ) +{ + Extension ext; + ext.value = value; + ext.critical = critical; + setExtension( key, ext ); +} + +void LDAPUrl::removeExtension( const TQString &key ) +{ + m_extensions.remove( key ); + updateQuery(); +} + +void LDAPUrl::updateQuery() +{ + Extension ext; + TQMap<TQString, Extension>::iterator it; + TQString q = "?"; + + // set the attributes to query + if ( m_attributes.count() > 0 ) q += m_attributes.join(","); + + // set the scope + q += "?"; + switch( m_scope ) { + case Sub: + q += "sub"; + break; + case One: + q += "one"; + break; + case Base: + q += "base"; + break; + } + + // set the filter + q += "?"; + if ( m_filter != "(objectClass=*)" && !m_filter.isEmpty() ) + q += m_filter; + + // set the extensions + q += "?"; + for ( it = m_extensions.begin(); it != m_extensions.end(); ++it ) { + if ( it.data().critical ) q += "!"; + q += it.key(); + if ( !it.data().value.isEmpty() ) + q += "=" + it.data().value; + q += ","; + } + while ( q.endsWith("?") || q.endsWith(",") ) + q.remove( q.length() - 1, 1 ); + + setQuery(q); + kdDebug(5700) << "LDAP URL updateQuery(): " << prettyURL() << endl; +} + +void LDAPUrl::parseQuery() +{ + Extension ext; + TQStringList extensions; + TQString q = query(); + // remove first ? + if (q.startsWith("?")) + q.remove(0,1); + + // split into a list + TQStringList url_items = TQStringList::split("?", q, true); + + m_attributes.clear(); + m_scope = Base; + m_filter = "(objectClass=*)"; + m_extensions.clear(); + + int i = 0; + for ( TQStringList::Iterator it = url_items.begin(); it != url_items.end(); ++it, i++ ) { + switch (i) { + case 0: + m_attributes = TQStringList::split(",", (*it), false); + break; + case 1: + if ( (*it) == "sub" ) m_scope = Sub; else + if ( (*it) == "one") m_scope = One; + break; + case 2: + m_filter = decode_string( *it ); + break; + case 3: + extensions = TQStringList::split(",", (*it), false); + break; + } + } + + TQString name,value; + for ( TQStringList::Iterator it = extensions.begin(); it != extensions.end(); ++it ) { + ext.critical = false; + name = decode_string( (*it).section('=',0,0) ).lower(); + value = decode_string( (*it).section('=',1) ); + if ( name.startsWith("!") ) { + ext.critical = true; + name.remove(0, 1); + } + kdDebug(5700) << "LDAPUrl extensions name= " << name << " value: " << value << endl; + ext.value = value.replace( "%2", "," ); + setExtension( name, ext ); + } +} diff --git a/tdeabc/ldapurl.h b/tdeabc/ldapurl.h new file mode 100644 index 000000000..0c2693758 --- /dev/null +++ b/tdeabc/ldapurl.h @@ -0,0 +1,110 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> + + 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 _K_LDAPURL_H_ +#define _K_LDAPURL_H_ + +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqmap.h> + +#include <kurl.h> + +namespace KABC { + +/** + * LDAPUrl + + * LDAPUrl implements an RFC 2255 compliant LDAP Url parser, with minimal + * differences. LDAP Urls implemented by this class has the following format: + * ldap[s]://[user[:password]@]hostname[:port]["/" [dn ["?" [attributes] + * ["?" [scope] ["?" [filter] ["?" extensions]]]]]] + */ + + + class KABC_EXPORT LDAPUrl : public KURL + { + public: + + struct Extension { + TQString value; + bool critical; + }; + + typedef enum Scope { Base, One, Sub }; + + /** Constructs an empty KLDAPUrl. */ + LDAPUrl(); + /** Constructs a KLDAPUrl from a KURL. */ + LDAPUrl( const KURL &url ); + + /** + * Returns the dn part of the LDAP Url (same as path(), but slash removed + * from the beginning). + */ + const TQString& dn() const { return m_dn; } + /** Sets the the dn part of the LDAP Url. */ + void setDn( const TQString &dn ); + + /** Returns the attributes part of the LDAP Url */ + const TQStringList &attributes() { return m_attributes; } + /** Sets the attributes part of the LDAP Url */ + void setAttributes( const TQStringList &attributes ) + { m_attributes=attributes; updateQuery(); } + + /** Returns the scope part of the LDAP Url */ + Scope scope() const { return m_scope; } + /** Sets the scope part of the LDAP Url */ + void setScope(Scope scope) { m_scope = scope; updateQuery(); } + + /** Returns the filter part of the LDAP Url */ + const TQString &filter() const { return m_filter; } + /** Sets the filter part of the LDAP Url */ + void setFilter( TQString filter ) { m_filter = filter; updateQuery(); } + + /** Returns if the specified extension exists in the LDAP Url */ + bool hasExtension( const TQString &key ) const; + /** Returns the specified extension */ + Extension extension( const TQString &key ) const; + /** Returns the specified extension */ + TQString extension( const TQString &key, bool &critical ) const; + /** Sets the specified extension key with the value and criticality in ext */ + void setExtension( const TQString &key, const Extension &ext ); + /** Sets the specified extension key with the value and criticality specified */ + void setExtension( const TQString &key, const TQString &value, bool critical = false ); + /** Removes the specified extension */ + void removeExtension( const TQString &key ); + /** Updates the query component from the attributes, scope, filter and extensions */ + void updateQuery(); + + protected: + void parseQuery(); + + private: + + TQMap<TQString, Extension> m_extensions; + TQString m_dn; + TQStringList m_attributes; + Scope m_scope; + TQString m_filter; + }; +} + +#endif diff --git a/tdeabc/ldif.cpp b/tdeabc/ldif.cpp new file mode 100644 index 000000000..408f5223f --- /dev/null +++ b/tdeabc/ldif.cpp @@ -0,0 +1,365 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> + + 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 <kdebug.h> +#include <kmdcodec.h> + +#include "ldif.h" + +using namespace KABC; + +LDIF::LDIF() +{ + startParsing(); +} + +LDIF::~LDIF() +{ +} + +TQCString LDIF::assembleLine( const TQString &fieldname, const TQByteArray &value, + uint linelen, bool url ) +{ + bool safe = false; + bool isDn; + TQCString result; + uint i; + + if ( url ) { + result = fieldname.utf8() + ":< " + TQCString( value.data(), value.size()+1 ); + } else { + isDn = fieldname.lower() == "dn"; + //SAFE-INIT-CHAR + if ( value.size() > 0 && value[0] > 0 && value[0] != '\n' && + value[0] != '\r' && value[0] != ':' && value[0] != '<' ) safe = true; + + //SAFE-CHAR + if ( safe ) { + for ( i=1; i < value.size(); i++ ) { + //allow utf-8 in Distinguished Names + if ( ( isDn && value[i] == 0 ) || + ( !isDn && value[i] <= 0 ) || + value[i] == '\r' || value[i] == '\n' ) { + safe = false; + break; + } + } + } + + if ( value.size() == 0 ) safe = true; + + if( safe ) { + result = fieldname.utf8() + ": " + TQCString( value.data(), value.size()+1 ); + } else { + result = fieldname.utf8() + ":: " + KCodecs::base64Encode( value, false ); + } + + if ( linelen > 0 ) { + i = (fieldname.length()+2) > linelen ? fieldname.length()+2 : linelen; + while ( i < result.length() ) { + result.insert( i, "\n " ); + i += linelen+2; + } + } + } + return result; +} + +TQCString LDIF::assembleLine( const TQString &fieldname, const TQCString &value, + uint linelen, bool url ) +{ + TQCString ret; + TQByteArray tmp; + uint valuelen = value.length(); + const char *data = value.data(); + + tmp.setRawData( data, valuelen ); + ret = assembleLine( fieldname, tmp, linelen, url ); + tmp.resetRawData( data, valuelen ); + return ret; + +} + +TQCString LDIF::assembleLine( const TQString &fieldname, const TQString &value, + uint linelen, bool url ) +{ + return assembleLine( fieldname, value.utf8(), linelen, url ); +} + +bool LDIF::splitLine( const TQCString &line, TQString &fieldname, TQByteArray &value ) +{ + int position; + TQByteArray tmp; + int linelen; + const char *data; + +// kdDebug(5700) << "splitLine line: " << TQString::fromUtf8(line) << endl; + + position = line.find( ":" ); + if ( position == -1 ) { + // strange: we did not find a fieldname + fieldname = ""; + TQCString str; + str = line.stripWhiteSpace(); + linelen = str.length(); + data = str.data(); + tmp.setRawData( data, linelen ); + value = tmp.copy(); + tmp.resetRawData( data, linelen ); +// kdDebug(5700) << "value : " << value[0] << endl; + return false; + } + + linelen = line.length(); + + if ( linelen > ( position + 1 ) && line[ position + 1 ] == ':' ) { + // String is BASE64 encoded -> decode it now. + fieldname = TQString::fromUtf8( + line.left( position ).stripWhiteSpace() ); + if ( linelen <= ( position + 3 ) ) { + value.resize( 0 ); + return false; + } + data = &line.data()[ position + 3 ]; + tmp.setRawData( data, linelen - position - 3 ); + KCodecs::base64Decode( tmp, value ); + tmp.resetRawData( data, linelen - position - 3 ); + return false; + } + + if ( linelen > ( position + 1 ) && line[ position + 1 ] == '<' ) { + // String is an URL. + fieldname = TQString::fromUtf8( + line.left( position ).stripWhiteSpace() ); + if ( linelen <= ( position + 3 ) ) { + value.resize( 0 ); + return false; + } + data = &line.data()[ position + 3]; + tmp.setRawData( data, linelen - position - 3 ); + value = tmp.copy(); + tmp.resetRawData( data, linelen - position - 3 ); + return true; + } + + fieldname = TQString::fromUtf8(line.left( position ).stripWhiteSpace()); + if ( linelen <= ( position + 2 ) ) { + value.resize( 0 ); + return false; + } + data = &line.data()[ position + 2 ]; + tmp.setRawData( data, linelen - position - 2 ); + value = tmp.copy(); + tmp.resetRawData( data, linelen - position - 2 ); + return false; +} + +bool LDIF::splitControl( const TQCString &line, TQString &oid, bool &critical, + TQByteArray &value ) +{ + TQString tmp; + critical = false; + bool url = splitLine( line, tmp, value ); + + kdDebug(5700) << "splitControl: value: " << TQString(TQString::fromUtf8(value, value.size())) << endl; + if ( tmp.isEmpty() ) { + tmp = TQString::fromUtf8( value, value.size() ); + value.resize( 0 ); + } + if ( tmp.right( 4 ) == "true" ) { + critical = true; + tmp.truncate( tmp.length() - 5 ); + } else if ( tmp.right( 5 ) == "false" ) { + critical = false; + tmp.truncate( tmp.length() - 6 ); + } + oid = tmp; + return url; +} + +LDIF::ParseVal LDIF::processLine() +{ + + if ( mIsComment ) return None; + + ParseVal retval = None; + if ( mLastParseVal == EndEntry ) mEntryType = Entry_None; + + mUrl = splitLine( line, mAttr, mVal ); + + TQString attrLower = mAttr.lower(); + + switch ( mEntryType ) { + case Entry_None: + if ( attrLower == "version" ) { + if ( !mDn.isEmpty() ) retval = Err; + } else if ( attrLower == "dn" ) { + kdDebug(5700) << "ldapentry dn: " << TQString(TQString::fromUtf8( mVal, mVal.size() )) << endl; + mDn = TQString::fromUtf8( mVal, mVal.size() ); + mModType = Mod_None; + retval = NewEntry; + } else if ( attrLower == "changetype" ) { + if ( mDn.isEmpty() ) + retval = Err; + else { + TQString tmpval = TQString::fromUtf8( mVal, mVal.size() ); + kdDebug(5700) << "changetype: " << tmpval << endl; + if ( tmpval == "add" ) mEntryType = Entry_Add; + else if ( tmpval == "delete" ) mEntryType = Entry_Del; + else if ( tmpval == "modrdn" || tmpval == "moddn" ) { + mNewRdn = ""; + mNewSuperior = ""; + mDelOldRdn = true; + mEntryType = Entry_Modrdn; + } + else if ( tmpval == "modify" ) mEntryType = Entry_Mod; + else retval = Err; + } + } else if ( attrLower == "control" ) { + mUrl = splitControl( TQCString( mVal, mVal.size() + 1 ), mOid, mCritical, mVal ); + retval = Control; + } else if ( !mAttr.isEmpty() && mVal.size() > 0 ) { + mEntryType = Entry_Add; + retval = Item; + } + break; + case Entry_Add: + if ( mAttr.isEmpty() && mVal.size() == 0 ) + retval = EndEntry; + else + retval = Item; + break; + case Entry_Del: + if ( mAttr.isEmpty() && mVal.size() == 0 ) + retval = EndEntry; + else + retval = Err; + break; + case Entry_Mod: + if ( mModType == Mod_None ) { + kdDebug(5700) << "tdeio_ldap: new modtype " << mAttr << endl; + if ( mAttr.isEmpty() && mVal.size() == 0 ) { + retval = EndEntry; + } else if ( attrLower == "add" ) { + mModType = Mod_Add; + } else if ( attrLower == "replace" ) { + mModType = Mod_Replace; + mAttr = TQString::fromUtf8( mVal, mVal.size() ); + mVal.resize( 0 ); + retval = Item; + } else if ( attrLower == "delete" ) { + mModType = Mod_Del; + mAttr = TQString::fromUtf8( mVal, mVal.size() ); + mVal.resize( 0 ); + retval = Item; + } else { + retval = Err; + } + } else { + if ( mAttr.isEmpty() ) { + if ( TQString::fromUtf8( mVal, mVal.size() ) == "-" ) { + mModType = Mod_None; + } else if ( mVal.size() == 0 ) { + retval = EndEntry; + } else + retval = Err; + } else + retval = Item; + } + break; + case Entry_Modrdn: + if ( mAttr.isEmpty() && mVal.size() == 0 ) + retval = EndEntry; + else if ( attrLower == "newrdn" ) + mNewRdn = TQString::fromUtf8( mVal, mVal.size() ); + else if ( attrLower == "newsuperior" ) + mNewSuperior = TQString::fromUtf8( mVal, mVal.size() ); + else if ( attrLower == "deleteoldrdn" ) { + if ( mVal.size() > 0 && mVal[0] == '0' ) + mDelOldRdn = false; + else if ( mVal.size() > 0 && mVal[0] == '1' ) + mDelOldRdn = true; + else + retval = Err; + } else + retval = Err; + break; + } + return retval; +} + +LDIF::ParseVal LDIF::nextItem() +{ + ParseVal retval = None; + char c=0; + + while( retval == None ) { + if ( mPos < mLdif.size() ) { + c = mLdif[mPos]; + mPos++; + if ( mIsNewLine && c == '\r' ) continue; //handle \n\r line end + if ( mIsNewLine && ( c == ' ' || c == '\t' ) ) { //line folding + mIsNewLine = false; + continue; + } + if ( mIsNewLine ) { + mIsNewLine = false; + retval = processLine(); + mLastParseVal = retval; + line.resize( 0 ); + mIsComment = ( c == '#' ); + } + if ( c == '\n' || c == '\r' ) { + mLineNo++; + mIsNewLine = true; + continue; + } + } else { + retval = MoreData; + break; + } + + if ( !mIsComment ) line += c; + } + return retval; +} + +void LDIF::endLDIF() +{ + TQByteArray tmp( 3 ); + tmp[ 0 ] = '\n'; + tmp[ 1 ] = '\n'; + tmp[ 2 ] = '\n'; + mLdif = tmp; + mPos = 0; +} + +void LDIF::startParsing() +{ + mPos = mLineNo = 0; + mDelOldRdn = false; + mEntryType = Entry_None; + mModType = Mod_None; + mDn = mNewRdn = mNewSuperior = ""; + line = ""; + mIsNewLine = false; + mIsComment = false; + mLastParseVal = None; +} diff --git a/tdeabc/ldif.h b/tdeabc/ldif.h new file mode 100644 index 000000000..f4da5f4f3 --- /dev/null +++ b/tdeabc/ldif.h @@ -0,0 +1,182 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi Gyorgy <gyurco@freemail.hu> + + 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 _K_LDIF_H_ +#define _K_LDIF_H_ + +#include <tqstring.h> +#include <tqcstring.h> +#include <tqmemarray.h> + +#include <tdelibs_export.h> + +namespace KABC { + + /** + * LDIF + + * LDIF implements an RFC 2849 compliant LDIF parser. LDIF files are used to + * represent directory information on LDAP-based servers, or to describe a set + * of changes which are to be applied to a directory. + */ + + class KABC_EXPORT LDIF + { + public: + + enum ParseVal{ None, NewEntry, EndEntry, Item, Control, Err, MoreData }; + enum EntryType{ Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn }; + enum ModType{ Mod_None, Mod_Add, Mod_Replace, Mod_Del }; + LDIF(); + virtual ~LDIF(); + + /** + * Assembles fieldname and value into a valid LDIF line, BASE64 encodes the + * value if neccessary and optionally splits into more lines. + * @param fieldname The name of the entry. + * @param value The value of the entry. + * @param linelen Maximum length of the lines in the result. + * @param url If true, encode value as url ( use :< ). + */ + static TQCString assembleLine( const TQString &fieldname, + const TQByteArray &value, uint linelen=0, bool url=false ); + /** + * This is the same as the above function, the only difference that + * this accepts TQCString as the value. + */ + static TQCString assembleLine( const TQString &fieldname, + const TQCString &value, uint linelen=0, bool url=false ); + /** + * This is the same as the above function, the only difference that + * this accepts TQString as the value. + */ + static TQCString assembleLine( const TQString &fieldname, + const TQString &value, uint linelen=0, bool url=false ); + + /** + * Splits one line from an LDIF file to attribute and value components. + * @returns true if value is an URL, false otherwise + */ + static bool splitLine( const TQCString &line, TQString &fieldname, TQByteArray &value ); + /** + * Splits a control specification (without the "control:" directive) + * @param line is the control directive + * @param oid will contain the OID + * @param critical will contain the criticality of control + * @param value is the control value + */ + static bool splitControl( const TQCString &line, TQString &oid, bool &critical, + TQByteArray &value ); + /** + * Starts the parsing of a new LDIF + */ + void startParsing(); + /** + * Process one LDIF line + */ + ParseVal processLine(); + /** + * Process the LDIF until a complete item can be returned + * @returns NewEntry if a new DN encountered, + * Item if a new item returned, + * Err if the LDIF contains error, + * EndEntry if the parser reached the end of the current entry + * and MoreData if the parser encountered the end of the current chunk of + * the LDIF. If you want to finish the parsing after receiving + * MoreData, then call endLDIF(), so the parser can safely flush + * the current entry. + */ + ParseVal nextItem(); + /** + * Sets a chunk of LDIF. Call before startParsing(), or if nextItem() returned + * MoreData. + */ + void setLDIF( const TQByteArray &ldif ) { mLdif = ldif; mPos = 0; } + /** + * Indicates the end of the LDIF file/stream. Call if nextItem() returned + * MoreData, but actually you don't have more data. + */ + void endLDIF(); + /** + * Returns the requested LDAP operation extracted from the current entry. + */ + EntryType entryType() const { return mEntryType; } + /** + * Returns the LDAP modify request type if entryType() returned Entry_Mod. + */ + int modType() const { return mModType; } + /** + * Returns the Distinguished Name of the current entry. + */ + const TQString& dn() const { return mDn; } + /** + * Returns the new Relative Distinguished Name if modType() returned Entry_Modrdn. + */ + const TQString& newRdn() const { return mNewRdn; } + /** + * Returns the new parent of the entry if modType() returned Entry_Modrdn. + */ + const TQString& newSuperior() const { return mNewSuperior; } + /** + * Returns if the delete of the old RDN is required. + */ + bool delOldRdn() const { return mDelOldRdn; } + /** + * Returns the attribute name. + */ + const TQString& attr() const { return mAttr; } + /** + * Returns the attribute value. + */ + const TQByteArray& val() const { return mVal; } + /** + * Returns if val() is an url + */ + bool isUrl() const { return mUrl; } + /** + * Returns the criticality level when modType() returned Control. + */ + bool critical() const { return mCritical; } + /** + * Returns the OID when modType() returned Control. + */ + const TQString& oid() const { return mOid; } + /** + * Returns the line number which the parser processes. + */ + uint lineNo() const { return mLineNo; } + private: + int mModType; + bool mDelOldRdn, mUrl; + TQString mDn,mAttr,mNewRdn,mNewSuperior, mOid; + TQByteArray mLdif, mVal; + EntryType mEntryType; + + bool mIsNewLine, mIsComment,mCritical; + ParseVal mLastParseVal; + uint mPos,mLineNo; + TQCString line; + + class LDIFPrivate; + LDIFPrivate *d; + }; +} + +#endif diff --git a/tdeabc/ldifconverter.cpp b/tdeabc/ldifconverter.cpp new file mode 100644 index 000000000..dcab83a40 --- /dev/null +++ b/tdeabc/ldifconverter.cpp @@ -0,0 +1,573 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Helge Deller <deller@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. +*/ + + +/* + Useful links: + - http://tldp.org/HOWTO/LDAP-Implementation-HOWTO/schemas.html + - http://www.faqs.org/rfcs/rfc2849.html + + Not yet handled items: + - objectclass microsoftaddressbook + - info, + - initials, + - otherfacsimiletelephonenumber, + - otherpager, + - physicaldeliveryofficename, +*/ + +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqregexp.h> +#include <tqtextstream.h> + +#include <tdelocale.h> +#include <kdebug.h> +#include <kmdcodec.h> + +#include "addressee.h" +#include "address.h" + +#include "ldif.h" +#include "ldifconverter.h" +#include "vcardconverter.h" + +using namespace KABC; + +/* generate LDIF stream */ + +bool LDIFConverter::addresseeToLDIF( const AddresseeList &addrList, TQString &str ) +{ + AddresseeList::ConstIterator it; + for ( it = addrList.begin(); it != addrList.end(); ++it ) { + addresseeToLDIF( *it, str ); + } + return true; +} + + + +static void ldif_out( TQTextStream &t, TQString formatStr, TQString value ) +{ + if ( value.isEmpty() ) + return; + + TQCString txt = LDIF::assembleLine( formatStr, value, 72 ); + + // write the string + t << TQString::fromUtf8(txt) << "\n"; +} + +bool LDIFConverter::addresseeToLDIF( const Addressee &addr, TQString &str ) +{ + if ( addr.isEmpty() ) + return false; + + TQTextStream t( str, IO_WriteOnly|IO_Append ); + t.setEncoding( TQTextStream::UnicodeUTF8 ); + + const Address homeAddr = addr.address( Address::Home ); + const Address workAddr = addr.address( Address::Work ); + + ldif_out( t, "dn", TQString( "cn=%1,mail=%2" ) + .arg( TQString(addr.formattedName()).simplifyWhiteSpace() ) + .arg( addr.preferredEmail() ) ); + ldif_out( t, "givenname", addr.givenName() ); + ldif_out( t, "sn", addr.familyName() ); + ldif_out( t, "cn", TQString(addr.formattedName()).simplifyWhiteSpace() ); + ldif_out( t, "uid", addr.uid() ); + ldif_out( t, "nickname", addr.nickName() ); + ldif_out( t, "xmozillanickname", addr.nickName() ); + + ldif_out( t, "mail", addr.preferredEmail() ); + if ( addr.emails().count() > 1 ) + ldif_out( t, "mozillasecondemail", addr.emails()[ 1 ] ); +//ldif_out( t, "mozilla_AIMScreenName: %1\n", "screen_name" ); + + ldif_out( t, "telephonenumber", addr.phoneNumber( PhoneNumber::Work ).number() ); + ldif_out( t, "facsimiletelephonenumber", addr.phoneNumber( PhoneNumber::Fax ).number() ); + ldif_out( t, "homephone", addr.phoneNumber( PhoneNumber::Home ).number() ); + ldif_out( t, "mobile", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 7 + ldif_out( t, "cellphone", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 4.x + ldif_out( t, "pager", addr.phoneNumber( PhoneNumber::Pager ).number() ); + ldif_out( t, "pagerphone", addr.phoneNumber( PhoneNumber::Pager ).number() ); + + ldif_out( t, "streethomeaddress", homeAddr.street() ); + ldif_out( t, "postalcode", workAddr.postalCode() ); + ldif_out( t, "postofficebox", workAddr.postOfficeBox() ); + + TQStringList streets = TQStringList::split( '\n', homeAddr.street() ); + if ( streets.count() > 0 ) + ldif_out( t, "homepostaladdress", streets[ 0 ] ); // Netscape 7 + if ( streets.count() > 1 ) + ldif_out( t, "mozillahomepostaladdress2", streets[ 1 ] ); // Netscape 7 + ldif_out( t, "mozillahomelocalityname", homeAddr.locality() ); // Netscape 7 + ldif_out( t, "mozillahomestate", homeAddr.region() ); + ldif_out( t, "mozillahomepostalcode", homeAddr.postalCode() ); + ldif_out( t, "mozillahomecountryname", Address::ISOtoCountry(homeAddr.country()) ); + ldif_out( t, "locality", workAddr.locality() ); + ldif_out( t, "streetaddress", workAddr.street() ); // Netscape 4.x + + streets = TQStringList::split( '\n', workAddr.street() ); + if ( streets.count() > 0 ) + ldif_out( t, "postaladdress", streets[ 0 ] ); + if ( streets.count() > 1 ) + ldif_out( t, "mozillapostaladdress2", streets[ 1 ] ); + ldif_out( t, "countryname", Address::ISOtoCountry(workAddr.country()) ); + ldif_out( t, "l", workAddr.locality() ); + ldif_out( t, "c", Address::ISOtoCountry(workAddr.country()) ); + ldif_out( t, "st", workAddr.region() ); + + ldif_out( t, "title", addr.title() ); + ldif_out( t, "vocation", addr.prefix() ); + ldif_out( t, "ou", addr.role() ); + ldif_out( t, "o", addr.organization() ); + ldif_out( t, "organization", addr.organization() ); + ldif_out( t, "organizationname", addr.organization() ); + + // Compatibility with older kabc versions. + if ( !addr.department().isEmpty() ) + ldif_out( t, "department", addr.department() ); + else + ldif_out( t, "department", addr.custom("KADDRESSBOOK", "X-Department") ); + + ldif_out( t, "workurl", addr.url().prettyURL() ); + ldif_out( t, "homeurl", addr.url().prettyURL() ); + ldif_out( t, "description", addr.note() ); + if (addr.revision().isValid()) + ldif_out(t, "modifytimestamp", dateToVCardString( TQT_TQDATETIME_OBJECT(addr.revision())) ); + + t << "objectclass: top\n"; + t << "objectclass: person\n"; + t << "objectclass: organizationalPerson\n"; + + t << "\n"; + + return true; +} + + +/* convert from LDIF stream */ + +bool LDIFConverter::LDIFToAddressee( const TQString &str, AddresseeList &addrList, TQDateTime dt ) +{ + if (str.isEmpty()) + return true; + + bool endldif = false, end = false; + LDIF ldif; + LDIF::ParseVal ret; + const char *latinstr = str.latin1(); + int latinstrlen = tqstrlen( latinstr ); + TQByteArray data; + Addressee a; + Address homeAddr, workAddr; + + data.setRawData( latinstr, latinstrlen ); + ldif.setLDIF( data ); + if (!dt.isValid()) + dt = TQDateTime::currentDateTime(); + a.setRevision(dt); + homeAddr = Address( Address::Home ); + workAddr = Address( Address::Work ); + + do { + ret = ldif.nextItem(); + switch ( ret ) { + case LDIF::Item: { + TQString fieldname = ldif.attr().lower(); + TQString value = TQString::fromUtf8( ldif.val(), ldif.val().size() ); + evaluatePair( a, homeAddr, workAddr, fieldname, value ); + break; + } + case LDIF::EndEntry: + // if the new address is not empty, append it + if ( !a.formattedName().isEmpty() || !a.name().isEmpty() || + !a.familyName().isEmpty() ) { + if ( !homeAddr.isEmpty() ) + a.insertAddress( homeAddr ); + if ( !workAddr.isEmpty() ) + a.insertAddress( workAddr ); + addrList.append( a ); + } + a = Addressee(); + a.setRevision(dt); + homeAddr = Address( Address::Home ); + workAddr = Address( Address::Work ); + break; + case LDIF::MoreData: { + if ( endldif ) + end = true; + else { + ldif.endLDIF(); + endldif = true; + break; + } + } + default: + break; + } + } while ( !end ); + + data.resetRawData( latinstr, latinstrlen ); + + return true; +} + +bool LDIFConverter::evaluatePair( Addressee &a, Address &homeAddr, + Address &workAddr, + TQString &fieldname, TQString &value ) +{ + if ( fieldname == TQString::fromLatin1( "dn" ) ) // ignore & return false! + return false; + + if ( fieldname.startsWith("#") ) { + return true; + } + + if ( fieldname.isEmpty() && !a.note().isEmpty() ) { + // some LDIF export filters are borken and add additional + // comments on stand-alone lines. Just add them to the notes for now. + a.setNote( a.note() + "\n" + value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "givenname" ) ) { + a.setGivenName( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "xmozillanickname") || + fieldname == TQString::fromLatin1( "nickname") ) { + a.setNickName( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "sn" ) ) { + a.setFamilyName( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "uid" ) ) { + a.setUid( value ); + return true; + } + if ( fieldname == TQString::fromLatin1( "mail" ) || + fieldname == TQString::fromLatin1( "mozillasecondemail" ) ) { // mozilla + if ( a.emails().findIndex( value ) == -1 ) + a.insertEmail( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "title" ) ) { + a.setTitle( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "vocation" ) ) { + a.setPrefix( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "cn" ) ) { + a.setFormattedName( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "o" ) || + fieldname == TQString::fromLatin1( "organization" ) || // Exchange + fieldname == TQString::fromLatin1( "organizationname" ) ) { // Exchange + a.setOrganization( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "description" ) ) { +addComment: + if ( !a.note().isEmpty() ) + a.setNote( a.note() + "\n" ); + a.setNote( a.note() + value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "custom1" ) || + fieldname == TQString::fromLatin1( "custom2" ) || + fieldname == TQString::fromLatin1( "custom3" ) || + fieldname == TQString::fromLatin1( "custom4" ) ) { + goto addComment; + } + + if ( fieldname == TQString::fromLatin1( "homeurl" ) || + fieldname == TQString::fromLatin1( "workurl" ) ) { + if (a.url().isEmpty()) { + a.setUrl( KURL( value ) ); + return true; + } + if ( a.url().prettyURL() == KURL(value).prettyURL() ) + return true; + // TODO: current version of kabc only supports one URL. + // TODO: change this with KDE 4 + } + + if ( fieldname == TQString::fromLatin1( "homephone" ) ) { + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Home ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "telephonenumber" ) ) { + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Work ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mobile" ) ) { // mozilla/Netscape 7 + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Cell ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "cellphone" ) ) { + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Cell ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "pager" ) || // mozilla + fieldname == TQString::fromLatin1( "pagerphone" ) ) { // mozilla + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Pager ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "facsimiletelephonenumber" ) ) { + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Fax ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "xmozillaanyphone" ) ) { // mozilla + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Work ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "street" ) || + fieldname == TQString::fromLatin1( "streethomeaddress" ) ) { + homeAddr.setStreet( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "postaladdress" ) ) { // mozilla + workAddr.setStreet( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillapostaladdress2" ) ) { // mozilla + workAddr.setStreet( workAddr.street() + TQString::fromLatin1( "\n" ) + value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "postalcode" ) ) { + workAddr.setPostalCode( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "postofficebox" ) ) { + workAddr.setPostOfficeBox( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "homepostaladdress" ) ) { // Netscape 7 + homeAddr.setStreet( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomepostaladdress2" ) ) { // mozilla + homeAddr.setStreet( homeAddr.street() + TQString::fromLatin1( "\n" ) + value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomelocalityname" ) ) { // mozilla + homeAddr.setLocality( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomestate" ) ) { // mozilla + homeAddr.setRegion( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomepostalcode" ) ) { // mozilla + homeAddr.setPostalCode( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomecountryname" ) ) { // mozilla + if ( value.length() <= 2 ) + value = Address::ISOtoCountry(value); + homeAddr.setCountry( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "locality" ) ) { + workAddr.setLocality( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "streetaddress" ) ) { // Netscape 4.x + workAddr.setStreet( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "countryname" ) || + fieldname == TQString::fromLatin1( "c" ) ) { // mozilla + if ( value.length() <= 2 ) + value = Address::ISOtoCountry(value); + workAddr.setCountry( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "l" ) ) { // mozilla + workAddr.setLocality( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "st" ) ) { + workAddr.setRegion( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "ou" ) ) { + a.setRole( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "department" ) ) { + a.setDepartment( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "member" ) ) { + // this is a mozilla list member (cn=xxx, mail=yyy) + TQStringList list( TQStringList::split( ',', value ) ); + TQString name, email; + + TQStringList::Iterator it; + for ( it = list.begin(); it != list.end(); ++it ) { + if ( (*it).startsWith( "cn=" ) ) + name = (*it).mid( 3 ).stripWhiteSpace(); + if ( (*it).startsWith( "mail=" ) ) + email = (*it).mid( 5 ).stripWhiteSpace(); + } + if ( !name.isEmpty() && !email.isEmpty() ) + email = " <" + email + ">"; + a.insertEmail( name + email ); + a.insertCategory( i18n( "List of Emails" ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "modifytimestamp" ) ) { + if (value == TQString::fromLatin1("0Z")) // ignore + return true; + TQDateTime dt = VCardStringToDate( value ); + if ( dt.isValid() ) { + a.setRevision(dt); + return true; + } + } + + if ( fieldname == TQString::fromLatin1( "objectclass" ) ) // ignore + return true; + + kdWarning() << TQString(TQString("LDIFConverter: Unknown field for '%1': '%2=%3'\n") + .arg(a.formattedName()).arg(fieldname).arg(value)); + + return true; +} + +/* The following functions are obsoleted. Similar functionality can be found + * in the LDIF class */ + +bool LDIFConverter::parseSingleLine( Addressee &a, Address &homeAddr, + Address &workAddr, TQString &line ) +{ + if ( line.isEmpty() ) + return true; + + TQString fieldname, value; + TQByteArray val; + + LDIF::splitLine( line.latin1(), fieldname, val ); + value = TQString::fromUtf8( val.data(), val.size() ); + return evaluatePair( a, homeAddr, workAddr, fieldname, value); +} + + +bool LDIFConverter::splitLine( TQString &line, TQString &fieldname, TQString &value) +{ + TQByteArray val; + bool ret = LDIF::splitLine( line.latin1(), fieldname, val ); + value = TQString::fromUtf8( val.data(), val.size() ); + return ret; +} + + +TQString LDIFConverter::makeLDIFfieldString( TQString formatStr, TQString value, bool allowEncode ) +{ + if ( value.isEmpty() ) + return TQString(); + + // append format if not given + if (formatStr.find(':') == -1) + formatStr.append(": %1\n"); + + // check if base64-encoding is needed + bool printable = true; + unsigned int i, len; + len = value.length(); + for (i = 0; i<len; ++i ) { + if (!value[i].isPrint()) { + printable = false; + break; + } + } + + if (printable) // always encode if we find special chars... + printable = (value.find('\n') == -1); + + if (!printable && allowEncode) { + // encode to base64 + value = KCodecs::base64Encode( value.utf8() ); + int p = formatStr.find(':'); + if (p>=0) + formatStr.insert(p, ':'); + } + + // generate the new string and split it to 72 chars/line + TQCString txt = TQString(formatStr.arg(value)).utf8(); + + if (allowEncode) { + len = txt.length(); + if (len && txt[len-1] == '\n') + --len; + i = 72; + while (i < len) { + txt.insert(i, "\n "); + i += 72+1; + len += 2; + } + } + + return TQString::fromUtf8(txt); +} + diff --git a/tdeabc/ldifconverter.h b/tdeabc/ldifconverter.h new file mode 100644 index 000000000..a8052a65f --- /dev/null +++ b/tdeabc/ldifconverter.h @@ -0,0 +1,100 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Helge Deller <deller@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 version 2 only as published by the Free Software Foundation. + + 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 KABC_LDIFCONVERTER_H +#define KABC_LDIFCONVERTER_H + +#include <tqstring.h> +#include <tqdatetime.h> + +#include "addressee.h" +#include "addresseelist.h" + +namespace KABC { + + /** + * A set of functions to convert a string with LDIF information to addressees + * and vice versa. It is useful for addressbook import- and exportfilters + * and might be used to read and write Mozilla and Netscape addresssbooks. + */ + + namespace LDIFConverter { + + /** + * Converts a LDIF string to a list of addressees. + * + * @param str The vcard string. + * @param addrList The addresseelist. + * @param dt The date & time value of the last modification (e.g. file modification time). + * @since 3.2 + */ + KABC_EXPORT bool LDIFToAddressee( const TQString &str, AddresseeList &addrList, TQDateTime dt = TQDateTime::currentDateTime() ); + + /** + * Converts a list of addressees to a LDIF string. + * + * @param addrList The addresseelist. + * @param str The LDIF string. + * @since 3.2 + */ + KABC_EXPORT bool addresseeToLDIF( const AddresseeList &addrList, TQString &str ); + + /** + * Converts an addressee to a LDIF string. + * + * @param addr The addressee. + * @param str The LDIF string. + * @since 3.2 + */ + KABC_EXPORT bool addresseeToLDIF( const Addressee &addr, TQString &str ); + + /** + * @deprecated + * Obsoleted - please use LDIF::assembleLine() + * Returns a LDIF compatible string representing a given field/value pair. + * If necessary, the value parameter will be base64encoded and split into multiple. + * This function will return an empty string if the given value is empty. + * + * @param field The LDAP field name or a complete LDIF field string (e.g. "cn" or "cn = %1\n"). + * @param value The value for this field. + * @param allowEncode Set to false if you wish no encoding of the value. + * @since 3.2 + */ + KABC_EXPORT TQString makeLDIFfieldString( TQString field, TQString value, bool allowEncode = true ) KDE_DEPRECATED; + + + + /* internal functions - do not use !! */ + + /** No need for this function anymore - use LDIF::splitLine() + evaluatePair() */ + KABC_EXPORT bool parseSingleLine( Addressee &a, + Address &homeAddr, Address &workAddr, TQString &line ); + + /** No need for this function anymore - use LDIF::splitLine() */ + KABC_EXPORT bool splitLine( TQString &line, TQString &fieldname, TQString &value); + + + KABC_EXPORT bool evaluatePair( Addressee &a, Address &homeAddr, Address &workAddr, + TQString &fieldname, TQString &value ); + + } + +} +#endif + diff --git a/tdeabc/lock.cpp b/tdeabc/lock.cpp new file mode 100644 index 000000000..a78cb4c5b --- /dev/null +++ b/tdeabc/lock.cpp @@ -0,0 +1,162 @@ +/* + This file is part of libkabc. + Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@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 "lock.h" + +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <kstandarddirs.h> +#include <tdetempfile.h> + +#include <tqfile.h> + +#include <signal.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +using namespace KABC; + +Lock::Lock( const TQString &identifier ) + : mIdentifier( identifier ) +{ + mIdentifier.replace( "/", "_" ); +} + +Lock::~Lock() +{ + unlock(); +} + +TQString Lock::locksDir() +{ + return locateLocal( "data", "tdeabc/lock/" ); +} + +bool Lock::readLockFile( const TQString &filename, int &pid, TQString &app ) +{ + TQFile file( filename ); + if ( !file.open( IO_ReadOnly ) ) return false; + + TQTextStream t( &file ); + pid = t.readLine().toInt(); + app = t.readLine(); + + return true; +} + +bool Lock::writeLockFile( const TQString &filename ) +{ + TQFile file( filename ); + if ( !file.open( IO_WriteOnly ) ) return false; + TQTextStream t( &file ); + t << ::getpid() << endl << TQString( TDEGlobal::instance()->instanceName() ); + + return true; +} + +TQString Lock::lockFileName() const +{ + return locksDir() + mIdentifier + ".lock"; +} + +bool Lock::lock() +{ + kdDebug(5700) << "Lock::lock()" << endl; + + TQString lockName = lockFileName(); + kdDebug(5700) << "-- lock name: " << lockName << endl; + + if ( TQFile::exists( lockName ) ) { // check if it is a stale lock file + int pid; + TQString app; + + if ( !readLockFile( lockFileName(), pid, app ) ) { + mError = i18n("Unable to open lock file."); + return false; + } + + int retval = ::kill( pid, 0 ); + if ( retval == -1 && errno == ESRCH ) { // process doesn't exists anymore + TQFile::remove( lockName ); + kdWarning(5700) << "Removed stale lock file from process '" << app << "'" + << endl; + } else { + TQString identifier( mIdentifier ); + identifier.replace( '_', '/' ); + + mError = i18n("The address book '%1' is locked by application '%2'.\nIf you believe this is incorrect, just remove the lock file from '%3'") + .arg( identifier ).arg( app ).arg( locateLocal( "data", "tdeabc/lock/*.lock" ) ); + return false; + } + } + + TQString lockUniqueName; + lockUniqueName = mIdentifier + kapp->randomString( 8 ); + mLockUniqueName = locateLocal( "data", "tdeabc/lock/" + lockUniqueName ); + kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; + + // Create unique file + writeLockFile( mLockUniqueName ); + + // Create lock file + int result = ::link( TQFile::encodeName( mLockUniqueName ), + TQFile::encodeName( lockName ) ); + + if ( result == 0 ) { + mError = ""; + emit locked(); + return true; + } + + // TODO: check stat + + mError = i18n("Error"); + return false; +} + +bool Lock::unlock() +{ + int pid; + TQString app; + if ( readLockFile( lockFileName(), pid, app ) ) { + if ( pid == getpid() ) { + TQFile::remove( lockFileName() ); + TQFile::remove( mLockUniqueName ); + emit unlocked(); + } else { + mError = i18n("Unlock failed. Lock file is owned by other process: %1 (%2)") + .arg( app ).arg( TQString::number( pid ) ); + kdDebug() << "Lock::unlock(): " << mError << endl; + return false; + } + } + + mError = ""; + return true; +} + +TQString Lock::error() const +{ + return mError; +} + +#include "lock.moc" diff --git a/tdeabc/lock.h b/tdeabc/lock.h new file mode 100644 index 000000000..addc2032f --- /dev/null +++ b/tdeabc/lock.h @@ -0,0 +1,88 @@ +/* + This file is part of libkabc. + + Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@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 KABC_LOCK_H +#define KABC_LOCK_H + +#include <tqstring.h> +#include <tqobject.h> + +#include <tdelibs_export.h> + +namespace KABC { + +/** + This class provides locking functionality for a file, directory or an + arbitrary string-represented resource. +*/ +class KABC_EXPORT Lock : public TQObject +{ + Q_OBJECT + public: + /** + Constructor. + + @param identifier An identifier for the resource to be locked, e.g. a file + name. + */ + Lock( const TQString &identifier ); + + /** + Destruct lock object. This also removes the lock on the resource. + */ + ~Lock(); + + /** + Lock resource. + */ + virtual bool lock(); + + /** + Unlock resource. + */ + virtual bool unlock(); + + virtual TQString error() const; + + TQString lockFileName() const; + + static bool readLockFile( const TQString &filename, int &pid, TQString &app ); + static bool writeLockFile( const TQString &filename ); + + static TQString locksDir(); + + signals: + void locked(); + void unlocked(); + + private: + TQString mIdentifier; + + TQString mLockUniqueName; + + TQString mError; + + class Private; + Private *d; +}; + +} + +#endif diff --git a/tdeabc/locknull.cpp b/tdeabc/locknull.cpp new file mode 100644 index 000000000..5f3ee06c7 --- /dev/null +++ b/tdeabc/locknull.cpp @@ -0,0 +1,63 @@ +/* + This file is part of libkabc. + + Copyright (c) 2003 Cornelius Schumacher <schumacher@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 "locknull.h" + +#include <tdelocale.h> +#include <kdebug.h> + +using namespace KABC; + +LockNull::LockNull( bool allowAccess ) + : Lock( TQString::null ), mAllowAccess( allowAccess ) +{ +} + +LockNull::~LockNull() +{ + unlock(); +} + +bool LockNull::lock() +{ + if ( !mAllowAccess ) return false; + + kdWarning() << "LockNull::lock() force success. Doesn't actually lock." + << endl; + + emit locked(); + + return true; +} + +bool LockNull::unlock() +{ + emit unlocked(); + return true; +} + +TQString LockNull::error() const +{ + if ( mAllowAccess ) + return i18n("LockNull: All locks succeed but no actual locking is done."); + else + return i18n("LockNull: All locks fail."); +} diff --git a/tdeabc/locknull.h b/tdeabc/locknull.h new file mode 100644 index 000000000..dfefe122a --- /dev/null +++ b/tdeabc/locknull.h @@ -0,0 +1,54 @@ +/* + This file is part of libkabc. + + Copyright (c) 2003 Cornelius Schumacher <schumacher@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 KABC_LOCKNULL_H +#define KABC_LOCKNULL_H + +#include <tqstring.h> + +#include "lock.h" + +namespace KABC { + +/** + This class provides a lock without actually locking. It can be constructed in + two ways: One that let all locks succeed and one that let all locks fail. +*/ +class KABC_EXPORT LockNull : public Lock +{ + public: + LockNull( bool allowAccess ); + ~LockNull(); + + bool lock(); + bool unlock(); + + TQString error() const; + + private: + bool mAllowAccess; + + class Private; + Private *d; +}; + +} + +#endif diff --git a/tdeabc/phonenumber.cpp b/tdeabc/phonenumber.cpp new file mode 100644 index 000000000..fd2468c73 --- /dev/null +++ b/tdeabc/phonenumber.cpp @@ -0,0 +1,213 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tdeapplication.h> +#include <tdelocale.h> + +#include "phonenumber.h" + +using namespace KABC; + +PhoneNumber::PhoneNumber() : + mType( Home ) +{ + init(); +} + +PhoneNumber::PhoneNumber( const TQString &number, int type ) : + mType( type ) +{ + init(); + + validateNumber( number ); +} + +PhoneNumber::~PhoneNumber() +{ +} + +void PhoneNumber::init() +{ + mId = TDEApplication::randomString( 8 ); +} + +void PhoneNumber::validateNumber( const TQString &number ) +{ + mNumber = number; + + // remove line breaks + mNumber = mNumber.replace( '\n', "" ); + mNumber = mNumber.replace( '\r', "" ); +} + +bool PhoneNumber::operator==( const PhoneNumber &p ) const +{ + if ( mNumber != p.mNumber ) return false; + if ( mType != p.mType ) return false; + + return true; +} + +bool PhoneNumber::operator!=( const PhoneNumber &p ) const +{ + return !( p == *this ); +} + +void PhoneNumber::setId( const TQString &id ) +{ + mId = id; +} + +TQString PhoneNumber::id() const +{ + return mId; +} + +void PhoneNumber::setNumber( const TQString &number ) +{ + validateNumber( number ); +} + +TQString PhoneNumber::number() const +{ + return mNumber; +} + +void PhoneNumber::setType( int type ) +{ + mType = type; +} + +int PhoneNumber::type() const +{ + return mType; +} + +TQString PhoneNumber::typeLabel() const +{ + TQString label; + bool first = true; + + const TypeList list = typeList(); + + TypeList::ConstIterator it; + for ( it = list.begin(); it != list.end(); ++it ) { + if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { + label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); + if ( first ) + first = false; + } + } + + return label; +} + +TQString PhoneNumber::label() const +{ + return typeLabel( type() ); +} + +PhoneNumber::TypeList PhoneNumber::typeList() +{ + static TypeList list; + + if ( list.isEmpty() ) { + list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video + << Bbs << Modem << Car << Isdn << Pcs << Pager; + } + + return list; +} + +TQString PhoneNumber::label( int type ) +{ + return typeLabel( type ); +} + +TQString PhoneNumber::typeLabel( int type ) +{ + if ( type & Pref ) + return i18n( "Preferred phone", "Preferred" ); + + switch ( type ) { + case Home: + return i18n("Home phone", "Home"); + break; + case Work: + return i18n("Work phone", "Work"); + break; + case Msg: + return i18n("Messenger"); + break; + case Pref: + return i18n("Preferred Number"); + break; + case Voice: + return i18n("Voice"); + break; + case Fax: + return i18n("Fax"); + break; + case Cell: + return i18n("Mobile Phone", "Mobile" ); + break; + case Video: + return i18n("Video"); + break; + case Bbs: + return i18n("Mailbox"); + break; + case Modem: + return i18n("Modem"); + break; + case Car: + return i18n("Car Phone", "Car" ); + break; + case Isdn: + return i18n("ISDN"); + break; + case Pcs: + return i18n("PCS"); + break; + case Pager: + return i18n("Pager"); + break; + case Home | Fax: + return i18n("Home Fax"); + break; + case Work | Fax: + return i18n("Work Fax"); + break; + default: + return i18n("Other"); + } +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const PhoneNumber &phone ) +{ + return s << phone.mId << phone.mType << phone.mNumber; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, PhoneNumber &phone ) +{ + s >> phone.mId >> phone.mType >> phone.mNumber; + + return s; +} diff --git a/tdeabc/phonenumber.h b/tdeabc/phonenumber.h new file mode 100644 index 000000000..3e6ae0941 --- /dev/null +++ b/tdeabc/phonenumber.h @@ -0,0 +1,161 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_PHONENUMBER_H +#define KABC_PHONENUMBER_H + +#include <tqvaluelist.h> +#include <tqstring.h> + +#include <tdelibs_export.h> + +namespace KABC { + +/** + @short Phonenumber information. + + This class provides phone number information. A phone number is classified by + a type. The following types are available, it's possible to use multiple types + Types for a number by combining them through a logical or. +*/ +class KABC_EXPORT PhoneNumber +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const PhoneNumber & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, PhoneNumber & ); + + public: + typedef TQValueList<PhoneNumber> List; + typedef TQValueList<int> TypeList; + + /** + @li @p Home - Home number + @li @p Work - Office number + @li @p Msg - Messaging + @li @p Pref - Preferred number + @li @p Voice - Voice + @li @p Fax - Fax machine + @li @p Cell - Cell phone + @li @p Video - Video phone + @li @p Bbs - Mailbox + @li @p Modem - Modem + @li @p Car - Car phone + @li @p Isdn - ISDN connection + @li @p Pcs - Personal Communication Service + @li @p Pager - Pager + */ + enum Types { Home = 1, Work = 2, Msg = 4, Pref = 8, Voice = 16, Fax = 32, + Cell = 64, Video = 128, Bbs = 256, Modem = 512, Car = 1024, + Isdn = 2048, Pcs = 4096, Pager = 8192 }; + + /** + Create an empty phone number object. + */ + PhoneNumber(); + + /** + Create a phonenumber object. + + @param number Number + @param type Type as defined in enum. Multiple types can be + specified by combining them by a logical or. + */ + PhoneNumber( const TQString &number, int type = Home ); + + /** + Destructor. + */ + ~PhoneNumber(); + + bool operator==( const PhoneNumber & ) const; + bool operator!=( const PhoneNumber & ) const; + + /** + Sets the unique identifier. + */ + void setId( const TQString &id ); + + /** + Returns the unique identifier. + */ + TQString id() const; + + /** + Sets the number. + */ + void setNumber( const TQString & ); + + /** + Returns the number. + */ + TQString number() const; + + /** + Sets the type. Multiple types can be specified by combining them by + a logical or. + */ + void setType( int ); + + /** + Returns the type. Can be a multiple types combined by a logical or. + */ + int type() const; + + /** + Returns a translated string of all types the address has. + */ + TQString typeLabel() const; + + /** + Returns the translated label for phone number depending on its type. + */ + TQString label() const; + + /** + Returns a list of all available types + */ + static TypeList typeList(); + + /** + Returns the translated label for phone number type. + */ + static TQString typeLabel( int type ); + + /** + Returns the translated label for phone number type. + @obsolete + */ + static TQString label( int type ); + + private: + void init(); + void validateNumber( const TQString& ); + + TQString mId; + + int mType; + TQString mNumber; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const PhoneNumber & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, PhoneNumber & ); + +} + +#endif diff --git a/tdeabc/picture.cpp b/tdeabc/picture.cpp new file mode 100644 index 000000000..4ddd3f537 --- /dev/null +++ b/tdeabc/picture.cpp @@ -0,0 +1,120 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 "picture.h" + +using namespace KABC; + +Picture::Picture() + : mIntern( false ) +{ +} + +Picture::Picture( const TQString &url ) + : mUrl( url ), mIntern( false ) +{ +} + +Picture::Picture( const TQImage &data ) + : mData( data ), mIntern( true ) +{ +} + +Picture::~Picture() +{ +} + +bool Picture::operator==( const Picture &p ) const +{ + if ( mIntern != p.mIntern ) return false; + + if ( mIntern ) { + if ( mData != p.mData ) + return false; + } else { + if ( mUrl != p.mUrl ) + return false; + } + + return true; +} + +bool Picture::operator!=( const Picture &p ) const +{ + return !( p == *this ); +} + +void Picture::setUrl( const TQString &url ) +{ + mUrl = url; + mIntern = false; +} + +void Picture::setData( const TQImage &data ) +{ + mData = data; + mIntern = true; +} + +void Picture::setType( const TQString &type ) +{ + mType = type; +} + +bool Picture::isIntern() const +{ + return mIntern; +} + +TQString Picture::url() const +{ + return mUrl; +} + +TQImage Picture::data() const +{ + return mData; +} + +TQString Picture::type() const +{ + return mType; +} + +TQString Picture::asString() const +{ + if ( mIntern ) + return "intern picture"; + else + return mUrl; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Picture &picture ) +{ + return s << picture.mIntern << picture.mUrl << picture.mType; +// return s << picture.mIntern << picture.mUrl << picture.mType << picture.mData; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Picture &picture ) +{ + s >> picture.mIntern >> picture.mUrl >> picture.mType; +// s >> picture.mIntern >> picture.mUrl >> picture.mType >> picture.mData; + return s; +} diff --git a/tdeabc/picture.h b/tdeabc/picture.h new file mode 100644 index 000000000..e6ed690c2 --- /dev/null +++ b/tdeabc/picture.h @@ -0,0 +1,128 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_PICTURE_H +#define KABC_PICTURE_H + +#include <tqimage.h> + +#include <tdelibs_export.h> + +namespace KABC { + +class KABC_EXPORT Picture +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Picture & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Picture & ); + +public: + + /** + * Consturctor. Creates an empty object. + */ + Picture(); + + /** + * Consturctor. + * + * @param url A URL that describes the position of the picture file. + */ + Picture( const TQString &url ); + + /** + * Consturctor. + * + * @param data The raw data of the picture. + */ + Picture( const TQImage &data ); + + /** + * Destructor. + */ + ~Picture(); + + + bool operator==( const Picture & ) const; + bool operator!=( const Picture & ) const; + + /** + * Sets a URL for the location of the picture file. When using this + * function, isIntern() will return 'false' until you use + * setData(). + * + * @param url The location URL of the picture file. + */ + void setUrl( const TQString &url ); + + /** + * Sets the raw data of the picture. When using this function, + * isIntern() will return 'true' until you use setUrl(). + * + * @param data The raw data of the picture. + */ + void setData( const TQImage &data ); + + /** + * Sets the type of the picture. + */ + void setType( const TQString &type ); + + /** + * Returns whether the picture is described by a URL (extern) or + * by the raw data (intern). + * When this method returns 'true' you can use data() to + * get the raw data. Otherwise you can request the URL of this + * picture by url() and load the raw data from that location. + */ + bool isIntern() const; + + /** + * Returns the location URL of this picture. + */ + TQString url() const; + + /** + * Returns the raw data of this picture. + */ + TQImage data() const; + + /** + * Returns the type of this picture. + */ + TQString type() const; + + /** + * Returns string representation of the picture. + */ + TQString asString() const; + +private: + TQString mUrl; + TQString mType; + TQImage mData; + + int mIntern; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Picture & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Picture & ); + +} +#endif diff --git a/tdeabc/plugin.cpp b/tdeabc/plugin.cpp new file mode 100644 index 000000000..a53192559 --- /dev/null +++ b/tdeabc/plugin.cpp @@ -0,0 +1,61 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 "plugin.h" + +using namespace KABC; + +Plugin::Plugin() +{ +} + +Plugin::~Plugin() +{ +} + +void Plugin::setType( const TQString& type ) +{ + mType = type; +} + +TQString Plugin::type() const +{ + return mType; +} + +void Plugin::setNameLabel( const TQString& label ) +{ + mNameLabel = label; +} + +TQString Plugin::nameLabel() const +{ + return mNameLabel; +} + +void Plugin::setDescriptionLabel( const TQString& label ) +{ + mDescriptionLabel = label; +} + +TQString Plugin::descriptionLabel() const +{ + return mDescriptionLabel; +} diff --git a/tdeabc/plugin.h b/tdeabc/plugin.h new file mode 100644 index 000000000..0c8e3b338 --- /dev/null +++ b/tdeabc/plugin.h @@ -0,0 +1,52 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_PLUGIN_H +#define KABC_PLUGIN_H + +#include <tqstring.h> + +#include <tdelibs_export.h> + +namespace KABC { + +class KABC_EXPORT Plugin +{ +public: + Plugin(); + virtual ~Plugin(); + + virtual void setType( const TQString& type ); + virtual TQString type() const; + + virtual void setNameLabel( const TQString& label ); + virtual TQString nameLabel() const; + + virtual void setDescriptionLabel( const TQString& label ); + virtual TQString descriptionLabel() const; + +private: + TQString mType; + TQString mNameLabel; + TQString mDescriptionLabel; +}; + +} +#endif diff --git a/tdeabc/plugins/CMakeLists.txt b/tdeabc/plugins/CMakeLists.txt new file mode 100644 index 000000000..597486816 --- /dev/null +++ b/tdeabc/plugins/CMakeLists.txt @@ -0,0 +1,15 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( file ) +add_subdirectory( dir ) +add_subdirectory( net ) +add_subdirectory( ldaptdeio ) diff --git a/tdeabc/plugins/Makefile.am b/tdeabc/plugins/Makefile.am new file mode 100644 index 000000000..bdedbec0f --- /dev/null +++ b/tdeabc/plugins/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = file dir net ldaptdeio diff --git a/tdeabc/plugins/dir/CMakeLists.txt b/tdeabc/plugins/dir/CMakeLists.txt new file mode 100644 index 000000000..fd4161342 --- /dev/null +++ b/tdeabc/plugins/dir/CMakeLists.txt @@ -0,0 +1,73 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + resourcedir.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### other data ################################ + +install( FILES dir.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) + + +##### kabc_dir (library) ######################## + +set( target kabc_dir ) + +set( ${target}_SRCS + resourcedir.cpp resourcedirconfig.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.0.0 + LINK tdeabc-shared + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### kabc_dir (module) ######################### + +set( target kabc_dir ) + +set( ${target}_SRCS + resourcedirplugin.cpp +) + +tde_add_kpart( ${target} + SOURCES ${${target}_SRCS} + LINK kabc_dir-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/plugins/dir/Makefile.am b/tdeabc/plugins/dir/Makefile.am new file mode 100644 index 000000000..94ddad3cc --- /dev/null +++ b/tdeabc/plugins/dir/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_builddir) $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourcedirconfig.h + +lib_LTLIBRARIES = libkabc_dir.la +libkabc_dir_la_SOURCES = resourcedir.cpp resourcedirconfig.cpp +libkabc_dir_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined +libkabc_dir_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(top_builddir)/tderesources/libtderesources.la $(LIB_TDECORE) $(LIB_TDEFILE) $(LIB_TDEUI) +libkabc_dir_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +kde_module_LTLIBRARIES = kabc_dir.la +kabc_dir_la_SOURCES = resourcedirplugin.cpp +kabc_dir_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined +kabc_dir_la_LIBADD = libkabc_dir.la $(LIB_QT) $(LIB_TDECORE) + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_dir.pot + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = resourcedir.h + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = dir.desktop + +resourcedirplugin.lo: ../../addressee.h diff --git a/tdeabc/plugins/dir/dir.desktop b/tdeabc/plugins/dir/dir.desktop new file mode 100644 index 000000000..a841040f9 --- /dev/null +++ b/tdeabc/plugins/dir/dir.desktop @@ -0,0 +1,92 @@ +[Desktop Entry] +Name=Directory +Name[af]=Gids +Name[ar]=دليل +Name[az]=CÉ™rgÉ™ +Name[be]=ТÑчка +Name[bn]=ডিরেকà§à¦Ÿà¦°à¦¿ +Name[br]=Renkell +Name[bs]=Direktorij +Name[ca]=Directori +Name[cs]=Adresář +Name[csb]=Katalog +Name[cy]=Cyfeiriadur +Name[da]=Mappe +Name[de]=Verzeichnis +Name[el]=Κατάλογος +Name[eo]=Dosierujo +Name[es]=Directorio +Name[et]=Kataloog +Name[eu]=Direktorioa +Name[fa]=Ùهرست راهنما +Name[fi]=Hakemisto +Name[fo]=Fíluskrá +Name[fr]=Dossier +Name[fy]=Map +Name[ga]=Comhadlann +Name[gl]=Directório +Name[he]=ספריה +Name[hi]=डिरेकà¥à¤Ÿà¥à¤°à¥€ +Name[hr]=Mapa +Name[hsb]=Zapisk +Name[hu]=Könyvtár +Name[id]=Direktori +Name[is]=Mappa +Name[it]=Cartella +Name[ja]=ディレクトリ +Name[ka]=დáƒáƒ¡áƒ¢áƒ +Name[kk]=Каталог +Name[km]=ážáž +Name[ko]=ìžë£Œë°© +Name[ku]=Peldank +Name[lb]=Verzeechnis +Name[lt]=Aplankas +Name[lv]=Direktorija +Name[mk]=Именик +Name[mn]=Лавлах +Name[ms]=Direktori +Name[mt]=Direttorju +Name[nb]=Katalog +Name[nds]=Orner +Name[ne]=डाइरेकà¥à¤Ÿà¤°à¥€ +Name[nl]=Map +Name[nn]=Katalog +Name[nso]=Tshupetso +Name[oc]=Directori +Name[pa]=ਡਾਇਰੈਕਟਰੀ +Name[pl]=Katalog +Name[pt]=Directoria +Name[pt_BR]=Diretório +Name[ro]=Director +Name[ru]=Каталог +Name[rw]=ububiko +Name[se]=Ohcu +Name[sk]=PrieÄinok +Name[sl]=Imenik +Name[sq]=Fioka +Name[sr]=ФаÑцикла +Name[sr@Latn]=Fascikla +Name[ss]=I-directory +Name[sv]=Katalog +Name[ta]=அடைவ௠+Name[te]=డైరకà±à°Ÿà°°à°¿ +Name[tg]=ФеҳраÑÑ‚ +Name[th]=ไดเรà¸à¸—อรี +Name[tr]=Dizin +Name[tt]=Törgäk +Name[uk]=Каталог +Name[uz]=Jild +Name[uz@cyrillic]=Жилд +Name[ven]=Tsumbavhulwo +Name[vi]=Thư mục +Name[wa]=Ridant +Name[xh]=Ulawulo +Name[zh_CN]=目录 +Name[zh_HK]=目錄 +Name[zh_TW]=目錄 +Name[zu]=Uhlu lwamafayela +X-TDE-Library=kabc_dir +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=dir diff --git a/tdeabc/plugins/dir/resourcedir.cpp b/tdeabc/plugins/dir/resourcedir.cpp new file mode 100644 index 000000000..53f178a6d --- /dev/null +++ b/tdeabc/plugins/dir/resourcedir.cpp @@ -0,0 +1,310 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 <errno.h> +#include <signal.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +#include <tqregexp.h> +#include <tqtimer.h> +#include <tqwidget.h> + +#include <tdeapplication.h> +#include <tdeconfig.h> +#include <kdebug.h> +#include <kgenericfactory.h> +#include <tdeglobal.h> +#include <tdelocale.h> +#include <kstandarddirs.h> +#include <kurlrequester.h> + +#include "addressbook.h" +#include "formatfactory.h" +#include "resourcedirconfig.h" +#include "stdaddressbook.h" +#include "lock.h" + +#include "resourcedir.h" + +using namespace KABC; + +extern "C" +{ + void *init_kabc_dir() + { + return new KRES::PluginFactory<ResourceDir,ResourceDirConfig>(); + } +} + + +ResourceDir::ResourceDir( const TDEConfig *config ) + : Resource( config ), mAsynchronous( false ) +{ + if ( config ) { + init( config->readPathEntry( "FilePath", StdAddressBook::directoryName() ), + config->readEntry( "FileFormat", "vcard" ) ); + } else { + init( StdAddressBook::directoryName(), "vcard" ); + } +} + +ResourceDir::ResourceDir( const TQString &path, const TQString &format ) + : Resource( 0 ), mAsynchronous( false ) +{ + init( path, format ); +} + +void ResourceDir::init( const TQString &path, const TQString &format ) +{ + mFormatName = format; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); + + if ( !mFormat ) { + mFormatName = "vcard"; + mFormat = factory->format( mFormatName ); + } + + mLock = 0; + + connect( &mDirWatch, TQT_SIGNAL( dirty(const TQString&) ), TQT_SLOT( pathChanged() ) ); + connect( &mDirWatch, TQT_SIGNAL( created(const TQString&) ), TQT_SLOT( pathChanged() ) ); + connect( &mDirWatch, TQT_SIGNAL( deleted(const TQString&) ), TQT_SLOT( pathChanged() ) ); + + setPath( path ); +} + +ResourceDir::~ResourceDir() +{ + delete mFormat; + mFormat = 0; +} + +void ResourceDir::writeConfig( TDEConfig *config ) +{ + Resource::writeConfig( config ); + + if ( mPath == StdAddressBook::directoryName() ) + config->deleteEntry( "FilePath" ); + else + config->writePathEntry( "FilePath", mPath ); + + config->writeEntry( "FileFormat", mFormatName ); +} + +Ticket *ResourceDir::requestSaveTicket() +{ + kdDebug(5700) << "ResourceDir::requestSaveTicket()" << endl; + + if ( !addressBook() ) return 0; + + delete mLock; + mLock = new Lock( mPath ); + + if ( mLock->lock() ) { + addressBook()->emitAddressBookLocked(); + } else { + addressBook()->error( mLock->error() ); + kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock path '" + << mPath << "': " << mLock->error() << endl; + return 0; + } + + return createTicket( this ); +} + +void ResourceDir::releaseSaveTicket( Ticket *ticket ) +{ + delete ticket; + + delete mLock; + mLock = 0; +} + +bool ResourceDir::doOpen() +{ + TQDir dir( mPath ); + if ( !dir.exists() ) { // no directory available + return dir.mkdir( dir.path() ); + } else { + TQString testName = dir.entryList( TQDir::Files )[0]; + if ( testName.isNull() || testName.isEmpty() ) // no file in directory + return true; + + TQFile file( mPath + "/" + testName ); + if ( file.open( IO_ReadOnly ) ) + return true; + + if ( file.size() == 0 ) + return true; + + bool ok = mFormat->checkFormat( &file ); + file.close(); + return ok; + } +} + +void ResourceDir::doClose() +{ +} + +bool ResourceDir::load() +{ + kdDebug(5700) << "ResourceDir::load(): '" << mPath << "'" << endl; + + mAsynchronous = false; + + TQDir dir( mPath ); + TQStringList files = dir.entryList( TQDir::Files ); + + TQStringList::Iterator it; + bool ok = true; + for ( it = files.begin(); it != files.end(); ++it ) { + TQFile file( mPath + "/" + (*it) ); + + if ( !file.open( IO_ReadOnly ) ) { + addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) ); + ok = false; + continue; + } + + if ( !mFormat->loadAll( addressBook(), this, &file ) ) + ok = false; + + file.close(); + } + + return ok; +} + +bool ResourceDir::asyncLoad() +{ + mAsynchronous = true; + + bool ok = load(); + if ( !ok ) + emit loadingError( this, i18n( "Loading resource '%1' failed!" ) + .arg( resourceName() ) ); + else + emit loadingFinished( this ); + + return ok; +} + +bool ResourceDir::save( Ticket * ) +{ + kdDebug(5700) << "ResourceDir::save(): '" << mPath << "'" << endl; + + Addressee::Map::Iterator it; + bool ok = true; + + mDirWatch.stopScan(); + + for ( it = mAddrMap.begin(); it != mAddrMap.end(); ++it ) { + if ( !it.data().changed() ) + continue; + + TQFile file( mPath + "/" + (*it).uid() ); + if ( !file.open( IO_WriteOnly ) ) { + addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); + continue; + } + + mFormat->save( *it, &file ); + + // mark as unchanged + (*it).setChanged( false ); + + file.close(); + } + + mDirWatch.startScan(); + + return ok; +} + +bool ResourceDir::asyncSave( Ticket *ticket ) +{ + bool ok = save( ticket ); + if ( !ok ) + emit savingError( this, i18n( "Saving resource '%1' failed!" ) + .arg( resourceName() ) ); + else + emit savingFinished( this ); + + return ok; +} + +void ResourceDir::setPath( const TQString &path ) +{ + mDirWatch.stopScan(); + if ( mDirWatch.contains( mPath ) ) + mDirWatch.removeDir( mPath ); + + mPath = path; + mDirWatch.addDir( mPath, true ); + mDirWatch.startScan(); +} + +TQString ResourceDir::path() const +{ + return mPath; +} + +void ResourceDir::setFormat( const TQString &format ) +{ + mFormatName = format; + + if ( mFormat ) + delete mFormat; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); +} + +TQString ResourceDir::format() const +{ + return mFormatName; +} + +void ResourceDir::pathChanged() +{ + if ( !addressBook() ) + return; + + clear(); + if ( mAsynchronous ) + asyncLoad(); + else { + load(); + addressBook()->emitAddressBookChanged(); + } +} + +void ResourceDir::removeAddressee( const Addressee& addr ) +{ + TQFile::remove( mPath + "/" + addr.uid() ); + mAddrMap.erase( addr.uid() ); +} + +#include "resourcedir.moc" diff --git a/tdeabc/plugins/dir/resourcedir.h b/tdeabc/plugins/dir/resourcedir.h new file mode 100644 index 000000000..dc3bdbd23 --- /dev/null +++ b/tdeabc/plugins/dir/resourcedir.h @@ -0,0 +1,113 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 KABC_RESOURCEDIR_H +#define KABC_RESOURCEDIR_H + +#include <tdeconfig.h> +#include <kdirwatch.h> + +#include <sys/types.h> + +#include <tdeabc/resource.h> + +class TQTimer; + +namespace KABC { + +class FormatPlugin; +class Lock; + +/** + @internal +*/ +class KABC_EXPORT ResourceDir : public Resource +{ + Q_OBJECT + + public: + ResourceDir( const TDEConfig* ); + ResourceDir( const TQString &path, const TQString &type = "vcard" ); + ~ResourceDir(); + + virtual void writeConfig( TDEConfig* ); + + virtual bool doOpen(); + virtual void doClose(); + + virtual Ticket *requestSaveTicket(); + virtual void releaseSaveTicket( Ticket* ); + + virtual bool load(); + virtual bool asyncLoad(); + virtual bool save( Ticket* ticket ); + virtual bool asyncSave( Ticket* ticket ); + + /** + Set path to be used for saving. + */ + void setPath( const TQString & ); + + /** + Return path used for loading and saving the address book. + */ + TQString path() const; + + /** + Set the format by name. + */ + void setFormat( const TQString &format ); + + /** + Returns the format name. + */ + TQString format() const; + + /** + Remove a addressee from its source. + This method is mainly called by KABC::AddressBook. + */ + virtual void removeAddressee( const Addressee& addr ); + + protected slots: + void pathChanged(); + + protected: + void init( const TQString &path, const TQString &format ); + + private: + FormatPlugin *mFormat; + + KDirWatch mDirWatch; + + TQString mPath; + TQString mFormatName; + + Lock *mLock; + + bool mAsynchronous; + + class ResourceDirPrivate; + ResourceDirPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/plugins/dir/resourcedirconfig.cpp b/tdeabc/plugins/dir/resourcedirconfig.cpp new file mode 100644 index 000000000..2807872f8 --- /dev/null +++ b/tdeabc/plugins/dir/resourcedirconfig.cpp @@ -0,0 +1,107 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqlabel.h> +#include <tqlayout.h> + +#include <kdebug.h> +#include <tdelocale.h> +#include <kstandarddirs.h> +#include <kdialog.h> + +#include "formatfactory.h" +#include "resourcedir.h" +#include "stdaddressbook.h" + +#include "resourcedirconfig.h" + +using namespace KABC; + +ResourceDirConfig::ResourceDirConfig( TQWidget* parent, const char* name ) + : KRES::ConfigWidget( parent, name ) +{ + TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2, 0, + KDialog::spacingHint() ); + + TQLabel *label = new TQLabel( i18n( "Format:" ), this ); + mFormatBox = new KComboBox( this ); + + mainLayout->addWidget( label, 0, 0 ); + mainLayout->addWidget( mFormatBox, 0, 1 ); + + label = new TQLabel( i18n( "Location:" ), this ); + mFileNameEdit = new KURLRequester( this ); + mFileNameEdit->setMode( KFile::Directory ); + + mainLayout->addWidget( label, 1, 0 ); + mainLayout->addWidget( mFileNameEdit, 1, 1 ); + + FormatFactory *factory = FormatFactory::self(); + TQStringList formats = factory->formats(); + TQStringList::Iterator it; + for ( it = formats.begin(); it != formats.end(); ++it ) { + FormatInfo *info = factory->info( *it ); + if ( info ) { + mFormatTypes << (*it); + mFormatBox->insertItem( info->nameLabel ); + } + } + + mInEditMode = false; +} + +void ResourceDirConfig::setEditMode( bool value ) +{ + mFormatBox->setEnabled( !value ); + mInEditMode = value; +} + +void ResourceDirConfig::loadSettings( KRES::Resource *res ) +{ + ResourceDir *resource = dynamic_cast<ResourceDir*>( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceDirConfig::loadSettings(): cast failed" << endl; + return; + } + + mFormatBox->setCurrentItem( mFormatTypes.findIndex( resource->format() ) ); + + mFileNameEdit->setURL( resource->path() ); + if ( mFileNameEdit->url().isEmpty() ) + mFileNameEdit->setURL( KABC::StdAddressBook::directoryName() ); +} + +void ResourceDirConfig::saveSettings( KRES::Resource *res ) +{ + ResourceDir *resource = dynamic_cast<ResourceDir*>( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceDirConfig::loadSettings(): cast failed" << endl; + return; + } + + if ( mInEditMode ) + resource->setFormat( mFormatTypes[ mFormatBox->currentItem() ] ); + + resource->setPath( mFileNameEdit->url() ); +} + +#include "resourcedirconfig.moc" diff --git a/tdeabc/plugins/dir/resourcedirconfig.h b/tdeabc/plugins/dir/resourcedirconfig.h new file mode 100644 index 000000000..9df1778d3 --- /dev/null +++ b/tdeabc/plugins/dir/resourcedirconfig.h @@ -0,0 +1,54 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 RESOURCEDIRCONFIG_H +#define RESOURCEDIRCONFIG_H + +#include <kcombobox.h> +#include <kurlrequester.h> + +#include <tderesources/configwidget.h> + +namespace KABC { + +class KABC_EXPORT ResourceDirConfig : public KRES::ConfigWidget +{ + Q_OBJECT + +public: + ResourceDirConfig( TQWidget* parent = 0, const char* name = 0 ); + + void setEditMode( bool value ); + +public slots: + void loadSettings( KRES::Resource* ); + void saveSettings( KRES::Resource* ); + +private: + KComboBox* mFormatBox; + KURLRequester* mFileNameEdit; + + TQStringList mFormatTypes; + + bool mInEditMode; +}; + +} +#endif diff --git a/tdeabc/plugins/dir/resourcedirplugin.cpp b/tdeabc/plugins/dir/resourcedirplugin.cpp new file mode 100644 index 000000000..a2bd6d138 --- /dev/null +++ b/tdeabc/plugins/dir/resourcedirplugin.cpp @@ -0,0 +1,32 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 "resourcedir.h" +#include "resourcedirconfig.h" + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_dir() + { + return new KRES::PluginFactory<ResourceDir, ResourceDirConfig>(); + } +} diff --git a/tdeabc/plugins/evolution/Makefile.am b/tdeabc/plugins/evolution/Makefile.am new file mode 100644 index 000000000..2c22cf376 --- /dev/null +++ b/tdeabc/plugins/evolution/Makefile.am @@ -0,0 +1,19 @@ +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourceevo.h dbwrapper.h + +kde_module_LTLIBRARIES = kabc_evo.la + +kabc_evo_la_SOURCES = dbwrapper.cpp resourceevo.cpp + +kabc_evo_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kabc_evo_la_LIBADD = ../../../tdeabc/libkabc.la ../../../tdeui/libtdeui.la -ldb ../../../tdeabc/vcardparser/libvcards.la + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_evolution.pot + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = evolution.desktop diff --git a/tdeabc/plugins/evolution/README b/tdeabc/plugins/evolution/README new file mode 100644 index 000000000..7dfefce00 --- /dev/null +++ b/tdeabc/plugins/evolution/README @@ -0,0 +1,15 @@ +A Resource using DB3 to access the evolution +addressbook make sure the wombat is not running +In future versions I may use bonobo to access it... + + +DESIGN: +The Format vs Resource idea is somehow not applyable to the +Evolution PAS + +Format would be vCard and Resource would be DB3.. +BUT +Format get's a QFile* pointer which is just not usable +with a DB3 +INSTEAD we will use the vCardImpl directly to convert +a string to Addressee \ No newline at end of file diff --git a/tdeabc/plugins/evolution/dbwrapper.cpp b/tdeabc/plugins/evolution/dbwrapper.cpp new file mode 100644 index 000000000..fbdff165a --- /dev/null +++ b/tdeabc/plugins/evolution/dbwrapper.cpp @@ -0,0 +1,187 @@ +#include <db.h> + +#include <tqfile.h> + +#include "dbwrapper.h" + + +using namespace Evolution; + +struct DBIterator::Data { + DBWrapper *wrapper; + TQString key; + TQString data; + DBC* cursor; + bool atEnd; +}; + +DBIterator::DBIterator( DBWrapper* wra) { + data = new Data; + data->wrapper = wra; + data->atEnd = false; + data->cursor = 0l; +} +DBIterator::DBIterator( const DBIterator& copy ) { + data = new Data; + data->wrapper = copy.data->wrapper; + data->key = copy.data->key; + data->data = copy.data->data; + data->atEnd = copy.data->atEnd; + if (copy.data->cursor ) + copy.data->cursor->c_dup(copy.data->cursor, &data->cursor, 0 ); + else + data->cursor = 0l; +} +DBIterator::~DBIterator() { + if (data->cursor) + data->cursor->c_close(data->cursor); + delete data; +} +DBIterator& DBIterator::operator=( const DBIterator& rhs ) { + if ( *this == rhs ) + return *this; + if (data->cursor) + data->cursor->c_close(data->cursor); + delete data; + data = new Data; + data->wrapper = rhs.data->wrapper; + data->key = rhs.data->key; + data->data = rhs.data->data; + data->atEnd = rhs.data->atEnd; + if ( rhs.data->cursor ) + rhs.data->cursor->c_dup(rhs.data->cursor, &data->cursor, 0 ); + else + data->cursor = 0l; + + return *this; +} +TQString DBIterator::key()const{ + return data->key; +} +TQString DBIterator::value()const { + return data->data; +} +TQString DBIterator::operator*() { + return data->data; +} +DBIterator& DBIterator::operator++() { + DBT key, val; + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + if ( data->cursor ) + if ( data->cursor->c_get(data->cursor, &key, &val,DB_NEXT ) != 0 ) + data->atEnd = true; + data->key = TQString::fromUtf8( (char*)key.data, key.size ); + data->data = TQString::fromUtf8( (char*)val.data, val.size ); + return *this; +} +DBIterator& DBIterator::operator--() { + DBT key, val; + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + if ( data->cursor ) + if ( data->cursor->c_get(data->cursor, &key, &val,DB_PREV ) != 0 ) + data->atEnd = true; + data->key = TQString::fromUtf8( (char*)key.data, key.size ); + data->data = TQString::fromUtf8( (char*)val.data, val.size ); + return *this; +} +bool DBIterator::operator==( const DBIterator& rhs ) { + if ( data->atEnd && data->atEnd == rhs.data->atEnd ) return true; + + return false; +} +bool DBIterator::operator!=( const DBIterator& rhs ) { + return !this->operator==(rhs ); +} +struct DBWrapper::Data { + DB* db; + bool only; +}; +DBWrapper::DBWrapper() { + data = new Data; + (void)db_create(&data->db, NULL, 0 ); + data->only = false; +} +DBWrapper::~DBWrapper() { + data->db->close(data->db, 0 ); + delete data; +} +bool DBWrapper::open( const TQString& file, bool on) { + data->only = on; + return !data->db->open(data->db, TQFile::encodeName( file ), NULL, DB_HASH, 0, 0666 ); +} +bool DBWrapper::save() { + return true; +} +DBIterator DBWrapper::begin() { + DBIterator it(this); + DBC* cursor; + DBT key, val; + int ret; + ret = data->db->cursor(data->db, NULL, &cursor, 0 ); + if (ret ) { + it.data->atEnd = true; + return it; + } + + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + ret = cursor->c_get(cursor, &key, &val, DB_FIRST ); + if (ret ) { + it.data->atEnd = true; + return it; + } + + it.data->cursor = cursor; + it.data->key = TQString::fromUtf8((char*)key.data, key.size ); + it.data->data = TQString::fromUtf8((char*)val.data, val.size ); + + return it; +} +DBIterator DBWrapper::end() { + DBIterator it(this); + it.data->atEnd = true; + + return it; +} +bool DBWrapper::find( const TQString& _key, TQString& _val ) { + DBT key, val; + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + + TQCString db_key = _key.local8Bit(); + key.data = db_key.data(); + key.size = db_key.size(); + + int ret = data->db->get(data->db, NULL, &key, &val, 0 ); + if (!ret) { + _val = TQString::fromUtf8( (char*)val.data, val.size ); + tqWarning("key: %s val: %sXXX", (char*)key.data, (char*)val.data ); + return true; + } + return false; +} +bool DBWrapper::add( const TQString& _key, const TQString& _val ) { + TQCString db_key = _key.local8Bit(); + TQCString db_val = _val.local8Bit(); + DBT key, val; + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + + key.data = db_key.data(); + key.size = db_key.size(); + val.data = db_val.data(); + val.size = db_val.size(); + + return !data->db->put(data->db, NULL, &key, &val, 0 ); +} +bool DBWrapper::remove( const TQString& _key ) { + TQCString db_key = _key.local8Bit(); + DBT key; + memset(&key, 0, sizeof(key) ); + key.data = db_key.data(); + key.size = db_key.size(); + + return !data->db->del(data->db, NULL, &key, 0 ); +} diff --git a/tdeabc/plugins/evolution/dbwrapper.h b/tdeabc/plugins/evolution/dbwrapper.h new file mode 100644 index 000000000..e5e0a2c33 --- /dev/null +++ b/tdeabc/plugins/evolution/dbwrapper.h @@ -0,0 +1,60 @@ +#ifndef KABC_EVOLUTION_DB_WRAPPER +#define KABC_EVOLUTION_DB_WRAPPER + +#include <db.h> + +#include <tqstring.h> +#include <tqpair.h> + +namespace Evolution { + + class DBWrapper; + class DBIterator { + friend class DBWrapper; + public: + DBIterator( DBWrapper* = 0l ); + ~DBIterator(); + + DBIterator( const DBIterator& ); + DBIterator &operator=( const DBIterator& ); + + TQString key()const; + TQString value()const; + + TQString operator*(); + + DBIterator &operator++(); + DBIterator &operator--(); + + bool operator==( const DBIterator& ); + bool operator!=( const DBIterator& ); + private: + struct Data; + Data* data; + }; + class DBWrapper { + public: + DBWrapper(); + ~DBWrapper(); + + TQString lastError()const; + + bool open( const TQString& file, bool readOnly = false); + bool save(); + DBIterator begin(); + DBIterator end(); + + bool find( const TQString& key, TQString& value ); + bool add( const TQString& key, const TQString& val ); + bool remove( const TQString& key ); + private: + // DBT element( const TQString& ); + struct Data; + Data* data; + + }; + +} + + +#endif diff --git a/tdeabc/plugins/evolution/evolution.desktop b/tdeabc/plugins/evolution/evolution.desktop new file mode 100644 index 000000000..98030e906 --- /dev/null +++ b/tdeabc/plugins/evolution/evolution.desktop @@ -0,0 +1,26 @@ +[Desktop Entry] +Name=Evolution +Name[be]=Ð­Ð²Ð°Ð»ÑŽÑ†Ñ‹Ñ +Name[bn]=ইভোলিউশন +Name[eo]=Evoluo +Name[fa]=اوولوشن +Name[hi]=à¤à¤µà¥‰à¤²à¥à¤¯à¥‚शन +Name[ko]=ì—볼루션 +Name[mn]=Хөгжил +Name[ne]=इभोलà¥à¤¯à¥à¤¸à¤¨ +Name[pa]=à¨à¨µà©‚ਲੇਸ਼ਨ +Name[sr]=Еволуција +Name[sr@Latn]=Evolucija +Name[ta]=படிபà¯à®ªà®Ÿà®¿à®¯à®¾à®© வளரà¯à®šà¯à®šà®¿ +Name[te]=ఎవలà±à°¯à±à°·à°¨à± +Name[th]=เอฟโวลูชัน +Name[tt]=ÜseÅŸ +Name[ven]=Tsikoni +Name[wa]=Evolucion +Name[xh]=Utshintsho lwendawo ngokwenqanawa +Name[zu]=Evolushini +X-TDE-Library=kabc_evo +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=evolution diff --git a/tdeabc/plugins/evolution/resourceevo.cpp b/tdeabc/plugins/evolution/resourceevo.cpp new file mode 100644 index 000000000..e6545f738 --- /dev/null +++ b/tdeabc/plugins/evolution/resourceevo.cpp @@ -0,0 +1,132 @@ +#include <tqdir.h> + +#include <tdeglobal.h> +#include <tdelocale.h> +#include <kdebug.h> + +#include <stdio.h> + +#include <tdeabc/vcardparser/vcardtool.h> + +#include "dbwrapper.h" +#include "resourceevo.h" + +using namespace Evolution; +using namespace KABC; + +class EvolutionFactory : public KRES::PluginFactoryBase +{ + public: + KRES::Resource *resource( const TDEConfig *config ) + { + return new ResourceEvolution( config ); + } + + KRES::ConfigWidget *configWidget( TQWidget * ) + { + return 0; + } +}; + +extern "C" +{ + KDE_EXPORT void *init_kabc_evo() + { + return ( new EvolutionFactory() ); + } +} + +ResourceEvolution::ResourceEvolution( const TDEConfig* conf ) + : Resource( conf ), mWrap(0l) +{ + m_isOpen = false; +} +ResourceEvolution::~ResourceEvolution() { + delete mWrap; +} +bool ResourceEvolution::doOpen() { + mWrap = new DBWrapper; + if (!mWrap->open( TQDir::homeDirPath() + "/evolution/local/Contacts/addressbook.db" ) ) { + return false; + } + + TQString val; + if (!mWrap->find( "PAS-DB-VERSION", val ) ) + return false; + + if (!val.startsWith("0.2") ) + return false; + + m_isOpen = true; + + return true; +} +void ResourceEvolution::doClose() { + delete mWrap; + mWrap = 0l; + m_isOpen = false; +} +Ticket* ResourceEvolution::requestSaveTicket() { + if ( !addressBook() ) return 0; + return createTicket( this ); +} +/* + * skip the first key + */ + +bool ResourceEvolution::load() { + /* doOpen never get's called :( */ + if (!doOpen()) return false; + if (!mWrap ) return false; // open first! + + DBIterator it = mWrap->begin(); + // skip the "PAS-DB-VERSION" + + for ( ; it != mWrap->end(); ++it ) { + if ( it.key().startsWith("PAS-DB-VERSION") ) + continue; + + tqWarning( "val:%s", it.value().latin1() ); + VCardTool tool; + TQString str = it.value().stripWhiteSpace(); + Addressee::List list = tool.parseVCards( str ); + if (!list.first().isEmpty() ) { + Addressee adr = list.first(); + adr.setResource(this); + addressBook()->insertAddressee( adr ); + } + } + return true; +} +bool ResourceEvolution::save( Ticket* ticket ) { + delete ticket; + if (!m_isOpen ) return false; + + // just delete the summary so evolution will regenerate it + // on next start up + (void)TQFile::remove( TQDir::homeDirPath() + "/evolution/local/Contacts/addressbook.db.summary" ); + + + AddressBook::Iterator it; + Addressee::List list; + for ( it = addressBook()->begin(); it !=addressBook()->end(); ++it ) { + if ( (*it).resource() != this || !(*it).changed() ) + continue; + + // remove, convert add set unchanged false + list.clear(); + mWrap->remove( (*it).uid() ); + VCardTool tool; + list.append( (*it) ); + mWrap->add( (*it).uid(), tool.createVCards( list, VCard::v2_1) ); + + (*it).setChanged( false ); + } + + return true; +} +void ResourceEvolution::removeAddressee( const Addressee& rem) { + if (!m_isOpen) return; + + mWrap->remove( rem.uid() ); +} diff --git a/tdeabc/plugins/evolution/resourceevo.h b/tdeabc/plugins/evolution/resourceevo.h new file mode 100644 index 000000000..29e163e1c --- /dev/null +++ b/tdeabc/plugins/evolution/resourceevo.h @@ -0,0 +1,23 @@ +#include "resource.h" + +namespace Evolution { + class DBWrapper; +} + +namespace KABC { + class ResourceEvolution : public Resource { + public: + ResourceEvolution( const TDEConfig* config ); + ~ResourceEvolution(); + + bool doOpen(); + void doClose(); + Ticket* requestSaveTicket(); + bool load(); + bool save( Ticket* ticket ); + void removeAddressee( const Addressee& ); + private: + Evolution::DBWrapper *mWrap; + bool m_isOpen : 1; + }; +} diff --git a/tdeabc/plugins/file/CMakeLists.txt b/tdeabc/plugins/file/CMakeLists.txt new file mode 100644 index 000000000..6c17d2dc7 --- /dev/null +++ b/tdeabc/plugins/file/CMakeLists.txt @@ -0,0 +1,73 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + resourcefile.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### other data ################################ + +install( FILES file.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) + + +##### kabc_file (library) ####################### + +set( target kabc_file ) + +set( ${target}_SRCS + resourcefile.cpp resourcefileconfig.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.0.0 + LINK tdeabc-shared + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### kabc_file (module) ######################## + +set( target kabc_file ) + +set( ${target}_SRCS + resourcefileplugin.cpp +) + +tde_add_kpart( ${target} + SOURCES ${${target}_SRCS} + LINK kabc_file-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/plugins/file/Makefile.am b/tdeabc/plugins/file/Makefile.am new file mode 100644 index 000000000..d00ffea3f --- /dev/null +++ b/tdeabc/plugins/file/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourcefileconfig.h + +lib_LTLIBRARIES = libkabc_file.la +libkabc_file_la_SOURCES = resourcefile.cpp resourcefileconfig.cpp +libkabc_file_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined +libkabc_file_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(top_builddir)/tderesources/libtderesources.la $(LIB_TDEFILE) $(LIB_TDECORE) $(LIB_TDEUI) +libkabc_file_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + + +kde_module_LTLIBRARIES = kabc_file.la +kabc_file_la_SOURCES = resourcefileplugin.cpp +kabc_file_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined +kabc_file_la_LIBADD = libkabc_file.la $(LIB_QT) $(LIB_TDECORE) +kabc_file_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_file.pot + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = resourcefile.h + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = file.desktop diff --git a/tdeabc/plugins/file/file.desktop b/tdeabc/plugins/file/file.desktop new file mode 100644 index 000000000..1359dd1c6 --- /dev/null +++ b/tdeabc/plugins/file/file.desktop @@ -0,0 +1,82 @@ +[Desktop Entry] +Name=File +Name[af]=Lêer +Name[ar]=ملÙÙ‘ +Name[az]=Fayl +Name[be]=Файл +Name[bn]=ফাইল +Name[br]=Restr +Name[bs]=Datoteka +Name[ca]=Fitxer +Name[cs]=Soubor +Name[csb]=Lopk +Name[cy]=Ffeil +Name[da]=Fil +Name[de]=Datei +Name[el]=ΑÏχείο +Name[eo]=Dosiero +Name[es]=Archivo +Name[et]=Fail +Name[eu]=Fitxategia +Name[fa]=پرونده +Name[fi]=Tiedosto +Name[fr]=Fichier +Name[fy]=Triem +Name[ga]=Comhad +Name[gl]=Ficheiro +Name[he]=קובץ +Name[hi]=फ़ाइल +Name[hr]=Datoteka +Name[hsb]=Dataja +Name[hu]=Fájl +Name[id]=Berkas +Name[is]=Skrá +Name[ja]=ファイル +Name[ka]=ფáƒáƒ˜áƒšáƒ˜ +Name[kk]=Файл +Name[km]=ឯកសារ +Name[ko]=íŒŒì¼ +Name[lb]=Datei +Name[lt]=Byla +Name[lv]=Fails +Name[mk]=Датотека +Name[mn]=Файл +Name[ms]=Fail +Name[nb]=Fil +Name[nds]=Datei +Name[ne]=फाइल +Name[nl]=Bestand +Name[nn]=Fil +Name[pa]=ਫਾਇਲ +Name[pl]=Plik +Name[pt]=Ficheiro +Name[pt_BR]=Arquivo +Name[ro]=FiÅŸier +Name[ru]=Файл +Name[rw]=Idosiye +Name[se]=Fiila +Name[sk]=Súbor +Name[sl]=Datoteka +Name[sq]=Skedë +Name[sr]=Фајл +Name[sr@Latn]=Fajl +Name[sv]=Fil +Name[ta]=கோபà¯à®ªà¯ +Name[te]=దసà±à°¤à±à°°à°‚ +Name[tg]=Файл +Name[th]=à¹à¸Ÿà¹‰à¸¡ +Name[tr]=Dosya +Name[tt]=Birem +Name[uk]=Файл +Name[uz]=Fayl +Name[uz@cyrillic]=Файл +Name[vi]=Tập tin +Name[wa]=Fitchî +Name[zh_CN]=文件 +Name[zh_HK]=檔案 +Name[zh_TW]=檔案 +X-TDE-Library=kabc_file +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=file diff --git a/tdeabc/plugins/file/resourcefile.cpp b/tdeabc/plugins/file/resourcefile.cpp new file mode 100644 index 000000000..b29cf33c3 --- /dev/null +++ b/tdeabc/plugins/file/resourcefile.cpp @@ -0,0 +1,395 @@ +/* + This file is part of libkabc. + + Copyright (c) 2001,2003 Cornelius Schumacher <schumacher@kde.org> + Copyright (c) 2006 Tom Abers <tomalbers@kde.nl> + + 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 <signal.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> + +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtimer.h> + +#include <tdeapplication.h> +#include <tdeconfig.h> +#include <kdebug.h> +#include <tdeio/scheduler.h> +#include <tdelocale.h> +#include <ksavefile.h> +#include <kstandarddirs.h> + +#include "formatfactory.h" +#include "resourcefileconfig.h" +#include "stdaddressbook.h" +#include "lock.h" + +#include "resourcefile.h" + +using namespace KABC; + +ResourceFile::ResourceFile( const TDEConfig *config ) + : Resource( config ), mFormat( 0 ), + mAsynchronous( false ) +{ + TQString fileName, formatName; + + if ( config ) { + fileName = config->readPathEntry( "FileName", StdAddressBook::fileName() ); + formatName = config->readEntry( "FileFormat", "vcard" ); + } else { + fileName = StdAddressBook::fileName(); + formatName = "vcard"; + } + + init( fileName, formatName ); +} + +ResourceFile::ResourceFile( const TQString &fileName, + const TQString &formatName ) + : Resource( 0 ), mFormat( 0 ), + mAsynchronous( false ) +{ + init( fileName, formatName ); +} + +void ResourceFile::init( const TQString &fileName, const TQString &formatName ) +{ + mFormatName = formatName; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); + + if ( !mFormat ) { + mFormatName = "vcard"; + mFormat = factory->format( mFormatName ); + } + + connect( &mDirWatch, TQT_SIGNAL( dirty(const TQString&) ), TQT_SLOT( fileChanged() ) ); + connect( &mDirWatch, TQT_SIGNAL( created(const TQString&) ), TQT_SLOT( fileChanged() ) ); + connect( &mDirWatch, TQT_SIGNAL( deleted(const TQString&) ), TQT_SLOT( fileChanged() ) ); + + setFileName( fileName ); + + mLock = 0; +} + +ResourceFile::~ResourceFile() +{ + delete mFormat; + mFormat = 0; +} + +void ResourceFile::writeConfig( TDEConfig *config ) +{ + Resource::writeConfig( config ); + + if ( mFileName == StdAddressBook::fileName() ) + config->deleteEntry( "FileName" ); + else + config->writePathEntry( "FileName", mFileName ); + + config->writeEntry( "FileFormat", mFormatName ); +} + +Ticket *ResourceFile::requestSaveTicket() +{ + kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; + + if ( !addressBook() ) return 0; + + delete mLock; + mLock = new Lock( mFileName ); + + if ( mLock->lock() ) { + addressBook()->emitAddressBookLocked(); + } else { + addressBook()->error( mLock->error() ); + kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock file '" + << mFileName << "': " << mLock->error() << endl; + return 0; + } + + return createTicket( this ); +} + +void ResourceFile::releaseSaveTicket( Ticket *ticket ) +{ + delete ticket; + + delete mLock; + mLock = 0; + + addressBook()->emitAddressBookUnlocked(); +} + +bool ResourceFile::doOpen() +{ + TQFile file( mFileName ); + + if ( !file.exists() ) { + // try to create the file + bool ok = file.open( IO_WriteOnly ); + if ( ok ) + file.close(); + + return ok; + } else { + TQFileInfo fileInfo( mFileName ); + if ( readOnly() || !fileInfo.isWritable() ) { + if ( !file.open( IO_ReadOnly ) ) + return false; + } else { + if ( !file.open( IO_ReadWrite ) ) + return false; + } + + if ( file.size() == 0 ) { + file.close(); + kdDebug() << "File size is zero. Evaluating backups" << endl; + for (int i=0; i!=20; i++) + { + TQFile backup( mFileName + "__" + TQString::number(i) ); + kdDebug() << "Evaluating" << backup.name() << " size: " << backup.size() << endl; + if ( backup.size() != 0 ) + { + kdDebug() << "Restoring backup " << i << endl; + const TQString src = mFileName + "__" + TQString::number(i); + const TQString dest = mFileName; + + // remove dest + TQFile::remove( dest ); + + // copy src to dest + if ( backup.open( IO_ReadOnly ) ) { + const TQByteArray data = backup.readAll(); + + TQFile out( dest ); + if ( out.open( IO_WriteOnly ) ) { + out.writeBlock( data ); + out.close(); + } + + backup.close(); + } + return true; + } + } + return true; + } + + bool ok = mFormat->checkFormat( &file ); + file.close(); + + return ok; + } +} + +void ResourceFile::doClose() +{ +} + +bool ResourceFile::load() +{ + kdDebug(5700) << "ResourceFile::load(): '" << mFileName << "'" << endl; + + mAsynchronous = false; + + TQFile file( mFileName ); + if ( !file.open( IO_ReadOnly ) ) { + addressBook()->error( i18n( "Unable to open file '%1'." ).arg( mFileName ) ); + return false; + } + + clear(); + + return mFormat->loadAll( addressBook(), this, &file ); +} + +bool ResourceFile::asyncLoad() +{ + kdDebug(5700) << "ResourceFile::asyncLoad()" << endl; + + mAsynchronous = true; + + bool ok = load(); + + if ( !ok ) + emitLoadingError(); + else + emitLoadingFinished(); + + return true; +} + +bool ResourceFile::save( Ticket * ) +{ + kdDebug(5700) << "ResourceFile::save()" << endl; + + // Only do the logrotate dance when the __0 file is not 0 bytes. + TQFile file( mFileName + "__0" ); + if ( file.size() != 0 ) { + const TQString last = mFileName + "__20"; + kdDebug() << "deleting " << last << endl; + + TQFile::remove( last ); + + for (int i=19; i>=0; i--) + { + const TQString src = mFileName + "__" + TQString::number(i); + const TQString dest = mFileName + "__" + TQString::number(i+1); + kdDebug() << "moving " << src << " -> " << dest << endl; + + // copy src to dest + TQFile in( src ); + if ( in.open( IO_ReadOnly ) ) { + const TQByteArray data = in.readAll(); + + TQFile out( dest ); + if ( out.open( IO_WriteOnly ) ) { + out.writeBlock( data ); + out.close(); + } + + in.close(); + } + + // remove src + TQFile::remove( src ); + } + } else + kdDebug() << "Not starting logrotate __0 is 0 bytes." << endl; + + TQString extension = "__0"; + (void) KSaveFile::backupFile( mFileName, TQString::null /*directory*/, + extension ); + + mDirWatch.stopScan(); + + KSaveFile saveFile( mFileName ); + bool ok = false; + + if ( saveFile.status() == 0 && saveFile.file() ) { + mFormat->saveAll( addressBook(), this, saveFile.file() ); + ok = saveFile.close(); + } + + if ( !ok ) { + saveFile.abort(); + addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); + } + + mDirWatch.startScan(); + + return ok; +} + +bool ResourceFile::asyncSave( Ticket *ticket ) +{ + kdDebug(5700) << "ResourceFile::asyncSave()" << endl; + + bool ok = save( ticket ); + + if ( !ok ) + TQTimer::singleShot( 0, this, TQT_SLOT( emitSavingError() ) ); + else + TQTimer::singleShot( 0, this, TQT_SLOT( emitSavingFinished() ) ); + + return ok; +} + +void ResourceFile::setFileName( const TQString &fileName ) +{ + mDirWatch.stopScan(); + if ( mDirWatch.contains( mFileName ) ) + mDirWatch.removeFile( mFileName ); + + mFileName = fileName; + + mDirWatch.addFile( mFileName ); + mDirWatch.startScan(); +} + +TQString ResourceFile::fileName() const +{ + return mFileName; +} + +void ResourceFile::setFormat( const TQString &format ) +{ + mFormatName = format; + delete mFormat; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); +} + +TQString ResourceFile::format() const +{ + return mFormatName; +} + +void ResourceFile::fileChanged() +{ + kdDebug(5700) << "ResourceFile::fileChanged(): " << mFileName << endl; + + if ( !addressBook() ) + return; + + if ( mAsynchronous ) + asyncLoad(); + else { + load(); + kdDebug() << "addressBookChanged() " << endl; + addressBook()->emitAddressBookChanged(); + } +} + +void ResourceFile::removeAddressee( const Addressee &addr ) +{ + TQFile::remove( TQFile::encodeName( locateLocal( "data", "tdeabc/photos/" ) + addr.uid() ) ); + TQFile::remove( TQFile::encodeName( locateLocal( "data", "tdeabc/logos/" ) + addr.uid() ) ); + TQFile::remove( TQFile::encodeName( locateLocal( "data", "tdeabc/sounds/" ) + addr.uid() ) ); + + mAddrMap.erase( addr.uid() ); +} + +void ResourceFile::emitSavingFinished() +{ + emit savingFinished( this ); +} + +void ResourceFile::emitSavingError() +{ + emit savingError( this, i18n( "Unable to save file '%1'." ).arg( mFileName ) ); +} + +void ResourceFile::emitLoadingFinished() +{ + emit loadingFinished( this ); +} + +void ResourceFile::emitLoadingError() +{ + emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mFileName ) ); +} + +#include "resourcefile.moc" diff --git a/tdeabc/plugins/file/resourcefile.h b/tdeabc/plugins/file/resourcefile.h new file mode 100644 index 000000000..a77f55798 --- /dev/null +++ b/tdeabc/plugins/file/resourcefile.h @@ -0,0 +1,162 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_RESOURCEFILE_H +#define KABC_RESOURCEFILE_H + +#include <tdeconfig.h> +#include <kdirwatch.h> + +#include <sys/types.h> + +#include <tdeabc/resource.h> + +namespace KABC { + +class FormatPlugin; +class ResourceConfigWidget; +class Lock; + +/** + This resource allows access to a local file. +*/ +class KABC_EXPORT ResourceFile : public Resource +{ + Q_OBJECT + + public: + /** + Constructor. + + @param cfg The config object where custom resource settings are stored. + */ + ResourceFile( const TDEConfig *cfg ); + + /** + Construct file resource on file @arg fileName using format @arg formatName. + */ + ResourceFile( const TQString &fileName, const TQString &formatName = "vcard" ); + + /** + Destructor. + */ + ~ResourceFile(); + + /** + Writes the config back. + */ + virtual void writeConfig( TDEConfig *cfg ); + + /** + Tries to open the file and checks for the proper format. + This method should be called before load(). + */ + virtual bool doOpen(); + + /** + Closes the file again. + */ + virtual void doClose(); + + /** + Requests a save ticket, that is used by save() + */ + virtual Ticket *requestSaveTicket(); + + virtual void releaseSaveTicket( Ticket* ); + + /** + Loads all addressees from file to the address book. + Returns true if all addressees could be loaded otherwise false. + */ + virtual bool load(); + + virtual bool asyncLoad(); + + /** + Saves all addresses from address book to file. + Returns true if all addressees could be saved otherwise false. + + @param ticket The ticket returned by requestSaveTicket() + */ + virtual bool save( Ticket *ticket ); + + virtual bool asyncSave( Ticket *ticket ); + + /** + Set name of file to be used for saving. + */ + void setFileName( const TQString & ); + + /** + Return name of file used for loading and saving the address book. + */ + TQString fileName() const; + + /** + Sets a new format by name. + */ + void setFormat( const TQString &name ); + + /** + Returns the format name. + */ + TQString format() const; + + /** + Remove a addressee from its source. + This method is mainly called by KABC::AddressBook. + */ + virtual void removeAddressee( const Addressee& addr ); + + private slots: + void emitLoadingFinished(); + void emitLoadingError(); + void emitSavingFinished(); + void emitSavingError(); + + protected slots: + void fileChanged(); + + protected: + void init( const TQString &fileName, const TQString &format ); + + bool lock( const TQString &fileName ); + void unlock( const TQString &fileName ); + + private: + TQString mFileName; + TQString mFormatName; + + FormatPlugin *mFormat; + + Lock *mLock; + + KDirWatch mDirWatch; + + bool mAsynchronous; + + class ResourceFilePrivate; + ResourceFilePrivate *d; +}; + +} + +#endif diff --git a/tdeabc/plugins/file/resourcefileconfig.cpp b/tdeabc/plugins/file/resourcefileconfig.cpp new file mode 100644 index 000000000..7c3f4da15 --- /dev/null +++ b/tdeabc/plugins/file/resourcefileconfig.cpp @@ -0,0 +1,118 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqlabel.h> +#include <tqlayout.h> + +#include <kdebug.h> +#include <tdelocale.h> +#include <kstandarddirs.h> +#include <kdialog.h> + +#include <unistd.h> + +#include "formatfactory.h" +#include "resourcefile.h" +#include "stdaddressbook.h" + +#include "resourcefileconfig.h" + +using namespace KABC; + +ResourceFileConfig::ResourceFileConfig( TQWidget* parent, const char* name ) + : ConfigWidget( parent, name ) +{ + TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2, 0, + KDialog::spacingHint() ); + + TQLabel *label = new TQLabel( i18n( "Format:" ), this ); + mFormatBox = new KComboBox( this ); + + mainLayout->addWidget( label, 0, 0 ); + mainLayout->addWidget( mFormatBox, 0, 1 ); + + label = new TQLabel( i18n( "Location:" ), this ); + mFileNameEdit = new KURLRequester( this ); + + connect( mFileNameEdit, TQT_SIGNAL( textChanged( const TQString & ) ), + TQT_SLOT( checkFilePermissions( const TQString & ) ) ); + + mainLayout->addWidget( label, 1, 0 ); + mainLayout->addWidget( mFileNameEdit, 1, 1 ); + + FormatFactory *factory = FormatFactory::self(); + TQStringList formats = factory->formats(); + TQStringList::Iterator it; + for ( it = formats.begin(); it != formats.end(); ++it ) { + FormatInfo *info = factory->info( *it ); + if ( info ) { + mFormatTypes << (*it); + mFormatBox->insertItem( info->nameLabel ); + } + } + + mInEditMode = false; +} + +void ResourceFileConfig::setEditMode( bool value ) +{ + mFormatBox->setEnabled( !value ); + mInEditMode = value; +} + +void ResourceFileConfig::loadSettings( KRES::Resource *res ) +{ + ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceFileConfig::loadSettings(): cast failed" << endl; + return; + } + + mFormatBox->setCurrentItem( mFormatTypes.findIndex( resource->format() ) ); + + mFileNameEdit->setURL( resource->fileName() ); + if ( mFileNameEdit->url().isEmpty() ) + mFileNameEdit->setURL( KABC::StdAddressBook::fileName() ); +} + +void ResourceFileConfig::saveSettings( KRES::Resource *res ) +{ + ResourceFile *resource = dynamic_cast<ResourceFile*>( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceFileConfig::saveSettings(): cast failed" << endl; + return; + } + + if ( !mInEditMode ) + resource->setFormat( mFormatTypes[ mFormatBox->currentItem() ] ); + + resource->setFileName( mFileNameEdit->url() ); +} + +void ResourceFileConfig::checkFilePermissions( const TQString& fileName ) +{ + // If file exist but is not writeable... + if ( access( TQFile::encodeName( fileName ), F_OK ) == 0 ) + emit setReadOnly( access( TQFile::encodeName( fileName ), W_OK ) < 0 ); +} + +#include "resourcefileconfig.moc" diff --git a/tdeabc/plugins/file/resourcefileconfig.h b/tdeabc/plugins/file/resourcefileconfig.h new file mode 100644 index 000000000..18c217eda --- /dev/null +++ b/tdeabc/plugins/file/resourcefileconfig.h @@ -0,0 +1,57 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 RESOURCEFILECONFIG_H +#define RESOURCEFILECONFIG_H + +#include <kcombobox.h> +#include <kurlrequester.h> + +#include <tderesources/configwidget.h> + +namespace KABC { + +class KABC_EXPORT ResourceFileConfig : public KRES::ConfigWidget +{ + Q_OBJECT + +public: + ResourceFileConfig( TQWidget* parent = 0, const char* name = 0 ); + + void setEditMode( bool value ); + +public slots: + void loadSettings( KRES::Resource *resource ); + void saveSettings( KRES::Resource *resource ); + +protected slots: + void checkFilePermissions( const TQString& fileName ); + +private: + KComboBox* mFormatBox; + KURLRequester* mFileNameEdit; + bool mInEditMode; + + TQStringList mFormatTypes; +}; + +} + +#endif diff --git a/tdeabc/plugins/file/resourcefileplugin.cpp b/tdeabc/plugins/file/resourcefileplugin.cpp new file mode 100644 index 000000000..4dce19bc0 --- /dev/null +++ b/tdeabc/plugins/file/resourcefileplugin.cpp @@ -0,0 +1,32 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 "resourcefile.h" +#include "resourcefileconfig.h" + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_file() + { + return new KRES::PluginFactory<ResourceFile, ResourceFileConfig>(); + } +} diff --git a/tdeabc/plugins/ldaptdeio/CMakeLists.txt b/tdeabc/plugins/ldaptdeio/CMakeLists.txt new file mode 100644 index 000000000..820f6e017 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/CMakeLists.txt @@ -0,0 +1,73 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefiles +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + resourceldaptdeio.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### other data ################################ + +install( FILES ldaptdeio.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) + + +##### kabc_ldaptdeio ############################## + +set( target kabc_ldaptdeio ) + +set( ${target}_SRCS + resourceldaptdeio.cpp resourceldaptdeioconfig.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.0.0 + LINK tdeabc-shared + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### kabc_ldaptdeio ############################## + +set( target kabc_ldaptdeio ) + +set( ${target}_SRCS + resourceldaptdeioplugin.cpp +) + +tde_add_kpart( ${target} + SOURCES ${${target}_SRCS} + LINK kabc_ldaptdeio-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/plugins/ldaptdeio/Makefile.am b/tdeabc/plugins/ldaptdeio/Makefile.am new file mode 100644 index 000000000..bc81d13d8 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourceldaptdeioconfig.h + +lib_LTLIBRARIES = libkabc_ldaptdeio.la +libkabc_ldaptdeio_la_SOURCES = resourceldaptdeio.cpp resourceldaptdeioconfig.cpp +libkabc_ldaptdeio_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined +libkabc_ldaptdeio_la_LIBADD = $(LIB_KABC) $(LIB_KIO) $(LIB_QT) $(top_builddir)/tderesources/libtderesources.la $(LIB_TDEUI) $(LIB_TDECORE) +libkabc_ldaptdeio_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +kde_module_LTLIBRARIES = kabc_ldaptdeio.la +kabc_ldaptdeio_la_SOURCES = resourceldaptdeioplugin.cpp +kabc_ldaptdeio_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kabc_ldaptdeio_la_LIBADD = libkabc_ldaptdeio.la $(LIB_QT) $(LIB_TDECORE) + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_ldaptdeio.pot + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = resourceldaptdeio.h + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = ldaptdeio.desktop + +resourceldaptdeioplugin.lo: ../../addressee.h diff --git a/tdeabc/plugins/ldaptdeio/ldaptdeio.desktop b/tdeabc/plugins/ldaptdeio/ldaptdeio.desktop new file mode 100644 index 000000000..9bcd13337 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/ldaptdeio.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=LDAP +Name[bn]=à¦à¦²-ডি-à¦-পি (LDAP) +Name[hi]=à¤à¤²à¤¡à¥€à¤à¤ªà¥€ (LDAP) +Name[te]=à°Žà°²à±à°¡à°¿à°à°ªà°¿ +X-TDE-Library=kabc_ldaptdeio +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=ldaptdeio diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeio.cpp b/tdeabc/plugins/ldaptdeio/resourceldaptdeio.cpp new file mode 100644 index 000000000..ea1a4294c --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeio.cpp @@ -0,0 +1,1041 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> + + 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 <tqapplication.h> +#include <tqbuffer.h> +#include <tqfile.h> + +#include <kdebug.h> +#include <tdeglobal.h> +#include <kstandarddirs.h> +#include <klineedit.h> +#include <tdelocale.h> +#include <tdeconfig.h> +#include <kstringhandler.h> +#include <tdetempfile.h> + +#include <stdlib.h> +#include <tdeio/netaccess.h> +#include <tdeabc/ldif.h> +#include <tdeabc/ldapurl.h> + +#include "resourceldaptdeio.h" +#include "resourceldaptdeioconfig.h" + +using namespace KABC; + +// Hack from Netaccess +void tqt_enter_modal( TQWidget *widget ); +void tqt_leave_modal( TQWidget *widget ); + +class ResourceLDAPTDEIO::ResourceLDAPTDEIOPrivate +{ + public: + LDIF mLdif; + bool mTLS,mSSL,mSubTree; + TQString mResultDn; + Addressee mAddr; + Address mAd; + Resource::Iterator mSaveIt; + bool mSASL; + TQString mMech; + TQString mRealm, mBindDN; + LDAPUrl mLDAPUrl; + int mVer, mSizeLimit, mTimeLimit, mRDNPrefix; + int mError; + int mCachePolicy; + bool mReadOnly; + bool mAutoCache; + TQString mCacheDst; + KTempFile *mTmp; +}; + +ResourceLDAPTDEIO::ResourceLDAPTDEIO( const TDEConfig *config ) + : Resource( config ) +{ + d = new ResourceLDAPTDEIOPrivate; + if ( config ) { + TQMap<TQString, TQString> attrList; + TQStringList attributes = config->readListEntry( "LdapAttributes" ); + for ( uint pos = 0; pos < attributes.count(); pos += 2 ) + mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] ); + + mUser = config->readEntry( "LdapUser" ); + mPassword = KStringHandler::obscure( config->readEntry( "LdapPassword" ) ); + mDn = config->readEntry( "LdapDn" ); + mHost = config->readEntry( "LdapHost" ); + mPort = config->readNumEntry( "LdapPort", 389 ); + mFilter = config->readEntry( "LdapFilter" ); + mAnonymous = config->readBoolEntry( "LdapAnonymous" ); + d->mTLS = config->readBoolEntry( "LdapTLS" ); + d->mSSL = config->readBoolEntry( "LdapSSL" ); + d->mSubTree = config->readBoolEntry( "LdapSubTree" ); + d->mSASL = config->readBoolEntry( "LdapSASL" ); + d->mMech = config->readEntry( "LdapMech" ); + d->mRealm = config->readEntry( "LdapRealm" ); + d->mBindDN = config->readEntry( "LdapBindDN" ); + d->mVer = config->readNumEntry( "LdapVer", 3 ); + d->mTimeLimit = config->readNumEntry( "LdapTimeLimit", 0 ); + d->mSizeLimit = config->readNumEntry( "LdapSizeLimit", 0 ); + d->mRDNPrefix = config->readNumEntry( "LdapRDNPrefix", 0 ); + d->mCachePolicy = config->readNumEntry( "LdapCachePolicy", 0 ); + d->mAutoCache = config->readBoolEntry( "LdapAutoCache", true ); + } else { + mPort = 389; + mAnonymous = true; + mUser = mPassword = mHost = mFilter = mDn = ""; + d->mMech = d->mRealm = d->mBindDN = ""; + d->mTLS = d->mSSL = d->mSubTree = d->mSASL = false; + d->mVer = 3; d->mRDNPrefix = 0; + d->mTimeLimit = d->mSizeLimit = 0; + d->mCachePolicy = Cache_No; + d->mAutoCache = true; + } + d->mCacheDst = TDEGlobal::dirs()->saveLocation("cache", "ldaptdeio") + "/" + + type() + "_" + identifier(); + init(); +} + +ResourceLDAPTDEIO::~ResourceLDAPTDEIO() +{ + delete d; +} + +void ResourceLDAPTDEIO::enter_loop() +{ + TQWidget dummy(0,0,(WFlags)(WType_Dialog | WShowModal)); + dummy.setFocusPolicy( TQ_NoFocus ); + tqt_enter_modal(&dummy); + tqApp->enter_loop(); + tqt_leave_modal(&dummy); +} + +void ResourceLDAPTDEIO::entries( TDEIO::Job*, const TDEIO::UDSEntryList & list ) +{ + TDEIO::UDSEntryListConstIterator it = list.begin(); + TDEIO::UDSEntryListConstIterator end = list.end(); + for (; it != end; ++it) { + TDEIO::UDSEntry::ConstIterator it2 = (*it).begin(); + for( ; it2 != (*it).end(); it2++ ) { + if ( (*it2).m_uds == TDEIO::UDS_URL ) { + KURL tmpurl( (*it2).m_str ); + d->mResultDn = tmpurl.path(); + kdDebug(7125) << "findUid(): " << d->mResultDn << endl; + if ( d->mResultDn.startsWith("/") ) d->mResultDn.remove(0,1); + return; + } + } + } +} + +void ResourceLDAPTDEIO::listResult( TDEIO::Job *job) +{ + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) + mErrorMsg = job->errorString(); + else + mErrorMsg = ""; + tqApp->exit_loop(); +} + +TQString ResourceLDAPTDEIO::findUid( const TQString &uid ) +{ + LDAPUrl url( d->mLDAPUrl ); + TDEIO::UDSEntry entry; + + mErrorMsg = d->mResultDn = ""; + + url.setAttributes("dn"); + url.setFilter( "(" + mAttributes[ "uid" ] + "=" + uid + ")" + mFilter ); + url.setExtension( "x-dir", "one" ); + + kdDebug(7125) << "ResourceLDAPTDEIO::findUid() uid: " << uid << " url " << + url.prettyURL() << endl; + + TDEIO::ListJob * listJob = TDEIO::listDir( url, false /* no GUI */ ); + connect( listJob, + TQT_SIGNAL( entries( TDEIO::Job *, const TDEIO::UDSEntryList& ) ), + TQT_SLOT( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) ); + connect( listJob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( listResult( TDEIO::Job* ) ) ); + + enter_loop(); + return d->mResultDn; +} + +TQCString ResourceLDAPTDEIO::addEntry( const TQString &attr, const TQString &value, bool mod ) +{ + TQCString tmp; + if ( !attr.isEmpty() ) { + if ( mod ) tmp += LDIF::assembleLine( "replace", attr ) + "\n"; + tmp += LDIF::assembleLine( attr, value ) + "\n"; + if ( mod ) tmp += "-\n"; + } + return ( tmp ); +} + +bool ResourceLDAPTDEIO::AddresseeToLDIF( TQByteArray &ldif, const Addressee &addr, + const TQString &olddn ) +{ + TQCString tmp; + TQString dn; + TQByteArray data; + bool mod = false; + + if ( olddn.isEmpty() ) { + //insert new entry + switch ( d->mRDNPrefix ) { + case 1: + dn = mAttributes[ "uid" ] + "=" + addr.uid() + "," +mDn; + break; + case 0: + default: + dn = mAttributes[ "commonName" ] + "=" + addr.assembledName() + "," +mDn; + break; + } + } else { + //modify existing entry + mod = true; + if ( olddn.startsWith( mAttributes[ "uid" ] ) ) { + dn = mAttributes[ "uid" ] + "=" + addr.uid() + "," + olddn.section( ',', 1 ); + } else if ( olddn.startsWith( mAttributes[ "commonName" ] ) ) { + dn = mAttributes[ "commonName" ] + "=" + addr.assembledName() + "," + + olddn.section( ',', 1 ); + } else { + dn = olddn; + } + + if ( olddn.lower() != dn.lower() ) { + tmp = LDIF::assembleLine( "dn", olddn ) + "\n"; + tmp += "changetype: modrdn\n"; + tmp += LDIF::assembleLine( "newrdn", dn.section( ',', 0, 0 ) ) + "\n"; + tmp += "deleteoldrdn: 1\n\n"; + } + } + + + tmp += LDIF::assembleLine( "dn", dn ) + "\n"; + if ( mod ) tmp += "changetype: modify\n"; + if ( !mod ) { + tmp += "objectClass: top\n"; + TQStringList obclass = TQStringList::split( ',', mAttributes[ "objectClass" ] ); + for ( TQStringList::iterator it = obclass.begin(); it != obclass.end(); it++ ) { + tmp += LDIF::assembleLine( "objectClass", *it ) + "\n"; + } + } + + tmp += addEntry( mAttributes[ "commonName" ], addr.assembledName(), mod ); + tmp += addEntry( mAttributes[ "formattedName" ], addr.formattedName(), mod ); + tmp += addEntry( mAttributes[ "givenName" ], addr.givenName(), mod ); + tmp += addEntry( mAttributes[ "familyName" ], addr.familyName(), mod ); + tmp += addEntry( mAttributes[ "uid" ], addr.uid(), mod ); + + PhoneNumber number; + number = addr.phoneNumber( PhoneNumber::Home ); + tmp += addEntry( mAttributes[ "phoneNumber" ], number.number().utf8(), mod ); + number = addr.phoneNumber( PhoneNumber::Work ); + tmp += addEntry( mAttributes[ "telephoneNumber" ], number.number().utf8(), mod ); + number = addr.phoneNumber( PhoneNumber::Fax ); + tmp += addEntry( mAttributes[ "facsimileTelephoneNumber" ], number.number().utf8(), mod ); + number = addr.phoneNumber( PhoneNumber::Cell ); + tmp += addEntry( mAttributes[ "mobile" ], number.number().utf8(), mod ); + number = addr.phoneNumber( PhoneNumber::Pager ); + tmp += addEntry( mAttributes[ "pager" ], number.number().utf8(), mod ); + + tmp += addEntry( mAttributes[ "description" ], addr.note(), mod ); + tmp += addEntry( mAttributes[ "title" ], addr.title(), mod ); + tmp += addEntry( mAttributes[ "organization" ], addr.organization(), mod ); + + Address ad = addr.address( Address::Home ); + if ( !ad.isEmpty() ) { + tmp += addEntry( mAttributes[ "street" ], ad.street(), mod ); + tmp += addEntry( mAttributes[ "state" ], ad.region(), mod ); + tmp += addEntry( mAttributes[ "city" ], ad.locality(), mod ); + tmp += addEntry( mAttributes[ "postalcode" ], ad.postalCode(), mod ); + } + + TQStringList emails = addr.emails(); + TQStringList::ConstIterator mailIt = emails.begin(); + + if ( !mAttributes[ "mail" ].isEmpty() ) { + if ( mod ) tmp += + LDIF::assembleLine( "replace", mAttributes[ "mail" ] ) + "\n"; + if ( mailIt != emails.end() ) { + tmp += LDIF::assembleLine( mAttributes[ "mail" ], *mailIt ) + "\n"; + mailIt ++; + } + if ( mod && mAttributes[ "mail" ] != mAttributes[ "mailAlias" ] ) tmp += "-\n"; + } + + if ( !mAttributes[ "mailAlias" ].isEmpty() ) { + if ( mod && mAttributes[ "mail" ] != mAttributes[ "mailAlias" ] ) tmp += + LDIF::assembleLine( "replace", mAttributes[ "mailAlias" ] ) + "\n"; + for ( ; mailIt != emails.end(); ++mailIt ) { + tmp += LDIF::assembleLine( mAttributes[ "mailAlias" ], *mailIt ) + "\n" ; + } + if ( mod ) tmp += "-\n"; + } + + if ( !mAttributes[ "jpegPhoto" ].isEmpty() ) { + TQByteArray pic; + TQBuffer buffer( pic ); + buffer.open( IO_WriteOnly ); + addr.photo().data().save( &buffer, "JPEG" ); + + if ( mod ) tmp += + LDIF::assembleLine( "replace", mAttributes[ "jpegPhoto" ] ) + "\n"; + tmp += LDIF::assembleLine( mAttributes[ "jpegPhoto" ], pic, 76 ) + "\n"; + if ( mod ) tmp += "-\n"; + } + + tmp += "\n"; + kdDebug(7125) << "ldif: " << TQString(TQString::fromUtf8(tmp)) << endl; + ldif = tmp; + return true; +} + +void ResourceLDAPTDEIO::setReadOnly( bool value ) +{ + //save the original readonly flag, because offline using disables writing + d->mReadOnly = true; + Resource::setReadOnly( value ); +} + +void ResourceLDAPTDEIO::init() +{ + if ( mPort == 0 ) mPort = 389; + + /** + If you want to add new attributes, append them here, add a + translation string in the ctor of AttributesDialog and + handle them in the load() method below. + These are the default values + */ + if ( !mAttributes.contains("objectClass") ) + mAttributes.insert( "objectClass", "inetOrgPerson" ); + if ( !mAttributes.contains("commonName") ) + mAttributes.insert( "commonName", "cn" ); + if ( !mAttributes.contains("formattedName") ) + mAttributes.insert( "formattedName", "displayName" ); + if ( !mAttributes.contains("familyName") ) + mAttributes.insert( "familyName", "sn" ); + if ( !mAttributes.contains("givenName") ) + mAttributes.insert( "givenName", "givenName" ); + if ( !mAttributes.contains("mail") ) + mAttributes.insert( "mail", "mail" ); + if ( !mAttributes.contains("mailAlias") ) + mAttributes.insert( "mailAlias", "" ); + if ( !mAttributes.contains("phoneNumber") ) + mAttributes.insert( "phoneNumber", "homePhone" ); + if ( !mAttributes.contains("telephoneNumber") ) + mAttributes.insert( "telephoneNumber", "telephoneNumber" ); + if ( !mAttributes.contains("facsimileTelephoneNumber") ) + mAttributes.insert( "facsimileTelephoneNumber", "facsimileTelephoneNumber" ); + if ( !mAttributes.contains("mobile") ) + mAttributes.insert( "mobile", "mobile" ); + if ( !mAttributes.contains("pager") ) + mAttributes.insert( "pager", "pager" ); + if ( !mAttributes.contains("description") ) + mAttributes.insert( "description", "description" ); + + if ( !mAttributes.contains("title") ) + mAttributes.insert( "title", "title" ); + if ( !mAttributes.contains("street") ) + mAttributes.insert( "street", "street" ); + if ( !mAttributes.contains("state") ) + mAttributes.insert( "state", "st" ); + if ( !mAttributes.contains("city") ) + mAttributes.insert( "city", "l" ); + if ( !mAttributes.contains("organization") ) + mAttributes.insert( "organization", "o" ); + if ( !mAttributes.contains("postalcode") ) + mAttributes.insert( "postalcode", "postalCode" ); + + if ( !mAttributes.contains("uid") ) + mAttributes.insert( "uid", "uid" ); + if ( !mAttributes.contains("jpegPhoto") ) + mAttributes.insert( "jpegPhoto", "jpegPhoto" ); + + d->mLDAPUrl = KURL(); + if ( !mAnonymous ) { + d->mLDAPUrl.setUser( mUser ); + d->mLDAPUrl.setPass( mPassword ); + } + d->mLDAPUrl.setProtocol( d->mSSL ? "ldaps" : "ldap"); + d->mLDAPUrl.setHost( mHost ); + d->mLDAPUrl.setPort( mPort ); + d->mLDAPUrl.setDn( mDn ); + + if (!mAttributes.empty()) { + TQMap<TQString,TQString>::Iterator it; + TQStringList attr; + for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) { + if ( !it.data().isEmpty() && it.key() != "objectClass" ) + attr.append( it.data() ); + } + d->mLDAPUrl.setAttributes( attr ); + } + + d->mLDAPUrl.setScope( d->mSubTree ? LDAPUrl::Sub : LDAPUrl::One ); + if ( !mFilter.isEmpty() && mFilter != "(objectClass=*)" ) + d->mLDAPUrl.setFilter( mFilter ); + d->mLDAPUrl.setExtension( "x-dir", "base" ); + if ( d->mTLS ) d->mLDAPUrl.setExtension( "x-tls", "" ); + d->mLDAPUrl.setExtension( "x-ver", TQString::number( d->mVer ) ); + if ( d->mSizeLimit ) + d->mLDAPUrl.setExtension( "x-sizelimit", TQString::number( d->mSizeLimit ) ); + if ( d->mTimeLimit ) + d->mLDAPUrl.setExtension( "x-timelimit", TQString::number( d->mTimeLimit ) ); + if ( d->mSASL ) { + d->mLDAPUrl.setExtension( "x-sasl", "" ); + if ( !d->mBindDN.isEmpty() ) d->mLDAPUrl.setExtension( "bindname", d->mBindDN ); + if ( !d->mMech.isEmpty() ) d->mLDAPUrl.setExtension( "x-mech", d->mMech ); + if ( !d->mRealm.isEmpty() ) d->mLDAPUrl.setExtension( "x-realm", d->mRealm ); + } + + d->mReadOnly = readOnly(); + + kdDebug(7125) << "resource_ldaptdeio url: " << d->mLDAPUrl.prettyURL() << endl; +} + +void ResourceLDAPTDEIO::writeConfig( TDEConfig *config ) +{ + Resource::writeConfig( config ); + + config->writeEntry( "LdapUser", mUser ); + config->writeEntry( "LdapPassword", KStringHandler::obscure( mPassword ) ); + config->writeEntry( "LdapDn", mDn ); + config->writeEntry( "LdapHost", mHost ); + config->writeEntry( "LdapPort", mPort ); + config->writeEntry( "LdapFilter", mFilter ); + config->writeEntry( "LdapAnonymous", mAnonymous ); + config->writeEntry( "LdapTLS", d->mTLS ); + config->writeEntry( "LdapSSL", d->mSSL ); + config->writeEntry( "LdapSubTree", d->mSubTree ); + config->writeEntry( "LdapSASL", d->mSASL ); + config->writeEntry( "LdapMech", d->mMech ); + config->writeEntry( "LdapVer", d->mVer ); + config->writeEntry( "LdapTimeLimit", d->mTimeLimit ); + config->writeEntry( "LdapSizeLimit", d->mSizeLimit ); + config->writeEntry( "LdapRDNPrefix", d->mRDNPrefix ); + config->writeEntry( "LdapRealm", d->mRealm ); + config->writeEntry( "LdapBindDN", d->mBindDN ); + config->writeEntry( "LdapCachePolicy", d->mCachePolicy ); + config->writeEntry( "LdapAutoCache", d->mAutoCache ); + + TQStringList attributes; + TQMap<TQString, TQString>::Iterator it; + for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) + attributes << it.key() << it.data(); + + config->writeEntry( "LdapAttributes", attributes ); +} + +Ticket *ResourceLDAPTDEIO::requestSaveTicket() +{ + if ( !addressBook() ) { + kdDebug(7125) << "no addressbook" << endl; + return 0; + } + + return createTicket( this ); +} + +void ResourceLDAPTDEIO::releaseSaveTicket( Ticket *ticket ) +{ + delete ticket; +} + +bool ResourceLDAPTDEIO::doOpen() +{ + return true; +} + +void ResourceLDAPTDEIO::doClose() +{ +} + +void ResourceLDAPTDEIO::createCache() +{ + d->mTmp = NULL; + if ( d->mCachePolicy == Cache_NoConnection && d->mAutoCache ) { + d->mTmp = new KTempFile( d->mCacheDst, "tmp" ); + d->mTmp->setAutoDelete( true ); + } +} + +void ResourceLDAPTDEIO::activateCache() +{ + if ( d->mTmp && d->mError == 0 ) { + d->mTmp->close(); + rename( TQFile::encodeName( d->mTmp->name() ), TQFile::encodeName( d->mCacheDst ) ); + } + if ( d->mTmp ) { + delete d->mTmp; + d->mTmp = 0; + } +} + +TDEIO::Job *ResourceLDAPTDEIO::loadFromCache() +{ + TDEIO::Job *job = NULL; + if ( d->mCachePolicy == Cache_Always || + ( d->mCachePolicy == Cache_NoConnection && + d->mError == TDEIO::ERR_COULD_NOT_CONNECT ) ) { + + d->mAddr = Addressee(); + d->mAd = Address( Address::Home ); + //initialize ldif parser + d->mLdif.startParsing(); + + Resource::setReadOnly( true ); + + KURL url( d->mCacheDst ); + job = TDEIO::get( url, true, false ); + connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( data( TDEIO::Job*, const TQByteArray& ) ) ); + } + return job; +} + +bool ResourceLDAPTDEIO::load() +{ + kdDebug(7125) << "ResourceLDAPTDEIO::load()" << endl; + TDEIO::Job *job; + + clear(); + //clear the addressee + d->mAddr = Addressee(); + d->mAd = Address( Address::Home ); + //initialize ldif parser + d->mLdif.startParsing(); + + //set to original settings, offline use will disable writing + Resource::setReadOnly( d->mReadOnly ); + + createCache(); + if ( d->mCachePolicy != Cache_Always ) { + job = TDEIO::get( d->mLDAPUrl, true, false ); + connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( data( TDEIO::Job*, const TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) ); + enter_loop(); + } + + job = loadFromCache(); + if ( job ) { + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) ); + enter_loop(); + } + if ( mErrorMsg.isEmpty() ) { + kdDebug(7125) << "ResourceLDAPTDEIO load ok!" << endl; + return true; + } else { + kdDebug(7125) << "ResourceLDAPTDEIO load finished with error: " << mErrorMsg << endl; + addressBook()->error( mErrorMsg ); + return false; + } +} + +bool ResourceLDAPTDEIO::asyncLoad() +{ + clear(); + //clear the addressee + d->mAddr = Addressee(); + d->mAd = Address( Address::Home ); + //initialize ldif parser + d->mLdif.startParsing(); + + Resource::setReadOnly( d->mReadOnly ); + + createCache(); + if ( d->mCachePolicy != Cache_Always ) { + TDEIO::Job *job = TDEIO::get( d->mLDAPUrl, true, false ); + connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( data( TDEIO::Job*, const TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( result( TDEIO::Job* ) ) ); + } else { + result( NULL ); + } + return true; +} + +void ResourceLDAPTDEIO::data( TDEIO::Job *, const TQByteArray &data ) +{ + if ( data.size() ) { + d->mLdif.setLDIF( data ); + if ( d->mTmp ) { + d->mTmp->file()->writeBlock( data ); + } + } else { + d->mLdif.endLDIF(); + } + + LDIF::ParseVal ret; + TQString name; + TQByteArray value; + do { + ret = d->mLdif.nextItem(); + switch ( ret ) { + case LDIF::NewEntry: + kdDebug(7125) << "new entry: " << d->mLdif.dn() << endl; + break; + case LDIF::Item: + name = d->mLdif.attr().lower(); + value = d->mLdif.val(); + if ( name == mAttributes[ "commonName" ].lower() ) { + if ( !d->mAddr.formattedName().isEmpty() ) { + TQString fn = d->mAddr.formattedName(); + d->mAddr.setNameFromString( TQString::fromUtf8( value, value.size() ) ); + d->mAddr.setFormattedName( fn ); + } else + d->mAddr.setNameFromString( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "formattedName" ].lower() ) { + d->mAddr.setFormattedName( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "givenName" ].lower() ) { + d->mAddr.setGivenName( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "mail" ].lower() ) { + d->mAddr.insertEmail( TQString::fromUtf8( value, value.size() ), true ); + } else if ( name == mAttributes[ "mailAlias" ].lower() ) { + d->mAddr.insertEmail( TQString::fromUtf8( value, value.size() ), false ); + } else if ( name == mAttributes[ "phoneNumber" ].lower() ) { + PhoneNumber phone; + phone.setNumber( TQString::fromUtf8( value, value.size() ) ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "telephoneNumber" ].lower() ) { + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), + PhoneNumber::Work ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "facsimileTelephoneNumber" ].lower() ) { + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), + PhoneNumber::Fax ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "mobile" ].lower() ) { + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), + PhoneNumber::Cell ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "pager" ].lower() ) { + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), + PhoneNumber::Pager ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "description" ].lower() ) { + d->mAddr.setNote( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "title" ].lower() ) { + d->mAddr.setTitle( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "street" ].lower() ) { + d->mAd.setStreet( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "state" ].lower() ) { + d->mAd.setRegion( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "city" ].lower() ) { + d->mAd.setLocality( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "postalcode" ].lower() ) { + d->mAd.setPostalCode( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "organization" ].lower() ) { + d->mAddr.setOrganization( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "familyName" ].lower() ) { + d->mAddr.setFamilyName( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "uid" ].lower() ) { + d->mAddr.setUid( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "jpegPhoto" ].lower() ) { + KABC::Picture photo; + TQImage img( value ); + if ( !img.isNull() ) { + photo.setData( img ); + photo.setType( "image/jpeg" ); + d->mAddr.setPhoto( photo ); + } + } + + break; + case LDIF::EndEntry: { + d->mAddr.setResource( this ); + d->mAddr.insertAddress( d->mAd ); + d->mAddr.setChanged( false ); + insertAddressee( d->mAddr ); + //clear the addressee + d->mAddr = Addressee(); + d->mAd = Address( Address::Home ); + } + break; + default: + break; + } + } while ( ret != LDIF::MoreData ); +} + +void ResourceLDAPTDEIO::loadCacheResult( TDEIO::Job *job ) +{ + mErrorMsg = ""; + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) { + mErrorMsg = job->errorString(); + } + if ( !mErrorMsg.isEmpty() ) + emit loadingError( this, mErrorMsg ); + else + emit loadingFinished( this ); +} + +void ResourceLDAPTDEIO::result( TDEIO::Job *job ) +{ + mErrorMsg = ""; + if ( job ) { + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) { + mErrorMsg = job->errorString(); + } + } else { + d->mError = 0; + } + activateCache(); + + TDEIO::Job *cjob; + cjob = loadFromCache(); + if ( cjob ) { + connect( cjob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( loadCacheResult( TDEIO::Job* ) ) ); + } else { + if ( !mErrorMsg.isEmpty() ) + emit loadingError( this, mErrorMsg ); + else + emit loadingFinished( this ); + } +} + +bool ResourceLDAPTDEIO::save( Ticket* ) +{ + kdDebug(7125) << "ResourceLDAPTDEIO save" << endl; + + d->mSaveIt = begin(); + TDEIO::Job *job = TDEIO::put( d->mLDAPUrl, -1, true, false, false ); + connect( job, TQT_SIGNAL( dataReq( TDEIO::Job*, TQByteArray& ) ), + this, TQT_SLOT( saveData( TDEIO::Job*, TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) ); + enter_loop(); + if ( mErrorMsg.isEmpty() ) { + kdDebug(7125) << "ResourceLDAPTDEIO save ok!" << endl; + return true; + } else { + kdDebug(7125) << "ResourceLDAPTDEIO finished with error: " << mErrorMsg << endl; + addressBook()->error( mErrorMsg ); + return false; + } +} + +bool ResourceLDAPTDEIO::asyncSave( Ticket* ) +{ + kdDebug(7125) << "ResourceLDAPTDEIO asyncSave" << endl; + d->mSaveIt = begin(); + TDEIO::Job *job = TDEIO::put( d->mLDAPUrl, -1, true, false, false ); + connect( job, TQT_SIGNAL( dataReq( TDEIO::Job*, TQByteArray& ) ), + this, TQT_SLOT( saveData( TDEIO::Job*, TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( saveResult( TDEIO::Job* ) ) ); + return true; +} + +void ResourceLDAPTDEIO::syncLoadSaveResult( TDEIO::Job *job ) +{ + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) + mErrorMsg = job->errorString(); + else + mErrorMsg = ""; + activateCache(); + + tqApp->exit_loop(); +} + +void ResourceLDAPTDEIO::saveResult( TDEIO::Job *job ) +{ + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) + emit savingError( this, job->errorString() ); + else + emit savingFinished( this ); +} + +void ResourceLDAPTDEIO::saveData( TDEIO::Job*, TQByteArray& data ) +{ + while ( d->mSaveIt != end() && + !(*d->mSaveIt).changed() ) d->mSaveIt++; + + if ( d->mSaveIt == end() ) { + kdDebug(7125) << "ResourceLDAPTDEIO endData" << endl; + data.resize(0); + return; + } + + kdDebug(7125) << "ResourceLDAPTDEIO saveData: " << (*d->mSaveIt).assembledName() << endl; + + AddresseeToLDIF( data, *d->mSaveIt, findUid( (*d->mSaveIt).uid() ) ); +// kdDebug(7125) << "ResourceLDAPTDEIO save LDIF: " << TQString::fromUtf8(data) << endl; + // mark as unchanged + (*d->mSaveIt).setChanged( false ); + + d->mSaveIt++; +} + +void ResourceLDAPTDEIO::removeAddressee( const Addressee& addr ) +{ + TQString dn = findUid( addr.uid() ); + + kdDebug(7125) << "ResourceLDAPTDEIO: removeAddressee: " << dn << endl; + + if ( !mErrorMsg.isEmpty() ) { + addressBook()->error( mErrorMsg ); + return; + } + if ( !dn.isEmpty() ) { + kdDebug(7125) << "ResourceLDAPTDEIO: found uid: " << dn << endl; + LDAPUrl url( d->mLDAPUrl ); + url.setPath( "/" + dn ); + url.setExtension( "x-dir", "base" ); + url.setScope( LDAPUrl::Base ); + if ( TDEIO::NetAccess::del( url, NULL ) ) mAddrMap.erase( addr.uid() ); + } else { + //maybe it's not saved yet + mAddrMap.erase( addr.uid() ); + } +} + + +void ResourceLDAPTDEIO::setUser( const TQString &user ) +{ + mUser = user; +} + +TQString ResourceLDAPTDEIO::user() const +{ + return mUser; +} + +void ResourceLDAPTDEIO::setPassword( const TQString &password ) +{ + mPassword = password; +} + +TQString ResourceLDAPTDEIO::password() const +{ + return mPassword; +} + +void ResourceLDAPTDEIO::setDn( const TQString &dn ) +{ + mDn = dn; +} + +TQString ResourceLDAPTDEIO::dn() const +{ + return mDn; +} + +void ResourceLDAPTDEIO::setHost( const TQString &host ) +{ + mHost = host; +} + +TQString ResourceLDAPTDEIO::host() const +{ + return mHost; +} + +void ResourceLDAPTDEIO::setPort( int port ) +{ + mPort = port; +} + +int ResourceLDAPTDEIO::port() const +{ + return mPort; +} + +void ResourceLDAPTDEIO::setVer( int ver ) +{ + d->mVer = ver; +} + +int ResourceLDAPTDEIO::ver() const +{ + return d->mVer; +} + +void ResourceLDAPTDEIO::setSizeLimit( int sizelimit ) +{ + d->mSizeLimit = sizelimit; +} + +int ResourceLDAPTDEIO::sizeLimit() +{ + return d->mSizeLimit; +} + +void ResourceLDAPTDEIO::setTimeLimit( int timelimit ) +{ + d->mTimeLimit = timelimit; +} + +int ResourceLDAPTDEIO::timeLimit() +{ + return d->mTimeLimit; +} + +void ResourceLDAPTDEIO::setFilter( const TQString &filter ) +{ + mFilter = filter; +} + +TQString ResourceLDAPTDEIO::filter() const +{ + return mFilter; +} + +void ResourceLDAPTDEIO::setIsAnonymous( bool value ) +{ + mAnonymous = value; +} + +bool ResourceLDAPTDEIO::isAnonymous() const +{ + return mAnonymous; +} + +void ResourceLDAPTDEIO::setIsTLS( bool value ) +{ + d->mTLS = value; +} + +bool ResourceLDAPTDEIO::isTLS() const +{ + return d->mTLS; +} +void ResourceLDAPTDEIO::setIsSSL( bool value ) +{ + d->mSSL = value; +} + +bool ResourceLDAPTDEIO::isSSL() const +{ + return d->mSSL; +} + +void ResourceLDAPTDEIO::setIsSubTree( bool value ) +{ + d->mSubTree = value; +} + +bool ResourceLDAPTDEIO::isSubTree() const +{ + return d->mSubTree; +} + +void ResourceLDAPTDEIO::setAttributes( const TQMap<TQString, TQString> &attributes ) +{ + mAttributes = attributes; +} + +TQMap<TQString, TQString> ResourceLDAPTDEIO::attributes() const +{ + return mAttributes; +} + +void ResourceLDAPTDEIO::setRDNPrefix( int value ) +{ + d->mRDNPrefix = value; +} + +int ResourceLDAPTDEIO::RDNPrefix() const +{ + return d->mRDNPrefix; +} + +void ResourceLDAPTDEIO::setIsSASL( bool value ) +{ + d->mSASL = value; +} + +bool ResourceLDAPTDEIO::isSASL() const +{ + return d->mSASL; +} + +void ResourceLDAPTDEIO::setMech( const TQString &mech ) +{ + d->mMech = mech; +} + +TQString ResourceLDAPTDEIO::mech() const +{ + return d->mMech; +} + +void ResourceLDAPTDEIO::setRealm( const TQString &realm ) +{ + d->mRealm = realm; +} + +TQString ResourceLDAPTDEIO::realm() const +{ + return d->mRealm; +} + +void ResourceLDAPTDEIO::setBindDN( const TQString &binddn ) +{ + d->mBindDN = binddn; +} + +TQString ResourceLDAPTDEIO::bindDN() const +{ + return d->mBindDN; +} + +void ResourceLDAPTDEIO::setCachePolicy( int pol ) +{ + d->mCachePolicy = pol; +} + +int ResourceLDAPTDEIO::cachePolicy() const +{ + return d->mCachePolicy; +} + +void ResourceLDAPTDEIO::setAutoCache( bool value ) +{ + d->mAutoCache = value; +} + +bool ResourceLDAPTDEIO::autoCache() +{ + return d->mAutoCache; +} + +TQString ResourceLDAPTDEIO::cacheDst() const +{ + return d->mCacheDst; +} + + +#include "resourceldaptdeio.moc" diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeio.h b/tdeabc/plugins/ldaptdeio/resourceldaptdeio.h new file mode 100644 index 000000000..bf1b70ec0 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeio.h @@ -0,0 +1,171 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> + Copyright (c) 2004 Szombathelyi György <gyurco@freemail.hu> + + 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 KABC_RESOURCELDAP_H +#define KABC_RESOURCELDAP_H + +#include <tdeabc/resource.h> +#include <tdeabc/ldif.h> +#include <tdeio/job.h> + +class TDEConfig; + +namespace KABC { + +class KABC_EXPORT ResourceLDAPTDEIO : public Resource +{ + Q_OBJECT + + public: + enum CachePolicy{ Cache_No, Cache_NoConnection, Cache_Always }; + + ResourceLDAPTDEIO( const TDEConfig* ); + virtual ~ResourceLDAPTDEIO(); + /** + * Call this after you used one of the set... methods + */ + virtual void init(); + + virtual void writeConfig( TDEConfig* ); + + virtual bool doOpen(); + virtual void doClose(); + + virtual Ticket *requestSaveTicket(); + virtual void releaseSaveTicket( Ticket* ); + + virtual bool readOnly() const { return Resource::readOnly(); } + virtual void setReadOnly( bool value ); + + virtual bool load(); + virtual bool asyncLoad(); + virtual bool save( Ticket * ticket ); + virtual bool asyncSave( Ticket * ticket ); + + virtual void removeAddressee( const Addressee& addr ); + + void setUser( const TQString &user ); + TQString user() const; + + void setPassword( const TQString &password ); + TQString password() const; + + void setRealm( const TQString &realm ); + TQString realm() const; + + void setBindDN( const TQString &binddn ); + TQString bindDN() const; + + void setDn( const TQString &dn ); + TQString dn() const; + + void setHost( const TQString &host ); + TQString host() const; + + void setPort( int port ); + int port() const; + + void setVer( int ver ); + int ver() const; + + void setSizeLimit( int sizelimit ); + int sizeLimit(); + + void setTimeLimit( int timelimit ); + int timeLimit(); + + void setFilter( const TQString &filter ); + TQString filter() const; + + void setIsAnonymous( bool value ); + bool isAnonymous() const; + + void setAttributes( const TQMap<TQString, TQString> &attributes ); + TQMap<TQString, TQString> attributes() const; + + void setRDNPrefix( int value ); + int RDNPrefix() const; + + void setIsTLS( bool value ); + bool isTLS() const ; + + void setIsSSL( bool value ); + bool isSSL() const; + + void setIsSubTree( bool value ); + bool isSubTree() const ; + + void setIsSASL( bool value ); + bool isSASL() const ; + + void setMech( const TQString &mech ); + TQString mech() const; + + void setCachePolicy( int pol ); + int cachePolicy() const; + + void setAutoCache( bool value ); + bool autoCache(); + + TQString cacheDst() const; + +protected slots: + void entries( TDEIO::Job*, const TDEIO::UDSEntryList& ); + void data( TDEIO::Job*, const TQByteArray& ); + void result( TDEIO::Job* ); + void listResult( TDEIO::Job* ); + void syncLoadSaveResult( TDEIO::Job* ); + void saveResult( TDEIO::Job* ); + void saveData( TDEIO::Job*, TQByteArray& ); + void loadCacheResult( TDEIO::Job* ); + + private: + TQString mUser; + TQString mPassword; + TQString mDn; + TQString mHost; + TQString mFilter; + int mPort; + bool mAnonymous; + TQMap<TQString, TQString> mAttributes; + + KURL mLDAPUrl; + int mGetCounter; //KDE 4: remove + bool mErrorOccured; //KDE 4: remove + TQString mErrorMsg; + TQMap<TDEIO::Job*, TQByteArray> mJobMap; //KDE 4: remove + + TDEIO::Job *loadFromCache(); + void createCache(); + void activateCache(); + void enter_loop(); + TQCString addEntry( const TQString &attr, const TQString &value, bool mod ); + TQString findUid( const TQString &uid ); + bool AddresseeToLDIF( TQByteArray &ldif, const Addressee &addr, + const TQString &olddn ); + + class ResourceLDAPTDEIOPrivate; + ResourceLDAPTDEIOPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp b/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp new file mode 100644 index 000000000..a6af7d065 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp @@ -0,0 +1,388 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 <tqapplication.h> + +#include <tqcheckbox.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqspinbox.h> +#include <tqvbox.h> +#include <tqvgroupbox.h> +#include <tqhbuttongroup.h> +#include <tqradiobutton.h> + +#include <tdeaccelmanager.h> +#include <kcombobox.h> +#include <kdebug.h> +#include <kdialogbase.h> +#include <tdelocale.h> +#include <klineedit.h> +#include <tdemessagebox.h> +#include <tdeio/netaccess.h> + +#include "resourceldaptdeio.h" + +#include "resourceldaptdeioconfig.h" +#include "resourceldaptdeioconfig.moc" + +using namespace KABC; + +ResourceLDAPTDEIOConfig::ResourceLDAPTDEIOConfig( TQWidget* parent, const char* name ) + : KRES::ConfigWidget( parent, name ) +{ + TQBoxLayout *mainLayout = new TQVBoxLayout( this ); + mainLayout->setAutoAdd( true ); + cfg = new LdapConfigWidget( LdapConfigWidget::W_ALL, this ); + + mSubTree = new TQCheckBox( i18n( "Sub-tree query" ), this ); + TQHBox *box = new TQHBox( this ); + box->setSpacing( KDialog::spacingHint() ); + mEditButton = new TQPushButton( i18n( "Edit Attributes..." ), box ); + mCacheButton = new TQPushButton( i18n( "Offline Use..." ), box ); + + connect( mEditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editAttributes() ) ); + connect( mCacheButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editCache() ) ); +} + +void ResourceLDAPTDEIOConfig::loadSettings( KRES::Resource *res ) +{ + ResourceLDAPTDEIO *resource = dynamic_cast<ResourceLDAPTDEIO*>( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceLDAPTDEIOConfig::loadSettings(): cast failed" << endl; + return; + } + + cfg->setUser( resource->user() ); + cfg->setPassword( resource->password() ); + cfg->setRealm( resource->realm() ); + cfg->setBindDN( resource->bindDN() ); + cfg->setHost( resource->host() ); + cfg->setPort( resource->port() ); + cfg->setVer( resource->ver() ); + cfg->setTimeLimit( resource->timeLimit() ); + cfg->setSizeLimit( resource->sizeLimit() ); + cfg->setDn( resource->dn() ); + cfg->setFilter( resource->filter() ); + cfg->setMech( resource->mech() ); + if ( resource->isTLS() ) cfg->setSecTLS(); + else if ( resource->isSSL() ) cfg->setSecSSL(); + else cfg->setSecNO(); + if ( resource->isAnonymous() ) cfg->setAuthAnon(); + else if ( resource->isSASL() ) cfg->setAuthSASL(); + else cfg->setAuthSimple(); + + mSubTree->setChecked( resource->isSubTree() ); + mAttributes = resource->attributes(); + mRDNPrefix = resource->RDNPrefix(); + mCachePolicy = resource->cachePolicy(); + mCacheDst = resource->cacheDst(); + mAutoCache = resource->autoCache(); +} + +void ResourceLDAPTDEIOConfig::saveSettings( KRES::Resource *res ) +{ + ResourceLDAPTDEIO *resource = dynamic_cast<ResourceLDAPTDEIO*>( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceLDAPTDEIOConfig::saveSettings(): cast failed" << endl; + return; + } + + resource->setUser( cfg->user() ); + resource->setPassword( cfg->password() ); + resource->setRealm( cfg->realm() ); + resource->setBindDN( cfg->bindDN() ); + resource->setHost( cfg->host() ); + resource->setPort( cfg->port() ); + resource->setVer( cfg->ver() ); + resource->setTimeLimit( cfg->timeLimit() ); + resource->setSizeLimit( cfg->sizeLimit() ); + resource->setDn( cfg->dn() ); + resource->setFilter( cfg->filter() ); + resource->setIsAnonymous( cfg->isAuthAnon() ); + resource->setIsSASL( cfg->isAuthSASL() ); + resource->setMech( cfg->mech() ); + resource->setIsTLS( cfg->isSecTLS() ); + resource->setIsSSL( cfg->isSecSSL() ); + resource->setIsSubTree( mSubTree->isChecked() ); + resource->setAttributes( mAttributes ); + resource->setRDNPrefix( mRDNPrefix ); + resource->setCachePolicy( mCachePolicy ); + resource->init(); + +} + +void ResourceLDAPTDEIOConfig::editAttributes() +{ + AttributesDialog dlg( mAttributes, mRDNPrefix, this ); + if ( dlg.exec() ) { + mAttributes = dlg.attributes(); + mRDNPrefix = dlg.rdnprefix(); + } +} + +void ResourceLDAPTDEIOConfig::editCache() +{ + LDAPUrl src; + TQStringList attr; + + src = cfg->url(); + src.setScope( mSubTree->isChecked() ? LDAPUrl::Sub : LDAPUrl::One ); + if (!mAttributes.empty()) { + TQMap<TQString,TQString>::Iterator it; + TQStringList attr; + for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) { + if ( !it.data().isEmpty() && it.key() != "objectClass" ) + attr.append( it.data() ); + } + src.setAttributes( attr ); + } + src.setExtension( "x-dir", "base" ); + OfflineDialog dlg( mAutoCache, mCachePolicy, src, mCacheDst, this ); + if ( dlg.exec() ) { + mCachePolicy = dlg.cachePolicy(); + mAutoCache = dlg.autoCache(); + } + +} + +AttributesDialog::AttributesDialog( const TQMap<TQString, TQString> &attributes, + int rdnprefix, + TQWidget *parent, const char *name ) + : KDialogBase( Plain, i18n( "Attributes Configuration" ), Ok | Cancel, + Ok, parent, name, true, true ) +{ + mNameDict.setAutoDelete( true ); + mNameDict.insert( "objectClass", new TQString( i18n( "Object classes" ) ) ); + mNameDict.insert( "commonName", new TQString( i18n( "Common name" ) ) ); + mNameDict.insert( "formattedName", new TQString( i18n( "Formatted name" ) ) ); + mNameDict.insert( "familyName", new TQString( i18n( "Family name" ) ) ); + mNameDict.insert( "givenName", new TQString( i18n( "Given name" ) ) ); + mNameDict.insert( "organization", new TQString( i18n( "Organization" ) ) ); + mNameDict.insert( "title", new TQString( i18n( "Title" ) ) ); + mNameDict.insert( "street", new TQString( i18n( "Street" ) ) ); + mNameDict.insert( "state", new TQString( i18n( "State" ) ) ); + mNameDict.insert( "city", new TQString( i18n( "City" ) ) ); + mNameDict.insert( "postalcode", new TQString( i18n( "Postal code" ) ) ); + mNameDict.insert( "mail", new TQString( i18n( "Email" ) ) ); + mNameDict.insert( "mailAlias", new TQString( i18n( "Email alias" ) ) ); + mNameDict.insert( "phoneNumber", new TQString( i18n( "Telephone number" ) ) ); + mNameDict.insert( "telephoneNumber", new TQString( i18n( "Work telephone number" ) ) ); + mNameDict.insert( "facsimileTelephoneNumber", new TQString( i18n( "Fax number" ) ) ); + mNameDict.insert( "mobile", new TQString( i18n( "Cell phone number" ) ) ); + mNameDict.insert( "pager", new TQString( i18n( "Pager" ) ) ); + mNameDict.insert( "description", new TQString( i18n( "Note" ) ) ); + mNameDict.insert( "uid", new TQString( i18n( "UID" ) ) ); + mNameDict.insert( "jpegPhoto", new TQString( i18n( "Photo" ) ) ); + + // default map + mDefaultMap.insert( "objectClass", "inetOrgPerson" ); + mDefaultMap.insert( "commonName", "cn" ); + mDefaultMap.insert( "formattedName", "displayName" ); + mDefaultMap.insert( "familyName", "sn" ); + mDefaultMap.insert( "givenName", "givenName" ); + mDefaultMap.insert( "title", "title" ); + mDefaultMap.insert( "street", "street" ); + mDefaultMap.insert( "state", "st" ); + mDefaultMap.insert( "city", "l" ); + mDefaultMap.insert( "organization", "o" ); + mDefaultMap.insert( "postalcode", "postalCode" ); + mDefaultMap.insert( "mail", "mail" ); + mDefaultMap.insert( "mailAlias", "" ); + mDefaultMap.insert( "phoneNumber", "homePhone" ); + mDefaultMap.insert( "telephoneNumber", "telephoneNumber" ); + mDefaultMap.insert( "facsimileTelephoneNumber", "facsimileTelephoneNumber" ); + mDefaultMap.insert( "mobile", "mobile" ); + mDefaultMap.insert( "pager", "pager" ); + mDefaultMap.insert( "description", "description" ); + mDefaultMap.insert( "uid", "uid" ); + mDefaultMap.insert( "jpegPhoto", "jpegPhoto" ); + + // overwrite the default values here + TQMap<TQString, TQString> kolabMap, netscapeMap, evolutionMap, outlookMap; + + // kolab + kolabMap.insert( "formattedName", "display-name" ); + kolabMap.insert( "mailAlias", "mailalias" ); + + // evolution + evolutionMap.insert( "formattedName", "fileAs" ); + + mMapList.append( attributes ); + mMapList.append( kolabMap ); + mMapList.append( netscapeMap ); + mMapList.append( evolutionMap ); + mMapList.append( outlookMap ); + + TQFrame *page = plainPage(); + TQGridLayout *layout = new TQGridLayout( page, 4, ( attributes.count() + 4 ) >> 1, + 0, spacingHint() ); + + TQLabel *label = new TQLabel( i18n( "Template:" ), page ); + layout->addWidget( label, 0, 0 ); + mMapCombo = new KComboBox( page ); + layout->addWidget( mMapCombo, 0, 1 ); + + mMapCombo->insertItem( i18n( "User Defined" ) ); + mMapCombo->insertItem( i18n( "Kolab" ) ); + mMapCombo->insertItem( i18n( "Netscape" ) ); + mMapCombo->insertItem( i18n( "Evolution" ) ); + mMapCombo->insertItem( i18n( "Outlook" ) ); + connect( mMapCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( mapChanged( int ) ) ); + + label = new TQLabel( i18n( "RDN prefix attribute:" ), page ); + layout->addWidget( label, 1, 0 ); + mRDNCombo = new KComboBox( page ); + layout->addWidget( mRDNCombo, 1, 1 ); + mRDNCombo->insertItem( i18n( "commonName" ) ); + mRDNCombo->insertItem( i18n( "UID" ) ); + mRDNCombo->setCurrentItem( rdnprefix ); + + TQMap<TQString, TQString>::ConstIterator it; + int i, j = 0; + for ( i = 2, it = attributes.begin(); it != attributes.end(); ++it, ++i ) { + if ( mNameDict[ it.key() ] == 0 ) { + i--; + continue; + } + if ( (uint)(i - 2) == ( mNameDict.count() >> 1 ) ) { + i = 0; + j = 2; + } + kdDebug(7125) << "itkey: " << it.key() << " i: " << i << endl; + label = new TQLabel( *mNameDict[ it.key() ] + ":", page ); + KLineEdit *lineedit = new KLineEdit( page ); + mLineEditDict.insert( it.key(), lineedit ); + lineedit->setText( it.data() ); + label->setBuddy( lineedit ); + layout->addWidget( label, i, j ); + layout->addWidget( lineedit, i, j+1 ); + } + + for ( i = 1; i < mMapCombo->count(); i++ ) { + TQDictIterator<KLineEdit> it2( mLineEditDict ); + for ( ; it2.current(); ++it2 ) { + if ( mMapList[ i ].contains( it2.currentKey() ) ) { + if ( mMapList[ i ][ it2.currentKey() ] != it2.current()->text() ) break; + } else { + if ( mDefaultMap[ it2.currentKey() ] != it2.current()->text() ) break; + } + } + if ( !it2.current() ) { + mMapCombo->setCurrentItem( i ); + break; + } + } + + TDEAcceleratorManager::manage( this ); +} + +AttributesDialog::~AttributesDialog() +{ +} + +TQMap<TQString, TQString> AttributesDialog::attributes() const +{ + TQMap<TQString, TQString> map; + + TQDictIterator<KLineEdit> it( mLineEditDict ); + for ( ; it.current(); ++it ) + map.insert( it.currentKey(), it.current()->text() ); + + return map; +} + +int AttributesDialog::rdnprefix() const +{ + return mRDNCombo->currentItem(); +} + +void AttributesDialog::mapChanged( int pos ) +{ + + // apply first the default and than the spezific changes + TQMap<TQString, TQString>::Iterator it; + for ( it = mDefaultMap.begin(); it != mDefaultMap.end(); ++it ) + mLineEditDict[ it.key() ]->setText( it.data() ); + + for ( it = mMapList[ pos ].begin(); it != mMapList[ pos ].end(); ++it ) { + if ( !it.data().isEmpty() ) { + KLineEdit *le = mLineEditDict[ it.key() ]; + if ( le ) le->setText( it.data() ); + } + } +} + +OfflineDialog::OfflineDialog( bool autoCache, int cachePolicy, const KURL &src, + const TQString &dst, TQWidget *parent, const char *name ) + : KDialogBase( Plain, i18n( "Offline Configuration" ), Ok | Cancel, + Ok, parent, name, true, true ) +{ + TQFrame *page = plainPage(); + TQVBoxLayout *layout = new TQVBoxLayout( page ); + layout->setAutoAdd( true ); + + mSrc = src; mDst = dst; + mCacheGroup = new TQButtonGroup( 1, Qt::Horizontal, + i18n("Offline Cache Policy"), page ); + + TQRadioButton *bt; + new TQRadioButton( i18n("Do not use offline cache"), mCacheGroup ); + bt = new TQRadioButton( i18n("Use local copy if no connection"), mCacheGroup ); + new TQRadioButton( i18n("Always use local copy"), mCacheGroup ); + mCacheGroup->setButton( cachePolicy ); + + mAutoCache = new TQCheckBox( i18n("Refresh offline cache automatically"), + page ); + mAutoCache->setChecked( autoCache ); + mAutoCache->setEnabled( bt->isChecked() ); + + connect( bt, TQT_SIGNAL(toggled(bool)), mAutoCache, TQT_SLOT(setEnabled(bool)) ); + + TQPushButton *lcache = new TQPushButton( i18n("Load into Cache"), page ); + connect( lcache, TQT_SIGNAL( clicked() ), TQT_SLOT( loadCache() ) ); +} + +OfflineDialog::~OfflineDialog() +{ +} + +bool OfflineDialog::autoCache() const +{ + return mAutoCache->isChecked(); +} + +int OfflineDialog::cachePolicy() const +{ + return mCacheGroup->selectedId(); +} + +void OfflineDialog::loadCache() +{ + if ( TDEIO::NetAccess::download( mSrc, mDst, this ) ) { + KMessageBox::information( this, + i18n("Successfully downloaded directory server contents!") ); + } else { + KMessageBox::error( this, + i18n("An error occurred downloading directory server contents into file %1.").arg(mDst) ); + } +} diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.h b/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.h new file mode 100644 index 000000000..121cf639e --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.h @@ -0,0 +1,118 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@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 RESOURCELDAPCONFIG_H +#define RESOURCELDAPCONFIG_H + +#include <tqmap.h> +#include <tqradiobutton.h> +#include <tqcombobox.h> +#include <tqdict.h> + +#include <kdialogbase.h> +#include <tderesources/configwidget.h> +#include <tdeabc/ldif.h> +#include <tdeabc/ldapconfigwidget.h> + + +class TQCheckBox; +class TQPushButton; +class TQSpinBox; +class TQString; + +class KComboBox; +class KLineEdit; + +namespace KABC { + +class KABC_EXPORT ResourceLDAPTDEIOConfig : public KRES::ConfigWidget +{ + Q_OBJECT + + public: + ResourceLDAPTDEIOConfig( TQWidget* parent = 0, const char* name = 0 ); + + public slots: + void loadSettings( KRES::Resource* ); + void saveSettings( KRES::Resource* ); + + private slots: + void editAttributes(); + void editCache(); + private: + TQPushButton *mEditButton, *mCacheButton; + LdapConfigWidget *cfg; + TQCheckBox *mSubTree; + TQMap<TQString, TQString> mAttributes; + int mRDNPrefix, mCachePolicy; + bool mAutoCache; + TQString mCacheDst; +}; + +class AttributesDialog : public KDialogBase +{ + Q_OBJECT + + public: + AttributesDialog( const TQMap<TQString, TQString> &attributes, int rdnprefix, + TQWidget *parent, const char *name = 0 ); + ~AttributesDialog(); + + TQMap<TQString, TQString> attributes() const; + int rdnprefix() const; + + private slots: + void mapChanged( int pos ); + + private: + enum { UserMap, KolabMap, NetscapeMap, EvolutionMap, OutlookMap }; + + KComboBox *mMapCombo, *mRDNCombo; + TQValueList< TQMap<TQString, TQString> > mMapList; + TQMap<TQString, TQString> mDefaultMap; + TQDict<KLineEdit> mLineEditDict; + TQDict<TQString> mNameDict; +}; + +class OfflineDialog : public KDialogBase +{ + Q_OBJECT + + public: + OfflineDialog( bool autoCache, int cachePolicy, const KURL &src, + const TQString &dst, TQWidget *parent, const char *name = 0 ); + ~OfflineDialog(); + + int cachePolicy() const; + bool autoCache() const; + + private slots: + void loadCache(); + + private: + KURL mSrc; + TQString mDst; + TQButtonGroup *mCacheGroup; + TQCheckBox *mAutoCache; +}; + +} + +#endif diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp b/tdeabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp new file mode 100644 index 000000000..6d173eb51 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp @@ -0,0 +1,36 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 "resourceldaptdeio.h" +#include "resourceldaptdeioconfig.h" + +#include <tdeglobal.h> +#include <tdelocale.h> + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_ldaptdeio() + { + TDEGlobal::locale()->insertCatalogue("kabc_ldaptdeio"); + return new KRES::PluginFactory<ResourceLDAPTDEIO, ResourceLDAPTDEIOConfig>(); + } +} diff --git a/tdeabc/plugins/net/CMakeLists.txt b/tdeabc/plugins/net/CMakeLists.txt new file mode 100644 index 000000000..cc9564995 --- /dev/null +++ b/tdeabc/plugins/net/CMakeLists.txt @@ -0,0 +1,73 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + resourcenet.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### other data ################################ + +install( FILES net.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) + + +##### kabc_net (library) ######################## + +set( target kabc_net ) + +set( ${target}_SRCS + resourcenet.cpp resourcenetconfig.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.0.0 + LINK tdeabc-shared + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### kabc_net (module) ######################### + +set( target kabc_net ) + +set( ${target}_SRCS + resourcenetplugin.cpp +) + +tde_add_kpart( ${target} AUTOMOC + SOURCES ${${target}_SRCS} + LINK kabc_net-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/plugins/net/Makefile.am b/tdeabc/plugins/net/Makefile.am new file mode 100644 index 000000000..c2ded1b44 --- /dev/null +++ b/tdeabc/plugins/net/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourcenetconfig.h + +lib_LTLIBRARIES = libkabc_net.la +libkabc_net_la_SOURCES = resourcenet.cpp resourcenetconfig.cpp +libkabc_net_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined +libkabc_net_la_LIBADD = $(top_builddir)/tdeabc/libkabc.la $(LIB_KIO) +libkabc_net_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +kde_module_LTLIBRARIES = kabc_net.la +kabc_net_la_SOURCES = resourcenetplugin.cpp +kabc_net_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -L../../../tdecore/.libs/ -ltdecore +kabc_net_la_LIBADD = libkabc_net.la + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_net.pot + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = resourcenet.h + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = net.desktop + +resourcenetplugin.lo: ../../addressee.h diff --git a/tdeabc/plugins/net/net.desktop b/tdeabc/plugins/net/net.desktop new file mode 100644 index 000000000..2c72c202d --- /dev/null +++ b/tdeabc/plugins/net/net.desktop @@ -0,0 +1,90 @@ +[Desktop Entry] +Name=Network +Name[af]=Netwerk +Name[ar]=الشبكة +Name[az]=ŞəbÉ™kÉ™ +Name[be]=Сетка +Name[bn]=নেটওয়ারà§à¦• +Name[br]=Rouedad +Name[bs]=Mreža +Name[ca]=Xarxa +Name[cs]=Síť +Name[csb]=Sec +Name[cy]=Rhydwaith +Name[da]=Netværk +Name[de]=Netzwerk +Name[el]=Δίκτυο +Name[eo]=Reto +Name[es]=Red +Name[et]=Võrk +Name[eu]=Sarea +Name[fa]=شبکه +Name[fi]=Verkko +Name[fr]=Réseau +Name[fy]=Netwurk +Name[ga]=Líonra +Name[gl]=Rede +Name[he]=רשת +Name[hi]=नेटवरà¥à¤• +Name[hr]=Mreža +Name[hsb]=Syć +Name[hu]=Hálózat +Name[id]=Jaringan +Name[is]=Net +Name[it]=Rete +Name[ja]=ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ +Name[ka]=ქსელი +Name[kk]=Желі +Name[km]=បណ្ážáž¶áž‰ +Name[ko]=ë„¤íŠ¸ì›Œí¬ +Name[ku]=Tor +Name[lb]=Netzwierk +Name[lt]=Tinklas +Name[lv]=TÄ«kls +Name[mi]=Hao +Name[mk]=Мрежа +Name[mn]=СүлжÑÑ +Name[ms]=Jaringan +Name[nds]=Nettwark +Name[ne]=सञà¥à¤œà¤¾à¤² +Name[nl]=Netwerk +Name[nn]=Nettverk +Name[nso]=Kgokagano +Name[oc]=Resèu +Name[pa]=ਨੈੱਟਵਰਕ +Name[pl]=Sieć +Name[pt]=Rede +Name[pt_BR]=Rede +Name[ro]=ReÅ£ea +Name[ru]=Сеть +Name[rw]=Urusobe +Name[se]=Fierbmi +Name[sk]=SieÅ¥ +Name[sl]=Omrežje +Name[sq]=Rrjeta +Name[sr]=Мрежа +Name[sr@Latn]=Mreža +Name[ss]=Luchungechunge +Name[sv]=Nätverk +Name[ta]=பிணையம௠+Name[te]=కలన జాలం +Name[tg]=Шабака +Name[th]=ระบบเครือข่าย +Name[tr]=AÄŸ +Name[tt]=Çeltär +Name[uk]=Мережа +Name[uz]=Tarmoq +Name[uz@cyrillic]=Tarмоқ +Name[ven]=Vhukwamani +Name[vi]=mạng +Name[wa]=Rantoele +Name[xh]=Umsebenzi womnatha +Name[zh_CN]=网络 +Name[zh_HK]=網絡 +Name[zh_TW]=網路 +Name[zu]=Umsebenzi wokuxhumana okusakazekile +X-TDE-Library=kabc_net +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=net diff --git a/tdeabc/plugins/net/resourcenet.cpp b/tdeabc/plugins/net/resourcenet.cpp new file mode 100644 index 000000000..5a46890d8 --- /dev/null +++ b/tdeabc/plugins/net/resourcenet.cpp @@ -0,0 +1,393 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 <tqfile.h> + +#include <kdebug.h> +#include <tdeio/netaccess.h> +#include <tdeio/scheduler.h> +#include <tdelocale.h> +#include <ksavefile.h> +#include <tdetempfile.h> +#include <kurlrequester.h> + +#include "addressbook.h" +#include "formatfactory.h" +#include "resourcenetconfig.h" +#include "stdaddressbook.h" + +#include "resourcenet.h" + +using namespace KABC; + +class ResourceNet::ResourceNetPrivate +{ + public: + TDEIO::Job *mLoadJob; + bool mIsLoading; + + TDEIO::Job *mSaveJob; + bool mIsSaving; + + TQString mLastErrorString; +}; + +ResourceNet::ResourceNet( const TDEConfig *config ) + : Resource( config ), mFormat( 0 ), + mTempFile( 0 ), + d( new ResourceNetPrivate ) +{ + if ( config ) { + init( KURL( config->readPathEntry( "NetUrl" ) ), config->readEntry( "NetFormat" ) ); + } else { + init( KURL(), TQString("vcard").latin1() ); + } +} + +ResourceNet::ResourceNet( const KURL &url, const TQString &format ) + : Resource( 0 ), mFormat( 0 ), + mTempFile( 0 ), + d( new ResourceNetPrivate ) +{ + init( url, format ); +} + +void ResourceNet::init( const KURL &url, const TQString &format ) +{ + d->mLoadJob = 0; + d->mIsLoading = false; + d->mSaveJob = 0; + d->mIsSaving = false; + + mFormatName = format; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); + if ( !mFormat ) { + mFormatName = TQString("vcard").latin1(); + mFormat = factory->format( mFormatName ); + } + + setUrl( url ); +} + +ResourceNet::~ResourceNet() +{ + if ( d->mIsLoading ) + d->mLoadJob->kill(); + if ( d->mIsSaving ) + d->mSaveJob->kill(); + + delete d; + d = 0; + + delete mFormat; + mFormat = 0; + + deleteLocalTempFile(); +} + +void ResourceNet::writeConfig( TDEConfig *config ) +{ + Resource::writeConfig( config ); + + config->writePathEntry( "NetUrl", mUrl.url() ); + config->writeEntry( "NetFormat", mFormatName ); +} + +Ticket *ResourceNet::requestSaveTicket() +{ + kdDebug(5700) << "ResourceNet::requestSaveTicket()" << endl; + + return createTicket( this ); +} + +void ResourceNet::releaseSaveTicket( Ticket *ticket ) +{ + delete ticket; +} + +bool ResourceNet::doOpen() +{ + return true; +} + +void ResourceNet::doClose() +{ +} + +bool ResourceNet::load() +{ + TQString tempFile; + + if ( !TDEIO::NetAccess::download( mUrl, tempFile, 0 ) ) { + addressBook()->error( i18n( "Unable to download file '%1'." ).arg( mUrl.prettyURL() ) ); + return false; + } + + TQFile file( tempFile ); + if ( !file.open( IO_ReadOnly ) ) { + addressBook()->error( i18n( "Unable to open file '%1'." ).arg( tempFile ) ); + TDEIO::NetAccess::removeTempFile( tempFile ); + return false; + } + + bool result = clearAndLoad( &file ); + if ( !result ) + addressBook()->error( i18n( "Problems during parsing file '%1'." ).arg( tempFile ) ); + + TDEIO::NetAccess::removeTempFile( tempFile ); + + return result; +} + +bool ResourceNet::clearAndLoad( TQFile *file ) +{ + clear(); + return mFormat->loadAll( addressBook(), this, file ); +} + +bool ResourceNet::asyncLoad() +{ + if ( d->mIsLoading ) { + abortAsyncLoading(); + } + + if (d->mIsSaving) { + kdWarning(5700) << "Aborted asyncLoad() because we're still asyncSave()ing!" << endl; + return false; + } + + bool ok = createLocalTempFile(); + if ( ok ) + mTempFile->sync(); + ok = mTempFile->close(); + + if ( !ok ) { + emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) ); + deleteLocalTempFile(); + return false; + } + + KURL dest; + dest.setPath( mTempFile->name() ); + + TDEIO::Scheduler::checkSlaveOnHold( true ); + d->mLoadJob = TDEIO::file_copy( mUrl, dest, -1, true, false, false ); + d->mIsLoading = true; + connect( d->mLoadJob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( downloadFinished( TDEIO::Job* ) ) ); + + return true; +} + +void ResourceNet::abortAsyncLoading() +{ + kdDebug(5700) << "ResourceNet::abortAsyncLoading()" << endl; + + if ( d->mLoadJob ) { + d->mLoadJob->kill(); // result not emitted + d->mLoadJob = 0; + } + + deleteLocalTempFile(); + d->mIsLoading = false; +} + +void ResourceNet::abortAsyncSaving() +{ + kdDebug(5700) << "ResourceNet::abortAsyncSaving()" << endl; + + if ( d->mSaveJob ) { + d->mSaveJob->kill(); // result not emitted + d->mSaveJob = 0; + } + + deleteLocalTempFile(); + d->mIsSaving = false; +} + +bool ResourceNet::save( Ticket* ) +{ + kdDebug(5700) << "ResourceNet::save()" << endl; + + if (d->mIsSaving) { + abortAsyncSaving(); + } + + KTempFile tempFile; + tempFile.setAutoDelete( true ); + bool ok = false; + + if ( tempFile.status() == 0 && tempFile.file() ) { + saveToFile( tempFile.file() ); + tempFile.sync(); + ok = tempFile.close(); + } + + if ( !ok ) { + addressBook()->error( i18n( "Unable to save file '%1'." ).arg( tempFile.name() ) ); + return false; + } + + ok = TDEIO::NetAccess::upload( tempFile.name(), mUrl, 0 ); + if ( !ok ) + addressBook()->error( i18n( "Unable to upload to '%1'." ).arg( mUrl.prettyURL() ) ); + + return ok; +} + +bool ResourceNet::asyncSave( Ticket* ) +{ + kdDebug(5700) << "ResourceNet::asyncSave()" << endl; + + if (d->mIsSaving) { + abortAsyncSaving(); + } + + if (d->mIsLoading) { + kdWarning(5700) << "Aborted asyncSave() because we're still asyncLoad()ing!" << endl; + return false; + } + + bool ok = createLocalTempFile(); + if ( ok ) { + saveToFile( mTempFile->file() ); + mTempFile->sync(); + ok = mTempFile->close(); + } + + if ( !ok ) { + emit savingError( this, i18n( "Unable to save file '%1'." ).arg( mTempFile->name() ) ); + deleteLocalTempFile(); + return false; + } + + KURL src; + src.setPath( mTempFile->name() ); + + TDEIO::Scheduler::checkSlaveOnHold( true ); + d->mIsSaving = true; + d->mSaveJob = TDEIO::file_copy( src, mUrl, -1, true, false, false ); + connect( d->mSaveJob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( uploadFinished( TDEIO::Job* ) ) ); + + return true; +} + +bool ResourceNet::createLocalTempFile() +{ + deleteStaleTempFile(); + mTempFile = new KTempFile(); + mTempFile->setAutoDelete( true ); + return mTempFile->status() == 0; +} + +void ResourceNet::deleteStaleTempFile() +{ + if ( hasTempFile() ) { + kdDebug(5700) << "stale temp file detected " << mTempFile->name() << endl; + deleteLocalTempFile(); + } +} + +void ResourceNet::deleteLocalTempFile() +{ + delete mTempFile; + mTempFile = 0; +} + +void ResourceNet::saveToFile( TQFile *file ) +{ + mFormat->saveAll( addressBook(), this, file ); +} + +void ResourceNet::setUrl( const KURL &url ) +{ + mUrl = url; +} + +KURL ResourceNet::url() const +{ + return mUrl; +} + +void ResourceNet::setFormat( const TQString &name ) +{ + mFormatName = name; + if ( mFormat ) + delete mFormat; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); +} + +TQString ResourceNet::format() const +{ + return mFormatName; +} + +void ResourceNet::downloadFinished( TDEIO::Job* ) +{ + kdDebug(5700) << "ResourceNet::downloadFinished()" << endl; + + d->mIsLoading = false; + + if ( !hasTempFile() || mTempFile->status() != 0 ) { + d->mLastErrorString = i18n( "Download failed: Unable to create temporary file" ); + TQTimer::singleShot( 0, this, TQT_SLOT( signalError() ) ); + return; + } + + TQFile file( mTempFile->name() ); + if ( file.open( IO_ReadOnly ) ) { + if ( clearAndLoad( &file ) ) + emit loadingFinished( this ); + else + emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mTempFile->name() ) ); + } + else { + emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) ); + } + + deleteLocalTempFile(); +} + +void ResourceNet::uploadFinished( TDEIO::Job *job ) +{ + kdDebug(5700) << "ResourceFile::uploadFinished()" << endl; + + d->mIsSaving = false; + + if ( job->error() ) + emit savingError( this, job->errorString() ); + else + emit savingFinished( this ); + + deleteLocalTempFile(); +} + +void ResourceNet::signalError() +{ + emit loadingError( this, d->mLastErrorString ); + d->mLastErrorString.truncate( 0 ); +} + +#include "resourcenet.moc" diff --git a/tdeabc/plugins/net/resourcenet.h b/tdeabc/plugins/net/resourcenet.h new file mode 100644 index 000000000..49707081e --- /dev/null +++ b/tdeabc/plugins/net/resourcenet.h @@ -0,0 +1,117 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 KABC_RESOURCENET_H +#define KABC_RESOURCENET_H + +#include <tdeconfig.h> + +#include <sys/types.h> + +#include <tdeabc/resource.h> + +class TQFile; +class TQTimer; +class KTempFile; + +namespace TDEIO { +class Job; +} + +namespace KABC { + +class FormatPlugin; + +/** + @internal +*/ +class KABC_EXPORT ResourceNet : public Resource +{ + Q_OBJECT + + public: + ResourceNet( const TDEConfig* ); + ResourceNet( const KURL &url, const TQString &format ); + ~ResourceNet(); + + virtual void writeConfig( TDEConfig* ); + + virtual bool doOpen(); + virtual void doClose(); + + virtual Ticket *requestSaveTicket(); + virtual void releaseSaveTicket( Ticket* ); + + virtual bool load(); + virtual bool asyncLoad(); + virtual bool save( Ticket* ticket ); + virtual bool asyncSave( Ticket* ticket ); + + /** + Set url of directory to be used for saving. + */ + void setUrl( const KURL & ); + + /** + Return url of directory used for loading and saving the address book. + */ + KURL url() const; + + /** + Sets a new format by name. + */ + void setFormat( const TQString &name ); + + /** + Returns the format name. + */ + TQString format() const; + + protected: + void init( const KURL &url, const TQString &format ); + + private slots: + void downloadFinished( TDEIO::Job* ); + void uploadFinished( TDEIO::Job* ); + void signalError(); + + private: + bool clearAndLoad( TQFile *file ); + void saveToFile( TQFile *file ); + bool hasTempFile() const { return mTempFile != 0; } + void abortAsyncLoading(); + void abortAsyncSaving(); + bool createLocalTempFile(); + void deleteLocalTempFile(); + void deleteStaleTempFile(); + + FormatPlugin *mFormat; + TQString mFormatName; + + KURL mUrl; + KTempFile *mTempFile; + + class ResourceNetPrivate; + ResourceNetPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/plugins/net/resourcenetconfig.cpp b/tdeabc/plugins/net/resourcenetconfig.cpp new file mode 100644 index 000000000..8d5903f8b --- /dev/null +++ b/tdeabc/plugins/net/resourcenetconfig.cpp @@ -0,0 +1,102 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 <tqlabel.h> +#include <tqlayout.h> + +#include <kdebug.h> +#include <tdelocale.h> +#include <kdialog.h> + +#include "formatfactory.h" +#include "resourcenet.h" +#include "stdaddressbook.h" + +#include "resourcenetconfig.h" + +using namespace KABC; + +ResourceNetConfig::ResourceNetConfig( TQWidget* parent, const char* name ) + : ConfigWidget( parent, name ), mInEditMode( false ) +{ + TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2, 0, + KDialog::spacingHint() ); + + TQLabel *label = new TQLabel( i18n( "Format:" ), this ); + mFormatBox = new KComboBox( this ); + + mainLayout->addWidget( label, 0, 0 ); + mainLayout->addWidget( mFormatBox, 0, 1 ); + + label = new TQLabel( i18n( "Location:" ), this ); + mUrlEdit = new KURLRequester( this ); + mUrlEdit->setMode( KFile::File ); + + mainLayout->addWidget( label, 1, 0 ); + mainLayout->addWidget( mUrlEdit, 1, 1 ); + + FormatFactory *factory = FormatFactory::self(); + TQStringList formats = factory->formats(); + TQStringList::Iterator it; + for ( it = formats.begin(); it != formats.end(); ++it ) { + FormatInfo *info = factory->info( *it ); + if ( info ) { + mFormatTypes << (*it); + mFormatBox->insertItem( info->nameLabel ); + } + } +} + +void ResourceNetConfig::setEditMode( bool value ) +{ + mFormatBox->setEnabled( !value ); + mInEditMode = value; +} + +void ResourceNetConfig::loadSettings( KRES::Resource *res ) +{ + ResourceNet *resource = dynamic_cast<ResourceNet*>( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceNetConfig::loadSettings(): cast failed" << endl; + return; + } + + mFormatBox->setCurrentItem( mFormatTypes.findIndex( resource->format() ) ); + + mUrlEdit->setURL( resource->url().url() ); +} + +void ResourceNetConfig::saveSettings( KRES::Resource *res ) +{ + ResourceNet *resource = dynamic_cast<ResourceNet*>( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceNetConfig::saveSettings(): cast failed" << endl; + return; + } + + if ( !mInEditMode ) + resource->setFormat( mFormatTypes[ mFormatBox->currentItem() ] ); + + resource->setUrl( KURL( mUrlEdit->url() ) ); +} + +#include "resourcenetconfig.moc" diff --git a/tdeabc/plugins/net/resourcenetconfig.h b/tdeabc/plugins/net/resourcenetconfig.h new file mode 100644 index 000000000..3c8986122 --- /dev/null +++ b/tdeabc/plugins/net/resourcenetconfig.h @@ -0,0 +1,53 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 RESOURCENETCONFIG_H +#define RESOURCENETCONFIG_H + +#include <kcombobox.h> +#include <kurlrequester.h> + +#include <tderesources/configwidget.h> + +namespace KABC { + +class KABC_EXPORT ResourceNetConfig : public KRES::ConfigWidget +{ + Q_OBJECT + + public: + ResourceNetConfig( TQWidget* parent = 0, const char* name = 0 ); + + void setEditMode( bool value ); + + public slots: + void loadSettings( KRES::Resource *resource ); + void saveSettings( KRES::Resource *resource ); + + private: + KComboBox* mFormatBox; + KURLRequester* mUrlEdit; + + TQStringList mFormatTypes; + bool mInEditMode; +}; + +} +#endif diff --git a/tdeabc/plugins/net/resourcenetplugin.cpp b/tdeabc/plugins/net/resourcenetplugin.cpp new file mode 100644 index 000000000..189bab051 --- /dev/null +++ b/tdeabc/plugins/net/resourcenetplugin.cpp @@ -0,0 +1,32 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 "resourcenet.h" +#include "resourcenetconfig.h" + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_net() + { + return new KRES::PluginFactory<ResourceNet, ResourceNetConfig>(); + } +} diff --git a/tdeabc/plugins/sql/Makefile.am b/tdeabc/plugins/sql/Makefile.am new file mode 100644 index 000000000..3fa3986ce --- /dev/null +++ b/tdeabc/plugins/sql/Makefile.am @@ -0,0 +1,20 @@ +INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourcesql.h resourcesqlconfig.h + +kde_module_LTLIBRARIES = kabc_sql.la + +kabc_sql_la_SOURCES = resourcesql.cpp resourcesqlconfig.cpp + +kabc_sql_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kabc_sql_la_LIBADD = ../../libkabc.la ../../../tdeui/libtdeui.la + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_sql.pot + +linkdir = $(kde_datadir)/tderesources/contact +link_DATA = sql.desktop +EXTRA_DIST = $(link_DATA) diff --git a/tdeabc/plugins/sql/resourcesql.cpp b/tdeabc/plugins/sql/resourcesql.cpp new file mode 100644 index 000000000..e3744eeec --- /dev/null +++ b/tdeabc/plugins/sql/resourcesql.cpp @@ -0,0 +1,338 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqsqldatabase.h> +#include <tqsqlcursor.h> + +#include <kdebug.h> +#include <tdeglobal.h> +#include <klineedit.h> +#include <tdelocale.h> + +#include "resourcesql.h" +#include "resourcesqlconfig.h" + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_sql() + { + return new KRES::PluginFactory<ResourceSql,ResourceSqlConfig>(); + } +} + +ResourceSql::ResourceSql( AddressBook *ab, const TDEConfig *config ) + : Resource( ab ), mDb( 0 ) +{ + TQString user, password, db, host; + + user = config->readEntry( "SqlUser" ); + password = cryptStr( config->readEntry( "SqlPassword " ) ); + db = config->readEntry( "SqlName" ); + host = config->readEntry( "SqlHost" ); + + init( user, password, db, host ); +} + +ResourceSql::ResourceSql( AddressBook *ab, const TQString &user, + const TQString &password, const TQString &db, const TQString &host ) + : Resource( ab ), mDb( 0 ) +{ + init( user, password, db, host ); +} + +void ResourceSql::init( const TQString &user, const TQString &password, + const TQString &db, const TQString &host ) +{ + mUser = user; + mPassword = password; + mDbName = db; + mHost = host; +} + +Ticket *ResourceSql::requestSaveTicket() +{ + if ( !addressBook() ) { + kdDebug(5700) << "no addressbook" << endl; + return 0; + } + + return createTicket( this ); +} + +bool ResourceSql::open() +{ + TQStringList drivers = TQSqlDatabase::drivers(); + for ( TQStringList::Iterator it = drivers.begin(); it != drivers.end(); ++it ) { + kdDebug(5700) << "Driver: " << (*it) << endl; + } + + mDb = TQSqlDatabase::addDatabase( "QMYSQL3" ); + + if ( !mDb ) { + kdDebug(5700) << "Error. Unable to connect to database." << endl; + return false; + } + + mDb->setDatabaseName( mDbName ); + mDb->setUserName( mUser ); + mDb->setPassword( mPassword ); + mDb->setHostName( mHost ); + + if ( !mDb->open() ) { + kdDebug(5700) << "Error. Unable to open database '" << mDbName << "'." << endl; + return false; + } + + return true; +} + +void ResourceSql::close() +{ + mDb->close(); +} + +bool ResourceSql::load() +{ + TQSqlQuery query( "select addressId, name, familyName, givenName, " + "additionalName, prefix, suffix, nickname, birthday, " + "mailer, timezone, geo_latitude, geo_longitude, title, " + "role, organization, note, productId, revision, " + "sortString, url from kaddressbook_main_" + mUser ); + + while ( query.next() ) { + TQString addrId = query.value(0).toString(); + + Addressee addr; + addr.setResource( this ); + addr.setUid( addrId ); + addr.setName( query.value(1).toString() ); + addr.setFamilyName( query.value(2).toString() ); + addr.setGivenName( query.value(3).toString() ); + addr.setAdditionalName( query.value(4).toString() ); + addr.setPrefix( query.value(5).toString() ); + addr.setSuffix( query.value(6).toString() ); + addr.setNickName( query.value(7).toString() ); + addr.setBirthday( query.value(8).toDateTime() ); + addr.setMailer( query.value(9).toString() ); + addr.setTimeZone( TimeZone( query.value(10).toInt() ) ); + addr.setGeo( Geo( query.value(11).toDouble(), query.value(12).toDouble() ) ); + addr.setTitle( query.value(13).toString() ); + addr.setRole( query.value(14).toString() ); + addr.setOrganization( query.value(15).toString() ); + addr.setNote( query.value(16).toString() ); + addr.setProductId( query.value(17).toString() ); + addr.setRevision( query.value(18).toDateTime() ); + addr.setSortString( query.value(19).toString() ); + addr.setUrl( query.value(20).toString() ); + + // emails + { + TQSqlQuery emailsQuery( "select email, preferred from kaddressbook_emails " + "where addressId = '" + addrId + "'" ); + while ( emailsQuery.next() ) + addr.insertEmail( emailsQuery.value( 0 ).toString(), + emailsQuery.value( 1 ).toInt() ); + } + + // phones + { + TQSqlQuery phonesQuery( "select number, type from kaddressbook_phones " + "where addressId = '" + addrId + "'" ); + while ( phonesQuery.next() ) + addr.insertPhoneNumber( PhoneNumber( phonesQuery.value( 0 ).toString(), + phonesQuery.value( 1 ).toInt() ) ); + } + + // addresses + { + TQSqlQuery addressesQuery( "select postOfficeBox, extended, street, " + "locality, region, postalCode, country, label, type " + "from kaddressbook_addresses where addressId = '" + addrId + "'" ); + while ( addressesQuery.next() ) { + Address a; + a.setPostOfficeBox( addressesQuery.value(0).toString() ); + a.setExtended( addressesQuery.value(1).toString() ); + a.setStreet( addressesQuery.value(2).toString() ); + a.setLocality( addressesQuery.value(3).toString() ); + a.setRegion( addressesQuery.value(4).toString() ); + a.setPostalCode( addressesQuery.value(5).toString() ); + a.setCountry( addressesQuery.value(6).toString() ); + a.setLabel( addressesQuery.value(7).toString() ); + a.setType( addressesQuery.value(8).toInt() ); + + addr.insertAddress( a ); + } + } + + // categories + { + TQSqlQuery categoriesQuery( "select category from kaddressbook_categories " + "where addressId = '" + addrId + "'" ); + while ( categoriesQuery.next() ) + addr.insertCategory( categoriesQuery.value( 0 ).toString() ); + } + + // customs + { + TQSqlQuery customsQuery( "select app, name, value from kaddressbook_customs " + "where addressId = '" + addrId + "'" ); + while ( customsQuery.next() ) + addr.insertCustom( customsQuery.value( 0 ).toString(), + customsQuery.value( 1 ).toString(), + customsQuery.value( 2 ).toString()); + } + + addressBook()->insertAddressee( addr ); + } + + return true; +} + +bool ResourceSql::save( Ticket * ) +{ + // we have to delete all entries for this user and reinsert them + TQSqlQuery query( "select addressId from kaddressbook_main_" + mUser ); + + while ( query.next() ) { + TQString addrId = query.value( 0 ).toString(); + TQSqlQuery q; + + q.exec( "DELETE FROM kaddressbook_emails WHERE addressId = '" + addrId + "'" ); + q.exec( "DELETE FROM kaddressbook_phones WHERE addressId = '" + addrId + "'" ); + q.exec( "DELETE FROM kaddressbook_addresses WHERE addressId = '" + addrId + "'" ); + q.exec( "DELETE FROM kaddressbook_categories WHERE addressId = '" + addrId + "'" ); + q.exec( "DELETE FROM kaddressbook_customs WHERE addressId = '" + addrId + "'" ); + + q.exec( "DELETE FROM kaddressbook_main_" + mUser + " WHERE addressId = '" + addrId + "'" ); + } + + // let's start... + AddressBook::Iterator it; + for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { + if ( (*it).resource() != this && (*it).resource() != 0 ) // save only my and new entries + continue; + + TQString uid = (*it).uid(); + + query.exec( "INSERT INTO kaddressbook_main_" + mUser + " VALUES ('" + + (*it).uid() + "','" + + (*it).name() + "','" + + (*it).familyName() + "','" + + (*it).givenName() + "','" + + (*it).additionalName() + "','" + + (*it).prefix() + "','" + + (*it).suffix() + "','" + + (*it).nickName() + "','" + + (*it).birthday().toString( Qt::ISODate ) + "','" + + (*it).mailer() + "','" + + TQString::number( (*it).timeZone().offset() ) + "','" + + TQString::number( (*it).geo().latitude() ) + "','" + + TQString::number( (*it).geo().longitude() ) + "','" + + (*it).title() + "','" + + (*it).role() + "','" + + (*it).organization() + "','" + + (*it).note() + "','" + + (*it).productId() + "','" + + (*it).revision().toString( Qt::ISODate ) + "','" + + (*it).sortString() + "','" + + (*it).url().url() + "')" + ); + + // emails + { + TQStringList emails = (*it).emails(); + TQStringList::ConstIterator it; + bool preferred = true; + for( it = emails.begin(); it != emails.end(); ++it ) { + query.exec("INSERT INTO kaddressbook_emails VALUES ('" + + uid + "','" + + (*it) + "','" + + TQString::number(preferred) + "')"); + preferred = false; + } + } + + // phonenumbers + { + PhoneNumber::List phoneNumberList = (*it).phoneNumbers(); + PhoneNumber::List::ConstIterator it; + for( it = phoneNumberList.begin(); it != phoneNumberList.end(); ++it ) { + query.exec("INSERT INTO kaddressbook_phones VALUES ('" + + uid + "','" + + (*it).number() + "','" + + TQString::number( (*it).type() ) + "')"); + } + } + + // postal addresses + { + Address::List addressList = (*it).addresses(); + Address::List::ConstIterator it; + for( it = addressList.begin(); it != addressList.end(); ++it ) { + query.exec("INSERT INTO kaddressbook_addresses VALUES ('" + + uid + "','" + + (*it).postOfficeBox() + "','" + + (*it).extended() + "','" + + (*it).street() + "','" + + (*it).locality() + "','" + + (*it).region() + "','" + + (*it).postalCode() + "','" + + (*it).country() + "','" + + (*it).label() + "','" + + TQString::number( (*it).type() ) + "')"); + } + } + + // categories + { + TQStringList categories = (*it).categories(); + TQStringList::ConstIterator it; + for( it = categories.begin(); it != categories.end(); ++it ) + query.exec("INSERT INTO kaddressbook_categories VALUES ('" + + uid + "','" + + (*it) + "')"); + } + + // customs + { + TQStringList list = (*it).customs(); + TQStringList::ConstIterator it; + for( it = list.begin(); it != list.end(); ++it ) { + int dashPos = (*it).find( '-' ); + int colonPos = (*it).find( ':' ); + TQString app = (*it).left( dashPos ); + TQString name = (*it).mid( dashPos + 1, colonPos - dashPos - 1 ); + TQString value = (*it).right( (*it).length() - colonPos - 1 ); + + query.exec("INSERT INTO kaddressbook_categories VALUES ('" + + uid + "','" + app + "','" + name + "','" + value + "')"); + } + } + } + + return true; +} + +TQString ResourceSql::identifier() const +{ + return mHost + "_" + mDbName; +} diff --git a/tdeabc/plugins/sql/resourcesql.h b/tdeabc/plugins/sql/resourcesql.h new file mode 100644 index 000000000..770e5b73b --- /dev/null +++ b/tdeabc/plugins/sql/resourcesql.h @@ -0,0 +1,63 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_RESOURCESQL_H +#define KABC_RESOURCESQL_H + +#include <tdeconfig.h> + +#include "addressbook.h" +#include "resource.h" + +class TQSqlDatabase; + +namespace KABC { + +class ResourceSql : public Resource +{ +public: + ResourceSql( AddressBook *ab, const TQString &user, const TQString &password, + const TQString &db, const TQString &host ); + ResourceSql( AddressBook *ab, const TDEConfig * ); + + bool open(); + void close(); + + Ticket *requestSaveTicket(); + + bool load(); + bool save( Ticket * ticket ); + + TQString identifier() const; + +private: + void init(const TQString &user, const TQString &password, + const TQString &db, const TQString &host ); + + TQString mUser; + TQString mPassword; + TQString mDbName; + TQString mHost; + + TQSqlDatabase *mDb; +}; + +} +#endif diff --git a/tdeabc/plugins/sql/resourcesqlconfig.cpp b/tdeabc/plugins/sql/resourcesqlconfig.cpp new file mode 100644 index 000000000..2f5b9d5b7 --- /dev/null +++ b/tdeabc/plugins/sql/resourcesqlconfig.cpp @@ -0,0 +1,95 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <tqlabel.h> +#include <tqlayout.h> +#include <tqspinbox.h> +#include <tqvbox.h> + +#include <klineedit.h> +#include <tdelocale.h> + +#include "resource.h" +#include "resourcesqlconfig.h" + +using namespace KABC; + +ResourceSqlConfig::ResourceSqlConfig( TQWidget* parent, const char* name ) + : ResourceConfigWidget( parent, name ) +{ + resize( 290, 170 ); + + TQGridLayout *mainLayout = new TQGridLayout( this, 4, 2 ); + + TQLabel *label = new TQLabel( i18n( "Username:" ), this ); + mUser = new KLineEdit( this ); + + mainLayout->addWidget( label, 0, 0 ); + mainLayout->addWidget( mUser, 0, 1 ); + + label = new TQLabel( i18n( "Password:" ), this ); + mPassword = new KLineEdit( this ); + mPassword->setEchoMode( KLineEdit::Password ); + + mainLayout->addWidget( label, 1, 0 ); + mainLayout->addWidget( mPassword, 1, 1 ); + + label = new TQLabel( i18n( "Host:" ), this ); + mHost = new KLineEdit( this ); + + mainLayout->addWidget( label, 2, 0 ); + mainLayout->addWidget( mHost, 2, 1 ); + + label = new TQLabel( i18n( "Port:" ), this ); + TQVBox *box = new TQVBox(this); + mPort = new TQSpinBox(0, 65535, 1, box ); + mPort->setSizePolicy(TQSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Preferred)); + mPort->setValue(389); + new TQWidget(box, "dummy"); + + mainLayout->addWidget( label, 3, 0 ); + mainLayout->addWidget( box, 3, 1 ); + + label = new TQLabel( i18n( "Database:" ), this ); + mDbName = new KLineEdit( this ); + + mainLayout->addWidget( label, 4, 0 ); + mainLayout->addWidget( mDbName, 4, 1 ); +} + +void ResourceSqlConfig::loadSettings( TDEConfig *config ) +{ + mUser->setText( config->readEntry( "SqlUser" ) ); + mPassword->setText( KABC::Resource::cryptStr( config->readEntry( "SqlPassword" ) ) ); + mDbName->setText( config->readEntry( "SqlName" ) ); + mHost->setText( config->readEntry( "SqlHost" ) ); + mPort->setValue( config->readNumEntry( "SqlPort" ) ); +} + +void ResourceSqlConfig::saveSettings( TDEConfig *config ) +{ + config->writeEntry( "SqlUser", mUser->text() ); + config->writeEntry( "SqlPassword", KABC::Resource::cryptStr( mPassword->text() ) ); + config->writeEntry( "SqlName", mDbName->text() ); + config->writeEntry( "SqlHost", mHost->text() ); + config->writeEntry( "SqlPort", mPort->value() ); +} + +#include "resourcesqlconfig.moc" diff --git a/tdeabc/plugins/sql/resourcesqlconfig.h b/tdeabc/plugins/sql/resourcesqlconfig.h new file mode 100644 index 000000000..ae2de7d6d --- /dev/null +++ b/tdeabc/plugins/sql/resourcesqlconfig.h @@ -0,0 +1,51 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 RESOURCESQLCONFIG_H +#define RESOURCESQLCONFIG_H + +#include "resourceconfigwidget.h" + +class KLineEdit; +class TQSpinBox; + +namespace KABC { + +class ResourceSqlConfig : public ResourceConfigWidget +{ + Q_OBJECT + +public: + ResourceSqlConfig( TQWidget* parent = 0, const char* name = 0 ); + +public slots: + void loadSettings( TDEConfig *config ); + void saveSettings( TDEConfig *config ); + +private: + KLineEdit* mUser; + KLineEdit* mPassword; + KLineEdit* mDbName; + KLineEdit* mHost; + TQSpinBox* mPort; +}; + +} +#endif diff --git a/tdeabc/plugins/sql/sql.desktop b/tdeabc/plugins/sql/sql.desktop new file mode 100644 index 000000000..4ac553008 --- /dev/null +++ b/tdeabc/plugins/sql/sql.desktop @@ -0,0 +1,10 @@ +[Misc] +Name=SQL +Name[bn]=à¦à¦¸-কিউ-à¦à¦² (SQL) +Name[hi]=à¤à¤¸à¤•à¥à¤¯à¥‚à¤à¤² (SQL) +Name[ss]=I-SQL +Name[te]=à°à°¸à±à°•à±à°¯à±à°Žà°²à± + +[Plugin] +Type=sql +X-TDE-Library=kabc_sql diff --git a/tdeabc/resource.cpp b/tdeabc/resource.cpp new file mode 100644 index 000000000..9613d90b5 --- /dev/null +++ b/tdeabc/resource.cpp @@ -0,0 +1,351 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <kdebug.h> +#include <tdelocale.h> + +#include "resource.h" + +using namespace KABC; + +Ticket::Ticket( Resource *resource ) + : mResource( resource ) +{ +} + +Ticket::~Ticket() +{ +/* FIXME: avoid cycle deletion + if ( mResource ) + mResource->releaseSaveTicket( this ); +*/ +} + +Resource *Ticket::resource() +{ + return mResource; +} + +struct Resource::Iterator::IteratorData +{ + Addressee::Map::Iterator mIt; +}; + +struct Resource::ConstIterator::ConstIteratorData +{ + Addressee::Map::ConstIterator mIt; +}; + +Resource::Iterator::Iterator() +{ + d = new IteratorData; +} + +Resource::Iterator::Iterator( const Resource::Iterator &i ) +{ + d = new IteratorData; + d->mIt = i.d->mIt; +} + +Resource::Iterator &Resource::Iterator::operator=( const Resource::Iterator &i ) +{ + if ( this == &i ) + return *this; + delete d; + + d = new IteratorData; + d->mIt = i.d->mIt; + return *this; +} + +Resource::Iterator::~Iterator() +{ + delete d; +} + +const Addressee &Resource::Iterator::operator*() const +{ + return d->mIt.data(); +} + +Addressee &Resource::Iterator::operator*() +{ + return d->mIt.data(); +} + +Resource::Iterator &Resource::Iterator::operator++() +{ + (d->mIt)++; + return *this; +} + +Resource::Iterator &Resource::Iterator::operator++( int ) +{ + (d->mIt)++; + return *this; +} + +Resource::Iterator &Resource::Iterator::operator--() +{ + (d->mIt)--; + return *this; +} + +Resource::Iterator &Resource::Iterator::operator--( int ) +{ + (d->mIt)--; + return *this; +} + +bool Resource::Iterator::operator==( const Iterator &it ) +{ + return ( d->mIt == it.d->mIt ); +} + +bool Resource::Iterator::operator!=( const Iterator &it ) +{ + return ( d->mIt != it.d->mIt ); +} + +Resource::ConstIterator::ConstIterator() +{ + d = new ConstIteratorData; +} + +Resource::ConstIterator::ConstIterator( const Resource::ConstIterator &i ) +{ + d = new ConstIteratorData; + d->mIt = i.d->mIt; +} + +Resource::ConstIterator::ConstIterator( const Resource::Iterator &i ) +{ + d = new ConstIteratorData; + d->mIt = i.d->mIt; +} + +Resource::ConstIterator &Resource::ConstIterator::operator=( const Resource::ConstIterator &i ) +{ + if ( this == &i ) + return *this; + delete d; + + d = new ConstIteratorData; + d->mIt = i.d->mIt; + return *this; +} + +Resource::ConstIterator::~ConstIterator() +{ + delete d; +} + +const Addressee &Resource::ConstIterator::operator*() const +{ + return *(d->mIt); +} + +Resource::ConstIterator &Resource::ConstIterator::operator++() +{ + (d->mIt)++; + return *this; +} + +Resource::ConstIterator &Resource::ConstIterator::operator++( int ) +{ + (d->mIt)++; + return *this; +} + +Resource::ConstIterator &Resource::ConstIterator::operator--() +{ + (d->mIt)--; + return *this; +} + +Resource::ConstIterator &Resource::ConstIterator::operator--( int ) +{ + (d->mIt)--; + return *this; +} + +bool Resource::ConstIterator::operator==( const ConstIterator &it ) +{ + return ( d->mIt == it.d->mIt ); +} + +bool Resource::ConstIterator::operator!=( const ConstIterator &it ) +{ + return ( d->mIt != it.d->mIt ); +} + + +Resource::Resource( const TDEConfig *config ) + : KRES::Resource( config ), mAddressBook( 0 ) +{ +} + +Resource::~Resource() +{ +} + +Resource::Iterator Resource::begin() +{ + Iterator it; + it.d->mIt = mAddrMap.begin(); + + return it; +} + +Resource::ConstIterator Resource::begin() const +{ + ConstIterator it; + it.d->mIt = mAddrMap.constBegin(); + return it; +} + +Resource::Iterator Resource::end() +{ + Iterator it; + it.d->mIt = mAddrMap.end(); + + return it; +} + +Resource::ConstIterator Resource::end() const +{ + ConstIterator it; + it.d->mIt = mAddrMap.constEnd(); + return it; +} + +void Resource::writeConfig( TDEConfig *config ) +{ + KRES::Resource::writeConfig( config ); +} + +void Resource::setAddressBook( AddressBook *ab ) +{ + mAddressBook = ab; +} + +AddressBook *Resource::addressBook() +{ + return mAddressBook; +} + +Ticket *Resource::createTicket( Resource *resource ) +{ + return new Ticket( resource ); +} + +void Resource::insertAddressee( const Addressee &addr ) +{ + mAddrMap.insert( addr.uid(), addr ); +} + +void Resource::removeAddressee( const Addressee &addr ) +{ + mAddrMap.erase( addr.uid() ); +} + +Addressee Resource::findByUid( const TQString &uid ) +{ + Addressee::Map::ConstIterator it = mAddrMap.find( uid ); + + if ( it != mAddrMap.end() ) + return it.data(); + + return Addressee(); +} + +Addressee::List Resource::findByName( const TQString &name ) +{ + Addressee::List results; + + ConstIterator it; + for ( it = begin(); it != end(); ++it ) { + if ( name == (*it).name() ) + results.append( *it ); + } + + return results; +} + +Addressee::List Resource::findByEmail( const TQString &email ) +{ + Addressee::List results; + const TQString lowerEmail = email.lower(); + + ConstIterator it; + for ( it = begin(); it != end(); ++it ) { + const TQStringList mailList = (*it).emails(); + for ( TQStringList::ConstIterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { + if ( lowerEmail == (*ite).lower() ) + results.append( *it ); + } + } + + return results; +} + +Addressee::List Resource::findByCategory( const TQString &category ) +{ + Addressee::List results; + + ConstIterator it; + for ( it = begin(); it != end(); ++it ) { + if ( (*it).hasCategory( category) ) { + results.append( *it ); + } + } + + return results; +} + +void Resource::clear() +{ + mAddrMap.clear(); +} + +bool Resource::asyncLoad() +{ + bool ok = load(); + if ( !ok ) + emit loadingError( this, i18n( "Loading resource '%1' failed!" ) + .arg( resourceName() ) ); + else + emit loadingFinished( this ); + + return ok; +} + +bool Resource::asyncSave( Ticket *ticket ) { + bool ok = save( ticket ); + if ( !ok ) + emit savingError( this, i18n( "Saving resource '%1' failed!" ) + .arg( resourceName() ) ); + else + emit savingFinished( this ); + + return ok; +} + +#include "resource.moc" diff --git a/tdeabc/resource.h b/tdeabc/resource.h new file mode 100644 index 000000000..0f5167e7b --- /dev/null +++ b/tdeabc/resource.h @@ -0,0 +1,319 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_RESOURCE_H +#define KABC_RESOURCE_H + +#include <tderesources/resource.h> + +#include "addressbook.h" +#include "plugin.h" + +namespace KABC { + +/** + * @short Helper class for handling coordinated save of address books. + * + * This class is used as helper class for saving address book. + * @see requestSaveTicket(), save(). + */ +class KABC_EXPORT Ticket +{ + friend class Resource; + + public: + ~Ticket(); + + Resource *resource(); + + private: + Ticket( Resource *resource ); + + Resource *mResource; +}; + +/** + * @internal + */ +class KABC_EXPORT Resource : public KRES::Resource +{ + Q_OBJECT + + public: + + /** + @short Resource Iterator + + This class provides an iterator for resource entries. + By default it points to a TQValueList<Addressee>::Iterator, + but you can reimplement this class to fit your own needs. + */ + class KABC_EXPORT Iterator + { + public: + Iterator(); + Iterator( const Iterator & ); + virtual ~Iterator(); + + virtual Iterator &operator=( const Iterator & ); + virtual const Addressee &operator*() const; + virtual Addressee &operator*(); + virtual Iterator &operator++(); + virtual Iterator &operator++( int ); + virtual Iterator &operator--(); + virtual Iterator &operator--( int ); + virtual bool operator==( const Iterator &it ); + virtual bool operator!=( const Iterator &it ); + + struct IteratorData; + IteratorData *d; + }; + + /** + @short Resource Const Iterator + + This class provides a const iterator for resource entries. + */ + class KABC_EXPORT ConstIterator + { + public: + ConstIterator(); + ConstIterator( const ConstIterator & ); + ConstIterator( const Iterator & ); + virtual ~ConstIterator(); + + virtual ConstIterator &operator=( const ConstIterator & ); + virtual const Addressee &operator*() const ; + virtual ConstIterator &operator++(); + virtual ConstIterator &operator++( int ); + virtual ConstIterator &operator--(); + virtual ConstIterator &operator--( int ); + virtual bool operator==( const ConstIterator &it ); + virtual bool operator!=( const ConstIterator &it ); + + struct ConstIteratorData; + ConstIteratorData *d; + }; + + /** + Constructor. + + @param config The config object where the derived classes can + read out their settings. + */ + Resource( const TDEConfig *config ); + + /** + Destructor. + */ + virtual ~Resource(); + + /** + Returns an iterator pointing to the first addressee in the resource. + This iterator equals end() if the resource is empty. + */ + virtual ConstIterator begin() const; + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + */ + virtual Iterator begin(); + + /** + Returns an iterator pointing to the last addressee in the resource. + This iterator equals begin() if the resource is empty. + */ + virtual ConstIterator end() const; + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + */ + virtual Iterator end(); + + /** + Returns a pointer to the addressbook. + */ + AddressBook *addressBook(); + + /** + Writes the resource specific config to file. + */ + virtual void writeConfig( TDEConfig *config ); + + /** + Request a ticket, you have to pass through save() to + allow locking. The resource has to create its locks + in this function. + */ + virtual Ticket *requestSaveTicket() = 0; + + /** + Releases the ticket previousely requested with requestSaveTicket(). + The resource has to remove its locks in this function. + This function is also responsible for deleting the ticket. + */ + virtual void releaseSaveTicket( Ticket* ) = 0; + + /** + Loads all addressees synchronously. + + @returns Whether the loading was successfully. + */ + virtual bool load() = 0; + + /** + Loads all addressees asyncronously. You have to make sure that either + the loadingFinished() or loadingError() signal is emitted from within + this function. + + The default implementation simply calls the synchronous load. + + @return Whether the synchronous part of loading was successfully. + */ + virtual bool asyncLoad(); + + /** + Insert an addressee into the resource. + */ + virtual void insertAddressee( const Addressee& ); + + /** + Removes an addressee from resource. + */ + virtual void removeAddressee( const Addressee& addr ); + + /** + Saves all addressees synchronously. + + @param ticket You have to release the ticket later with + releaseSaveTicket() explicitely. + @return Whether the saving was successfully. + */ + virtual bool save( Ticket *ticket ) = 0; + + /** + Saves all addressees asynchronously. You have to make sure that either + the savingFinished() or savingError() signal is emitted from within + this function. + + The default implementation simply calls the synchronous save. + + @param ticket You have to release the ticket later with + releaseSaveTicket() explicitely. + @return Whether the saving was successfully. + */ + virtual bool asyncSave( Ticket *ticket ); + + /** + Searches an addressee with the specified unique identifier. + + @param uid The unique identifier you are looking for. + @return The addressee with the specified unique identifier or an + empty addressee. + */ + virtual Addressee findByUid( const TQString &uid ); + + /** + Searches all addressees which match the specified name. + + @param name The name you are looking for. + @return A list of all matching addressees. + */ + virtual Addressee::List findByName( const TQString &name ); + + /** + Searches all addressees which match the specified email address. + + @param email The email address you are looking for. + @return A list of all matching addressees. + */ + virtual Addressee::List findByEmail( const TQString &email ); + + /** + Searches all addressees which belongs to the specified category. + + @param category The category you are looking for. + @return A list of all matching addressees. + */ + virtual Addressee::List findByCategory( const TQString &category ); + + /** + Removes all addressees from the resource. + */ + virtual void clear(); + + /** + @internal + + Sets the address book of the resource. + */ + void setAddressBook( AddressBook* ); + + signals: + /** + This signal is emitted when the resource has finished the loading of all + addressees from the backend to the internal cache. + + @param resource The pointer to the resource which emitted this signal. + */ + void loadingFinished( Resource *resource ); + + /** + This signal is emitted when an error occured during loading the + addressees from the backend to the internal cache. + + @param resource The pointer to the resource which emitted this signal. + @param msg A translated error message. + */ + void loadingError( Resource *resource, const TQString &msg ); + + /** + This signal is emitted when the resource has finished the saving of all + addressees from the internal cache to the backend. + + @param resource The pointer to the resource which emitted this signal. + */ + void savingFinished( Resource *resource ); + + /** + This signal is emitted when an error occured during saving the + addressees from the internal cache to the backend. + + @param resource The pointer to the resource which emitted this signal. + @param msg A translated error message. + */ + void savingError( Resource *resource, const TQString &msg ); + + protected: + Ticket *createTicket( Resource * ); + Addressee::Map mAddrMap; + + private: + AddressBook *mAddressBook; + + class ResourcePrivate; + ResourcePrivate *d; +}; + +} + +#endif diff --git a/tdeabc/resourceselectdialog.cpp b/tdeabc/resourceselectdialog.cpp new file mode 100644 index 000000000..92f770ed4 --- /dev/null +++ b/tdeabc/resourceselectdialog.cpp @@ -0,0 +1,111 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <tdelocale.h> +#include <kbuttonbox.h> +#include <tdelistbox.h> +#include <kstdguiitem.h> + +#include <tqgroupbox.h> +#include <tqlayout.h> + +#include "resource.h" +#include "addressbook.h" + +#include "resourceselectdialog.h" + +using namespace KABC; + +ResourceSelectDialog::ResourceSelectDialog( AddressBook *ab, TQWidget *parent, const char *name ) + : KDialog( parent, name, true ) +{ + setCaption( i18n( "Resource Selection" ) ); + resize( 300, 200 ); + + TQVBoxLayout *mainLayout = new TQVBoxLayout( this ); + mainLayout->setMargin( marginHint() ); + + TQGroupBox *groupBox = new TQGroupBox( 2, Qt::Horizontal, this ); + groupBox->setTitle( i18n( "Resources" ) ); + + mResourceId = new TDEListBox( groupBox ); + + mainLayout->addWidget( groupBox ); + + mainLayout->addSpacing( 10 ); + + KButtonBox *buttonBox = new KButtonBox( this ); + + buttonBox->addStretch(); + buttonBox->addButton( KStdGuiItem::ok(), TQT_TQOBJECT(this), TQT_SLOT( accept() ) ); + buttonBox->addButton( KStdGuiItem::cancel(), TQT_TQOBJECT(this), TQT_SLOT( reject() ) ); + buttonBox->layout(); + + mainLayout->addWidget( buttonBox ); + + // setup listbox + uint counter = 0; + TQPtrList<Resource> list = ab->resources(); + for ( uint i = 0; i < list.count(); ++i ) { + Resource *resource = list.at( i ); + if ( resource && !resource->readOnly() ) { + mResourceMap.insert( counter, resource ); + mResourceId->insertItem( resource->resourceName() ); + counter++; + } + } + + mResourceId->setCurrentItem( 0 ); +} + +Resource *ResourceSelectDialog::resource() +{ + if ( mResourceId->currentItem() != -1 ) + return mResourceMap[ mResourceId->currentItem() ]; + else + return 0; +} + +Resource *ResourceSelectDialog::getResource( AddressBook *ab, TQWidget *parent ) +{ + TQPtrList<Resource> resources = ab->resources(); + if ( resources.count() == 1 ) return resources.first(); + + Resource *found = 0; + Resource *r = resources.first(); + while( r ) { + if ( !r->readOnly() ) { + if ( found ) { + found = 0; + break; + } else { + found = r; + } + } + r = resources.next(); + } + if ( found ) return found; + + ResourceSelectDialog dlg( ab, parent ); + if ( dlg.exec() == KDialog::Accepted ) return dlg.resource(); + else return 0; +} + +#include "resourceselectdialog.moc" diff --git a/tdeabc/resourceselectdialog.h b/tdeabc/resourceselectdialog.h new file mode 100644 index 000000000..f5f2d6984 --- /dev/null +++ b/tdeabc/resourceselectdialog.h @@ -0,0 +1,57 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_RESOURCESELECTDIALOG_H +#define KABC_RESOURCESELECTDIALOG_H + +#include <tqmap.h> + +#include <kdialog.h> +#include <kdemacros.h> + +class TDEListBox; + +namespace KABC { + +class AddressBook; +class Resource; + +/** + This class is @deprecated, use KRES::SelectDialog instead. + */ +class KABC_EXPORT_DEPRECATED ResourceSelectDialog : KDialog +{ + Q_OBJECT + + public: + ResourceSelectDialog( AddressBook *ab, TQWidget *parent = 0, + const char *name = 0); + Resource *resource(); + + static Resource *getResource( AddressBook *ab, TQWidget *parent = 0 ); + + private: + TDEListBox *mResourceId; + TQMap<int, Resource*> mResourceMap; +}; + +} + +#endif diff --git a/tdeabc/scripts/Makefile.am b/tdeabc/scripts/Makefile.am new file mode 100644 index 000000000..7715fba5c --- /dev/null +++ b/tdeabc/scripts/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = $(srcdir)/makeaddressee \ + $(srcdir)/addressee.src.cpp \ + $(srcdir)/addressee.src.h \ + $(srcdir)/entrylist \ + $(srcdir)/field.src.cpp + diff --git a/tdeabc/scripts/addressee.src.cpp b/tdeabc/scripts/addressee.src.cpp new file mode 100644 index 000000000..7514b4a1d --- /dev/null +++ b/tdeabc/scripts/addressee.src.cpp @@ -0,0 +1,1127 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> + Copyright (c) 2003 Carsten Pfeiffer <pfeiffer@kde.org> + Copyright (c) 2005 Ingo Kloecker <kloecker@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 <tqregexp.h> + +#include <ksharedptr.h> +#include <kdebug.h> +#include <tdeapplication.h> +#include <tdelocale.h> + +#include "addresseehelper.h" +#include "field.h" +#include "resource.h" +#include "sortmode.h" + +#include "addressee.h" + +using namespace KABC; + +static bool matchBinaryPattern( int value, int pattern ); + +template <class L> +static bool listEquals( const TQValueList<L>&, const TQValueList<L>& ); +static bool emailsEquals( const TQStringList&, const TQStringList& ); + +KABC::SortMode *Addressee::mSortMode = 0; + +struct Addressee::AddresseeData : public TDEShared +{ + TQString uid; + TQString uri; + --VARIABLES-- + + PhoneNumber::List phoneNumbers; + Address::List addresses; + Key::List keys; + TQStringList emails; + TQStringList categories; + TQStringList custom; + + Resource *resource; + + bool empty :1; + bool changed :1; +}; + +Addressee::AddresseeData* Addressee::shared_null = 0; + +Addressee::AddresseeData* Addressee::makeSharedNull() +{ + Addressee::shared_null = new AddresseeData; + shared_null->_TDEShared_ref(); //just in case (we should add KSD) + shared_null->empty = true; + shared_null->changed = false; + shared_null->resource = 0; + return shared_null; +} + +Addressee::Addressee() +{ + mData = shared_null ? shared_null : makeSharedNull(); +} + +Addressee::~Addressee() +{ +} + +Addressee::Addressee( const Addressee &a ) +{ + mData = a.mData; +} + +Addressee &Addressee::operator=( const Addressee &a ) +{ + if ( this == &a ) + return (*this); + + mData = a.mData; + return (*this); +} + +void Addressee::detach() +{ + if ( mData.data() == shared_null ) { + mData = new AddresseeData; + mData->empty = true; + mData->changed = false; + mData->resource = 0; + mData->uid = TDEApplication::randomString( 10 ); + return; + } else if ( mData.count() == 1 ) return; + + AddresseeData data = *mData; + mData = new AddresseeData( data ); +} + +bool Addressee::operator==( const Addressee &a ) const +{ + if ( uid() != a.uid() ) { + kdDebug(5700) << "uid differs" << endl; + return false; + } + --EQUALSTEST-- + if ( ( mData->url.isValid() || a.mData->url.isValid() ) && + ( mData->url != a.mData->url ) ) { + kdDebug(5700) << "url differs" << endl; + return false; + } + if ( !listEquals( mData->phoneNumbers, a.mData->phoneNumbers ) ) { + kdDebug(5700) << "phoneNumbers differs" << endl; + return false; + } + if ( !listEquals( mData->addresses, a.mData->addresses ) ) { + kdDebug(5700) << "addresses differs" << endl; + return false; + } + if ( !listEquals( mData->keys, a.mData->keys ) ) { + kdDebug(5700) << "keys differs" << endl; + return false; + } + if ( !emailsEquals( mData->emails, a.mData->emails ) ) { + kdDebug(5700) << "emails differs" << endl; + return false; + } + if ( !listEquals( mData->categories, a.mData->categories ) ) { + kdDebug(5700) << "categories differs" << endl; + return false; + } + if ( !listEquals( mData->custom, a.mData->custom ) ) { + kdDebug(5700) << "custom differs" << endl; + return false; + } + + return true; +} + +bool Addressee::operator!=( const Addressee &a ) const +{ + return !( a == *this ); +} + +bool Addressee::isEmpty() const +{ + return mData->empty; +} + +void Addressee::setUid( const TQString &id ) +{ + if ( id == mData->uid ) return; + detach(); + mData->empty = false; + mData->uid = id; +} + +TQString Addressee::uid() const +{ + return mData->uid; +} + +TQString Addressee::uidLabel() +{ + return i18n("Unique Identifier"); +} + +void Addressee::setUri( const TQString &id ) +{ + if ( id == mData->uri ) return; + detach(); + mData->empty = false; + mData->uri = id; +} + +TQString Addressee::uri() const +{ + return mData->uri; +} + +TQString Addressee::uriLabel() +{ + return i18n("Unique Resource Identifier"); +} + +--DEFINITIONS-- + +void Addressee::setNameFromString( const TQString &s ) +{ + TQString str = s; + //remove enclosing quotes from string + if ( str.length() > 1 && s[ 0 ] == '"' && s[ s.length() - 1 ] == '"' ) + str = s.mid( 1, s.length() - 2 ); + + setFormattedName( str ); + setName( str ); + + // clear all name parts + setPrefix( TQString() ); + setGivenName( TQString() ); + setAdditionalName( TQString() ); + setFamilyName( TQString() ); + setSuffix( TQString() ); + + if ( str.isEmpty() ) + return; + + TQString spaceStr = " "; + TQString emptyStr = ""; + AddresseeHelper *helper = AddresseeHelper::self(); + + int i = str.find( ',' ); + if( i < 0 ) { + TQStringList parts = TQStringList::split( spaceStr, str ); + int leftOffset = 0; + int rightOffset = parts.count() - 1; + + TQString suffix; + while ( rightOffset >= 0 ) { + if ( helper->containsSuffix( parts[ rightOffset ] ) ) { + suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? emptyStr : spaceStr)); + rightOffset--; + } else + break; + } + setSuffix( suffix ); + + if ( rightOffset < 0 ) + return; + + TQStringList inclusionList; + for ( int n = 1; (rightOffset - n >= 0) && (n < 4); ++n ) { + if ( helper->containsPrefix( parts[ rightOffset - n ].lower() ) ) { + inclusionList.prepend( parts[ rightOffset - n ] ); + } else + break; + } + + if ( !inclusionList.isEmpty() ) { + setFamilyName( inclusionList.join( " " ) + spaceStr + parts[ rightOffset ] ); + rightOffset -= inclusionList.count(); + } else { + if ( helper->tradeAsFamilyName() ) + setFamilyName( parts[ rightOffset ] ); + else + setGivenName( parts[ rightOffset ] ); + } + + TQString prefix; + while ( leftOffset < rightOffset ) { + if ( helper->containsTitle( parts[ leftOffset ] ) ) { + prefix.append( ( prefix.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } else + break; + } + setPrefix( prefix ); + + if ( leftOffset < rightOffset ) { + setGivenName( parts[ leftOffset ] ); + leftOffset++; + } + + TQString additionalName; + while ( leftOffset < rightOffset ) { + additionalName.append( ( additionalName.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } + setAdditionalName( additionalName ); + } else { + TQString part1 = str.left( i ); + TQString part2 = str.mid( i + 1 ); + + TQStringList parts = TQStringList::split( spaceStr, part1 ); + int leftOffset = 0; + int rightOffset = parts.count() - 1; + + if ( parts.count() > 0 ) { + + TQString suffix; + while ( rightOffset >= 0 ) { + if ( helper->containsSuffix( parts[ rightOffset ] ) ) { + suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? emptyStr : spaceStr)); + rightOffset--; + } else + break; + } + setSuffix( suffix ); + + if ( rightOffset - 1 >= 0 && helper->containsPrefix( parts[ rightOffset - 1 ].lower() ) ) { + setFamilyName( parts[ rightOffset - 1 ] + spaceStr + parts[ rightOffset ] ); + rightOffset--; + } else + setFamilyName( parts[ rightOffset ] ); + + TQString prefix; + while ( leftOffset < rightOffset ) { + if ( helper->containsTitle( parts[ leftOffset ] ) ) { + prefix.append( ( prefix.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } else + break; + } + } else { + setPrefix( "" ); + setFamilyName( "" ); + setSuffix( "" ); + } + + parts = TQStringList::split( spaceStr, part2 ); + + leftOffset = 0; + rightOffset = parts.count(); + + if ( parts.count() > 0 ) { + + TQString prefix; + while ( leftOffset < rightOffset ) { + if ( helper->containsTitle( parts[ leftOffset ] ) ) { + prefix.append( ( prefix.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } else + break; + } + setPrefix( prefix ); + + if ( leftOffset < rightOffset ) { + setGivenName( parts[ leftOffset ] ); + leftOffset++; + } + + TQString additionalName; + while ( leftOffset < rightOffset ) { + additionalName.append( ( additionalName.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } + setAdditionalName( additionalName ); + } else { + setGivenName( "" ); + setAdditionalName( "" ); + } + } +} + +TQString Addressee::realName() const +{ + TQString n( formattedName() ); + if ( !n.isEmpty() ) + return n; + + n = assembledName(); + if ( !n.isEmpty() ) + return n; + + n = name(); + if ( !n.isEmpty() ) + return n; + + return organization(); +} + +TQString Addressee::assembledName() const +{ + TQString name = prefix() + " " + givenName() + " " + additionalName() + " " + + familyName() + " " + suffix(); + + return name.simplifyWhiteSpace(); +} + +TQString Addressee::fullEmail( const TQString &email ) const +{ + TQString e; + if ( email.isNull() ) { + e = preferredEmail(); + } else { + e = email; + } + if ( e.isEmpty() ) return TQString(); + + TQString text; + if ( realName().isEmpty() ) + text = e; + else { + TQRegExp needQuotes( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ); + if ( realName().find( needQuotes ) != -1 ) { + TQString name = realName(); + name.replace( "\"", "\\\"" ); + text = "\"" + name + "\" <" + e + ">"; + } else + text = realName() + " <" + e + ">"; + } + + return text; +} + +void Addressee::insertEmail( const TQString &email, bool preferred ) +{ + if ( email.simplifyWhiteSpace().isEmpty() ) + return; + + detach(); + mData->empty = false; + + TQStringList::Iterator it = mData->emails.find( email ); + + if ( it != mData->emails.end() ) { + if ( !preferred || it == mData->emails.begin() ) return; + mData->emails.remove( it ); + mData->emails.prepend( email ); + } else { + if ( preferred ) { + mData->emails.prepend( email ); + } else { + mData->emails.append( email ); + } + } +} + +void Addressee::removeEmail( const TQString &email ) +{ + detach(); + + TQStringList::Iterator it = mData->emails.find( email ); + if ( it == mData->emails.end() ) return; + + mData->emails.remove( it ); +} + +TQString Addressee::preferredEmail() const +{ + if ( mData->emails.count() == 0 ) return TQString(); + else return mData->emails.first(); +} + +TQStringList Addressee::emails() const +{ + return mData->emails; +} +void Addressee::setEmails( const TQStringList& emails ) { + detach(); + + mData->emails = emails; +} +void Addressee::insertPhoneNumber( const PhoneNumber &phoneNumber ) +{ + detach(); + mData->empty = false; + + PhoneNumber::List::Iterator it; + for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { + if ( (*it).id() == phoneNumber.id() ) { + *it = phoneNumber; + return; + } + } + if ( !phoneNumber.number().simplifyWhiteSpace().isEmpty() ) + mData->phoneNumbers.append( phoneNumber ); +} + +void Addressee::removePhoneNumber( const PhoneNumber &phoneNumber ) +{ + detach(); + + PhoneNumber::List::Iterator it; + for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { + if ( (*it).id() == phoneNumber.id() ) { + mData->phoneNumbers.remove( it ); + return; + } + } +} + +PhoneNumber Addressee::phoneNumber( int type ) const +{ + PhoneNumber phoneNumber( "", type ); + PhoneNumber::List::ConstIterator it; + for( it = mData->phoneNumbers.constBegin(); it != mData->phoneNumbers.constEnd(); ++it ) { + if ( matchBinaryPattern( (*it).type(), type ) ) { + if ( (*it).type() & PhoneNumber::Pref ) + return (*it); + else if ( phoneNumber.number().isEmpty() ) + phoneNumber = (*it); + } + } + + return phoneNumber; +} + +PhoneNumber::List Addressee::phoneNumbers() const +{ + return mData->phoneNumbers; +} + +PhoneNumber::List Addressee::phoneNumbers( int type ) const +{ + PhoneNumber::List list; + + PhoneNumber::List::ConstIterator it; + for( it = mData->phoneNumbers.constBegin(); it != mData->phoneNumbers.constEnd(); ++it ) { + if ( matchBinaryPattern( (*it).type(), type ) ) { + list.append( *it ); + } + } + return list; +} + +PhoneNumber Addressee::findPhoneNumber( const TQString &id ) const +{ + PhoneNumber::List::ConstIterator it; + for( it = mData->phoneNumbers.constBegin(); it != mData->phoneNumbers.constEnd(); ++it ) { + if ( (*it).id() == id ) { + return *it; + } + } + return PhoneNumber(); +} + +void Addressee::insertKey( const Key &key ) +{ + detach(); + mData->empty = false; + + Key::List::Iterator it; + for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { + if ( (*it).id() == key.id() ) { + *it = key; + return; + } + } + mData->keys.append( key ); +} + +void Addressee::removeKey( const Key &key ) +{ + detach(); + + Key::List::Iterator it; + for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { + if ( (*it).id() == key.id() ) { + mData->keys.remove( key ); + return; + } + } +} + +Key Addressee::key( int type, TQString customTypeString ) const +{ + Key::List::ConstIterator it; + for( it = mData->keys.constBegin(); it != mData->keys.constEnd(); ++it ) { + if ( (*it).type() == type ) { + if ( type == Key::Custom ) { + if ( customTypeString.isEmpty() ) { + return *it; + } else { + if ( (*it).customTypeString() == customTypeString ) + return (*it); + } + } else { + return *it; + } + } + } + return Key( TQString(), type ); +} + +void Addressee::setKeys( const Key::List& list ) +{ + detach(); + mData->keys = list; +} + +Key::List Addressee::keys() const +{ + return mData->keys; +} + +Key::List Addressee::keys( int type, TQString customTypeString ) const +{ + Key::List list; + + Key::List::ConstIterator it; + for( it = mData->keys.constBegin(); it != mData->keys.constEnd(); ++it ) { + if ( (*it).type() == type ) { + if ( type == Key::Custom ) { + if ( customTypeString.isEmpty() ) { + list.append( *it ); + } else { + if ( (*it).customTypeString() == customTypeString ) + list.append( *it ); + } + } else { + list.append( *it ); + } + } + } + return list; +} + +Key Addressee::findKey( const TQString &id ) const +{ + Key::List::ConstIterator it; + for( it = mData->keys.constBegin(); it != mData->keys.constEnd(); ++it ) { + if ( (*it).id() == id ) { + return *it; + } + } + return Key(); +} + +TQString Addressee::asString() const +{ + return "Smith, agent Smith..."; +} + +void Addressee::dump() const +{ + kdDebug(5700) << "Addressee {" << endl; + + kdDebug(5700) << " Uid: '" << uid() << "'" << endl; + + --DEBUG-- + + kdDebug(5700) << " Emails {" << endl; + const TQStringList e = emails(); + TQStringList::ConstIterator it; + for( it = e.begin(); it != e.end(); ++it ) { + kdDebug(5700) << " " << (*it) << endl; + } + kdDebug(5700) << " }" << endl; + + kdDebug(5700) << " PhoneNumbers {" << endl; + const PhoneNumber::List p = phoneNumbers(); + PhoneNumber::List::ConstIterator it2; + for( it2 = p.begin(); it2 != p.end(); ++it2 ) { + kdDebug(5700) << " Type: " << int((*it2).type()) << " Number: " << (*it2).number() << endl; + } + kdDebug(5700) << " }" << endl; + + const Address::List a = addresses(); + Address::List::ConstIterator it3; + for( it3 = a.begin(); it3 != a.end(); ++it3 ) { + (*it3).dump(); + } + + kdDebug(5700) << " Keys {" << endl; + const Key::List k = keys(); + Key::List::ConstIterator it4; + for( it4 = k.begin(); it4 != k.end(); ++it4 ) { + kdDebug(5700) << " Type: " << int((*it4).type()) << + " Key: " << (*it4).textData() << + " CustomString: " << (*it4).customTypeString() << endl; + } + kdDebug(5700) << " }" << endl; + + kdDebug(5700) << "}" << endl; +} + + +void Addressee::insertAddress( const Address &address ) +{ + if ( address.isEmpty() ) + return; + + detach(); + mData->empty = false; + + Address::List::Iterator it; + for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { + if ( (*it).id() == address.id() ) { + *it = address; + return; + } + } + + mData->addresses.append( address ); +} + +void Addressee::removeAddress( const Address &address ) +{ + detach(); + + Address::List::Iterator it; + for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { + if ( (*it).id() == address.id() ) { + mData->addresses.remove( it ); + return; + } + } +} + +Address Addressee::address( int type ) const +{ + Address address( type ); + Address::List::ConstIterator it; + for( it = mData->addresses.constBegin(); it != mData->addresses.constEnd(); ++it ) { + if ( matchBinaryPattern( (*it).type(), type ) ) { + if ( (*it).type() & Address::Pref ) + return (*it); + else if ( address.isEmpty() ) + address = (*it); + } + } + + return address; +} + +Address::List Addressee::addresses() const +{ + return mData->addresses; +} + +Address::List Addressee::addresses( int type ) const +{ + Address::List list; + + Address::List::ConstIterator it; + for( it = mData->addresses.constBegin(); it != mData->addresses.constEnd(); ++it ) { + if ( matchBinaryPattern( (*it).type(), type ) ) { + list.append( *it ); + } + } + + return list; +} + +Address Addressee::findAddress( const TQString &id ) const +{ + Address::List::ConstIterator it; + for( it = mData->addresses.constBegin(); it != mData->addresses.constEnd(); ++it ) { + if ( (*it).id() == id ) { + return *it; + } + } + return Address(); +} + +void Addressee::insertCategory( const TQString &c ) +{ + detach(); + mData->empty = false; + + if ( mData->categories.findIndex( c ) != -1 ) return; + + mData->categories.append( c ); +} + +void Addressee::removeCategory( const TQString &c ) +{ + detach(); + + TQStringList::Iterator it = mData->categories.find( c ); + if ( it == mData->categories.end() ) return; + + mData->categories.remove( it ); +} + +bool Addressee::hasCategory( const TQString &c ) const +{ + return ( mData->categories.findIndex( c ) != -1 ); +} + +void Addressee::setCategories( const TQStringList &c ) +{ + detach(); + mData->empty = false; + + mData->categories = c; +} + +TQStringList Addressee::categories() const +{ + return mData->categories; +} + +void Addressee::insertCustom( const TQString &app, const TQString &name, + const TQString &value ) +{ + if ( value.isEmpty() || name.isEmpty() || app.isEmpty() ) return; + + detach(); + mData->empty = false; + + TQString qualifiedName = app + "-" + name + ":"; + + TQStringList::Iterator it; + for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { + if ( (*it).startsWith( qualifiedName ) ) { + (*it) = qualifiedName + value; + return; + } + } + + mData->custom.append( qualifiedName + value ); +} + +void Addressee::removeCustom( const TQString &app, const TQString &name) +{ + detach(); + + TQString qualifiedName = app + "-" + name + ":"; + + TQStringList::Iterator it; + for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { + if ( (*it).startsWith( qualifiedName ) ) { + mData->custom.remove( it ); + return; + } + } +} + +TQString Addressee::custom( const TQString &app, const TQString &name ) const +{ + TQString qualifiedName = app + "-" + name + ":"; + TQString value; + + TQStringList::ConstIterator it; + for( it = mData->custom.constBegin(); it != mData->custom.constEnd(); ++it ) { + if ( (*it).startsWith( qualifiedName ) ) { + value = (*it).mid( (*it).find( ":" ) + 1 ); + break; + } + } + + return value; +} + +void Addressee::setCustoms( const TQStringList &l ) +{ + detach(); + mData->empty = false; + + mData->custom = l; +} + +TQStringList Addressee::customs() const +{ + return mData->custom; +} + +void Addressee::parseEmailAddress( const TQString &rawEmail, TQString &fullName, + TQString &email) +{ + // This is a simplified version of KPIM::splitAddress(). + + fullName = ""; + email = ""; + if ( rawEmail.isEmpty() ) + return; // KPIM::AddressEmpty; + + // The code works on 8-bit strings, so convert the input to UTF-8. + TQCString address = rawEmail.utf8(); + + TQCString displayName; + TQCString addrSpec; + TQCString comment; + + // The following is a primitive parser for a mailbox-list (cf. RFC 2822). + // The purpose is to extract a displayable string from the mailboxes. + // Comments in the addr-spec are not handled. No error checking is done. + + enum { TopLevel, InComment, InAngleAddress } context = TopLevel; + bool inQuotedString = false; + int commentLevel = 0; + bool stop = false; + + for ( char* p = address.data(); *p && !stop; ++p ) { + switch ( context ) { + case TopLevel : { + switch ( *p ) { + case '"' : inQuotedString = !inQuotedString; + displayName += *p; + break; + case '(' : if ( !inQuotedString ) { + context = InComment; + commentLevel = 1; + } + else + displayName += *p; + break; + case '<' : if ( !inQuotedString ) { + context = InAngleAddress; + } + else + displayName += *p; + break; + case '\\' : // quoted character + displayName += *p; + ++p; // skip the '\' + if ( *p ) + displayName += *p; + else + //return KPIM::UnexpectedEnd; + goto ABORT_PARSING; + break; + case ',' : if ( !inQuotedString ) { + //if ( allowMultipleAddresses ) + // stop = true; + //else + // return KPIM::UnexpectedComma; + goto ABORT_PARSING; + } + else + displayName += *p; + break; + default : displayName += *p; + } + break; + } + case InComment : { + switch ( *p ) { + case '(' : ++commentLevel; + comment += *p; + break; + case ')' : --commentLevel; + if ( commentLevel == 0 ) { + context = TopLevel; + comment += ' '; // separate the text of several comments + } + else + comment += *p; + break; + case '\\' : // quoted character + comment += *p; + ++p; // skip the '\' + if ( *p ) + comment += *p; + else + //return KPIM::UnexpectedEnd; + goto ABORT_PARSING; + break; + default : comment += *p; + } + break; + } + case InAngleAddress : { + switch ( *p ) { + case '"' : inQuotedString = !inQuotedString; + addrSpec += *p; + break; + case '>' : if ( !inQuotedString ) { + context = TopLevel; + } + else + addrSpec += *p; + break; + case '\\' : // quoted character + addrSpec += *p; + ++p; // skip the '\' + if ( *p ) + addrSpec += *p; + else + //return KPIM::UnexpectedEnd; + goto ABORT_PARSING; + break; + default : addrSpec += *p; + } + break; + } + } // switch ( context ) + } + +ABORT_PARSING: + displayName = displayName.stripWhiteSpace(); + comment = comment.stripWhiteSpace(); + addrSpec = addrSpec.stripWhiteSpace(); + + fullName = TQString::fromUtf8( displayName ); + email = TQString::fromUtf8( addrSpec ); + + // check for errors + if ( inQuotedString ) + return; // KPIM::UnbalancedQuote; + if ( context == InComment ) + return; // KPIM::UnbalancedParens; + if ( context == InAngleAddress ) + return; // KPIM::UnclosedAngleAddr; + + if ( addrSpec.isEmpty() ) { + if ( displayName.isEmpty() ) + return; // KPIM::NoAddressSpec; + else { + //addrSpec = displayName; + //displayName.truncate( 0 ); + // Address of the form "foo@bar" or "foo@bar (Name)". + email = fullName; + fullName = TQString::fromUtf8( comment ); + } + } + + // Check that we do not have any extra characters on the end of the + // strings + unsigned int len = fullName.length(); + if ( fullName[ 0 ] == '"' && fullName[ len - 1 ] == '"' ) + fullName = fullName.mid( 1, len - 2 ); +} + +void Addressee::setResource( Resource *resource ) +{ + detach(); + mData->resource = resource; +} + +Resource *Addressee::resource() const +{ + return mData->resource; +} + +void Addressee::setChanged( bool value ) +{ + detach(); + mData->changed = value; +} + +bool Addressee::changed() const +{ + return mData->changed; +} + +void Addressee::setSortMode( KABC::SortMode *mode ) +{ + mSortMode = mode; +} + +bool Addressee::operator< ( const Addressee &addr ) +{ + if ( !mSortMode ) + return false; + else + return mSortMode->lesser( *this, addr ); +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Addressee &a ) +{ + if (!a.mData) return s; + + s << a.uid(); + + --STREAMOUT-- + s << a.mData->phoneNumbers; + s << a.mData->addresses; + s << a.mData->emails; + s << a.mData->categories; + s << a.mData->custom; + s << a.mData->keys; + return s; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Addressee &a ) +{ + if (!a.mData) + return s; + + a.detach(); + + s >> a.mData->uid; + + --STREAMIN-- + s >> a.mData->phoneNumbers; + s >> a.mData->addresses; + s >> a.mData->emails; + s >> a.mData->categories; + s >> a.mData->custom; + s >> a.mData->keys; + + a.mData->empty = false; + + return s; +} + +bool matchBinaryPattern( int value, int pattern ) +{ + /** + We want to match all telephonnumbers/addresses which have the bits in the + pattern set. More are allowed. + if pattern == 0 we have a special handling, then we want only those with + exactly no bit set. + */ + if ( pattern == 0 ) + return ( value == 0 ); + else + return ( pattern == ( pattern & value ) ); +} + +template <class L> +bool listEquals( const TQValueList<L> &list, const TQValueList<L> &pattern ) +{ + if ( list.count() != pattern.count() ) + return false; + + for ( uint i = 0; i < list.count(); ++i ) + if ( pattern.find( list[ i ] ) == pattern.end() ) + return false; + + return true; +} + +bool emailsEquals( const TQStringList &list, const TQStringList &pattern ) +{ + if ( list.count() != pattern.count() ) + return false; + + if ( list.first() != pattern.first() ) + return false; + + TQStringList::ConstIterator it; + for ( it = list.begin(); it != list.end(); ++it ) + if ( pattern.find( *it ) == pattern.end() ) + return false; + + return true; +} diff --git a/tdeabc/scripts/addressee.src.h b/tdeabc/scripts/addressee.src.h new file mode 100644 index 000000000..9cadfd41e --- /dev/null +++ b/tdeabc/scripts/addressee.src.h @@ -0,0 +1,407 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_ADDRESSEE_H +#define KABC_ADDRESSEE_H + +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> + +#include <ksharedptr.h> +#include <kurl.h> + +#include "address.h" +#include "agent.h" +#include "geo.h" +#include "key.h" +#include "phonenumber.h" +#include "picture.h" +#include "secrecy.h" +#include "sound.h" +#include "timezone.h" + +namespace KABC { + +class Resource; +class Field; +class SortMode; + +/** + @short address book entry + + This class represents an entry in the address book. + + The data of this class is implicitly shared. You can pass this class by value. + + If you need the name of a field for presenting it to the user you should use + the functions ending in Label(). They return a translated string which can be + used as label for the corresponding field. + + About the name fields: + + givenName() is the first name and familyName() the last name. In some + countries the family name comes first, that's the reason for the + naming. formattedName() is the full name with the correct formatting. + It is used as an override, when the correct formatting can't be generated + from the other name fields automatically. + + realName() returns a fully formatted name(). It uses formattedName, if set, + otherwise it constucts the name from the name fields. As fallback, if + nothing else is set it uses name(). + + name() is the NAME type of RFC2426. It can be used as internal name for the + data enty, but shouldn't be used for displaying the data to the user. + */ +class KABC_EXPORT Addressee +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Addressee & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Addressee & ); + + public: + typedef TQValueList<Addressee> List; + typedef TQMap<TQString, Addressee> Map; + + /** + Construct an empty address book entry. + */ + Addressee(); + ~Addressee(); + + Addressee( const Addressee & ); + Addressee &operator=( const Addressee & ); + + bool operator==( const Addressee & ) const; + bool operator!=( const Addressee & ) const; + + /** + Return, if the address book entry is empty. + */ + bool isEmpty() const; + + /** + Set unique identifier. + */ + void setUid( const TQString &uid ); + /** + Return unique identifier. + */ + TQString uid() const; + /** + Return translated label for uid field. + */ + static TQString uidLabel(); + + /** + Set unique resource identifier. + */ + void setUri( const TQString &uid ); + /** + Return unique resource identifier. + */ + TQString uri() const; + /** + Return translated label for uri field. + */ + static TQString uriLabel(); + + --DECLARATIONS-- + /** + Set name fields by parsing the given string and trying to associate the + parts of the string with according fields. This function should probably + be a bit more clever. + */ + void setNameFromString( const TQString & ); + + /** + Return the name of the addressee. This is calculated from all the name + fields. + */ + TQString realName() const; + + /** + Return the name that consists of all name parts. + */ + TQString assembledName() const; + + /** + Return email address including real name. + + @param email Email address to be used to construct the full email string. + If this is TQString::null the preferred email address is used. + */ + TQString fullEmail( const TQString &email=TQString::null ) const; + + /** + Insert an email address. If the email address already exists in this + addressee it is not duplicated. + + @param email Email address + @param preferred Set to true, if this is the preferred email address of + the addressee. + */ + void insertEmail( const TQString &email, bool preferred=false ); + + /** + Remove email address. If the email address doesn't exist, nothing happens. + */ + void removeEmail( const TQString &email ); + + /** + Return preferred email address. This is the first email address or the + last one added with insertEmail() with a set preferred parameter. + */ + TQString preferredEmail() const; + + /** + Return list of all email addresses. + */ + TQStringList emails() const; + + /** + Set the emails to @p list. + The first email address gets the preferred one! + @param list The list of email addresses. + */ + void setEmails( const TQStringList& list); + + /** + Insert a phone number. If a phone number with the same id already exists + in this addressee it is not duplicated. + */ + void insertPhoneNumber( const PhoneNumber &phoneNumber ); + + /** + Remove phone number. If no phone number with the given id exists for this + addresse nothing happens. + */ + void removePhoneNumber( const PhoneNumber &phoneNumber ); + + /** + Return phone number, which matches the given type. + */ + PhoneNumber phoneNumber( int type ) const; + + /** + Return list of all phone numbers. + */ + PhoneNumber::List phoneNumbers() const; + + /** + Return list of phone numbers with a special type. + */ + PhoneNumber::List phoneNumbers( int type ) const; + + /** + Return phone number with the given id. + */ + PhoneNumber findPhoneNumber( const TQString &id ) const; + + /** + Insert a key. If a key with the same id already exists + in this addressee it is not duplicated. + */ + void insertKey( const Key &key ); + + /** + Remove a key. If no key with the given id exists for this + addresse nothing happens. + */ + void removeKey( const Key &key ); + + /** + Return key, which matches the given type. + If @p type == Key::Custom you can specify a string + that should match. If you leave the string empty, the first + key with a custom value is returned. + */ + Key key( int type, TQString customTypeString = TQString::null ) const; + + /** + Return list of all keys. + */ + Key::List keys() const; + + /** + Set the list of keys + @param keys The keys to be set. + */ + void setKeys( const Key::List& keys); + + /** + Return list of keys with a special type. + If @p type == Key::Custom you can specify a string + that should match. If you leave the string empty, all custom + keys will be returned. + */ + Key::List keys( int type, TQString customTypeString = TQString::null ) const; + + /** + Return key with the given id. + */ + Key findKey( const TQString &id ) const; + + /** + Insert an address. If an address with the same id already exists + in this addressee it is not duplicated. + */ + void insertAddress( const Address &address ); + + /** + Remove address. If no address with the given id exists for this + addresse nothing happens. + */ + void removeAddress( const Address &address ); + + /** + Return address, which matches the given type. + */ + Address address( int type ) const; + + /** + Return list of all addresses. + */ + Address::List addresses() const; + + /** + Return list of addresses with a special type. + */ + Address::List addresses( int type ) const; + + /** + Return address with the given id. + */ + Address findAddress( const TQString &id ) const; + + /** + Insert category. If the category already exists it is not duplicated. + */ + void insertCategory( const TQString & ); + + /** + Remove category. + */ + void removeCategory( const TQString & ); + + /** + Return, if addressee has the given category. + */ + bool hasCategory( const TQString & ) const; + + /** + Set categories to given value. + */ + void setCategories( const TQStringList & ); + + /** + Return list of all set categories. + */ + TQStringList categories() const; + + /** + Insert custom entry. The entry is identified by the name of the inserting + application and a unique name. If an entry with the given app and name + already exists its value is replaced with the new given value. + + An empty value isn't allowed (nothing happens if this is called with + any of the three arguments being empty) + */ + void insertCustom( const TQString &app, const TQString &name, + const TQString &value ); + + /** + Remove custom entry. + */ + void removeCustom( const TQString &app, const TQString &name ); + + /** + Return value of custom entry, identified by app and entry name. + */ + TQString custom( const TQString &app, const TQString &name ) const; + + /** + Set all custom entries. + */ + void setCustoms( const TQStringList & ); + + /** + Return list of all custom entries. + */ + TQStringList customs() const; + + /** + Parse full email address. The result is given back in fullName and email. + */ + static void parseEmailAddress( const TQString &rawEmail, TQString &fullName, + TQString &email ); + + /** + Debug output. + */ + void dump() const; + + /** + Returns string representation of the addressee. + */ + TQString asString() const; + + /** + Set resource where the addressee is from. + */ + void setResource( Resource *resource ); + + /** + Return pointer to resource. + */ + Resource *resource() const; + + /** + Mark addressee as changed. + */ + void setChanged( bool value ); + + /** + Return whether the addressee is changed. + */ + bool changed() const; + + static void setSortMode( KABC::SortMode *mode ); + + bool operator< ( const Addressee &addr ); + + private: + void detach(); + + struct AddresseeData; + mutable TDESharedPtr<AddresseeData> mData; + + private: + static AddresseeData* shared_null; + static AddresseeData* makeSharedNull(); + static KABC::SortMode *mSortMode; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Addressee & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Addressee & ); + +} + +#endif diff --git a/tdeabc/scripts/createisomap.pl b/tdeabc/scripts/createisomap.pl new file mode 100755 index 000000000..897cd4896 --- /dev/null +++ b/tdeabc/scripts/createisomap.pl @@ -0,0 +1,35 @@ +#!/usr/bin/perl +# +# Create a translation table countryname->iso-code from the entry.desktop +# files in tdebase/l10n/*/ +# +# USAGE EXAMPLE: +# ./createisomap.pl $TDEDIR/share/locale/l10n > countrytransl.map +# +# Don't laugh at me. I put this together with an old perl book, perl +# being a language I've never used before. + +@entries = <$ARGV[0]/*/entry.desktop>; +chomp @entries; +foreach $entry (@entries) { + local ( $entryiso, @entryfile, @mappings ); + # print "--> $entry\n"; + $entryiso = $entry; + $entryiso =~ s/$ARGV[0]\///; + $entryiso =~ s/\/entry\.desktop//; + # print " $entryiso\n"; + open (IN, $entry); + @entryfile = <IN>; + close IN; + chomp @entryfile; + foreach $entryfileline (@entryfile) { + if ( $entryfileline =~ /^Name.*=(.*)$/ ) { + # push (@mappings, $1 . "\t" . $entryiso ); + print "$1\t$entryiso\n"; + } + } +} + +# add some convenience entries which aren't part of the entry.desktop files + +print "Czech Republic\tcz\n"; diff --git a/tdeabc/scripts/entrylist b/tdeabc/scripts/entrylist new file mode 100644 index 000000000..87c342a06 --- /dev/null +++ b/tdeabc/scripts/entrylist @@ -0,0 +1,82 @@ +# This file describes the fields of an address book entry. +# +# The following comma-separated fields are used: +# +# Control: A generates accessor functions. +# L generates a static function for returning a tranlsated label +# F generates a Field id and object for generic field handling +# E generate an equality test in Addressee::operator==(). +# Field Name : A descriptive name which is shown to the user. +# Comment : A comment helping translators to understand the field name +# Type : C++ type of field. +# Identifier : A string used in code as variable name etc. +# Field Category : Categories the field belongs to (see Field::FieldCategory). +# Output function: Function used to convert type to string for debug output (optional) + +ALE,name,,TQString,name + +ALFE,formatted name,,TQString,formattedName,Frequent + +ALFE,family name,,TQString,familyName,Frequent +ALFE,given name,,TQString,givenName,Frequent +ALFE,additional names,,TQString,additionalName +ALFE,honorific prefixes,,TQString,prefix +ALFE,honorific suffixes,,TQString,suffix + +ALFE,nick name,,TQString,nickName,Personal + +ALFE,birthday,,TQDateTime,birthday,Personal,.toString() + +#Address address +LF,home address street,,TQString,homeAddressStreet,Address|Personal +LF,home address city,,TQString,homeAddressLocality,Address|Personal +LF,home address state,,TQString,homeAddressRegion,Address|Personal +LF,home address zip code,,TQString,homeAddressPostalCode,Address|Personal +LF,home address country,,TQString,homeAddressCountry,Address|Personal +LF,home address label,,TQString,homeAddressLabel,Address|Personal + +LF,business address street,,TQString,businessAddressStreet,Address|Organization +LF,business address city,,TQString,businessAddressLocality,Address|Organization +LF,business address state,,TQString,businessAddressRegion,Address|Organization +LF,business address zip code,,TQString,businessAddressPostalCode,Address|Organization +LF,business address country,,TQString,businessAddressCountry,Address|Organization +LF,business address label,,TQString,businessAddressLabel,Address|Organization + +#phoneNumbers +LF,home phone,,TQString,homePhone,Personal|Frequent +LF,business phone,,TQString,businessPhone,Organization|Frequent +LF,mobile phone,,TQString,mobilePhone,Frequent +LF,home fax,,TQString,homeFax +LF,business fax,,TQString,businessFax +LF,car phone,,TQString,carPhone +LF,ISDN,,TQString,isdn +LF,pager,,TQString,pager + +#emails +LF,email address,,TQString,email,Email|Frequent + +ALFE,mail client,,TQString,mailer,Email + +ALE,time zone,,TimeZone,timeZone,,.asString() +ALE,geographic position,,Geo,geo,,.asString() + +ALFE,title,person,TQString,title,Organization +ALFE,role,person in organization,TQString,role,Organization +ALFE,organization,,TQString,organization,Organization +ALFE,department,,TQString,department,Organization + +ALFE,note,,TQString,note + +ALE,product identifier,,TQString,productId +ALE,revision date,,TQDateTime,revision,,.toString() + +ALE,sort string,,TQString,sortString + +ALF,homepage,,KURL,url,,.url() + +ALE,security class,,Secrecy,secrecy,,.asString() + +ALE,logo,,Picture,logo,,.asString() +ALE,photo,,Picture,photo,,.asString() +ALE,sound,,Sound,sound,,.asString() +ALE,agent,,Agent,agent,,.asString() diff --git a/tdeabc/scripts/field.src.cpp b/tdeabc/scripts/field.src.cpp new file mode 100644 index 000000000..bec318880 --- /dev/null +++ b/tdeabc/scripts/field.src.cpp @@ -0,0 +1,512 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Cornelius Schumacher <schumacher@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 <tdelocale.h> +#include <tdeconfig.h> +#include <tdeglobal.h> + +#include "field.h" +#include "address.h" + +using namespace KABC; + +class Field::FieldImpl +{ + public: + FieldImpl( int fieldId, int category = 0, + const TQString &label = TQString::null, + const TQString &key = TQString::null, + const TQString &app = TQString::null ) + : mFieldId( fieldId ), mCategory( category ), mLabel( label ), + mKey( key ), mApp( app ) {} + + enum FieldId + { + CustomField, + --ENUMS-- + }; + + int fieldId() { return mFieldId; } + int category() { return mCategory; } + + TQString label() { return mLabel; } + TQString key() { return mKey; } + TQString app() { return mApp; } + + private: + int mFieldId; + int mCategory; + + TQString mLabel; + TQString mKey; + TQString mApp; +}; + + +Field::List Field::mAllFields; +Field::List Field::mDefaultFields; +Field::List Field::mCustomFields; + + +Field::Field( FieldImpl *impl ) +{ + mImpl = impl; +} + +Field::~Field() +{ + delete mImpl; +} + +TQString Field::label() +{ + switch ( mImpl->fieldId() ) { + --CASELABEL-- + case FieldImpl::CustomField: + return mImpl->label(); + default: + return i18n("Unknown Field"); + } +} + +int Field::category() +{ + return mImpl->category(); +} + +TQString Field::categoryLabel( int category ) +{ + switch ( category ) { + case All: + return i18n("All"); + case Frequent: + return i18n("Frequent"); + case Address: + return i18n("street/postal","Address"); + case Email: + return i18n("Email"); + case Personal: + return i18n("Personal"); + case Organization: + return i18n("Organization"); + case CustomCategory: + return i18n("Custom"); + default: + return i18n("Undefined"); + } +} + +TQString Field::value( const KABC::Addressee &a ) +{ + switch ( mImpl->fieldId() ) { + --CASEVALUE-- + case FieldImpl::Email: + return a.preferredEmail(); + case FieldImpl::Birthday: + if ( a.birthday().isValid() ) + return a.birthday().date().toString( Qt::ISODate ); + else + return TQString::null; + case FieldImpl::Url: + return a.url().prettyURL(); + case FieldImpl::HomePhone: + { + PhoneNumber::List::ConstIterator it; + + { + // check for preferred number + const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Home | PhoneNumber::Pref ); + for ( it = list.begin(); it != list.end(); ++it ) + if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home ) + return (*it).number(); + } + + { + // check for normal home number + const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Home ); + for ( it = list.begin(); it != list.end(); ++it ) + if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home ) + return (*it).number(); + } + + return TQString::null; + } + case FieldImpl::BusinessPhone: + { + PhoneNumber::List::ConstIterator it; + + { + // check for preferred number + const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Work | PhoneNumber::Pref ); + for ( it = list.begin(); it != list.end(); ++it ) + if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work ) + return (*it).number(); + } + + { + // check for normal work number + const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Work ); + for ( it = list.begin(); it != list.end(); ++it ) + if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work ) + return (*it).number(); + } + + return TQString::null; + } + case FieldImpl::MobilePhone: + return a.phoneNumber( PhoneNumber::Cell ).number(); + case FieldImpl::HomeFax: + return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number(); + case FieldImpl::BusinessFax: + return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number(); + case FieldImpl::CarPhone: + return a.phoneNumber( PhoneNumber::Car ).number(); + case FieldImpl::Isdn: + return a.phoneNumber( PhoneNumber::Isdn ).number(); + case FieldImpl::Pager: + return a.phoneNumber( PhoneNumber::Pager ).number(); + case FieldImpl::HomeAddressStreet: + return a.address( Address::Home ).street(); + case FieldImpl::HomeAddressLocality: + return a.address( Address::Home ).locality(); + case FieldImpl::HomeAddressRegion: + return a.address( Address::Home ).region(); + case FieldImpl::HomeAddressPostalCode: + return a.address( Address::Home ).postalCode(); + case FieldImpl::HomeAddressCountry: + return a.address( Address::Home ).country(); + case FieldImpl::HomeAddressLabel: + return a.address( Address::Home ).label(); + case FieldImpl::BusinessAddressStreet: + return a.address( Address::Work ).street(); + case FieldImpl::BusinessAddressLocality: + return a.address( Address::Work ).locality(); + case FieldImpl::BusinessAddressRegion: + return a.address( Address::Work ).region(); + case FieldImpl::BusinessAddressPostalCode: + return a.address( Address::Work ).postalCode(); + case FieldImpl::BusinessAddressCountry: + return a.address( Address::Work ).country(); + case FieldImpl::BusinessAddressLabel: + return a.address( Address::Work ).label(); + case FieldImpl::CustomField: + return a.custom( mImpl->app(), mImpl->key() ); + default: + return TQString::null; + } +} + +bool Field::setValue( KABC::Addressee &a, const TQString &value ) +{ + switch ( mImpl->fieldId() ) { + --CASESETVALUE-- + case FieldImpl::MobilePhone: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Cell ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::HomeFax: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::BusinessFax: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::CarPhone: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Car ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::Isdn: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Isdn ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::Pager: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Pager ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::HomeAddressStreet: + { + KABC::Address address = a.address( Address::Home ); + address.setStreet( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressLocality: + { + KABC::Address address = a.address( Address::Home ); + address.setLocality( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressRegion: + { + KABC::Address address = a.address( Address::Home ); + address.setRegion( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressPostalCode: + { + KABC::Address address = a.address( Address::Home ); + address.setPostalCode( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressCountry: + { + KABC::Address address = a.address( Address::Home ); + address.setCountry( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressLabel: + { + KABC::Address address = a.address( Address::Home ); + address.setLabel( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressStreet: + { + KABC::Address address = a.address( Address::Work ); + address.setStreet( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressLocality: + { + KABC::Address address = a.address( Address::Work ); + address.setLocality( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressRegion: + { + KABC::Address address = a.address( Address::Work ); + address.setRegion( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressPostalCode: + { + KABC::Address address = a.address( Address::Work ); + address.setPostalCode( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressCountry: + { + KABC::Address address = a.address( Address::Work ); + address.setCountry( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressLabel: + { + KABC::Address address = a.address( Address::Work ); + address.setLabel( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::Birthday: + a.setBirthday( TQT_TQDATE_OBJECT(TQDate::fromString( value, Qt::ISODate )) ); + return true; + case FieldImpl::CustomField: + a.insertCustom( mImpl->app(), mImpl->key(), value ); + return true; + default: + return false; + } +} + +TQString Field::sortKey( const KABC::Addressee &a ) +{ + switch ( mImpl->fieldId() ) { + --CASEVALUE-- + case FieldImpl::Birthday: + if ( a.birthday().isValid() ) { + TQDate date = TQT_TQDATE_OBJECT(a.birthday().date()); + TQString key; + key.sprintf( "%02d-%02d", date.month(), date.day() ); + return key; + } else + return TQString( "00-00" ); + default: + return value( a ).lower(); + } +} + +bool Field::isCustom() +{ + return mImpl->fieldId() == FieldImpl::CustomField; +} + +Field::List Field::allFields() +{ + if ( mAllFields.isEmpty() ) { + --CREATEFIELDS-- + } + + return mAllFields; +} + +Field::List Field::defaultFields() +{ + if ( mDefaultFields.isEmpty() ) { + createDefaultField( FieldImpl::FormattedName ); + createDefaultField( FieldImpl::Email ); + } + + return mDefaultFields; +} + +void Field::createField( int id, int category ) +{ + mAllFields.append( new Field( new FieldImpl( id, category ) ) ); +} + +void Field::createDefaultField( int id, int category ) +{ + mDefaultFields.append( new Field( new FieldImpl( id, category ) ) ); +} + +void Field::deleteFields() +{ + Field::List::ConstIterator it; + + for ( it = mAllFields.constBegin(); it != mAllFields.constEnd(); ++it ) { + delete (*it); + } + mAllFields.clear(); + + for ( it = mDefaultFields.constBegin(); it != mDefaultFields.constEnd(); ++it ) { + delete (*it); + } + mDefaultFields.clear(); + + for ( it = mCustomFields.constBegin(); it != mCustomFields.constEnd(); ++it ) { + delete (*it); + } + mCustomFields.clear(); +} + +void Field::saveFields( const TQString &identifier, + const Field::List &fields ) +{ + TDEConfig *cfg = TDEGlobal::config(); + TDEConfigGroupSaver( cfg, "KABCFields" ); + + saveFields( cfg, identifier, fields ); +} + +void Field::saveFields( TDEConfig *cfg, const TQString &identifier, + const Field::List &fields ) +{ + TQValueList<int> fieldIds; + + int custom = 0; + Field::List::ConstIterator it; + for( it = fields.begin(); it != fields.end(); ++it ) { + fieldIds.append( (*it)->mImpl->fieldId() ); + if( (*it)->isCustom() ) { + TQStringList customEntry; + customEntry << (*it)->mImpl->label(); + customEntry << (*it)->mImpl->key(); + customEntry << (*it)->mImpl->app(); + cfg->writeEntry( "KABC_CustomEntry_" + identifier + "_" + + TQString::number( custom++ ), customEntry ); + } + } + + cfg->writeEntry( identifier, fieldIds ); +} + +Field::List Field::restoreFields( const TQString &identifier ) +{ + TDEConfig *cfg = TDEGlobal::config(); + TDEConfigGroupSaver( cfg, "KABCFields" ); + + return restoreFields( cfg, identifier ); +} + +Field::List Field::restoreFields( TDEConfig *cfg, const TQString &identifier ) +{ + const TQValueList<int> fieldIds = cfg->readIntListEntry( identifier ); + + Field::List fields; + + int custom = 0; + TQValueList<int>::ConstIterator it; + for( it = fieldIds.begin(); it != fieldIds.end(); ++it ) { + FieldImpl *f = 0; + if ( (*it) == FieldImpl::CustomField ) { + TQStringList customEntry = cfg->readListEntry( "KABC_CustomEntry_" + + identifier + "_" + + TQString::number( custom++ ) ); + f = new FieldImpl( *it, CustomCategory, customEntry[ 0 ], + customEntry[ 1 ], customEntry[ 2 ] ); + } else { + f = new FieldImpl( *it ); + } + fields.append( new Field( f ) ); + } + + return fields; +} + +bool Field::equals( Field *field ) +{ + bool sameId = ( mImpl->fieldId() == field->mImpl->fieldId() ); + + if ( !sameId ) return false; + + if ( mImpl->fieldId() != FieldImpl::CustomField ) return true; + + return mImpl->key() == field->mImpl->key(); +} + +Field *Field::createCustomField( const TQString &label, int category, + const TQString &key, const TQString &app ) +{ + Field *field = new Field( new FieldImpl( FieldImpl::CustomField, + category | CustomCategory, + label, key, app ) ); + mCustomFields.append( field ); + + return field; +} diff --git a/tdeabc/scripts/makeaddressee b/tdeabc/scripts/makeaddressee new file mode 100755 index 000000000..fa955b0bf --- /dev/null +++ b/tdeabc/scripts/makeaddressee @@ -0,0 +1,215 @@ +#!/usr/bin/perl + +my $srcdir; +$srcdir = `dirname $0` || die "Can't determine \$srcdir."; +chomp $srcdir; + +if (!open( ENTRIES, "$srcdir/entrylist" ) ) { + print "Can't open $srcdir/entrylist\n"; + exit 1; +} + + while(<ENTRIES>) { + if (/^#/) { next; } + chop; + @entries = split /,/; + if (!/^.+,(\w+),(\w+)/) { next; } + push @entryCtrl, @entries[0]; + push @entryRealNames, @entries[1]; + push @entryComments, @entries[2]; + push @entryTypes, @entries[3]; + push @entryNames, @entries[4]; + push @entryCategory, @entries[5]; + push @entryDebug, @entries[6]; + } + +close ENTRIES; + +if (!open( H_IN, "$srcdir/addressee.src.h" ) ) { + print "Can't open $srcdir/addressee.src.h\n"; + exit 1; +} +if (!open( H_OUT, ">../addressee.h" ) ) { + print "Can't open addressee.h\n"; + exit 1; +} + print H_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; + + while( <H_IN> ) { + if (/--DECLARATIONS--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /A/ ) { + print H_OUT " /**\n"; + print H_OUT " Set $entryRealNames[$i].\n"; + print H_OUT " */\n"; + print H_OUT " void set" . ucfirst($entryNames[$i]); + print H_OUT "( const $entryTypes[$i] &$entryNames[$i] );\n"; + + print H_OUT " /**\n"; + print H_OUT " Return $entryRealNames[$i].\n"; + print H_OUT " */\n"; + print H_OUT " $entryTypes[$i] $entryNames[$i]() const;\n"; + } + + if ( $entryCtrl[$i] !~ /L/ ) { next; } + print H_OUT " /**\n"; + print H_OUT " Return translated label for $entryNames[$i] field.\n"; + print H_OUT " */\n"; + print H_OUT " static TQString $entryNames[$i]Label();\n\n"; + } + } else { + print H_OUT; + } + } + +close H_OUT; +close H_IN; + +if (!open( CPP_IN, "$srcdir/addressee.src.cpp" ) ) { + print "Can't open $srcdir/addressee.src.cpp\n"; + exit 1; +} +if (!open( CPP_OUT, ">../addressee.cpp" ) ) { + print "Can't open addressee.cpp\n"; + exit 1; +} + print CPP_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; + + while( <CPP_IN> ) { + if (/--VARIABLES--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /A/ ) { next; } + print CPP_OUT " $entryTypes[$i] $entryNames[$i];\n"; + } + } elsif (/--DEFINITIONS--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /A/ ) { + print CPP_OUT "void Addressee::set" . ucfirst($entryNames[$i]); + print CPP_OUT "( const $entryTypes[$i] &$entryNames[$i] )\n{\n"; + print CPP_OUT " if ( $entryNames[$i] == mData->$entryNames[$i] ) return;\n"; + print CPP_OUT " detach();\n mData->empty = false;\n"; + print CPP_OUT " mData->$entryNames[$i] = $entryNames[$i];\n}\n\n"; + + print CPP_OUT "$entryTypes[$i] Addressee::$entryNames[$i]() const\n{\n"; + print CPP_OUT " return mData->$entryNames[$i];\n}\n\n"; + } + + if ( $entryCtrl[$i] !~ /L/ ) { next; } + @labelwords = split ' ', $entryRealNames[$i]; + for( $j=0; $j < @labelwords; ++$j ) { + $labelwords[$j] = ucfirst $labelwords[$j]; + } + $label = join ' ', @labelwords; + print CPP_OUT "TQString Addressee::$entryNames[$i]Label()\n{\n"; + if ( $entryComments[$i] ) { + print CPP_OUT " return i18n(\"$entryComments[$i]\",\"$label\");\n"; + } else { + print CPP_OUT " return i18n(\"$label\");\n"; + } + print CPP_OUT "}\n\n\n"; + } + } elsif (/--EQUALSTEST--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /E/ ) { + if ( $entryNames[$i] !~ "revision" ) { + if ( $entryTypes[$i] =~ "TQString" ) { + print CPP_OUT " if ( mData->$entryNames[$i] != a.mData->$entryNames[$i] &&\n"; + print CPP_OUT " !( mData->$entryNames[$i].isEmpty() && a.mData->$entryNames[$i].isEmpty() ) ) {\n"; + print CPP_OUT " kdDebug(5700) << \"$entryNames[$i] differs\" << endl;\n"; + print CPP_OUT " return false;\n"; + print CPP_OUT " }\n"; + } else { + print CPP_OUT " if ( mData->$entryNames[$i] != a.mData->$entryNames[$i] ) {\n"; + print CPP_OUT " kdDebug(5700) << \"$entryNames[$i] differs\" << endl;\n"; + print CPP_OUT " return false;\n"; + print CPP_OUT " }\n"; + } + } + } + } + } elsif (/--STREAMOUT--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /A/ ) { + print CPP_OUT " s << a.mData->$entryNames[$i];\n"; + } + } + } elsif (/--STREAMIN--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /A/ ) { + print CPP_OUT " s >> a.mData->$entryNames[$i];\n"; + } + } + } elsif (/--DEBUG--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /A/ ) { next; } + print CPP_OUT " kdDebug(5700) << \" " . ucfirst($entryNames[$i]); + print CPP_OUT ": '\" << $entryNames[$i]()$entryDebug[$i] << \"'\" << endl;\n"; + } + } else { + print CPP_OUT; + } + } + +close CPP_OUT; +close CPP_IN; + +if (!open( CPP_IN, "$srcdir/field.src.cpp" ) ) { + print "Can't open $srcdir/field.src.cpp\n"; + exit 1; +} +if (!open( CPP_OUT, ">../field.cpp" ) ) { + print "Can't open field.cpp\n"; + exit 1; +} + print CPP_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; + + while( <CPP_IN> ) { + if (/--ENUMS--/) { + $first = 1; + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /F/ ) { next; } + if ( $first ) { $first = 0; } + else { print CPP_OUT ",\n"; } + print CPP_OUT " " . ucfirst($entryNames[$i]); + } + print CPP_OUT "\n"; + } elsif (/--CASELABEL--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /F/ ) { next; } + if ( $entryCtrl[$i] !~ /L/ ) { next; } + print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; + print CPP_OUT " return Addressee::$entryNames[$i]Label();\n"; + } + } elsif (/--CASEVALUE--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /A/ ) { next; } + if ( $entryCtrl[$i] !~ /F/ ) { next; } + if ( $entryTypes[$i] ne "TQString" ) { next; } + print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; + print CPP_OUT " return a.$entryNames[$i]();\n"; + } + } elsif (/--CASESETVALUE--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /A/ ) { next; } + if ( $entryCtrl[$i] !~ /F/ ) { next; } + if ( $entryTypes[$i] ne "TQString" ) { next; } + print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; + print CPP_OUT " a.set" . ucfirst($entryNames[$i]) . "( value );\n"; + print CPP_OUT " return true;\n"; + } + } elsif (/--CREATEFIELDS--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /F/ ) { next; } + print CPP_OUT " createField( FieldImpl::" . ucfirst($entryNames[$i]); + if ( $entryCategory[$i] ) { + print CPP_OUT ", $entryCategory[$i]"; + } + print CPP_OUT " );\n"; + } + } else { + print CPP_OUT; + } + } + +close CPP_OUT; +close CPP_IN; diff --git a/tdeabc/secrecy.cpp b/tdeabc/secrecy.cpp new file mode 100644 index 000000000..2725612bc --- /dev/null +++ b/tdeabc/secrecy.cpp @@ -0,0 +1,100 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <tdelocale.h> + +#include "secrecy.h" + +using namespace KABC; + +Secrecy::Secrecy( int type ) + : mType( type ) +{ +} + +bool Secrecy::operator==( const Secrecy &s ) const +{ + return ( mType == s.mType ); +} + +bool Secrecy::operator!=( const Secrecy &s ) const +{ + return !( *this == s ); +} + +bool Secrecy::isValid() const +{ + return mType != Invalid; +} + +void Secrecy::setType( int type ) +{ + mType = type; +} + +int Secrecy::type() const +{ + return mType; +} + +Secrecy::TypeList Secrecy::typeList() +{ + static TypeList list; + + if ( list.isEmpty() ) + list << Public << Private << Confidential; + + return list; +} + +TQString Secrecy::typeLabel( int type ) +{ + switch ( type ) { + case Public: + return i18n( "Public" ); + break; + case Private: + return i18n( "Private" ); + break; + case Confidential: + return i18n( "Confidential" ); + break; + default: + return i18n( "Unknown type" ); + break; + } +} + +TQString Secrecy::asString() const +{ + return typeLabel( mType ); +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Secrecy &secrecy ) +{ + return s << secrecy.mType; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Secrecy &secrecy ) +{ + s >> secrecy.mType; + + return s; +} diff --git a/tdeabc/secrecy.h b/tdeabc/secrecy.h new file mode 100644 index 000000000..5cc60b11d --- /dev/null +++ b/tdeabc/secrecy.h @@ -0,0 +1,100 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_SECRECY_H +#define KABC_SECRECY_H + +#include <tqvaluelist.h> + +#include <tdelibs_export.h> + +namespace KABC { + +class KABC_EXPORT Secrecy +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Secrecy & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Secrecy & ); + +public: + typedef TQValueList<int> TypeList; + + /** + * Secrecy types + * + * @li Public - for public access + * @li Private - only private access + * @li Confidential - access for confidential persons + */ + enum Types { + Public, + Private, + Confidential, + Invalid + }; + + /** + * Constructor. + * + * @param type The secrecy type, see Types. + */ + Secrecy( int type = Invalid ); + + bool operator==( const Secrecy & ) const; + bool operator!=( const Secrecy & ) const; + + /** + Returns if the Secrecy object has a valid value. + */ + bool isValid() const; + + /** + * Sets the type, see Types. + */ + void setType( int type ); + + /** + * Returns the type, see Types. + */ + int type() const; + + /** + * Returns a list of all available secrecy types. + */ + static TypeList typeList(); + + /** + * Returns a translated label for a given secrecy type. + */ + static TQString typeLabel( int type ); + + /** + * For debug. + */ + TQString asString() const; + +private: + int mType; +}; + +KABC_EXPORT TQDataStream& operator<<( TQDataStream &s, const Secrecy &secrecy ); +KABC_EXPORT TQDataStream& operator>>( TQDataStream &s, Secrecy &secrecy ); + +} +#endif diff --git a/tdeabc/sortmode.cpp b/tdeabc/sortmode.cpp new file mode 100644 index 000000000..efb4a3919 --- /dev/null +++ b/tdeabc/sortmode.cpp @@ -0,0 +1,79 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Tobias Koenig <tokoe@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 <tdeabc/field.h> + +#include "sortmode.h" + +using namespace KABC; + +NameSortMode::NameSortMode() + : mNameType( FormattedName ), mAscendingOrder( true ), d( 0 ) +{ + mNameType = FormattedName; +} + +NameSortMode::NameSortMode( NameType type, bool ascending ) + : mNameType( type ), mAscendingOrder( ascending ), d( 0 ) +{ +} + +bool NameSortMode::lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const +{ + bool lesser = false; + + switch ( mNameType ) { + case FormattedName: + lesser = TQString::localeAwareCompare( first.formattedName(), second.formattedName() ) < 0; + break; + case FamilyName: + lesser = TQString::localeAwareCompare( first.familyName(), second.familyName() ) < 0; + break; + case GivenName: + lesser = TQString::localeAwareCompare( first.givenName(), second.givenName() ) < 0; + break; + default: + lesser = false; + break; + } + + if ( !mAscendingOrder ) + lesser = !lesser; + + return lesser; +} + +FieldSortMode::FieldSortMode( KABC::Field *field, bool ascending ) + : mField( field ), mAscendingOrder( ascending ), d( 0 ) +{ +} + +bool FieldSortMode::lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const +{ + if ( !mField ) + return false; + else { + bool lesser = TQString::localeAwareCompare( mField->value( first ), mField->value( second ) ) < 0; + if ( !mAscendingOrder ) + lesser = !lesser; + + return lesser; + } +} diff --git a/tdeabc/sortmode.h b/tdeabc/sortmode.h new file mode 100644 index 000000000..f02662b7d --- /dev/null +++ b/tdeabc/sortmode.h @@ -0,0 +1,114 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Tobias Koenig <tokoe@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 KABC_SORTMODE_H +#define KABC_SORTMODE_H + +#include <tdelibs_export.h> + +#include <tdeabc/addressee.h> + +namespace KABC { + +/** + @short Sort method for sorting an addressee list. + + This interface should be reimplemented by classes which shall act as + SortModes for KABC::AddresseeList. +*/ +class KABC_EXPORT SortMode +{ + public: + /** + Reimplement this method and return whether the first contact is 'smaller' + than the second. + */ + virtual bool lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const = 0; +}; + +class KABC_EXPORT NameSortMode : public SortMode +{ + public: + enum NameType + { + FormattedName, + FamilyName, + GivenName + }; + + /** + Constructor. + + Creates a NameSortMethod with FormattedName as name type set. + */ + NameSortMode(); + + /** + Constructor. + + Creates a NameSortMethod with the specified name type. + + @param type The name type. + @param ascending true for ascending sort, false for descending. + */ + NameSortMode( NameType type, bool ascending = true ); + + /** + Returns whether the first contact is 'smaller' then the second. + */ + virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const; + + private: + NameType mNameType; + bool mAscendingOrder; + + class NameSortModePrivate; + NameSortModePrivate *d; +}; + +class KABC_EXPORT FieldSortMode : public SortMode +{ + public: + /** + Constructor. + + Creates a FieldSortMethod with the specified field. + + @param field The field. + @param ascending true for ascending sort, false for descending. + */ + FieldSortMode( KABC::Field *field, bool ascending = true ); + + /** + Returns whether the first contact is 'smaller' then the second. + */ + virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const; + + private: + KABC::Field *mField; + bool mAscendingOrder; + + class FieldSortModePrivate; + FieldSortModePrivate *d; +}; + +} + +#endif diff --git a/tdeabc/sound.cpp b/tdeabc/sound.cpp new file mode 100644 index 000000000..cf645be83 --- /dev/null +++ b/tdeabc/sound.cpp @@ -0,0 +1,118 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 "sound.h" + +#include <tqdatastream.h> + +using namespace KABC; + +Sound::Sound() + : mIntern( false ) +{ +} + +Sound::Sound( const TQString &url ) + : mUrl( url ), mIntern( false ) +{ +} + +Sound::Sound( const TQByteArray &data ) + : mData( data ), mIntern( true ) +{ +} + +Sound::~Sound() +{ +} + +bool Sound::operator==( const Sound &s ) const +{ + if ( mIntern != s.mIntern ) return false; + + if ( mIntern ) { + if ( mData != s.mData ) + return false; + } else { + if ( mUrl != s.mUrl ) + return false; + } + + return true; +} + +bool Sound::operator!=( const Sound &s ) const +{ + return !( s == *this ); +} + +void Sound::setUrl( const TQString &url ) +{ + mUrl = url; + mIntern = false; +} + +void Sound::setData( const TQByteArray &data ) +{ + mData = data; + mIntern = true; +} + +bool Sound::isIntern() const +{ + return mIntern; +} + +bool Sound::isEmpty() const +{ + return (!mIntern) && mUrl.isEmpty(); + +} + +TQString Sound::url() const +{ + return mUrl; +} + +TQByteArray Sound::data() const +{ + return mData; +} + +TQString Sound::asString() const +{ + if ( mIntern ) + return "intern sound"; + else + return mUrl; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Sound &sound ) +{ + return s << sound.mIntern << sound.mUrl; +// return s << sound.mIntern << sound.mUrl << sound.mData; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Sound &sound ) +{ + s >> sound.mIntern >> sound.mUrl; +// s >> sound.mIntern >> sound.mUrl >> sound.mData; + return s; +} diff --git a/tdeabc/sound.h b/tdeabc/sound.h new file mode 100644 index 000000000..98dcf320b --- /dev/null +++ b/tdeabc/sound.h @@ -0,0 +1,153 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_SOUND_H +#define KABC_SOUND_H + +#include <tqcstring.h> +#include <tqstring.h> + +#include <tdelibs_export.h> + +namespace KABC { + +/** @short Class that holds a Sound clip for a contact. + * + * The sound can be played doing something like this: + * + * \code + * KTempFile tmp; + * if(sound.isIntern()) { + * tmp.file()->tqwriteBlock( sound.data() ); + * tmp.close(); + * KAudioPlayer::play( tmp.name() ); + * } else if(!sound.url().isEmpty()) { + * TQString tmpFile; + * if(!TDEIO::NetAccess::download(KURL(themeURL.url()), tmpFile, NULL)) + * { + * KMessageBox::error(0L, + * TDEIO::NetAccess::lastErrorString(), + * i18n("Failed to download sound file"), + * KMessageBox::Notify + * ); + * return; + * } + * KAudioPlayer::play( tmpFile ); + * } + * \endcode + * + * Unfortunetly KAudioPlayer::play is ASync, so to delete the temporary file, the best you can really do is set a timer. + * + */ +class KABC_EXPORT Sound +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Sound & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Sound & ); + +public: + + /** + * Consturctor. Creates an empty object. + */ + Sound(); + + /** + * Consturctor. + * + * @param url A URL that describes the position of the sound file. + */ + Sound( const TQString &url ); + + /** + * Consturctor. + * + * @param data The raw data of the sound. + */ + Sound( const TQByteArray &data ); + + /** + * Destructor. + */ + ~Sound(); + + + bool operator==( const Sound & ) const; + bool operator!=( const Sound & ) const; + + /** + * Sets a URL for the location of the sound file. When using this + * function, isIntern() will return 'false' until you use + * setData(). + * + * @param url The location URL of the sound file. + */ + void setUrl( const TQString &url ); + + /** + * Test if this sound file has been set. + * Just does: !isIntern() && url.isEmpty() + * @since 3.4 + */ + bool isEmpty() const; + + /** + * Sets the raw data of the sound. When using this function, + * isIntern() will return 'true' until you use setUrl(). + * + * @param data The raw data of the sound. + */ + void setData( const TQByteArray &data ); + + /** + * Returns whether the sound is described by a URL (extern) or + * by the raw data (intern). + * When this method returns 'true' you can use data() to + * get the raw data. Otherwise you can request the URL of this + * sound by url() and load the raw data from that location. + */ + bool isIntern() const; + + /** + * Returns the location URL of this sound. + */ + TQString url() const; + + /** + * Returns the raw data of this sound. + */ + TQByteArray data() const; + + /** + * Returns string representation of the sound. + */ + TQString asString() const; + +private: + TQString mUrl; + TQByteArray mData; + + int mIntern; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Sound & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Sound & ); + +} +#endif diff --git a/tdeabc/stdaddressbook.cpp b/tdeabc/stdaddressbook.cpp new file mode 100644 index 000000000..3e64645ea --- /dev/null +++ b/tdeabc/stdaddressbook.cpp @@ -0,0 +1,203 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <stdlib.h> + +#include <tdeapplication.h> +#include <kcrash.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tderesources/manager.h> +#include <ksimpleconfig.h> +#include <kstandarddirs.h> +#include <kstaticdeleter.h> + +#include "resource.h" + +#include "stdaddressbook.h" + +using namespace KABC; + +StdAddressBook *StdAddressBook::mSelf = 0; +bool StdAddressBook::mAutomaticSave = true; + +static KStaticDeleter<StdAddressBook> addressBookDeleter; + +TQString StdAddressBook::fileName() +{ + return locateLocal( "data", "tdeabc/std.vcf" ); +} + +TQString StdAddressBook::directoryName() +{ + return locateLocal( "data", "tdeabc/stdvcf" ); +} + +void StdAddressBook::handleCrash() +{ +} + +StdAddressBook *StdAddressBook::self() +{ + if ( !mSelf ) + addressBookDeleter.setObject( mSelf, new StdAddressBook ); + + return mSelf; +} + +StdAddressBook *StdAddressBook::self( bool asynchronous ) +{ + if ( !mSelf ) + addressBookDeleter.setObject( mSelf, new StdAddressBook( asynchronous ) ); + + return mSelf; +} + +StdAddressBook::StdAddressBook() + : AddressBook( "" ) +{ + kdDebug(5700) << "StdAddressBook::StdAddressBook()" << endl; + + init( false ); +} + +StdAddressBook::StdAddressBook( bool asynchronous ) + : AddressBook( "" ) +{ + kdDebug(5700) << "StdAddressBook::StdAddressBook( bool )" << endl; + + init( asynchronous ); +} + +StdAddressBook::~StdAddressBook() +{ + if ( mAutomaticSave ) + saveAll(); +} + +void StdAddressBook::init( bool asynchronous ) +{ + KRES::Manager<Resource> *manager = resourceManager(); + + KRES::Manager<Resource>::ActiveIterator it; + for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { + (*it)->setAddressBook( this ); + if ( !(*it)->open() ) { + error( TQString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); + continue; + } + connect( *it, TQT_SIGNAL( loadingFinished( Resource* ) ), + this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); + connect( *it, TQT_SIGNAL( savingFinished( Resource* ) ), + this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); + + connect( *it, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); + connect( *it, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceSavingError( Resource*, const TQString& ) ) ); + } + + Resource *res = standardResource(); + if ( !res ) { + res = manager->createResource( "file" ); + if ( res ) + addResource( res ); + else + kdDebug(5700) << "No resource available!!!" << endl; + } + + setStandardResource( res ); + manager->writeConfig(); + + if ( asynchronous ) + asyncLoad(); + else + load(); +} + +bool StdAddressBook::saveAll() +{ + kdDebug(5700) << "StdAddressBook::saveAll()" << endl; + bool ok = true; + + deleteRemovedAddressees(); + + KRES::Manager<Resource>::ActiveIterator it; + KRES::Manager<Resource> *manager = resourceManager(); + for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { + if ( !(*it)->readOnly() && (*it)->isOpen() ) { + Ticket *ticket = requestSaveTicket( *it ); + if ( !ticket ) { + error( i18n( "Unable to save to resource '%1'. It is locked." ) + .arg( (*it)->resourceName() ) ); + return false; + } + + if ( !AddressBook::save( ticket ) ) { + ok = false; + releaseSaveTicket( ticket ); + } + } + } + + return ok; +} + +bool StdAddressBook::save() +{ + kdDebug(5700) << "StdAddressBook::save()" << endl; + + if ( mSelf ) + return mSelf->saveAll(); + else + return true; +} + +void StdAddressBook::close() +{ + addressBookDeleter.destructObject(); +} + +void StdAddressBook::setAutomaticSave( bool enable ) +{ + mAutomaticSave = enable; +} + +bool StdAddressBook::automaticSave() +{ + return mAutomaticSave; +} + +// should get const for 4.X +Addressee StdAddressBook::whoAmI() +{ + TDEConfig config( "kabcrc" ); + config.setGroup( "General" ); + + return findByUid( config.readEntry( "WhoAmI" ) ); +} + +void StdAddressBook::setWhoAmI( const Addressee &addr ) +{ + TDEConfig config( "kabcrc" ); + config.setGroup( "General" ); + + config.writeEntry( "WhoAmI", addr.uid() ); +} diff --git a/tdeabc/stdaddressbook.h b/tdeabc/stdaddressbook.h new file mode 100644 index 000000000..935b2bad1 --- /dev/null +++ b/tdeabc/stdaddressbook.h @@ -0,0 +1,153 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_STDADDRESSBOOK_H +#define KABC_STDADDRESSBOOK_H + +#include "addressbook.h" + +namespace KABC { + +/** + Standard KDE address book + + This class provides access to the standard KDE address book shared by all + applications. + + It's implemented as a singleton. Use self() to get the address book + object. On the first self() call the address book also gets loaded. + + Example: + + \code + KABC::AddressBook *ab = KABC::StdAddressBook::self(); + + AddressBook::Ticket *ticket = ab->requestSaveTicket(); + + if ( ticket ) { + KABC::AddressBook::Iterator it; + for ( it = ab->begin(); it != ab->end(); ++it ) { + kdDebug() << "UID=" << (*it).uid() << endl; + + // do some other stuff + } + + KABC::StdAddressBook::save( ticket ); + } + \endcode +*/ +class KABC_EXPORT StdAddressBook : public AddressBook +{ + public: + + /** + Destructor. + */ + ~StdAddressBook(); + + /** + Returns the standard addressbook object. It also loads all resources of + the users standard address book synchronously. + */ + static StdAddressBook *self(); + + /** + This is the same as above, but with specified behaviour of resource loading. + + @param asynchronous When true, the resources are loaded asynchronous, that + means you have the data foremost the addressBookChanged() + signal has been emitted. So connect to this signal when + using this method! + */ + static StdAddressBook *self( bool asynchronous ); + + /** + Saves the standard address book to disk. + + @deprecated Use AddressBook::save( Ticket* ) instead + */ + static bool save() KDE_DEPRECATED; + + /** + @deprecated There is no need to call this function anymore. + */ + static void handleCrash() KDE_DEPRECATED; + + /** + Returns the default file name for vcard-based addressbook + */ + static TQString fileName(); + + /** + Returns the default directory name for vcard-based addressbook + */ + static TQString directoryName(); + + /** + Sets the automatic save property of the address book. + + @param state If true, the address book is saved automatically + at destruction time, otherwise you have to call + AddressBook::save( Ticket* ). + */ + static void setAutomaticSave( bool state ); + + /** + Closes the address book. Depending on automaticSave() it will + save the address book first. + */ + static void close(); + + /** + Returns whether the address book is saved at destruction time. + See also setAutomaticSave(). + */ + static bool automaticSave(); + + /** + Returns the contact, that is associated with the owner of the + address book. This contact should be used by other programs + to access user specific data. + */ + Addressee whoAmI(); + + /** + Sets the users contact. See whoAmI() for more information. + + @param addr The users contact. + */ + void setWhoAmI( const Addressee &addr ); + + protected: + StdAddressBook(); + StdAddressBook( bool asynchronous ); + + void init( bool asynchronous ); + bool saveAll(); + + private: + static StdAddressBook *mSelf; + static bool mAutomaticSave; +}; + +} + +#endif + diff --git a/tdeabc/tdeab2tdeabc.cpp b/tdeabc/tdeab2tdeabc.cpp new file mode 100644 index 000000000..13b433abc --- /dev/null +++ b/tdeabc/tdeab2tdeabc.cpp @@ -0,0 +1,476 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> +#include <tqtextstream.h> + +#include <kabapi.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> +#include <tdeconfig.h> +#include <kdebug.h> +#include <tdeglobal.h> +#include <tdelocale.h> +#include <tdemessagebox.h> +#include <kstandarddirs.h> + +#include "addressbook.h" +#include "stdaddressbook.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + { "disable-autostart", I18N_NOOP( "Disable automatic startup on login" ), 0 }, + { "quiet", "", 0 }, + { "o", 0, 0 }, + { "override", I18N_NOOP( "Override existing entries" ), "1" }, + TDECmdLineLastOption +}; + +void readKMailEntry( const TQString &kmailEntry, KABC::AddressBook *ab ) +{ + kdDebug() << "KMAILENTRY: " << kmailEntry << endl; + + TQString entry = kmailEntry.simplifyWhiteSpace(); + if ( entry.isEmpty() ) return; + + TQString email; + TQString name; + TQString comment; + + if ( entry.at( entry.length() -1 ) == ')' ) { + int br = entry.findRev( '(' ); + if ( br >= 0 ) { + comment = entry.mid( br + 1, entry.length() - br - 2 ); + entry.truncate( br ); + if ( entry.at( entry.length() - 1 ).isSpace() ) { + entry.truncate( br - 1 ); + } + } + } + + int posSpace = entry.findRev( ' ' ); + if ( posSpace < 0 ) { + email = entry; + if ( !comment.isEmpty() ) { + name = comment; + comment = ""; + } + } else { + email = entry.mid( posSpace + 1 ); + name = entry.left( posSpace ); + } + + if ( email.at( 0 ) == '<' && email.at( email.length() - 1) == '>' ) { + email = email.mid( 1, email.length() - 2 ); + } + if ( name.at( 0 ) == '"' && name.at( name.length() - 1) == '"' ) { + name = name.mid( 1, name.length() - 2 ); + } + if ( name.at( 0 ) == '\'' && name.at( name.length() - 1) == '\'' ) { + name = name.mid( 1, name.length() - 2 ); + } + + if ( name.at( name.length() -1 ) == ')' ) { + int br = name.findRev( '(' ); + if ( br >= 0 ) { + comment = name.mid( br + 1, name.length() - br - 2 ) + " " + comment; + name.truncate( br ); + if ( name.at( name.length() - 1 ).isSpace() ) { + name.truncate( br - 1 ); + } + } + } + + kdDebug() << " EMAIL : " << email << endl; + kdDebug() << " NAME : " << name << endl; + kdDebug() << " COMMENT : " << comment << endl; + + KABC::Addressee::List al = ab->findByEmail( email ); + if ( al.isEmpty() ) { + KABC::Addressee a; + a.setNameFromString( name ); + a.insertEmail( email ); + a.setNote( comment ); + + ab->insertAddressee( a ); + + kdDebug() << "--INSERTED: " << a.realName() << endl; + } +} + +void importKMailAddressBook( KABC::AddressBook *ab ) +{ + TQString fileName = locateLocal( "data", "kmail/addressbook" ); + TQString kmailConfigName = locate( "config", "kmailrc" ); + if ( !kmailConfigName.isEmpty() ) { + TDEConfig cfg( kmailConfigName ); + cfg.setGroup( "Addressbook" ); + fileName = cfg.readPathEntry( "default", fileName ); + } + if ( !TDEStandardDirs::exists( fileName ) ) { + kdDebug(5700) << "Couldn't find KMail addressbook." << endl; + return; + } + + TQFile f( fileName ); + if ( !f.open(IO_ReadOnly) ) { + kdDebug(5700) << "Couldn't open file '" << fileName << "'" << endl; + return; + } + + TQStringList kmailEntries; + + TQTextStream t( &f ); + while ( !t.eof() ) { + kmailEntries.append( t.readLine() ); + } + f.close(); + + TQStringList::ConstIterator it; + for ( it = kmailEntries.begin(); it != kmailEntries.end(); ++it ) { + if ( (*it).at( 0 ) == '#' ) continue; + bool insideQuote = false; + int end = (*it).length() - 1; + for ( int i = end; i; i-- ) { + if ( (*it).at( i ) == '"' ) { + if ( insideQuote ) + insideQuote = false; + else + insideQuote = true; + } else if ( (*it).at( i ) == ',' && !insideQuote ) { + readKMailEntry( (*it).mid( i + 1, end - i ), ab ); + end = i - 1; + } + } + + readKMailEntry( (*it).mid( 0, end + 1 ), ab ); + } +} + +void readKAddressBookEntries( const TQString &dataString, Addressee &a ) +{ + // Strip "KMail:1.0" prefix and "[EOS]" suffix. + TQString str = dataString.mid( 11, dataString.length() - 24 ); + + TQStringList entries = TQStringList::split( "\n[EOR]\n ", str ); + + Address homeAddress( Address::Home ); + Address businessAddress( Address::Work ); + Address otherAddress; + + TQStringList::ConstIterator it; + for ( it = entries.begin(); it != entries.end(); ++it ) { + int pos = (*it).find( "\n" ); + TQString fieldName = (*it).left( pos ); + TQString fieldValue = (*it).mid( pos + 2 ); + + if ( fieldName == "X-HomeFax" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home | + PhoneNumber::Fax ) ); + } else if ( fieldName == "X-OtherPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, 0 ) ); + } else if ( fieldName == "X-PrimaryPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pref ) ); + } else if ( fieldName == "X-BusinessFax" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work | + PhoneNumber::Fax ) ); + } else if ( fieldName == "X-CarPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Car ) ); + } else if ( fieldName == "X-MobilePhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Cell ) ); + } else if ( fieldName == "X-ISDN" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Isdn ) ); + } else if ( fieldName == "X-OtherFax" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Fax ) ); + } else if ( fieldName == "X-Pager" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pager ) ); + } else if ( fieldName == "X-BusinessPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work ) ); + } else if ( fieldName == "X-HomePhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home ) ); + } else if ( fieldName == "X-HomeAddress" ) { + homeAddress.setLabel( fieldValue ); + } else if ( fieldName == "X-HomeAddressStreet" ) { + homeAddress.setStreet( fieldValue ); + } else if ( fieldName == "X-HomeAddressCity" ) { + homeAddress.setLocality( fieldValue ); + } else if ( fieldName == "X-HomeAddressPostalCode" ) { + homeAddress.setPostalCode( fieldValue ); + } else if ( fieldName == "X-HomeAddressState" ) { + homeAddress.setRegion( fieldValue ); + } else if ( fieldName == "X-HomeAddressCountry" ) { + homeAddress.setCountry( fieldValue ); + } else if ( fieldName == "X-BusinessAddress" ) { + businessAddress.setLabel( fieldValue ); + } else if ( fieldName == "X-BusinessAddressStreet" ) { + businessAddress.setStreet( fieldValue ); + } else if ( fieldName == "X-BusinessAddressCity" ) { + businessAddress.setLocality( fieldValue ); + } else if ( fieldName == "X-BusinessAddressPostalCode" ) { + businessAddress.setPostalCode( fieldValue ); + } else if ( fieldName == "X-BusinessAddressState" ) { + businessAddress.setRegion( fieldValue ); + } else if ( fieldName == "X-BusinessAddressCountry" ) { + businessAddress.setCountry( fieldValue ); + } else if ( fieldName == "X-OtherAddress" ) { + otherAddress.setLabel( fieldValue ); + } else if ( fieldName == "X-OtherAddressStreet" ) { + otherAddress.setStreet( fieldValue ); + } else if ( fieldName == "X-OtherAddressCity" ) { + otherAddress.setLocality( fieldValue ); + } else if ( fieldName == "X-OtherAddressPostalCode" ) { + otherAddress.setPostalCode( fieldValue ); + } else if ( fieldName == "X-OtherAddressState" ) { + otherAddress.setRegion( fieldValue ); + } else if ( fieldName == "X-OtherAddressCountry" ) { + otherAddress.setCountry( fieldValue ); + } else if ( fieldName == "NICKNAME" ) { + a.setNickName( fieldValue ); + } else if ( fieldName == "ORG" ) { + a.setOrganization( fieldValue ); + } else if ( fieldName == "ROLE" ) { + a.setRole( fieldValue ); + } else if ( fieldName == "BDAY" ) { + a.setBirthday( TDEGlobal::locale()->readDate( fieldValue ) ); + } else if ( fieldName == "WEBPAGE" ) { + a.setUrl( KURL( fieldValue ) ); + } else if ( fieldName == "N" ) { + } else if ( fieldName == "X-FirstName" ) { + } else if ( fieldName == "X-MiddleName" ) { + } else if ( fieldName == "X-LastName" ) { + } else if ( fieldName == "X-Title" ) { + } else if ( fieldName == "X-Suffix" ) { + } else if ( fieldName == "X-FileAs" ) { + } else if ( fieldName == "EMAIL" ) { + a.insertEmail( fieldValue, true ); + } else if ( fieldName == "X-E-mail2" ) { + a.insertEmail( fieldValue ); + } else if ( fieldName == "X-E-mail3" ) { + a.insertEmail( fieldValue ); + } else if ( fieldName == "X-Notes" ) { + } else { + a.insertCustom( "KADDRESSBOOK", fieldName, fieldValue ); + } + } + + if ( !homeAddress.isEmpty() ) a.insertAddress( homeAddress ); + if ( !businessAddress.isEmpty() ) a.insertAddress( businessAddress ); + if ( !otherAddress.isEmpty() ) a.insertAddress( otherAddress ); +} + +void importKab( KABC::AddressBook *ab, bool override, bool quiet ) +{ + TQString fileName = TDEGlobal::dirs()->saveLocation( "data", "kab/" ); + fileName += "addressbook.kab"; + if ( !TQFile::exists( fileName ) ) { + if ( !quiet ) { + KMessageBox::error( 0, "<qt>" + i18n( "Address book file <b>%1</b> not found! Make sure the old address book is located there and you have read permission for this file." ) + .arg( fileName ) + "</qt>" ); + } + kdDebug(5700) << "No KDE 2 addressbook found." << endl; + return; + } + + kdDebug(5700) << "Converting old-style kab addressbook to " + "new-style kabc addressbook." << endl; + + KabAPI kab( 0 ); + if ( kab.init() != ::AddressBook::NoError ) { + kdDebug(5700) << "Error initing kab" << endl; + exit( 1 ); + } + + KabKey key; + ::AddressBook::Entry entry; + + int num = kab.addressbook()->noOfEntries(); + + kdDebug(5700) << "kab Addressbook has " << num << " entries." << endl; + + for ( int i = 0; i < num; ++i ) { + if ( ::AddressBook::NoError != kab.addressbook()->getKey( i, key ) ) { + kdDebug(5700) << "Error getting key for index " << i << " from kab." << endl; + continue; + } + if ( ::AddressBook::NoError != kab.addressbook()->getEntry( key, entry ) ) { + kdDebug(5700) << "Error getting entry for index " << i << " from kab." << endl; + continue; + } + + Addressee a; + + // Convert custom entries + int count = 0; + bool idFound = false; + TQStringList::ConstIterator customIt; + for ( customIt = entry.custom.begin(); customIt != entry.custom.end(); ++customIt ) { + if ( (*customIt).startsWith( "X-KABC-UID:" ) ) { + a.setUid( (*customIt).mid( (*customIt).find( ":" ) + 1 ) ); + idFound = true; + } else if ( (*customIt).startsWith( "KMail:1.0\n" ) ) { + readKAddressBookEntries( *customIt, a ); + } else { + a.insertCustom( "tdeab2tdeabc", TQString::number( count++ ), *customIt ); + } + } + if ( idFound ) { + if ( !override ) continue; + } else { + entry.custom << "X-KABC-UID:" + a.uid(); + ::AddressBook::ErrorCode error = kab.addressbook()->change( key, entry ); + if ( error != ::AddressBook::NoError ) { + kdDebug(5700) << "kab.change returned with error " << error << endl; + } else { + kdDebug(5700) << "Wrote back to kab uid " << a.uid() << endl; + } + } + + a.setTitle( entry.title ); + a.setFormattedName( entry.fn ); + a.setPrefix( entry.nameprefix ); + a.setGivenName( entry.firstname ); + a.setAdditionalName( entry.middlename ); + a.setFamilyName( entry.lastname ); + a.setBirthday( entry.birthday ); + + TQStringList::ConstIterator emailIt; + for ( emailIt = entry.emails.begin(); emailIt != entry.emails.end(); ++emailIt ) + a.insertEmail( *emailIt ); + + TQStringList::ConstIterator phoneIt; + for ( phoneIt = entry.telephone.begin(); phoneIt != entry.telephone.end(); ++phoneIt ) { + int kabType = (*phoneIt++).toInt(); + if ( phoneIt == entry.telephone.end() ) break; + TQString number = *phoneIt; + int type = 0; + if ( kabType == ::AddressBook::Fixed ) type = PhoneNumber::Voice; + else if ( kabType == ::AddressBook::Mobile ) type = PhoneNumber::Cell | PhoneNumber::Voice; + else if ( kabType == ::AddressBook::Fax ) type = PhoneNumber::Fax; + else if ( kabType == ::AddressBook::Modem ) type = PhoneNumber::Modem; + a.insertPhoneNumber( PhoneNumber( number, type ) ); + } + + if ( entry.URLs.count() > 0 ) { + a.setUrl( KURL( entry.URLs.first() ) ); + if ( entry.URLs.count() > 1 ) { + kdWarning() << "More than one URL. Ignoring all but the first." << endl; + } + } + + int noAdr = entry.noOfAddresses(); + for ( int j = 0; j < noAdr; ++j ) { + ::AddressBook::Entry::Address kabAddress; + entry.getAddress( j, kabAddress ); + + Address adr; + + adr.setStreet( kabAddress.address ); + adr.setPostalCode( kabAddress.zip ); + adr.setLocality( kabAddress.town ); + adr.setCountry( kabAddress.country ); + adr.setRegion( kabAddress.state ); + + TQString label; + if ( !kabAddress.headline.isEmpty() ) label += kabAddress.headline + "\n"; + if ( !kabAddress.position.isEmpty() ) label += kabAddress.position + "\n"; + if ( !kabAddress.org.isEmpty() ) label += kabAddress.org + "\n"; + if ( !kabAddress.orgUnit.isEmpty() ) label += kabAddress.orgUnit + "\n"; + if ( !kabAddress.orgSubUnit.isEmpty() ) label += kabAddress.orgSubUnit + "\n"; + if ( !kabAddress.deliveryLabel.isEmpty() ) label += kabAddress.deliveryLabel + "\n"; + adr.setLabel( label ); + + a.insertAddress( adr ); + } + + TQString note = entry.comment; + + if ( !entry.user1.isEmpty() ) note += "\nUser1: " + entry.user1; + if ( !entry.user2.isEmpty() ) note += "\nUser2: " + entry.user2; + if ( !entry.user3.isEmpty() ) note += "\nUser3: " + entry.user3; + if ( !entry.user4.isEmpty() ) note += "\nUser4: " + entry.user4; + + if ( !entry.keywords.count() == 0 ) note += "\nKeywords: " + entry.keywords.join( ", " ); + + TQStringList::ConstIterator talkIt; + for ( talkIt = entry.talk.begin(); talkIt != entry.talk.end(); ++talkIt ) { + note += "\nTalk: " + (*talkIt); + } + + a.setNote( note ); + + a.setPrefix( entry.rank + a.prefix() ); // Add rank to prefix + + a.setCategories( entry.categories ); + + kdDebug(5700) << "Addressee: " << a.familyName() << endl; + + ab->insertAddressee( a ); + } + + kab.save( true ); +} + +int main( int argc, char **argv ) +{ + TDEAboutData aboutData( "tdeab2tdeabc", I18N_NOOP( "Kab to Kabc Converter" ), "0.1" ); + aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); + + TDECmdLineArgs::init( argc, argv, &aboutData ); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + bool override = false; + + if ( args->isSet( "override" ) ) { + kdDebug() << "Override existing entries." << endl; + + override = true; + } + + bool quiet = false; + + if ( args->isSet( "quiet" ) ) + quiet = true; + + if ( args->isSet( "disable-autostart" ) ) { + kdDebug() << "Disable autostart." << endl; + + TDEConfig *config = app.config(); + config->setGroup( "Startup" ); + config->writeEntry( "EnableAutostart", false ); + } + + KABC::AddressBook *kabcBook = StdAddressBook::self(); + + importKMailAddressBook( kabcBook ); + + importKab( kabcBook, override, quiet ); + + StdAddressBook::save(); + + kdDebug(5700) << "Saved kabc addressbook to '" << kabcBook->identifier() << "'" << endl; +} + diff --git a/tdeabc/tdeab2tdeabc.desktop b/tdeabc/tdeab2tdeabc.desktop new file mode 100644 index 000000000..ef7641b23 --- /dev/null +++ b/tdeabc/tdeab2tdeabc.desktop @@ -0,0 +1,105 @@ +[Desktop Entry] +Name=tdeab2tdeabc +Name[af]=kab-na-kabc +Name[csb]=Kònwersëjô adresowi knéżczi +Name[eo]=Konvertilo de "kab" al "kabc" +Name[fr]=KAB2KABC +Name[fy]=Kab2kabc +Name[hu]=Kab2kabc +Name[it]=Kab2Kabc +Name[nl]=Kab2kabc +Name[pl]=Konwersja książki adresowej +Name[pt_BR]=Conversão de kab para kabc +Name[ro]=Kab2kabc +Name[sv]=Kab2kabc +Name[te]=కెఎబి2కెఎబిసి +Name[zu]=i-tdeab2tdeabc +Exec=tdeab2tdeabc --disable-autostart --quiet +Icon=misc +Type=Application +Comment=libkab to libkabc conversion tool. +Comment[af]=libkab na libkabc omskakeling program. +Comment[ar]=أداة تحويل libkab إلى libkabc. +Comment[az]=libkab - libkabc dönüşdürmÉ™ vasitÉ™si. +Comment[be]=ІнÑтрумент пераўтварÑÐ½Ð½Ñ libkab у libkabc. +Comment[bg]=Програма за конвертиране на libkab до libkabc. +Comment[bn]=libkab থেকে libtdeabc-তে পরিবরà§à¦¤à¦¨ করার পà§à¦°à§‹à¦—à§à¦°à¦¾à¦®à¥¤ +Comment[bs]=alat za pretvaranje libkab u libkabc. +Comment[ca]=Eina de conversió de libkab a libkabc. +Comment[cs]=PÅ™evod dat z libkab do libkabc. +Comment[csb]=Nôrzãdze do kònwersëji z libkab do libkabc. +Comment[cy]=erfyn trosi libkab i libkabc +Comment[da]=libkab-til-libtdeabc-konverteringsværktøj. +Comment[de]=Konvertierung von libkab in libkabc +Comment[el]=ΕÏγαλείο μετατÏοπής από το libkab στο libkabc. +Comment[eo]=Konvertilo de "libkab" al "libkabc" +Comment[es]=Conversor libkab a libkabc. +Comment[et]=libkab -> libkabc teisendamine +Comment[eu]=libkab-etik libtdeabc-era bihurtzeko tresna. +Comment[fa]=ابزار تبدیل libkab به libcabc. +Comment[fi]=libkab-libkabc -muunnin +Comment[fr]=Outil de conversion de libkab vers libkabc. +Comment[fy]=Konversjeprogramma fan libkab nei libkabc. +Comment[ga]=Uirlis tiontaithe ó libkab go libkabc. +Comment[gl]=Ferramenta de conversión de libkab a libkabc. +Comment[he]=כלי המרה מ־libkab ל־libkabc +Comment[hi]=libkab से libkabc बदलने वाला औजार +Comment[hr]=Alat za pretvaranje iz libkab u libkabc +Comment[hsb]=libkab -> libkabc konwerter +Comment[hu]=libkab -> libkabc konvertáló. +Comment[id]=konverter libkab ke libkabc. +Comment[is]=libkab í libkabc breytingatól. +Comment[it]=Strumento di conversione da libkab a libkabc. +Comment[ja]=libkab ã‹ã‚‰ libkabc ã¸ã®å¤‰æ›ãƒ„ール +Comment[ka]=libkab => libkabc გáƒáƒ áƒ“áƒáƒ¥áƒ›áƒœáƒ˜áƒ¡ ხელსáƒáƒ¬áƒ§áƒ. +Comment[kk]=libkab дегеннен libkabc дегенге айналдыру құралы. +Comment[km]=ឧបករណáŸâ€‹áž”ម្លែង​ពី libkab ទៅ libkabc +Comment[ko]=libkabì„ libkabc로 바꿔주는 연장. +Comment[lb]=libkab op libkabc Konvertéierungs-Hëllefsmëttel. +Comment[lt]=libkab į libkabc konvertavimo įrankis. +Comment[lv]=libkab uz libkabc kovertēšanas rÄ«ks. +Comment[mk]=алатка за претворање од libkab во libkabc. +Comment[mn]=libkab-Ð°Ð°Ñ libtdeabc-руу хөрвүүлÑгч +Comment[ms]=perkakasan penukaran libkab to libkabc. +Comment[mt]=Għodda għall-konverżjoni libkab għal libkabc +Comment[nb]=libkab til libkabc konverteringsverktøy. +Comment[nds]=Warktüüch för't Ümwanneln vun libkab na libkabc. +Comment[ne]=libkab to libkabc रूपानà¥à¤¤à¤°à¤£ उपकरण । +Comment[nl]=Conversieprogramma van libkab naar libkabc. +Comment[nn]=Konverterer libkab til libkabc +Comment[nso]=Sebereka sa phetosetso ya libkab go libkabc +Comment[pa]=libkab ਤੋ libkabc ਤਬਦੀਲੀ ਸੰਦ। +Comment[pl]=NarzÄ™dzie do konwersji z libkab do libkabc. +Comment[pt]=Ferramenta de conversão de libkab para libkabc. +Comment[pt_BR]=Ferramenta de conversão de libkab para libkabc. +Comment[ro]=Utilitar de conversie de la "libkab" la "libkabc". +Comment[ru]=утилита Ð¿Ñ€ÐµÐ¾Ð±Ñ€Ð°Ð·Ð¾Ð²Ð°Ð½Ð¸Ñ libkab в libkabc. +Comment[rw]=Igikoresho cy'ihindura libkab muri libkabc. +Comment[se]=konverterenreaidu libkab:as libkabc:ai +Comment[sk]=Prevod dát z libkab do libkabc. +Comment[sl]=Orodje za pretvorbo iz libkab v libkabc +Comment[sq]=Vegla për shëndrimin e libkab në libkabc. +Comment[sr]=Ðлат за конверзију из libkab-а у libkabc. +Comment[sr@Latn]=Alat za konverziju iz libkab-a u libkabc. +Comment[ss]=Lithulusi lekutjintja le-libkab kuya ku-libkabc. +Comment[sv]=Konverteringsverktyg frÃ¥n libkab till libkabc +Comment[ta]=libkab இலிரà¯à®¨à¯à®¤à¯ libkabc கà¯à®•௠மாறà¯à®±à¯à®®à¯ கரà¯à®µà®¿. +Comment[te]=libkab à°¨à±à°‚à°šà°¿ libkabc కౠమారà±à°šà± పనిమà±à°Ÿà±à°Ÿà± +Comment[tg]=аÑбоби дигаргунÑози libkab ба libkabc +Comment[th]=เครื่องมือเปลี่ยน libkab เป็น libkabc +Comment[tr]=libkab' tan libkabc' ye dönüştürme aracı +Comment[tt]=libkab-›libkabc äyländerü qoralı. +Comment[uk]=ЗаÑіб Ð¿ÐµÑ€ÐµÑ‚Ð²Ð¾Ñ€ÐµÐ½Ð½Ñ libkab до libkabc. +Comment[uz]=libkab'ni libkabc'ga aylantiradigan vosita. +Comment[uz@cyrillic]=libkab'ни libkabc'га айлантирадиган воÑита. +Comment[ven]=Tshishumiswa tsha u shandukisa libkab itshi ya kha libkabc +Comment[vi]=Công cụ chuyển đổi libkab sang libkabc. +Comment[xh]=libkab kwi libkabc isixhobo sokuguqulela. +Comment[zh_CN]=libkab 到 libkabc 的转æ¢å·¥å…·ã€‚ +Comment[zh_HK]=libkab 至 libkabc 的轉æ›å·¥å…· +Comment[zh_TW]=libkab 至 libkabc 轉æ›å·¥å…· +Comment[zu]=Ithuluzi lokuguqula le-libkab kuyaku-libkabc +Terminal=false +NoDisplay=true +X-TDE-autostart-condition=tdeab2tdeabcrc:Startup:EnableAutostart:true +OnlyShowIn=TDE; diff --git a/tdeabc/tests/Makefile.am b/tdeabc/tests/Makefile.am new file mode 100644 index 000000000..201cf746a --- /dev/null +++ b/tdeabc/tests/Makefile.am @@ -0,0 +1,55 @@ +# Make sure $(all_includes) remains last! +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_srcdir)/kab \ + -I$(srcdir)/../vcardparser/ -I$(srcdir)/../vcard/include \ + -I$(srcdir)/../vcard/include/generated \ + -I$(srcdir)/../vcardparser $(all_includes) +LDADD = ../libkabc.la + +METASOURCES = AUTO + +check_PROGRAMS = testlock testldapclient + +testlock_LDFLAGS = $(all_libraries) +testlock_SOURCES = testlock.cpp + +testldapclient_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testldapclient_SOURCES = testldapclient.cpp + +EXTRA_PROGRAMS = testkabc testkabcdlg testdistlist bigread bigwrite testdb \ + testaddressee testaddresseelist testaddressfmt kabcargl testaddresslineedit + +testkabc_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testkabc_SOURCES = testkabc.cpp + +testaddressee_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testaddressee_SOURCES = testaddressee.cpp + +testaddresseelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testaddresseelist_SOURCES = testaddresseelist.cpp + +testaddressfmt_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testaddressfmt_SOURCES = testaddressfmt.cpp + +testkabcdlg_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testkabcdlg_SOURCES = testkabcdlg.cpp + +testdistlist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testdistlist_SOURCES = testdistlist.cpp + +testaddresslineedit_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testaddresslineedit_SOURCES = testaddresslineedit.cpp + +bigread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +bigread_LDADD = ../libkabc.la $(top_builddir)/tdeabc/plugins/file/libkabc_file.la +bigread_SOURCES = bigread.cpp + +bigwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +bigwrite_LDADD = ../libkabc.la $(top_builddir)/tdeabc/plugins/file/libkabc_file.la +bigwrite_SOURCES = bigwrite.cpp + +testdb_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testdb_SOURCES = testdb.cpp + +kabcargl_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +kabcargl_SOURCES = kabcargl.cpp + diff --git a/tdeabc/tests/bigread.cpp b/tdeabc/tests/bigread.cpp new file mode 100644 index 000000000..a5022367c --- /dev/null +++ b/tdeabc/tests/bigread.cpp @@ -0,0 +1,65 @@ +#include <sys/times.h> + +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> + +#include "addressbook.h" +#include "vcardformat.h" +#include "plugins/file/resourcefile.h" +#if 0 +#include "resourcesql.h" +#endif + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("bigread","BigReadKabc","0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + + TDEApplication app( false, false ); + + AddressBook ab; + + ResourceFile r( "my.kabc", "vcard2" ); + ab.addResource( &r ); + +#if 0 + ResourceSql rsql( &ab, "root", "kde4ever", "localhost" ); + ab.addResource( &rsql ); +#endif + + struct tms start; + + times( &start ); + +#if 0 + kdDebug() << "utime : " << int( start.tms_utime ) << endl; + kdDebug() << "stime : " << int( start.tms_stime ) << endl; + kdDebug() << "cutime: " << int( start.tms_cutime ) << endl; + kdDebug() << "cstime: " << int( start.tms_cstime ) << endl; +#endif + + kdDebug() << "Start load" << endl; + ab.load(); + kdDebug() << "Finished load" << endl; + + struct tms end; + + times( &end ); + +#if 0 + kdDebug() << "utime : " << int( end.tms_utime ) << endl; + kdDebug() << "stime : " << int( end.tms_stime ) << endl; + kdDebug() << "cutime: " << int( end.tms_cutime ) << endl; + kdDebug() << "cstime: " << int( end.tms_cstime ) << endl; +#endif + + kdDebug() << "UTime: " << int( end.tms_utime ) - int( start.tms_utime ) << endl; + kdDebug() << "STime: " << int( end.tms_stime ) - int( start.tms_stime ) << endl; + +// ab.dump(); +} diff --git a/tdeabc/tests/bigwrite.cpp b/tdeabc/tests/bigwrite.cpp new file mode 100644 index 000000000..4b9fa7bc3 --- /dev/null +++ b/tdeabc/tests/bigwrite.cpp @@ -0,0 +1,70 @@ +#include <sys/times.h> + +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> + +#include "addressbook.h" +#include "vcardformat.h" +#include "plugins/file/resourcefile.h" + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("bigwrite","BigWriteKabc","0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + + TDEApplication app( false, false ); + + AddressBook ab; + ResourceFile r( "my.kabc", "vcard" ); + ab.addResource( &r ); + + for( int i = 0; i < 5000; ++i ) { + Addressee a; + a.setGivenName( "number" + TQString::number( i ) ); + a.setFamilyName( "Name" ); + a.insertEmail( TQString::number( i ) + "@domain" ); + + ab.insertAddressee( a ); + } + printf( "\n" ); + + Ticket *t = ab.requestSaveTicket( &r ); + if ( t ) { + struct tms start; + + times( &start ); + +#if 0 + kdDebug() << "utime : " << int( start.tms_utime ) << endl; + kdDebug() << "stime : " << int( start.tms_stime ) << endl; + kdDebug() << "cutime: " << int( start.tms_cutime ) << endl; + kdDebug() << "cstime: " << int( start.tms_cstime ) << endl; +#endif + + if ( !ab.save( t ) ) { + kdDebug() << "Can't save." << endl; + } + + struct tms end; + + times( &end ); + +#if 0 + kdDebug() << "utime : " << int( end.tms_utime ) << endl; + kdDebug() << "stime : " << int( end.tms_stime ) << endl; + kdDebug() << "cutime: " << int( end.tms_cutime ) << endl; + kdDebug() << "cstime: " << int( end.tms_cstime ) << endl; +#endif + + kdDebug() << "UTime: " << int( end.tms_utime ) - int( start.tms_utime ) << endl; + kdDebug() << "STime: " << int( end.tms_stime ) - int( start.tms_stime ) << endl; + + } else { + kdDebug() << "No ticket for save." << endl; + } +} diff --git a/tdeabc/tests/kabcargl.cpp b/tdeabc/tests/kabcargl.cpp new file mode 100644 index 000000000..e38a8a22e --- /dev/null +++ b/tdeabc/tests/kabcargl.cpp @@ -0,0 +1,70 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> +#include <tqtextstream.h> +#include <tqregexp.h> + +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdecmdlineargs.h> +#include <tdeglobal.h> +#include <kstandarddirs.h> + +#include "stdaddressbook.h" + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("kabcargl","Fix broken pre3.0rc3 format","0.1"); + aboutData.addAuthor("Cornelius Schumacher", 0, "schumacher@kde.org"); + + TDECmdLineArgs::init(argc,argv,&aboutData); + + TDEApplication app; + + TQString filename = StdAddressBook::fileName(); + + TQFile f( filename ); + if ( !f.open( IO_ReadOnly ) ) { + kdDebug() << "Error opening file '" << filename << "' for reading." << endl; + return 1; + } + + TQTextStream t( &f ); + t.setEncoding(TQTextStream::UnicodeUTF8); + TQString text = t.read(); + f.close(); + + text = TQString::fromUtf8( text.local8Bit() ); + text.replace( "\n", "\r\n" ); + + if ( !f.open( IO_WriteOnly ) ) { + kdDebug() << "Error opening file '" << filename << "' for writing." << endl; + return 1; + } + + TQTextStream t2( &f ); + t2.setEncoding(TQTextStream::UnicodeUTF8); + t2 << text; + f.close(); +} diff --git a/tdeabc/tests/testaddressee.cpp b/tdeabc/tests/testaddressee.cpp new file mode 100644 index 000000000..ef55ae403 --- /dev/null +++ b/tdeabc/tests/testaddressee.cpp @@ -0,0 +1,57 @@ +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> +#include <kstandarddirs.h> + +#include "addressbook.h" +#include "plugins/file/resourcefile.h" +#include "formats/binaryformat.h" +#include "vcardformat.h" +#include "phonenumber.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + { "save", "", 0 }, + { "number", "", 0 }, + TDECmdLineLastOption +}; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testaddressee","TestAddressee","0.1"); + TDECmdLineArgs::init(argc, argv, &aboutData); + TDECmdLineArgs::addCmdLineOptions(options); + + TDEApplication app; + TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); + + kdDebug() << "Creating a" << endl; + Addressee a; + + kdDebug() << "tick1" << endl; + a.setGivenName("Hans"); + kdDebug() << "tick2" << endl; + a.setPrefix("Dr."); + + kdDebug() << "Creating b" << endl; + Addressee b( a ); + + kdDebug() << "tack1" << endl; + a.setFamilyName("Wurst"); + kdDebug() << "tack2" << endl; + a.setNickName("hansi"); + + kdDebug() << "Creating c" << endl; + Addressee c = a; + + kdDebug() << "tock1" << endl; + c.setGivenName("Eberhard"); + + a.dump(); + b.dump(); + c.dump(); +} diff --git a/tdeabc/tests/testaddresseelist.cpp b/tdeabc/tests/testaddresseelist.cpp new file mode 100644 index 000000000..f247f1744 --- /dev/null +++ b/tdeabc/tests/testaddresseelist.cpp @@ -0,0 +1,196 @@ +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> +#include <kstandarddirs.h> + +#include "addressbook.h" +#include "addresseelist.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + { "save", "", 0 }, + { "number", "", 0 }, + TDECmdLineLastOption +}; + +int main(int /*argc*/,char /* **argv*/) +{ +/* TDEAboutData aboutData("testaddresseelist","TestAddresseeList","0.1"); + TDECmdLineArgs::init(argc, argv, &aboutData); + TDECmdLineArgs::addCmdLineOptions(options); + + TDEApplication app; + TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); */ + + kdDebug() << "Creating addressees" << endl; + Addressee a, b, c, d, e, f; + a.setGivenName ("Peter"); + a.setFamilyName("Pan"); + a.setFormattedName("Pan, Peter"); + a.setUid("Asdf"); + b.setGivenName ("Phileas"); + b.setFamilyName("Fogg"); + b.setFormattedName("Fogg, Phileas"); + b.setUid("Rsdf"); + c.setGivenName ("Jim"); + c.setFamilyName("Hawkins"); + c.setFormattedName("Hawkins, Jim"); + c.setUid("Fhwn"); + d.setGivenName ("John"); + d.setFamilyName("Silver"); + d.setPrefix ("Long"); + d.setFormattedName("Long John Silver"); + d.setUid("Z2hk"); + e.setGivenName ("Alice"); + e.setFamilyName("Liddel"); + e.setFormattedName("Liddel, Alice"); + e.setUid("kk45"); + f.setGivenName ("Edmond"); + f.setFamilyName("Dantes"); + f.setFormattedName("Dantes, Edmond"); + f.setUid("78ze"); + + kdDebug() << "Adding to list" << endl; + AddresseeList list; + list.append(a); + list.append(b); + list.append(c); + list.append(d); + list.append(e); + list.append(f); + + list.sortBy(FamilyName); + if ( !( (*list.at(0)).uid()=="78ze" + && (*list.at(1)).uid()=="Rsdf" + && (*list.at(2)).uid()=="Fhwn" + && (*list.at(3)).uid()=="kk45" + && (*list.at(4)).uid()=="Asdf" + && (*list.at(5)).uid()=="Z2hk" + ) ) { + kdError() << "SORTING BY FAMILY NAME NOT CORRECT!" << endl; + kdDebug() << "list sorted by family name:" << endl; + list.dump(); + } else { + kdDebug() << "Sorting by family name correct." << endl; + } + list.setReverseSorting(true); + list.sort(); + if ( !( (*list.at(5)).uid()=="78ze" + && (*list.at(4)).uid()=="Rsdf" + && (*list.at(3)).uid()=="Fhwn" + && (*list.at(2)).uid()=="kk45" + && (*list.at(1)).uid()=="Asdf" + && (*list.at(0)).uid()=="Z2hk" + ) ) { + kdError() << "REVERSE SORTING BY FAMILY NAME NOT CORRECT!" << endl; + kdDebug() << "list reverse sorted by family name:" << endl; + list.dump(); + } else { + kdDebug() << "Reverse sorting by family name correct." << endl; + } + + list.setReverseSorting(false); + list.sortBy(FormattedName); + if ( !( (*list.at(0)).uid()=="78ze" + && (*list.at(1)).uid()=="Rsdf" + && (*list.at(2)).uid()=="Fhwn" + && (*list.at(3)).uid()=="kk45" + && (*list.at(4)).uid()=="Z2hk" + && (*list.at(5)).uid()=="Asdf" + ) ) { + kdError() << "SORTING BY FORMATTED NAME NOT CORRECT!" << endl; + kdDebug() << "list sorted by formatted name:" << endl; + list.dump(); + } else { + kdDebug() << "Sorting by formatted name correct." << endl; + } + list.setReverseSorting(true); + list.sort(); + if ( !( (*list.at(5)).uid()=="78ze" + && (*list.at(4)).uid()=="Rsdf" + && (*list.at(3)).uid()=="Fhwn" + && (*list.at(2)).uid()=="kk45" + && (*list.at(1)).uid()=="Z2hk" + && (*list.at(0)).uid()=="Asdf" + ) ) { + kdError() << "REVERSE SORTING BY FORMATTED NAME NOT CORRECT!" << endl; + kdDebug() << "list reverse sorted by formatted name:" << endl; + list.dump(); + } else { + kdDebug() << "Reverse sorting by formatted name correct." << endl; + } + + + list.setReverseSorting(false); + list.sortBy(Uid); + if ( !( (*list.at(0)).uid()=="78ze" + && (*list.at(1)).uid()=="Asdf" + && (*list.at(2)).uid()=="Fhwn" + && (*list.at(3)).uid()=="Rsdf" + && (*list.at(4)).uid()=="Z2hk" + && (*list.at(5)).uid()=="kk45" + ) ) { + kdError() << "SORTING BY UID NOT CORRECT!" << endl; + kdDebug() << "list sorted by Uid:" << endl; + list.dump(); + } else { + kdDebug() << "Sorting by Uid correct." << endl; + } + list.setReverseSorting(true); + list.sortBy(Uid); + if ( !( (*list.at(5)).uid()=="78ze" + && (*list.at(4)).uid()=="Asdf" + && (*list.at(3)).uid()=="Fhwn" + && (*list.at(2)).uid()=="Rsdf" + && (*list.at(1)).uid()=="Z2hk" + && (*list.at(0)).uid()=="kk45" + ) ) { + kdError() << "REVERSE SORTING BY UID NOT CORRECT!" << endl; + kdDebug() << "list sorted by Uid:" << endl; + list.dump(); + } else { + kdDebug() << "Reverse sorting by Uid correct." << endl; + } + + // zero, one or two entries might give errors in a poor sorting + // implementation + kdDebug() << "sorting empty list" << endl; + AddresseeList list2; + list2.sort(); + + kdDebug() << "sorting one entry list" << endl; + list2.append(a); + list2.sort(); + + kdDebug() << "sorting two entry list" << endl; + list2.append(f); + list2.setReverseSorting(false); + list2.sort(); + if ( !( (*list2.at(0)).uid()=="78ze" + && (*list2.at(1)).uid()=="Asdf" + ) ) { + kdError() << "SORTING BY FORMATTED NAME IN A TWO ENTRY LIST NOT CORRECT!" << endl; + kdDebug() << "list sorted by formatted name, two entries:" << endl; + list2.dump(); + } else { + kdDebug() << "Sorting by FormattedName in a two entry list correct." << endl; + } + list2.setReverseSorting(true); + list2.sort(); + if ( !( (*list2.at(1)).uid()=="78ze" + && (*list2.at(0)).uid()=="Asdf" + ) ) { + kdError() << "REVERSE SORTING BY FORMATTED NAME IN A TWO ENTRY LIST NOT CORRECT!" << endl; + kdDebug() << "list reverse sorted by formatted name, two entries:" << endl; + list2.dump(); + } else { + kdDebug() << "Reverse sorting by FormattedName in a two entry list correct." << endl; + } + +} + + diff --git a/tdeabc/tests/testaddressfmt.cpp b/tdeabc/tests/testaddressfmt.cpp new file mode 100644 index 000000000..2eb438335 --- /dev/null +++ b/tdeabc/tests/testaddressfmt.cpp @@ -0,0 +1,63 @@ +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> +#include <kstandarddirs.h> + +#include "addressbook.h" +#include "address.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + { "save", "", 0 }, + { "number", "", 0 }, + TDECmdLineLastOption +}; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testaddressfmt","TestAddressFormat","0.1"); + TDECmdLineArgs::init(argc, argv, &aboutData); + TDECmdLineArgs::addCmdLineOptions(options); + + TDEApplication app; + + Address a; + a.setStreet("Lummerlandstr. 1"); + a.setPostalCode("12345"); + a.setLocality("Lummerstadt"); + a.setCountry ("Germany"); + + Address b; + b.setStreet("457 Foobar Ave"); + b.setPostalCode("1A2B3C"); + b.setLocality("Nervousbreaktown"); + b.setRegion("DC"); + b.setCountry("United States of America"); + + Address c; + c.setStreet("Lummerlandstr. 1"); + c.setPostalCode("12345"); + c.setLocality("Lummerstadt"); + c.setCountry ("Deutschland"); + + Address d; + d.setStreet("Lummerlandstr. 1"); + d.setPostalCode("12345"); + d.setLocality("Lummerstadt"); + d.setCountry (""); + + tqDebug( "-------------------------------------\nShould have german address formatting, local country formatting\n" ); + tqDebug( a.formattedAddress("Jim Knopf").latin1() ); + tqDebug( "-------------------------------------\nShould have US address formatting, local country formatting\n" ); + tqDebug( b.formattedAddress("Huck Finn").latin1() ); + tqDebug( "-------------------------------------\nShould have german address formatting, local country formatting\n" ); + tqDebug( c.formattedAddress("Jim Knopf").latin1() ); + tqDebug( "-------------------------------------\nShould have local address formatting, local country formatting\n" ); + tqDebug( d.formattedAddress("Jim Knopf").latin1() ); +} + + diff --git a/tdeabc/tests/testaddresslineedit.cpp b/tdeabc/tests/testaddresslineedit.cpp new file mode 100644 index 000000000..74446f482 --- /dev/null +++ b/tdeabc/tests/testaddresslineedit.cpp @@ -0,0 +1,29 @@ +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> + +#include "addresslineedit.h" + +using namespace KABC; + +int main( int argc,char **argv ) +{ + TDEAboutData aboutData( "testaddresslineedit", + I18N_NOOP( "Test Address LineEdit" ), "0.1" ); + TDECmdLineArgs::init( argc, argv, &aboutData ); + + TDEApplication app; + + AddressLineEdit *lineEdit = new AddressLineEdit( 0 ); + + lineEdit->show(); + app.setMainWidget( lineEdit ); + + TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) ); + + app.exec(); + + delete lineEdit; +} diff --git a/tdeabc/tests/testdb.cpp b/tdeabc/tests/testdb.cpp new file mode 100644 index 000000000..f7ec1d17c --- /dev/null +++ b/tdeabc/tests/testdb.cpp @@ -0,0 +1,33 @@ +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> + +#include "addressbook.h" +#include "vcardformat.h" +#include "resourcesql.h" + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testdb","TestKabcDB","0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + +// TDEApplication app( false, false ); + TDEApplication app; + + AddressBook ab; + + ResourceSql r( &ab, "root", "kde4ever", "localhost" ); + if ( ! r.open() ) { + kdDebug() << "Failed to open resource." << endl; + } + + r.load( &ab ); + + r.close(); + + ab.dump(); +} diff --git a/tdeabc/tests/testdistlist.cpp b/tdeabc/tests/testdistlist.cpp new file mode 100644 index 000000000..69a309ff9 --- /dev/null +++ b/tdeabc/tests/testdistlist.cpp @@ -0,0 +1,59 @@ +#include <tqwidget.h> + +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> + +#include "stdaddressbook.h" + +#include "distributionlisteditor.h" +#include "distributionlist.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + {"list <listname>", I18N_NOOP("Show distribution list with name <listname>"), 0}, + TDECmdLineLastOption +}; + + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testdistlist",I18N_NOOP("Test Distribution Lists"),"0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + if (args->isSet("list")) { + TQString name = args->getOption("list"); + + DistributionListManager *manager = + new DistributionListManager( StdAddressBook::self() ); + manager->load(); + DistributionList *list = manager->list( name ); + if ( !list ) { + kdDebug() << "No list with name '" << name << "'" << endl; + return 1; + } else { + kdDebug() << "RESULT: " << list->emails().join(", ") << endl; + return 0; + } + } + + DistributionListEditor *editor = + new DistributionListEditor( StdAddressBook::self(), 0 ); + + editor->show(); + app.setMainWidget(editor); + + TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) ); + + app.exec(); + + delete editor; +} diff --git a/tdeabc/tests/testkabc.cpp b/tdeabc/tests/testkabc.cpp new file mode 100644 index 000000000..427262cab --- /dev/null +++ b/tdeabc/tests/testkabc.cpp @@ -0,0 +1,62 @@ +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> +#include <kstandarddirs.h> + +#include <tqfile.h> +#include <tqimage.h> + +#include "geo.h" +#include "secrecy.h" +#include "stdaddressbook.h" +#include "timezone.h" +#include "key.h" +#include "agent.h" +#include "vcardconverter.h" + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testkabc",I18N_NOOP("TestKabc"),"0.1"); + TDECmdLineArgs::init(argc, argv, &aboutData); + + TDEApplication app( false, false ); + AddressBook *ab = StdAddressBook::self(); + +#define READ + +#ifdef READ + AddressBook::Iterator it; + for ( it = ab->begin(); it != ab->end(); ++it ) { + TQString vcard; + VCardConverter converter; + converter.addresseeToVCard( *it, vcard ); + kdDebug() << "card=" << vcard << endl; + } +#else + Addressee addr; + + addr.setGivenName("Tobias"); + addr.setFamilyName("Koenig"); + + + Picture pic; + TQImage img; + img.load("/home/tobias/test.png"); +/* + pic.setData(img); + pic.setType(TQImage::imageFormat("/home/tobias/test.png")); +*/ + pic.setUrl("http://www.mypict.de"); + addr.setLogo( pic ); + + ab->insertAddressee( addr ); + + StdAddressBook::save(); +#endif + + return 0; +} diff --git a/tdeabc/tests/testkabcdlg.cpp b/tdeabc/tests/testkabcdlg.cpp new file mode 100644 index 000000000..aef203d28 --- /dev/null +++ b/tdeabc/tests/testkabcdlg.cpp @@ -0,0 +1,45 @@ +#include <tqwidget.h> + +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> + +#include "addresseedialog.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + {"multiple", I18N_NOOP("Allow selection of multiple addressees"), 0}, + TDECmdLineLastOption +}; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testkabcdlg",I18N_NOOP("TestKabc"),"0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + if (args->isSet("multiple")) { + Addressee::List al = AddresseeDialog::getAddressees( 0 ); + Addressee::List::ConstIterator it; + kdDebug() << "Selected Addressees:" << endl; + for( it = al.begin(); it != al.end(); ++it ) { + kdDebug() << " " << (*it).fullEmail() << endl; + } + } else { + Addressee a = AddresseeDialog::getAddressee( 0 ); + + if ( !a.isEmpty() ) { + kdDebug() << "Selected Addressee:" << endl; + a.dump(); + } else { + kdDebug() << "No Addressee selected." << endl; + } + } +} diff --git a/tdeabc/tests/testldapclient.cpp b/tdeabc/tests/testldapclient.cpp new file mode 100644 index 000000000..df9fd6226 --- /dev/null +++ b/tdeabc/tests/testldapclient.cpp @@ -0,0 +1,161 @@ +/* This file is part of the KDE project + Copyright (C) 2005 David Faure <faure@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 version 2 as published by the Free Software Foundation. + + 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 "testldapclient.h" + +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdecmdlineargs.h> + +#include <tqeventloop.h> + +#include <assert.h> +#include <stdlib.h> + +int main(int argc, char *argv[]) +{ + TDEApplication::disableAutoDcopRegistration(); + TDECmdLineArgs::init(argc,argv,"testldapclient", 0, 0, 0, 0); + TDEApplication app; + + TestLDAPClient test; + test.setup(); + test.runAll(); + test.cleanup(); + kdDebug() << "All tests OK." << endl; + return 0; +} + +void TestLDAPClient::setup() +{ +} + +void TestLDAPClient::runAll() +{ + testIntevation(); +} + +bool TestLDAPClient::check(const TQString& txt, TQString a, TQString b) +{ + if (a.isEmpty()) + a = TQString::null; + if (b.isEmpty()) + b = TQString::null; + if (a == b) { + kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; + } + else { + kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "KO !" << endl; + cleanup(); + exit(1); + } + return true; +} + +void TestLDAPClient::cleanup() +{ + mClient = 0; +} + +void TestLDAPClient::testIntevation() +{ + kdDebug() << k_funcinfo << endl; + mClient = new LdapClient( this ); + + mClient->setHost( "ca.intevation.de" ); + mClient->setPort( "389" ); + mClient->setBase( "o=Intevation GmbH,c=de" ); + + // Same list as in kaddressbook's ldapsearchdialog + TQStringList attrs; + attrs << "l" << "Company" << "co" << "department" << "description" << "mail" << "facsimileTelephoneNumber" << "cn" << "homePhone" << "mobile" << "o" << "pager" << "postalAddress" << "st" << "street" << "title" << "uid" << "telephoneNumber" << "postalCode" << "objectClass"; + // the list from ldapclient.cpp + //attrs << "cn" << "mail" << "givenname" << "sn" << "objectClass"; + mClient->setAttrs( attrs ); + + // Taken from LdapSearch + //TQString mSearchText = TQString::fromUtf8( "Till" ); + //TQString filter = TQString( "&(|(objectclass=person)(objectclass=groupOfNames)(mail=*))(|(cn=%1*)(mail=%2*)(givenName=%3*)(sn=%4*))" ) + // .arg( mSearchText ).arg( mSearchText ).arg( mSearchText ).arg( mSearchText ); + + // For some reason a fromUtf8 broke the search for me (no results). + // But this certainly looks fishy, it might break on non-utf8 systems. + TQString filter = "&(|(objectclass=person)(objectclass=groupofnames)(mail=*))(|(cn=*Ägypten MDK*)(sn=*Ägypten MDK*))"; + + connect( mClient, TQT_SIGNAL( result( const KABC::LdapObject& ) ), + this, TQT_SLOT( slotLDAPResult( const KABC::LdapObject& ) ) ); + connect( mClient, TQT_SIGNAL( done() ), + this, TQT_SLOT( slotLDAPDone() ) ); + connect( mClient, TQT_SIGNAL( error( const TQString& ) ), + this, TQT_SLOT( slotLDAPError( const TQString& ) ) ); + mClient->startQuery( filter ); + kapp->eventLoop()->enterLoop(); + delete mClient; mClient = 0; +} + +// from kaddressbook... ugly though... +static TQString asUtf8( const TQByteArray &val ) +{ + if ( val.isEmpty() ) + return TQString::null; + + const char *data = val.data(); + + //TQString::fromUtf8() bug workaround + if ( data[ val.size() - 1 ] == '\0' ) + return TQString::fromUtf8( data, val.size() - 1 ); + else + return TQString::fromUtf8( data, val.size() ); +} + +static TQString join( const KABC::LdapAttrValue& lst, const TQString& sep ) +{ + TQString res; + bool already = false; + for ( KABC::LdapAttrValue::ConstIterator it = lst.begin(); it != lst.end(); ++it ) { + if ( already ) + res += sep; + already = TRUE; + res += asUtf8( *it ); + } + return res; +} + +void TestLDAPClient::slotLDAPResult( const KABC::LdapObject& obj ) +{ + TQString cn = join( obj.attrs[ "cn" ], ", " ); + kdDebug() << " cn:" << cn << endl; + assert( !obj.attrs[ "mail" ].isEmpty() ); + TQString mail = join( obj.attrs[ "mail" ], ", " ); + kdDebug() << " mail:" << mail << endl; + assert( mail.contains( '@' ) ); +} + +void TestLDAPClient::slotLDAPError( const TQString& err ) +{ + kdDebug() << k_funcinfo << err << endl; + ::exit( 1 ); +} + +void TestLDAPClient::slotLDAPDone() +{ + kdDebug() << k_funcinfo << endl; + kapp->eventLoop()->exitLoop(); +} + +#include "testldapclient.moc" diff --git a/tdeabc/tests/testldapclient.h b/tdeabc/tests/testldapclient.h new file mode 100644 index 000000000..1995914c3 --- /dev/null +++ b/tdeabc/tests/testldapclient.h @@ -0,0 +1,51 @@ +/* This file is part of the KDE project + Copyright (C) 2005 David Faure <faure@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 version 2 as published by the Free Software Foundation. + + 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 TESTLDAPCLIENT_H +#define TESTLDAPCLIENT_H + +#include <tqobject.h> + +#include "../ldapclient.h" +typedef KABC::LdapClient LdapClient; + +class TestLDAPClient : public TQObject +{ + Q_OBJECT + +public: + TestLDAPClient() {} + void setup(); + void runAll(); + void cleanup(); + + // tests + void testIntevation(); + +private slots: + void slotLDAPResult( const KABC::LdapObject& ); + void slotLDAPError( const TQString& ); + void slotLDAPDone(); + +private: + bool check(const TQString& txt, TQString a, TQString b); + + LdapClient* mClient; +}; + +#endif diff --git a/tdeabc/tests/testlock.cpp b/tdeabc/tests/testlock.cpp new file mode 100644 index 000000000..3ebd724bb --- /dev/null +++ b/tdeabc/tests/testlock.cpp @@ -0,0 +1,206 @@ +/* + This file is part of libkabc. + + Copyright (c) 2003 Cornelius Schumacher <schumacher@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 "testlock.h" + +#include "stdaddressbook.h" + +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> +#include <kdirwatch.h> + +#include <tdemessagebox.h> +#include <kdialog.h> + +#include <tqwidget.h> +#include <tqlabel.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqlistview.h> +#include <tqdir.h> + +#include <iostream> + +#include <sys/types.h> +#include <unistd.h> + +using namespace KABC; + +LockWidget::LockWidget( const TQString &identifier ) +{ + TQVBoxLayout *topLayout = new TQVBoxLayout( this ); + topLayout->setMargin( KDialog::marginHint() ); + topLayout->setSpacing( KDialog::spacingHint() ); + + if ( identifier.isEmpty() ) { + mLock = 0; + } else { + mLock = new Lock( identifier ); + + int pid = getpid(); + + TQLabel *pidLabel = new TQLabel( "Process ID: " + TQString::number( pid ), + this ); + topLayout->addWidget( pidLabel ); + + TQHBoxLayout *identifierLayout = new TQHBoxLayout( topLayout ); + + TQLabel *resourceLabel = new TQLabel( "Identifier:", this ); + identifierLayout->addWidget( resourceLabel ); + + TQLabel *resourceIdentifier = new TQLabel( identifier, this ); + identifierLayout->addWidget( resourceIdentifier ); + + mStatus = new TQLabel( "Status: Unlocked", this ); + topLayout->addWidget( mStatus ); + + TQPushButton *button = new TQPushButton( "Lock", this ); + topLayout->addWidget( button ); + connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( lock() ) ); + + button = new TQPushButton( "Unlock", this ); + topLayout->addWidget( button ); + connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( unlock() ) ); + } + + mLockView = new TQListView( this ); + topLayout->addWidget( mLockView ); + mLockView->addColumn( "Lock File" ); + mLockView->addColumn( "PID" ); + mLockView->addColumn( "Locking App" ); + + updateLockView(); + + TQPushButton *quitButton = new TQPushButton( "Quit", this ); + topLayout->addWidget( quitButton ); + connect( quitButton, TQT_SIGNAL( clicked() ), TQT_SLOT( close() ) ); + + KDirWatch *watch = KDirWatch::self(); + connect( watch, TQT_SIGNAL( dirty( const TQString & ) ), + TQT_SLOT( updateLockView() ) ); + connect( watch, TQT_SIGNAL( created( const TQString & ) ), + TQT_SLOT( updateLockView() ) ); + connect( watch, TQT_SIGNAL( deleted( const TQString & ) ), + TQT_SLOT( updateLockView() ) ); + watch->addDir( Lock::locksDir() ); + watch->startScan(); +} + +LockWidget::~LockWidget() +{ + delete mLock; +} + +void LockWidget::updateLockView() +{ + mLockView->clear(); + + TQDir dir( Lock::locksDir() ); + + TQStringList files = dir.entryList( "*.lock" ); + + TQStringList::ConstIterator it; + for( it = files.begin(); it != files.end(); ++it ) { + if ( *it == "." || *it == ".." ) continue; + + TQString app; + int pid; + if ( !Lock::readLockFile( dir.filePath( *it ), pid, app ) ) { + kdWarning() << "Unable to open lock file '" << *it << "'" << endl; + } else { + new TQListViewItem( mLockView, *it, TQString::number( pid ), app ); + } + } +} + +void LockWidget::lock() +{ + if ( !mLock->lock() ) { + KMessageBox::sorry( this, mLock->error() ); + } else { + mStatus->setText( "Status: Locked" ); + } +} + +void LockWidget::unlock() +{ + if ( !mLock->unlock() ) { + KMessageBox::sorry( this, mLock->error() ); + } else { + mStatus->setText( "Status: Unlocked" ); + } +} + + +static const TDECmdLineOptions options[] = +{ + { "a", 0, 0 }, + { "addressbook", "Standard address book", 0 }, + { "d", 0, 0 }, + { "diraddressbook", "Standard address book directory resource", 0 }, + { "+identifier", "Identifier of resource to be locked, e.g. filename", 0 }, + TDECmdLineLastOption +}; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testlock",I18N_NOOP("Test libkabc Lock"),"0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TQString identifier; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + if ( args->count() == 1 ) { + identifier = args->arg( 0 ); + } else if ( args->count() != 0 ) { + std::cerr << "Usage: testlock <identifier>" << std::endl; + return 1; + } + + if ( args->isSet( "addressbook" ) ) { + if ( args->count() == 1 ) { + std::cerr << "Ignoring resource identifier" << std::endl; + } + identifier = StdAddressBook::fileName(); + } + + if ( args->isSet( "diraddressbook" ) ) { + if ( args->count() == 1 ) { + std::cerr << "Ignoring resource identifier" << std::endl; + } + identifier = StdAddressBook::directoryName(); + } + + LockWidget mainWidget( identifier ); + + kapp->setMainWidget( &mainWidget ); + mainWidget.show(); + + return app.exec(); +} + +#include "testlock.moc" diff --git a/tdeabc/tests/testlock.h b/tdeabc/tests/testlock.h new file mode 100644 index 000000000..a94d4e8c6 --- /dev/null +++ b/tdeabc/tests/testlock.h @@ -0,0 +1,51 @@ +/* + This file is part of libkabc. + + Copyright (c) 2003 Cornelius Schumacher <schumacher@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 KABC_TESTLOCK_H +#define KABC_TESTLOCK_H + +#include "lock.h" + +#include <tqwidget.h> + +class TQLabel; +class TQListView; + +class KABC_EXPORT LockWidget : public TQWidget +{ + Q_OBJECT + public: + LockWidget( const TQString &identifier ); + ~LockWidget(); + + protected slots: + void lock(); + void unlock(); + + void updateLockView(); + + private: + KABC::Lock *mLock; + + TQLabel *mStatus; + TQListView *mLockView; +}; + +#endif diff --git a/tdeabc/timezone.cpp b/tdeabc/timezone.cpp new file mode 100644 index 000000000..59a184c6d --- /dev/null +++ b/tdeabc/timezone.cpp @@ -0,0 +1,85 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqdatastream.h> + +#include "timezone.h" + +using namespace KABC; + +TimeZone::TimeZone() : + mOffset( 0 ), mValid( false ) +{ +} + +TimeZone::TimeZone( int offset ) : + mOffset( offset ), mValid( true ) +{ +} + +void TimeZone::setOffset( int offset ) +{ + mOffset = offset; + mValid = true; +} + +int TimeZone::offset() const +{ + return mOffset; +} + +bool TimeZone::isValid() const +{ + return mValid; +} + +bool TimeZone::operator==( const TimeZone &t ) const +{ + if ( !t.isValid() && !isValid() ) return true; + if ( !t.isValid() || !isValid() ) return false; + if ( t.mOffset == mOffset ) return true; + return false; +} + +bool TimeZone::operator!=( const TimeZone &t ) const +{ + if ( !t.isValid() && !isValid() ) return false; + if ( !t.isValid() || !isValid() ) return true; + if ( t.mOffset != mOffset ) return true; + return false; +} + +TQString TimeZone::asString() const +{ + return TQString::number( mOffset ); +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const TimeZone &zone ) +{ + return s << zone.mOffset; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, TimeZone &zone ) +{ + s >> zone.mOffset; + zone.mValid = true; + + return s; +} diff --git a/tdeabc/timezone.h b/tdeabc/timezone.h new file mode 100644 index 000000000..8705797fb --- /dev/null +++ b/tdeabc/timezone.h @@ -0,0 +1,89 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_TIMEZONE_H +#define KABC_TIMEZONE_H + +#include <tqstring.h> + +#include <tdelibs_export.h> + +namespace KABC { + +/** + * @short Time zone information. + * + * This class stores information about a time zone. + */ +class KABC_EXPORT TimeZone +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const TimeZone & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, TimeZone & ); + +public: + + /** + * Construct invalid time zone. + */ + TimeZone(); + + /** + * Construct time zone. + * + * @param offset Offset in minutes relative to UTC. + */ + TimeZone( int offset ); + + /** + * Set time zone offset relative to UTC. + * + * @param offset Offset in minutes. + */ + void setOffset( int offset ); + + /** + * Return offset in minutes relative to UTC. + */ + int offset() const; + + /** + * Return, if this time zone object is valid. + */ + bool isValid() const; + + bool operator==( const TimeZone & ) const; + bool operator!=( const TimeZone & ) const; + + /** + * Return string representation of time zone offset. + */ + TQString asString() const; + +private: + int mOffset; // Offset in minutes + + bool mValid; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const TimeZone & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, TimeZone & ); + +} +#endif diff --git a/tdeabc/vcard/AdrParam.cpp b/tdeabc/vcard/AdrParam.cpp new file mode 100644 index 000000000..5ad56f4fb --- /dev/null +++ b/tdeabc/vcard/AdrParam.cpp @@ -0,0 +1,126 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardRToken.h> +#include <VCardAdrParam.h> +#include <VCardParam.h> + +using namespace VCARD; + +AdrParam::AdrParam() + : Param() +{ +} + +AdrParam::AdrParam(const AdrParam & x) + : Param(x), + adrTypeList_ (x.adrTypeList_) +{ +} + +AdrParam::AdrParam(const TQCString & s) + : Param(s) +{ +} + + AdrParam & +AdrParam::operator = (AdrParam & x) +{ + if (*this == x) return *this; + + adrTypeList_ = x.adrTypeList(); + textParam_ = x.textParam(); + + Param::operator = (x); + return *this; +} + + AdrParam & +AdrParam::operator = (const TQCString & s) +{ + Param::operator = (s); + + adrTypeList_.clear(); + textParam_.truncate(0); + + return *this; +} + + bool +AdrParam::operator == (AdrParam & x) +{ + parse(); + + if (!x.textParam().isEmpty()) + return (x.textParam_ == textParam_); + + if (x.adrTypeList().count() != adrTypeList_.count()) + return false; + + TQStrListIterator it(x.adrTypeList_); + + for (; it.current(); ++it) + if (!adrTypeList_.find(it.current())) + return false; + + return true; +} + +AdrParam::~AdrParam() +{ +} + + void +AdrParam::_parse() +{ + adrTypeList_.clear(); + + if (strRep_.left(4) != "TYPE") { + textParam_ = strRep_; + return; + } + + if (!strRep_.contains('=')) + return; + + RTokenise(strRep_, ",", adrTypeList_); +} + + void +AdrParam::_assemble() +{ + if (!textParam_.isEmpty()) { + strRep_ = textParam_; + return; + } + + TQStrListIterator it(adrTypeList_); + + for (; it.current(); ++it) { + + strRep_ += it.current(); + + if (it.current() != adrTypeList_.last()) + strRep_ += ','; + } +} diff --git a/tdeabc/vcard/AdrValue.cpp b/tdeabc/vcard/AdrValue.cpp new file mode 100644 index 000000000..535ba6980 --- /dev/null +++ b/tdeabc/vcard/AdrValue.cpp @@ -0,0 +1,140 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardRToken.h> +#include <VCardAdrValue.h> +#include <VCardValue.h> +#include <VCardDefines.h> + +using namespace VCARD; + +AdrValue::AdrValue() + : Value() +{ +} + +AdrValue::AdrValue(const AdrValue & x) + : Value(x), + poBox_ (x.poBox_), + extAddress_ (x.extAddress_), + street_ (x.street_), + locality_ (x.locality_), + region_ (x.region_), + postCode_ (x.postCode_), + countryName_ (x.countryName_) +{ +} + +AdrValue::AdrValue(const TQCString & s) + : Value(s) +{ +} + + AdrValue & +AdrValue::operator = (AdrValue & x) +{ + if (*this == x) return *this; + + poBox_ = x.poBox_; + extAddress_ = x.extAddress_; + street_ = x.street_; + locality_ = x.locality_; + region_ = x.region_; + postCode_ = x.postCode_; + countryName_ = x.countryName_; + + Value::operator = (x); + return *this; +} + + AdrValue & +AdrValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +AdrValue::operator == (AdrValue & x) +{ + parse(); + x.parse(); + + return ( + poBox_ == x.poBox_ && + extAddress_ == x.extAddress_ && + street_ == x.street_ && + locality_ == x.locality_ && + region_ == x.region_ && + postCode_ == x.postCode_ && + countryName_ == x.countryName_); +} + +AdrValue::~AdrValue() +{ +} + + AdrValue * +AdrValue::clone() +{ + return new AdrValue( *this ); +} + + void +AdrValue::_parse() +{ + vDebug("AdrValue::_parse()"); + + TQStrList l; + RTokenise(strRep_, ";", l); + + for (unsigned int i = 0; i < l.count(); i++) { + + switch (i) { + + case 0: poBox_ = l.at(0); break; + case 1: extAddress_ = l.at(1); break; + case 2: street_ = l.at(2); break; + case 3: locality_ = l.at(3); break; + case 4: region_ = l.at(4); break; + case 5: postCode_ = l.at(5); break; + case 6: countryName_ = l.at(6); break; + default: break; + } + } +} + + void +AdrValue::_assemble() +{ + vDebug("AdrValue::_assemble"); + + strRep_ = poBox_; + strRep_ += ";" + extAddress_; + strRep_ += ";" + street_; + strRep_ += ";" + locality_; + strRep_ += ";" + region_; + strRep_ += ";" + postCode_; + strRep_ += ";" + countryName_; +} + diff --git a/tdeabc/vcard/AgentParam.cpp b/tdeabc/vcard/AgentParam.cpp new file mode 100644 index 000000000..9e4531b02 --- /dev/null +++ b/tdeabc/vcard/AgentParam.cpp @@ -0,0 +1,103 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardAgentParam.h> + +#include <VCardParam.h> + +using namespace VCARD; + +AgentParam::AgentParam() + : Param() +{ +} + +AgentParam::AgentParam(const AgentParam & x) + : Param(x), + refer_ (x.refer_), + uri_ (x.uri_) +{ +} + +AgentParam::AgentParam(const TQCString & s) + : Param(s) +{ +} + + AgentParam & +AgentParam::operator = (AgentParam & x) +{ + if (*this == x) return *this; + + refer_ = x.refer_; + uri_ = x.uri_; + + Param::operator = (x); + return *this; +} + + AgentParam & +AgentParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +AgentParam::operator == (AgentParam & x) +{ + parse(); + + if (refer_) + return (x.refer() && uri_ == x.uri_); + + return !x.refer(); +} + +AgentParam::~AgentParam() +{ +} + + void +AgentParam::_parse() +{ + if (strRep_.isEmpty()) { + refer_ = false; + return; + } + + refer_ = true; + uri_ = strRep_; +} + + void +AgentParam::_assemble() +{ + if (!refer_) { + strRep_.truncate(0); + return; + } + + strRep_ = uri_.asString(); + return; +} diff --git a/tdeabc/vcard/AgentValue.cpp b/tdeabc/vcard/AgentValue.cpp new file mode 100644 index 000000000..7d356f8d7 --- /dev/null +++ b/tdeabc/vcard/AgentValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardAgentValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +AgentValue::AgentValue() + : Value() +{ +} + +AgentValue::AgentValue(const AgentValue & x) + : Value(x) +{ +} + +AgentValue::AgentValue(const TQCString & s) + : Value(s) +{ +} + + AgentValue & +AgentValue::operator = (AgentValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + AgentValue & +AgentValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +AgentValue::operator == (AgentValue & x) +{ + x.parse(); + return false; +} + +AgentValue::~AgentValue() +{ +} + + void +AgentValue::_parse() +{ +} + + void +AgentValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/CMakeLists.txt b/tdeabc/vcard/CMakeLists.txt new file mode 100644 index 000000000..8ad988434 --- /dev/null +++ b/tdeabc/vcard/CMakeLists.txt @@ -0,0 +1,40 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/generated + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdecore +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### vcard ##################################### + +set( target vcard ) + +set( ${target}_SRCS + vCard-all.cpp +) + +tde_add_library( ${target} SHARED + SOURCES ${${target}_SRCS} + VERSION 0.0.0 + LINK tdecore-shared + DESTINATION ${LIB_INSTALL_DIR} +) diff --git a/tdeabc/vcard/ClassValue.cpp b/tdeabc/vcard/ClassValue.cpp new file mode 100644 index 000000000..21417f87b --- /dev/null +++ b/tdeabc/vcard/ClassValue.cpp @@ -0,0 +1,120 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardClassValue.h> + +#include <VCardValue.h> + +#include <kdebug.h> + +using namespace VCARD; + +ClassValue::ClassValue() + : Value() +{ +} + +ClassValue::ClassValue(const ClassValue & x) + : Value(x), + classType_(x.classType_) +{ +} + +ClassValue::ClassValue(const TQCString & s) + : Value(s) +{ +} + + ClassValue & +ClassValue::operator = (ClassValue & x) +{ + if (*this == x) return *this; + x.parse(); + + classType_ = x.classType_; + + Value::operator = (x); + return *this; +} + + ClassValue & +ClassValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +ClassValue::operator == (ClassValue & x) +{ + x.parse(); + return ( classType_ == x.classType_ ); +} + +ClassValue::~ClassValue() +{ +} + + ClassValue * +ClassValue::clone() +{ + return new ClassValue( *this ); +} + + void +ClassValue::_parse() +{ + if (tqstricmp(strRep_, "PUBLIC") == 0) + classType_ = Public; + + else if (tqstricmp(strRep_, "PRIVATE") == 0) + classType_ = Private; + + else if (tqstricmp(strRep_, "CONFIDENTIAL") == 0) + classType_ = Confidential; + + else classType_ = Other; +} + + void +ClassValue::_assemble() +{ + switch (classType_) { + + case Public: + strRep_ = "PUBLIC"; + break; + + case Private: + strRep_ = "PRIVATE"; + break; + + case Confidential: + strRep_ = "CONFIDENTIAL"; + break; + + default: + break; + } +} + diff --git a/tdeabc/vcard/ContentLine.cpp b/tdeabc/vcard/ContentLine.cpp new file mode 100644 index 000000000..52bcdf4f5 --- /dev/null +++ b/tdeabc/vcard/ContentLine.cpp @@ -0,0 +1,302 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <tqcstring.h> +#include <tqstrlist.h> +#include <tqregexp.h> + +#include <kdebug.h> + +#include <VCardAdrParam.h> +#include <VCardAgentParam.h> +#include <VCardDateParam.h> +#include <VCardEmailParam.h> +#include <VCardImageParam.h> +#include <VCardSourceParam.h> +#include <VCardTelParam.h> +#include <VCardTextBinParam.h> +#include <VCardTextParam.h> + +#include <VCardAdrValue.h> +#include <VCardAgentValue.h> +#include <VCardDateValue.h> +#include <VCardImageValue.h> +#include <VCardTextValue.h> +#include <VCardTextBinValue.h> +#include <VCardLangValue.h> +#include <VCardNValue.h> +#include <VCardURIValue.h> +#include <VCardSoundValue.h> +#include <VCardClassValue.h> +#include <VCardFloatValue.h> +#include <VCardOrgValue.h> +#include <VCardTelValue.h> +#include <VCardTextListValue.h> +#include <VCardUTCValue.h> +#include <VCardGeoValue.h> + +#include <VCardRToken.h> +#include <VCardContentLine.h> + +#include <VCardEntity.h> +#include <VCardEnum.h> +#include <VCardDefines.h> + +using namespace VCARD; + +ContentLine::ContentLine() + : Entity(), + value_(0), + paramType_( ParamUnknown ), + valueType_( ValueUnknown ), + entityType_( EntityUnknown ) +{ +} + +ContentLine::ContentLine(const ContentLine & x) + : Entity(x), + group_ (x.group_), + name_ (x.name_), + paramList_(x.paramList_), + value_(x.value_->clone()), + paramType_( x.paramType_ ), + valueType_( x.valueType_ ), + entityType_( x.entityType_ ) +{ +} + +ContentLine::ContentLine(const TQCString & s) + : Entity(s), + value_(0), + paramType_( ParamUnknown ), + valueType_( ValueUnknown ), + entityType_( EntityUnknown ) +{ +} + + ContentLine & +ContentLine::operator = (ContentLine & x) +{ + if (*this == x) return *this; + + paramList_ = x.paramList(); + value_ = x.value_->clone(); + + Entity::operator = (x); + return *this; +} + + ContentLine & +ContentLine::operator = (const TQCString & s) +{ + Entity::operator = (s); + delete value_; + value_ = 0; + return *this; +} + + bool +ContentLine::operator == (ContentLine & x) +{ + x.parse(); + + TQPtrListIterator<Param> it(x.paramList()); + + if (!paramList_.find(it.current())) + return false; + + return true; +} + +ContentLine::~ContentLine() +{ + delete value_; + value_ = 0; +} + + void +ContentLine::_parse() +{ + vDebug("parse"); + + // Unqote newlines + strRep_ = strRep_.replace( TQRegExp( "\\\\n" ), "\n" ); + + int split = strRep_.find(':'); + + if (split == -1) { // invalid content line + vDebug("No ':'"); + return; + } + + TQCString firstPart(strRep_.left(split)); + TQCString valuePart(strRep_.mid(split + 1)); + + split = firstPart.find('.'); + + if (split != -1) { + group_ = firstPart.left(split); + firstPart = firstPart.mid(split + 1); + } + + vDebug("Group == " + group_); + vDebug("firstPart == " + firstPart); + vDebug("valuePart == " + valuePart); + + // Now we have the group, the name and param list together and the value. + + TQStrList l; + + RTokenise(firstPart, ";", l); + + if (l.count() == 0) {// invalid - no name ! + vDebug("No name for this content line !"); + return; + } + + name_ = l.at(0); + + // Now we have the name, so the rest of 'l' is the params. + // Remove the name part. + l.remove(0u); + + entityType_ = EntityNameToEntityType(name_); + paramType_ = EntityTypeToParamType(entityType_); + + unsigned int i = 0; + + // For each parameter, create a new parameter of the correct type. + + TQStrListIterator it(l); + + for (; it.current(); ++it, i++) { + + TQCString str = *it; + + split = str.find("="); + if (split < 0 ) { + vDebug("No '=' in parameter."); + continue; + } + + TQCString paraName = str.left(split); + TQCString paraValue = str.mid(split + 1); + + TQStrList paraValues; + RTokenise(paraValue, ",", paraValues); + + TQStrListIterator it2( paraValues ); + + for(; it2.current(); ++it2) { + + Param *p = new Param; + p->setName( paraName ); + p->setValue( *it2 ); + + paramList_.append(p); + } + } + + // Create a new value of the correct type. + + valueType_ = EntityTypeToValueType(entityType_); + +// kdDebug(5710) << "valueType: " << valueType_ << endl; + + switch (valueType_) { + + case ValueSound: value_ = new SoundValue; break; + case ValueAgent: value_ = new AgentValue; break; + case ValueAddress: value_ = new AdrValue; break; + case ValueTel: value_ = new TelValue; break; + case ValueTextBin: value_ = new TextBinValue; break; + case ValueOrg: value_ = new OrgValue; break; + case ValueN: value_ = new NValue; break; + case ValueUTC: value_ = new UTCValue; break; + case ValueURI: value_ = new URIValue; break; + case ValueClass: value_ = new ClassValue; break; + case ValueFloat: value_ = new FloatValue; break; + case ValueImage: value_ = new ImageValue; break; + case ValueDate: value_ = new DateValue; break; + case ValueTextList: value_ = new TextListValue; break; + case ValueGeo: value_ = new GeoValue; break; + case ValueText: + case ValueUnknown: + default: value_ = new TextValue; break; + } + + *value_ = valuePart; +} + + void +ContentLine::_assemble() +{ + vDebug("Assemble (argl) - my name is \"" + name_ + "\""); + strRep_.truncate(0); + + TQCString line; + + if (!group_.isEmpty()) + line += group_ + '.'; + + line += name_; + + vDebug("Adding parameters"); + ParamListIterator it(paramList_); + + for (; it.current(); ++it) + line += ";" + it.current()->asString(); + + vDebug("Adding value"); + if (value_ != 0) + line += ":" + value_->asString(); + else { + vDebug("No value"); + } + + // Quote newlines + line = line.replace( TQRegExp( "\n" ), "\\n" ); + + // Fold lines longer than 72 chars + const int maxLen = 72; + uint cursor = 0; + while( line.length() > ( cursor + 1 ) * maxLen ) { + strRep_ += line.mid( cursor * maxLen, maxLen ); + strRep_ += "\r\n "; + ++cursor; + } + strRep_ += line.mid( cursor * maxLen ); +} + + void +ContentLine::clear() +{ + group_.truncate(0); + name_.truncate(0); + paramList_.clear(); + delete value_; + value_ = 0; + paramType_ = ParamUnknown; + valueType_ = ValueUnknown; + entityType_ = EntityUnknown; +} diff --git a/tdeabc/vcard/DateParam.cpp b/tdeabc/vcard/DateParam.cpp new file mode 100644 index 000000000..ffaf4b3f6 --- /dev/null +++ b/tdeabc/vcard/DateParam.cpp @@ -0,0 +1,82 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardDateParam.h> + +#include <VCardParam.h> + +using namespace VCARD; + +DateParam::DateParam() + : Param() +{ +} + +DateParam::DateParam(const DateParam & x) + : Param(x) +{ +} + +DateParam::DateParam(const TQCString & s) + : Param(s) +{ +} + + DateParam & +DateParam::operator = (DateParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + DateParam & +DateParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +DateParam::operator == (DateParam & x) +{ + x.parse(); + + return false; +} + +DateParam::~DateParam() +{ +} + + void +DateParam::_parse() +{ +} + + void +DateParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/DateValue.cpp b/tdeabc/vcard/DateValue.cpp new file mode 100644 index 000000000..9f578a158 --- /dev/null +++ b/tdeabc/vcard/DateValue.cpp @@ -0,0 +1,434 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <tqregexp.h> + +#include <kdebug.h> + +#include <VCardDefines.h> +#include <VCardDateValue.h> +#include <VCardValue.h> + +using namespace VCARD; + +DateValue::DateValue() + : Value() +{ + vDebug("DateValue::DateValue()"); +} + +DateValue::DateValue( + unsigned int year, + unsigned int month, + unsigned int day, + unsigned int hour, + unsigned int minute, + unsigned int second, + double secFrac, + bool zonePositive, + unsigned int zoneHour, + unsigned int zoneMinute) + : Value (), + year_ (year), + month_ (month), + day_ (day), + hour_ (hour), + minute_ (minute), + second_ (second), + zoneHour_ (zoneHour), + zoneMinute_ (zoneMinute), + secFrac_ (secFrac), + zonePositive_ (zonePositive), + hasTime_(true) +{ + parsed_ = true; + assembled_ = false; +} + +DateValue::DateValue(const TQDate & d) + : Value (), + year_ (d.year()), + month_ (d.month()), + day_ (d.day()), + hasTime_(false) +{ + parsed_ = true; + assembled_ = false; +} + +DateValue::DateValue(const TQDateTime & d) + : Value (), + year_ (d.date().year()), + month_ (d.date().month()), + day_ (d.date().day()), + hour_ (d.time().hour()), + minute_ (d.time().minute()), + second_ (d.time().second()), + hasTime_(true) +{ + parsed_ = true; + assembled_ = false; +} + +DateValue::DateValue(const DateValue & x) + : Value(x) +{ + year_ = x.year_; + month_ = x.month_; + day_ = x.day_; + hour_ = x.hour_; + minute_ = x.minute_; + second_ = x.second_; + zoneHour_ = x.zoneHour_; + zoneMinute_ = x.zoneMinute_; + secFrac_ = x.secFrac_; + hasTime_ = x.hasTime_; +} + +DateValue::DateValue(const TQCString & s) + : Value(s) +{ +} + + DateValue & +DateValue::operator = (DateValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + DateValue & +DateValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +DateValue::operator == (DateValue & x) +{ + x.parse(); + return false; +} + +DateValue::~DateValue() +{ +} + + DateValue * +DateValue::clone() +{ + return new DateValue( *this ); +} + + void +DateValue::_parse() +{ + vDebug("DateValue::_parse()"); + + // date = date-full-year ["-"] date-month ["-"] date-mday + // time = time-hour [":"] time-minute [":"] time-second [":"] + // [time-secfrac] [time-zone] + + int timeSep = strRep_.find('T'); + + TQCString dateStr; + TQCString timeStr; + + if (timeSep == -1) { + + dateStr = strRep_; + vDebug("Has date string \"" + dateStr + "\""); + + } else { + + dateStr = strRep_.left(timeSep); + vDebug("Has date string \"" + dateStr + "\""); + + timeStr = strRep_.mid(timeSep + 1); + vDebug("Has time string \"" + timeStr + "\""); + } + + /////////////////////////////////////////////////////////////// DATE + + dateStr.replace(TQRegExp("-"), ""); + + kdDebug(5710) << "dateStr: " << dateStr << endl; + + year_ = dateStr.left(4).toInt(); + month_ = dateStr.mid(4, 2).toInt(); + day_ = dateStr.right(2).toInt(); + + if (timeSep == -1) { + hasTime_ = false; + return; // No time, done. + } + else + hasTime_ = true; + + /////////////////////////////////////////////////////////////// TIME + + /////////////////////////////////////////////////////////////// ZONE + + int zoneSep = timeStr.find('Z'); + + if (zoneSep != -1 && timeStr.length() - zoneSep > 3) { + + TQCString zoneStr(timeStr.mid(zoneSep + 1)); + vDebug("zoneStr == " + zoneStr); + + zonePositive_ = (zoneStr[0] == '+'); + zoneHour_ = zoneStr.mid(1, 2).toInt(); + zoneMinute_ = zoneStr.right(2).toInt(); + + timeStr.remove(zoneSep, timeStr.length() - zoneSep); + } + + //////////////////////////////////////////////////// SECOND FRACTION + + int secFracSep = timeStr.findRev(','); + + if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors. + TQCString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep); + secFrac_ = quirkafleeg.toDouble(); + } + + /////////////////////////////////////////////////////////////// HMS + + timeStr.replace(TQRegExp(":"), ""); + + hour_ = timeStr.left(2).toInt(); + minute_ = timeStr.mid(2, 2).toInt(); + second_ = timeStr.mid(4, 2).toInt(); +} + + void +DateValue::_assemble() +{ + vDebug("DateValue::_assemble"); + + TQCString year; + TQCString month; + TQCString day; + + year.setNum( year_ ); + month.setNum( month_ ); + day.setNum( day_ ); + + if ( month.length() < 2 ) month.prepend( "0" ); + if ( day.length() < 2 ) day.prepend( "0" ); + + strRep_ = year + '-' + month + '-' + day; + + if ( hasTime_ ) { + TQCString hour; + TQCString minute; + TQCString second; + + hour.setNum( hour_ ); + minute.setNum( minute_ ); + second.setNum( second_ ); + + if ( hour.length() < 2 ) hour.prepend( "0" ); + if ( minute.length() < 2 ) minute.prepend( "0" ); + if ( second.length() < 2 ) second.prepend( "0" ); + + strRep_ += 'T' + hour + ':' + minute + ':' + second + 'Z'; + } +} + + unsigned int +DateValue::year() +{ + parse(); + return year_; +} + + unsigned int +DateValue::month() +{ + parse(); + return month_; +} + + unsigned int +DateValue::day() +{ + parse(); + return day_; +} + unsigned int +DateValue::hour() +{ + parse(); + return hour_; +} + + unsigned int +DateValue::minute() +{ + parse(); + return minute_; +} + + unsigned int +DateValue::second() +{ + parse(); + return second_; +} + + double +DateValue::secondFraction() +{ + parse(); + return secFrac_; +} + + bool +DateValue::zonePositive() +{ + parse(); + return zonePositive_; +} + + unsigned int +DateValue::zoneHour() +{ + parse(); + return zoneHour_; +} + + unsigned int +DateValue::zoneMinute() +{ + parse(); + return zoneMinute_; +} + + void +DateValue::setYear(unsigned int i) +{ + year_ = i; + assembled_ = false; +} + + void +DateValue::setMonth(unsigned int i) +{ + month_ = i; + assembled_ = false; +} + + void +DateValue::setDay(unsigned int i) +{ + day_ = i; + assembled_ = false; +} + + void +DateValue::setHour(unsigned int i) +{ + hour_ = i; + assembled_ = false; +} + + void +DateValue::setMinute(unsigned int i) +{ + minute_ = i; + assembled_ = false; +} + + void +DateValue::setSecond(unsigned int i) +{ + second_ = i; + assembled_ = false; +} + + void +DateValue::setSecondFraction(double d) +{ + secFrac_ = d; + assembled_ = false; +} + + void +DateValue::setZonePositive(bool b) +{ + zonePositive_ = b; + assembled_ = false; +} + + void +DateValue::setZoneHour(unsigned int i) +{ + zoneHour_ = i; + assembled_ = false; +} + + void +DateValue::setZoneMinute(unsigned int i) +{ + zoneMinute_ = i; + assembled_ = false; +} + + TQDate +DateValue::qdate() +{ + parse(); + TQDate d(year_, month_, day_); + return d; +} + + TQTime +DateValue::qtime() +{ + parse(); + TQTime t(hour_, minute_, second_); +// t.setMs(1 / secFrac_); + return t; +} + + TQDateTime +DateValue::qdt() +{ + parse(); + TQDateTime dt; + dt.setDate(qdate()); + dt.setTime(qtime()); + return dt; +} + + bool +DateValue::hasTime() +{ + parse(); + return hasTime_; +} + diff --git a/tdeabc/vcard/EmailParam.cpp b/tdeabc/vcard/EmailParam.cpp new file mode 100644 index 000000000..7daf19ccc --- /dev/null +++ b/tdeabc/vcard/EmailParam.cpp @@ -0,0 +1,116 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardEmailParam.h> +#include <VCardParam.h> +#include <VCardDefines.h> + +using namespace VCARD; + +EmailParam::EmailParam() + : Param() +{ + vDebug("ctor"); +} + +EmailParam::EmailParam(const EmailParam & x) + : Param(x), + emailType_ (x.emailType_), + pref_ (x.pref_) +{ +} + +EmailParam::EmailParam(const TQCString & s) + : Param(s) +{ +} + + EmailParam & +EmailParam::operator = (EmailParam & x) +{ + if (*this == x) return *this; + + emailType_ = x.emailType(); + pref_ = x.pref_; + + Param::operator = (x); + return *this; +} + + EmailParam & +EmailParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +EmailParam::operator == (EmailParam & x) +{ + parse(); + + if (pref_) + return (x.pref_ && x.emailType() == emailType_); + + return !x.pref(); +} + +EmailParam::~EmailParam() +{ +} + + void +EmailParam::_parse() +{ +#if 0 + Param::parseToList(); + + SubParamListIterator it(subParamList_); + + pref_ = true; + emailType_ = ""; + + for (; it.current(); ++it) { + + if (tqstricmp(it.current()->name(), "TYPE") == 0) { + emailType_ = it.current()->value(); + continue; + } + + if (tqstricmp(it.current()->name(), "PREF") == 0) { + pref_ = true; + } + } +#endif +} + + void +EmailParam::_assemble() +{ + strRep_ = "TYPE="; + strRep_ += emailType_; + + if (pref_) + strRep_ += ",PREF"; +} + diff --git a/tdeabc/vcard/Entity.cpp b/tdeabc/vcard/Entity.cpp new file mode 100644 index 000000000..5eaf6a1d0 --- /dev/null +++ b/tdeabc/vcard/Entity.cpp @@ -0,0 +1,134 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardEntity.h> + +using namespace VCARD; + +Entity::Entity() + : parsed_ (false), + assembled_ (true) +{ + // empty +} + +Entity::Entity(const Entity & e) + : strRep_ (e.strRep_), + parsed_ (e.parsed_), + assembled_ (e.assembled_) +{ + // empty +} + +Entity::Entity(const TQCString & s) + : strRep_ (s), + parsed_ (false), + assembled_ (true) +{ + // empty +} + + Entity & +Entity::operator = (const Entity & e) +{ + if (this == &e) return *this; + + strRep_ = e.strRep_; + parsed_ = e.parsed_; + assembled_ = e.assembled_; + + return *this; +} + + Entity & +Entity::operator = (const TQCString & s) +{ + strRep_ = s; + parsed_ = false; + assembled_ = true; + + return *this; +} + + bool +Entity::operator == (Entity & e) +{ + return asString() == e.asString(); +} + + bool +Entity::operator != (Entity & e) +{ + return !(*this == e); +} + + bool +Entity::operator == (const TQCString & s) +{ + return asString() == s; +} + + bool +Entity::operator != (const TQCString & s) +{ + return !(*this == s); +} + +Entity::~Entity() +{ + // empty +} + + TQCString +Entity::asString() +{ +// vDebug("Entity::asString()"); + assemble(); + + return strRep_; +} + + void +Entity::parse() +{ +// vDebug( "Entity::parse()" ); + + if (!parsed_) _parse(); + + parsed_ = true; + assembled_ = false; +} + + void +Entity::assemble() +{ +// vDebug( "Entity::assemble()" ); + + if (assembled_) return; + + parse(); + _assemble(); + + assembled_ = true; +} + diff --git a/tdeabc/vcard/Enum.cpp b/tdeabc/vcard/Enum.cpp new file mode 100644 index 000000000..bcb48f98a --- /dev/null +++ b/tdeabc/vcard/Enum.cpp @@ -0,0 +1,490 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <tqcstring.h> +#include <ctype.h> + +#include <VCardEnum.h> + +using namespace VCARD; + +// There are 31 possible types, not including extensions. +// URI is a custom field designed to store the upstream URI for each contact +// in order to handle certain limited CardDAV systems such as Zimbra + const TQCString +VCARD::paramNames [] = +{ + "NAME", + "PROFILE", + "SOURCE", + "FN", + "N", + "NICKNAME", + "PHOTO", + "BDAY", + "ADR", + "LABEL", + "TEL", + "EMAIL", + "MAILER", + "TZ", + "GEO", + "TITLE", + "ROLE", + "LOGO", + "AGENT", + "ORG", + "CATEGORIES", + "NOTE", + "PRODID", + "REV", + "SORT-STRING", + "SOUND", + "UID", + "URL", + "VERSION", + "CLASS", + "KEY", + "URI" +}; + + const ParamType +VCARD::paramTypesTable[] = { + ParamNone, // NAME + ParamNone, // PROFILE + ParamSource, // SOURCE + ParamText, // FN + ParamText, // N + ParamText, // NICKNAME + ParamImage, // PHOTO (inline/refer) + ParamDate, // BDAY ("VALUE = "date-time/date) + ParamAddrText, // ADR (adr-param/text-param) + ParamAddrText, // LABEL (adr-param/text-param) + ParamTel, // TEL + ParamEmail, // EMAIL + ParamText, // MAILER + ParamNone, // TZ + ParamNone, // GEO + ParamText, // TITLE + ParamText, // ROLE + ParamImage, // LOGO + ParamAgent, // AGENT + ParamText, // ORG + ParamText, // CATEGORIES + ParamText, // NOTE + ParamNone, // PRODID + ParamDate, // REV + ParamText, // SORT-STRING + ParamSound, // SOUND + ParamNone, // UID + ParamNone, // URL + ParamNone, // VERSION + ParamNone, // CLASS + ParamTextBin, // KEY + ParamTextNS, // X + ParamNone // URI +}; + + ParamType +VCARD::EntityTypeToParamType(EntityType e) +{ + ParamType t(ParamUnknown); + + switch (e) { + + //---------------------------------------------------------------// + case EntityAgent: t = ParamAgent; break; + //---------------------------------------------------------------// + case EntitySound: t = ParamSound; break; + //---------------------------------------------------------------// + case EntitySource: t = ParamSource; break; + //---------------------------------------------------------------// + case EntityTelephone: t = ParamTel; break; + //---------------------------------------------------------------// + case EntityEmail: t = ParamEmail; break; + //---------------------------------------------------------------// + case EntityKey: t = ParamTextBin; break; + //---------------------------------------------------------------// + case EntityExtension: t = ParamTextNS; break; + //---------------------------------------------------------------// + case EntityAddress: + case EntityLabel: t = ParamAddrText; break; + //---------------------------------------------------------------// + case EntityBirthday: + case EntityRevision: t = ParamDate; break; + //---------------------------------------------------------------// + case EntityPhoto: + case EntityLogo: t = ParamImage; break; + //---------------------------------------------------------------// + case EntityOrganisation: + case EntityTitle: + case EntityRole: + case EntityFullName: + case EntityMailer: + case EntityN: + case EntitySortString: + case EntityNickname: + case EntityCategories: + case EntityNote: t = ParamText; break; + //---------------------------------------------------------------// + case EntityProductID: + case EntityTimeZone: + case EntityUID: + case EntityURL: + case EntityClass: + case EntityGeo: + case EntityName: + case EntityVersion: + case EntityProfile: + case EntityURI: + default: t = ParamNone; break; + //---------------------------------------------------------------// + + } + + return t; +} + + ValueType +VCARD::EntityTypeToValueType(EntityType e) +{ + ValueType t(ValueUnknown); + + switch (e) { + + //---------------------------------------------------------------// + case EntitySound: t = ValueSound; break; + //---------------------------------------------------------------// + case EntityAgent: t = ValueAgent; break; + //---------------------------------------------------------------// + case EntityAddress: t = ValueAddress; break; + //---------------------------------------------------------------// + case EntityTelephone: t = ValueTel; break; + //---------------------------------------------------------------// + case EntityKey: t = ValueTextBin; break; + //---------------------------------------------------------------// + case EntityOrganisation: t = ValueOrg; break; + //---------------------------------------------------------------// + case EntityN: t = ValueN; break; + //---------------------------------------------------------------// + case EntityTimeZone: t = ValueUTC; break; + //---------------------------------------------------------------// + case EntityClass: t = ValueClass; break; + //---------------------------------------------------------------// + case EntityGeo: t = ValueGeo; break; + //---------------------------------------------------------------// + case EntitySource: + case EntityURL: t = ValueURI; break; + //---------------------------------------------------------------// + case EntityPhoto: + case EntityLogo: t = ValueImage; break; + //---------------------------------------------------------------// + case EntityBirthday: + case EntityRevision: t = ValueDate; break; + //---------------------------------------------------------------// + case EntityCategories: + case EntityNickname: t = ValueTextList; break; + //---------------------------------------------------------------// + case EntityLabel: + case EntityExtension: + case EntityEmail: + case EntityTitle: + case EntityRole: + case EntityFullName: + case EntityMailer: + case EntityProductID: + case EntityName: + case EntitySortString: + case EntityVersion: + case EntityProfile: + case EntityUID: + case EntityNote: + case EntityURI: + default: t = ValueText; break; + //---------------------------------------------------------------// + + } + + return t; +} + + TQCString +VCARD::EntityTypeToParamName(EntityType e) +{ + if ( e > EntityUnknown ) e = EntityUnknown; + return paramNames[ int( e ) ]; +} + + EntityType +VCARD::EntityNameToEntityType(const TQCString & s) +{ + if (s.isEmpty()) return EntityUnknown; + + EntityType t(EntityUnknown); + + switch (s[0]) { + + case 'A': + if (s == "ADR") + t = EntityAddress; + else if (s == "AGENT") + t = EntityAgent; + break; + + case 'B': + if (s == "BDAY") + t = EntityBirthday; + break; + + case 'C': + if (s == "CATEGORIES") + t = EntityCategories; + else if (s == "CLASS") + t = EntityClass; + break; + + case 'E': + if (s == "EMAIL") + t = EntityEmail; + break; + + case 'F': + if (s == "FN") + t = EntityFullName; + break; + + case 'G': + if (s == "GEO") + t = EntityGeo; + break; + + case 'K': + if (s == "KEY") + t = EntityKey; + break; + + case 'L': + if (s == "LABEL") + t = EntityLabel; + else if (s == "LOGO") + t = EntityLogo; + break; + + case 'M': + if (s == "MAILER") + t = EntityMailer; + break; + + case 'N': + if (s == "N") + t = EntityN; + else if (s == "NAME") + t = EntityName; + else if (s == "NICKNAME") + t = EntityNickname; + else if (s == "NOTE") + t = EntityNote; + break; + + case 'O': + if (s == "ORG") + t = EntityOrganisation; + break; + + case 'P': + if (s == "PHOTO") + t = EntityPhoto; + else if (s == "PRODID") + t = EntityProductID; + else if (s == "PROFILE") + t = EntityProfile; + break; + + case 'R': + if (s == "REV") + t = EntityRevision; + else if (s == "ROLE") + t = EntityRole; + break; + + case 'S': + if (s == "SORT-STRING") + t = EntitySortString; + else if (s == "SOUND") + t = EntitySound; + else if (s == "SOURCE") + t = EntitySource; + break; + + case 'T': + if (s == "TEL") + t = EntityTelephone; + else if (s == "TITLE") + t = EntityTitle; + else if (s == "TZ") + t = EntityTimeZone; + break; + + case 'U': + if (s == "UID") + t = EntityUID; + else if (s == "URL") + t = EntityURL; + else if (s == "URI") + t = EntityURI; + case 'V': + if (s == "VERSION") + t = EntityVersion; + break; + + case 'X': + if (s.left(2) == "X-") + t = EntityExtension; + break; + + default: + + t = EntityUnknown; + } + + return t; +} + +// The copyright notice below refers to the base64 codec functions used below, +// which are modified from the original sources. + +/* + * Original version Copyright 1988 by The Leland Stanford Junior University + * Copyright 1998 by the University of Washington + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notices appear in all copies and that both the + * above copyright notices and this permission notice appear in supporting + * documentation, and that the name of the University of Washington or The + * Leland Stanford Junior University not be used in advertising or publicity + * pertaining to distribution of the software without specific, written prior + * permission. This software is made available "as is", and + * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY + * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE, + * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF + * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +static char B64[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +// the mime base64 disctionary used for decoding +static signed char b64dec[] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 30 + -1, -1, -1,-19, -1, -1, -1,-16, -4, -4, // 40 -19 == '+' -16 == '/' + -4, -4, -4, -4, -4, -4, -4, -4, -1, -1, // 50 -4 == '0' + -1, 0, -1, -1, -1, 65, 65, 65, 65, 65, // 60 0 == '=' 65 == 'A' + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 70 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 80 + 65, -1, -1, -1, -1, -1, -1, 71, 71, 71, // 90 71 == 'a' + 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 100 + 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 110 + 71, 71, 71, -1, -1, -1, -1, -1, -1, -1, // 120 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 130 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 140 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 150 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 160 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 170 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 180 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 190 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 200 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 210 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 220 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 230 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 240 + -1, -1, -1, -1, -1, -1, -1 // 250 +}; + + char * +VCARD::decodeBase64(const char * s, unsigned long srcl, unsigned long & len) +{ + register unsigned char c; + register unsigned long e(0); + len = 0; + unsigned const char * src = (unsigned const char *)s; + char * ret = new char[srcl + (srcl / 4 + 1)]; + register char *d = ret; + while (srcl--) { // Critical loop + c = *src++; + int dec = b64dec[c]; + if (dec == -1) continue; + if (c == '=') { + switch (e++) { + case 3: e = 0; break; + case 2: if (*src == '=') break; + default: delete [] ret; ret = 0; return 0; break; + } + continue; + } + c -= dec; + if (e == 0) { *d = c << 2; ++e; continue; } + switch (e) { + case 1: *d |= c >> 4; *++d = c << 4; break; + case 2: *d |= c >> 2; *++d = c << 6; break; + case 3: *d++ |= c; e = 0; continue; break; + } + ++e; + } + len = d - (char *)ret; + return ret; +} + + + char * +VCARD::encodeBase64(const char * src, unsigned long srcl, unsigned long & destl) +{ + register const unsigned char *s = (unsigned char *)src; + register unsigned long i = ((srcl + 2) / 3) * 4; + destl = i += 2 * ((i / 60) + 1); + i = 0; + char * ret = new char[destl]; + register unsigned char *d((unsigned char *)ret); + while (srcl != 0) { // Critical loop + *d++ = B64[s[0] >> 2]; + *d++ = B64[((s[0] << 4) + (--srcl == 0 ? 0 : s[1] >> 4)) & 0x3f]; + *d++ = srcl == 0 ? '=' : + B64[((s[1] << 2) + (--srcl == 0 ? 0 : s[2] >> 6)) & 0x3f]; + *d++ = srcl == 0 ? '=' : B64[s[2] & 0x3f]; + if (srcl != 0) srcl--; + if (++i == 15) { i = 0; *d++ = '\r'; *d++ = '\n'; } + s += 3; + } + *d = '\r'; *++d = '\n'; *++d = '\0'; + return ret; +} + diff --git a/tdeabc/vcard/FloatValue.cpp b/tdeabc/vcard/FloatValue.cpp new file mode 100644 index 000000000..ac1f2c6b5 --- /dev/null +++ b/tdeabc/vcard/FloatValue.cpp @@ -0,0 +1,120 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardFloatValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +FloatValue::FloatValue() + : Value() +{ +} + +FloatValue::FloatValue(float f) + : Value (), + value_ (f) +{ + parsed_ = true; +} + +FloatValue::FloatValue(const FloatValue & x) + : Value(x) +{ + value_ = x.value_; +} + +FloatValue::FloatValue(const TQCString & s) + : Value(s) +{ +} + + FloatValue & +FloatValue::operator = (FloatValue & x) +{ + if (*this == x) return *this; + + x.parse(); + value_ = x.value_; + + Value::operator = (x); + return *this; +} + + FloatValue & +FloatValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +FloatValue::operator == (FloatValue & x) +{ + x.parse(); + return (value_ == x.value_); +} + +FloatValue::~FloatValue() +{ +} + + void +FloatValue::_parse() +{ + bool negative(false); + + if (strRep_[0] == '-' || strRep_[1] == '+') { + + if (strRep_[0] == '-') + negative = true; + + strRep_.remove(0, 1); + } + + value_ = strRep_.toFloat(); + if (negative) + value_ = -value_; +} + + void +FloatValue::_assemble() +{ + strRep_ = TQCString().setNum(value_); +} + + float +FloatValue::value() +{ + parse(); + return value_; +} + + void +FloatValue::setValue(float f) +{ + parsed_ = true; + value_ = f; +} + diff --git a/tdeabc/vcard/GeoValue.cpp b/tdeabc/vcard/GeoValue.cpp new file mode 100644 index 000000000..2bac28c1e --- /dev/null +++ b/tdeabc/vcard/GeoValue.cpp @@ -0,0 +1,100 @@ +/* + This file is part of libvcard. + Copyright (c) 2002 Tobias Koenig <tokoe@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 <VCardGeoValue.h> + +#include <VCardValue.h> + +#include <kdebug.h> + +using namespace VCARD; + +GeoValue::GeoValue() + : Value() +{ +} + +GeoValue::GeoValue(const GeoValue & x) + : Value(x), latitude_(x.latitude_), longitude_(x.longitude_) +{ +} + +GeoValue::GeoValue(const TQCString & s) + : Value(s) +{ +} + + GeoValue & +GeoValue::operator = (GeoValue & x) +{ + if (*this == x) return *this; + + latitude_ = x.latitude_; + longitude_ = x.longitude_; + + Value::operator = (x); + return *this; +} + + GeoValue & +GeoValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +GeoValue::operator == (GeoValue & x) +{ + x.parse(); + + if ( latitude_ != x.latitude_ ) return false; + if ( longitude_ != x.longitude_ ) return false; + + return true; +} + +GeoValue::~GeoValue() +{ +} + + GeoValue * +GeoValue::clone() +{ + return new GeoValue( *this ); +} + + void +GeoValue::_parse() +{ + int semiColon = strRep_.find( ";" ); + + if ( semiColon == -1 ) // invalid + return; + + latitude_ = strRep_.left( semiColon ).toFloat(); + longitude_ = strRep_.mid( semiColon + 1, strRep_.length() - semiColon ).toFloat(); +} + + void +GeoValue::_assemble() +{ + strRep_.sprintf( "%.6f;%.6f", latitude_, longitude_ ); +} diff --git a/tdeabc/vcard/ImageParam.cpp b/tdeabc/vcard/ImageParam.cpp new file mode 100644 index 000000000..69611eeab --- /dev/null +++ b/tdeabc/vcard/ImageParam.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardImageParam.h> + +#include <VCardParam.h> + +using namespace VCARD; + +ImageParam::ImageParam() + : Param() +{ +} + +ImageParam::ImageParam(const ImageParam & x) + : Param(x) +{ +} + +ImageParam::ImageParam(const TQCString & s) + : Param(s) +{ +} + + ImageParam & +ImageParam::operator = (ImageParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + ImageParam & +ImageParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +ImageParam::operator == (ImageParam & x) +{ + x.parse(); + return false; +} + +ImageParam::~ImageParam() +{ +} + + void +ImageParam::_parse() +{ +} + + void +ImageParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/ImageValue.cpp b/tdeabc/vcard/ImageValue.cpp new file mode 100644 index 000000000..5d8d29bb7 --- /dev/null +++ b/tdeabc/vcard/ImageValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardImageValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +ImageValue::ImageValue() + : Value() +{ +} + +ImageValue::ImageValue(const ImageValue & x) + : Value(x) +{ +} + +ImageValue::ImageValue(const TQCString & s) + : Value(s) +{ +} + + ImageValue & +ImageValue::operator = (ImageValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + ImageValue & +ImageValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +ImageValue::operator == (ImageValue & x) +{ + x.parse(); + return false; +} + +ImageValue::~ImageValue() +{ +} + + void +ImageValue::_parse() +{ +} + + void +ImageValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/ImgValue.cpp b/tdeabc/vcard/ImgValue.cpp new file mode 100644 index 000000000..42889acd8 --- /dev/null +++ b/tdeabc/vcard/ImgValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardImgValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +ImgValue::ImgValue() + : Value() +{ +} + +ImgValue::ImgValue(const ImgValue & x) + : Value(x) +{ +} + +ImgValue::ImgValue(const TQCString & s) + : Value(s) +{ +} + + ImgValue & +ImgValue::operator = (ImgValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + ImgValue & +ImgValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +ImgValue::operator == (ImgValue & x) +{ + x.parse(); + return false; +} + +ImgValue::~ImgValue() +{ +} + + void +ImgValue::_parse() +{ +} + + void +ImgValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/LangValue.cpp b/tdeabc/vcard/LangValue.cpp new file mode 100644 index 000000000..f7e5a759e --- /dev/null +++ b/tdeabc/vcard/LangValue.cpp @@ -0,0 +1,127 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardRToken.h> + +#include <VCardLangValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +LangValue::LangValue() + : Value() +{ +} + +LangValue::LangValue(const LangValue & x) + : Value(x) +{ +} + +LangValue::LangValue(const TQCString & s) + : Value(s) +{ +} + + LangValue & +LangValue::operator = (LangValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + LangValue & +LangValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +LangValue::operator == (LangValue & x) +{ + x.parse(); + return false; +} + +LangValue::~LangValue() +{ +} + + void +LangValue::_parse() +{ + TQStrList l; + RTokenise(strRep_, "-", l); + + if (l.count() == 0) return; + + primary_ = l.at(0); + + l.remove(0u); + + subtags_ = l; +} + + void +LangValue::_assemble() +{ + strRep_ = primary_; + + TQStrListIterator it(subtags_); + + for (; it.current(); ++it) + strRep_ += TQCString('-') + it.current(); +} + + TQCString +LangValue::primary() +{ + parse(); + return primary_; +} + + TQStrList +LangValue::subtags() +{ + parse(); + return subtags_; +} + + void +LangValue::setPrimary(const TQCString & s) +{ + parse(); + primary_ = s; +} + + void +LangValue::setSubTags(const TQStrList & l) +{ + parse(); + subtags_ = l; +} + diff --git a/tdeabc/vcard/Makefile.am b/tdeabc/vcard/Makefile.am new file mode 100644 index 000000000..e8a33c3a9 --- /dev/null +++ b/tdeabc/vcard/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = \ + -I$(srcdir)/include \ + -I$(srcdir)/include/generated \ + $(all_includes) + +### KDE 4.0: either make noinst or rename to something like libkvcard +lib_LTLIBRARIES = libvcard.la + +libvcard_la_SOURCES = vCard-all.cpp +libvcard_la_LDFLAGS = $(all_libraries) +libvcard_la_LIBADD = $(LIB_TDECORE) $(LIB_QT) + +check_PROGRAMS = testwrite testread + +testwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testwrite_LDADD = libvcard.la +testwrite_SOURCES = testwrite.cpp + +testread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testread_LDADD = libvcard.la +testread_SOURCES = testread.cpp diff --git a/tdeabc/vcard/NValue.cpp b/tdeabc/vcard/NValue.cpp new file mode 100644 index 000000000..e63268134 --- /dev/null +++ b/tdeabc/vcard/NValue.cpp @@ -0,0 +1,128 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <tqstrlist.h> + +#include <VCardRToken.h> +#include <VCardNValue.h> +#include <VCardValue.h> +#include <VCardDefines.h> + +using namespace VCARD; + +NValue::NValue() + : Value() +{ + vDebug("ctor"); +} + +NValue::NValue(const NValue & x) + : Value(x), + family_ (x.family_), + given_ (x.given_), + middle_ (x.middle_), + prefix_ (x.prefix_), + suffix_ (x.suffix_) +{ +} + +NValue::NValue(const TQCString & s) + : Value(s) +{ + vDebug("ctor"); +} + + NValue & +NValue::operator = (NValue & x) +{ + if (*this == x) return *this; + + family_ = x.family_; + given_ = x.given_; + middle_ = x.middle_; + prefix_ = x.prefix_; + suffix_ = x.suffix_; + + Value::operator = (x); + return *this; +} + + NValue & +NValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +NValue::operator == (NValue & x) +{ + x.parse(); + + return ( + family_ == x.family_ && + given_ == x.given_ && + middle_ == x.middle_ && + prefix_ == x.prefix_ && + suffix_ == x.suffix_); +} + +NValue::~NValue() +{ +} + + NValue * +NValue::clone() +{ + return new NValue( *this ); +} + + void +NValue::_parse() +{ + TQStrList l; + RTokenise(strRep_, ";", l); + + for (unsigned int i = 0; i < l.count(); i++) { + + switch (i) { + case 0: family_ = l.at(0); break; + case 1: given_ = l.at(1); break; + case 2: middle_ = l.at(2); break; + case 3: prefix_ = l.at(3); break; + case 4: suffix_ = l.at(4); break; + default: break; + } + } +} + + void +NValue::_assemble() +{ + strRep_ = family_; + strRep_ += ";" + given_; + strRep_ += ";" + middle_; + strRep_ += ";" + prefix_; + strRep_ += ";" + suffix_; +} + diff --git a/tdeabc/vcard/OrgValue.cpp b/tdeabc/vcard/OrgValue.cpp new file mode 100644 index 000000000..94ca18243 --- /dev/null +++ b/tdeabc/vcard/OrgValue.cpp @@ -0,0 +1,107 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardRToken.h> + +#include <VCardOrgValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +OrgValue::OrgValue() + : Value() +{ +} + +OrgValue::OrgValue(const OrgValue & x) + : Value(x) +{ +} + +OrgValue::OrgValue(const TQCString & s) + : Value(s) +{ +} + + OrgValue & +OrgValue::operator = (OrgValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + OrgValue & +OrgValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +OrgValue::operator == (OrgValue & x) +{ + x.parse(); + return false; +} + +OrgValue::~OrgValue() +{ +} + + void +OrgValue::_parse() +{ + RTokenise(strRep_, ";", valueList_); +} + + void +OrgValue::_assemble() +{ + bool first(true); + + TQStrListIterator it(valueList_); + + for (; it.current(); ++it) { + if (!first) strRep_ += ';'; + strRep_ += it.current(); + first = false; + } +} + + unsigned int +OrgValue::numValues() +{ + parse(); + return valueList_.count(); +} + + TQCString +OrgValue::value(unsigned int i) +{ + parse(); + return valueList_.at(i); +} + diff --git a/tdeabc/vcard/Param.cpp b/tdeabc/vcard/Param.cpp new file mode 100644 index 000000000..8c5ad9e2c --- /dev/null +++ b/tdeabc/vcard/Param.cpp @@ -0,0 +1,129 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardParam.h> + +#include <VCardEntity.h> + +#include <VCardRToken.h> + +using namespace VCARD; + +Param::Param() + : Entity(), + name_(""), + value_("") +{ +} + +Param::Param(const Param & x) + : Entity(x), + name_(x.name_), + value_(x.value_) +{ +} + +Param::Param(const TQCString & s) + : Entity(s), + name_(""), + value_("") +{ +} + + Param & +Param::operator = (Param & x) +{ + if (*this == x) return *this; + + Entity::operator = (x); + name_ = x.name_; + value_ = x.value_; + + return *this; +} + + Param & +Param::operator = (const TQCString & s) +{ + Entity::operator = (s); + return *this; +} + + bool +Param::operator == (Param & x) +{ + x.parse(); + return false; +} + +Param::~Param() +{ +} + + void +Param::_parse() +{ +} + + void +Param::_assemble() +{ + strRep_ = name_ + "=" + value_; +} + +Param::Param(const TQCString &name, const TQCString &value) + : Entity(), + name_(name), + value_(value) +{ + parsed_ = true; + assembled_ = false; +} + + void +Param::setName(const TQCString & name) +{ + name_ = name; + + assembled_ = false; +} + + void +Param::setValue(const TQCString & value) +{ + value_ = value; + + assembled_ = false; +} + + TQCString +Param::name() +{ + return name_; +} + + TQCString +Param::value() +{ + return value_; +} diff --git a/tdeabc/vcard/PhoneNumberValue.cpp b/tdeabc/vcard/PhoneNumberValue.cpp new file mode 100644 index 000000000..02a1266fe --- /dev/null +++ b/tdeabc/vcard/PhoneNumberValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardPhoneNumberValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +PhoneNumberValue::PhoneNumberValue() + : Value() +{ +} + +PhoneNumberValue::PhoneNumberValue(const PhoneNumberValue & x) + : Value(x) +{ +} + +PhoneNumberValue::PhoneNumberValue(const TQCString & s) + : Value(s) +{ +} + + PhoneNumberValue & +PhoneNumberValue::operator = (PhoneNumberValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + PhoneNumberValue & +PhoneNumberValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +PhoneNumberValue::operator == (PhoneNumberValue & x) +{ + x.parse(); + return false; +} + +PhoneNumberValue::~PhoneNumberValue() +{ +} + + void +PhoneNumberValue::_parse() +{ +} + + void +PhoneNumberValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/README b/tdeabc/vcard/README new file mode 100644 index 000000000..18a9daf4a --- /dev/null +++ b/tdeabc/vcard/README @@ -0,0 +1,15 @@ +libvcard (C) 1999 Rik Hemsley <rik@kde.org> +Written for the KDE project. + +This software is licensed under the MIT license. + +A vCard 3.0 parser based on the same principles that librmm (from Empath) uses. + +It's small and very fast due to parsing and assembly of object being lazy. + +There is a base64 codec declared in Enum.h + +Feedback welcome. + +Rik <rik@kde.org> + diff --git a/tdeabc/vcard/RToken.cpp b/tdeabc/vcard/RToken.cpp new file mode 100644 index 000000000..582a9e1c7 --- /dev/null +++ b/tdeabc/vcard/RToken.cpp @@ -0,0 +1,88 @@ +/* + + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <string.h> +#include <stddef.h> +#include <tqcstring.h> +#include <tqstrlist.h> + +namespace VCARD +{ + + TQ_UINT32 +RTokenise(const char * str, const char * delim, TQStrList & l) +{ + // FIXME no stderr ! + l.clear(); + + if (!delim || !str || strlen(delim) == 0 || strlen(str) == 0) return 0; + + char * len = (char *)(str + strlen(str)); // End of string. + + register char * rstart = new char[strlen(str) + 1]; + register char * r = rstart; + + + register const char * i = str; // Cursor. + + while (i <= len) { + + if (*i == '\\') { // Escaped chars go straight through. + *r++ = *i++; + if (i <= len) + *r++ = *i++; + continue; + } + + if (strchr(delim, *i) != 0) { + // We hit a delimiter. If we have some text, make a new token. + // This has the effect that multiple delimiters are collapsed. + // cs: We mustn't collapse multiple delimiters, otherwise we + // lose empty fields. + *r = '\0'; +// if (r != rstart) { + l.append(rstart); +// } + r = rstart; + ++i; + continue; + } + + *r++ = *i++; + } + + // Catch last token +// if (r != rstart) { + *r = '\0'; + l.append(rstart); +// } + + r = 0; + + delete [] rstart; + + return l.count(); +} + +} diff --git a/tdeabc/vcard/SoundValue.cpp b/tdeabc/vcard/SoundValue.cpp new file mode 100644 index 000000000..5be75d358 --- /dev/null +++ b/tdeabc/vcard/SoundValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardSoundValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +SoundValue::SoundValue() + : Value() +{ +} + +SoundValue::SoundValue(const SoundValue & x) + : Value(x) +{ +} + +SoundValue::SoundValue(const TQCString & s) + : Value(s) +{ +} + + SoundValue & +SoundValue::operator = (SoundValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + SoundValue & +SoundValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +SoundValue::operator == (SoundValue & x) +{ + x.parse(); + return false; +} + +SoundValue::~SoundValue() +{ +} + + void +SoundValue::_parse() +{ +} + + void +SoundValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/SourceParam.cpp b/tdeabc/vcard/SourceParam.cpp new file mode 100644 index 000000000..6a0e772ac --- /dev/null +++ b/tdeabc/vcard/SourceParam.cpp @@ -0,0 +1,112 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardSourceParam.h> + +#include <VCardParam.h> + +using namespace VCARD; + +SourceParam::SourceParam() + : Param(), + type_(SourceParam::TypeUnknown) +{ +} + +SourceParam::SourceParam(const SourceParam & x) + : Param(x), + type_ (x.type_), + par_ (x.par_), + val_ (x.val_) +{ +} + +SourceParam::SourceParam(const TQCString & s) + : Param(s), + type_(SourceParam::TypeUnknown) +{ +} + + SourceParam & +SourceParam::operator = (SourceParam & x) +{ + if (*this == x) return *this; + type_ = x.type(); + par_ = x.par(); + val_ = x.val(); + + Param::operator = (x); + return *this; +} + + SourceParam & +SourceParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +SourceParam::operator == (SourceParam & x) +{ + x.parse(); + return false; +} + +SourceParam::~SourceParam() +{ +} + + void +SourceParam::_parse() +{ + int i = strRep_.find('='); + if (i == -1) // Invalid + return; + + par_ = strRep_.left(i); + val_ = strRep_.right(strRep_.length() - i - 1); + + if (tqstricmp(par_, "VALUE") == 0 && tqstricmp(val_, "uri") == 0) + type_ = TypeValue; + else if (tqstricmp(par_, "CONTEXT") == 0 && tqstricmp(val_, "word") == 0) + type_ = TypeContext; + else if (tqstrnicmp(par_, "X-", 2) == 0) { + type_ = TypeX; + } + else type_ = TypeUnknown; + +} + + void +SourceParam::_assemble() +{ + if (type_ == TypeValue) + strRep_ = "VALUE=uri"; + else if (type_ == TypeContext) + strRep_ = "CONTEXT=word"; + else if (type_ == TypeX) + strRep_ = par_ + "=" + val_; + else strRep_ = ""; +} + diff --git a/tdeabc/vcard/TelParam.cpp b/tdeabc/vcard/TelParam.cpp new file mode 100644 index 000000000..072b1dc81 --- /dev/null +++ b/tdeabc/vcard/TelParam.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardTelParam.h> + +#include <VCardParam.h> + +using namespace VCARD; + +TelParam::TelParam() + : Param() +{ +} + +TelParam::TelParam(const TelParam & x) + : Param(x) +{ +} + +TelParam::TelParam(const TQCString & s) + : Param(s) +{ +} + + TelParam & +TelParam::operator = (TelParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + TelParam & +TelParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +TelParam::operator == (TelParam & x) +{ + x.parse(); + return false; +} + +TelParam::~TelParam() +{ +} + + void +TelParam::_parse() +{ +} + + void +TelParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/TelValue.cpp b/tdeabc/vcard/TelValue.cpp new file mode 100644 index 000000000..c9c1b85aa --- /dev/null +++ b/tdeabc/vcard/TelValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardTelValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +TelValue::TelValue() + : Value() +{ +} + +TelValue::TelValue(const TelValue & x) + : Value(x) +{ +} + +TelValue::TelValue(const TQCString & s) + : Value(s) +{ +} + + TelValue & +TelValue::operator = (TelValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + TelValue & +TelValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +TelValue::operator == (TelValue & x) +{ + x.parse(); + return false; +} + +TelValue::~TelValue() +{ +} + + void +TelValue::_parse() +{ +} + + void +TelValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/TextBinParam.cpp b/tdeabc/vcard/TextBinParam.cpp new file mode 100644 index 000000000..4e0ebadff --- /dev/null +++ b/tdeabc/vcard/TextBinParam.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardTextBinParam.h> + +#include <VCardParam.h> + +using namespace VCARD; + +TextBinParam::TextBinParam() + : Param() +{ +} + +TextBinParam::TextBinParam(const TextBinParam & x) + : Param(x) +{ +} + +TextBinParam::TextBinParam(const TQCString & s) + : Param(s) +{ +} + + TextBinParam & +TextBinParam::operator = (TextBinParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + TextBinParam & +TextBinParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +TextBinParam::operator == (TextBinParam & x) +{ + x.parse(); + return false; +} + +TextBinParam::~TextBinParam() +{ +} + + void +TextBinParam::_parse() +{ +} + + void +TextBinParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/TextBinValue.cpp b/tdeabc/vcard/TextBinValue.cpp new file mode 100644 index 000000000..e7da0b7c6 --- /dev/null +++ b/tdeabc/vcard/TextBinValue.cpp @@ -0,0 +1,104 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <kmdcodec.h> + +#include <VCardTextBinValue.h> +#include <VCardValue.h> + +using namespace VCARD; + +TextBinValue::TextBinValue() + : Value() +{ +} + +TextBinValue::TextBinValue(const TextBinValue & x) + : Value(x) +{ + mIsBinary_ = x.mIsBinary_; + mData_ = x.mData_; + mUrl_ = x.mUrl_; +} + +TextBinValue::TextBinValue(const TQCString & s) + : Value(s) +{ +} + + TextBinValue & +TextBinValue::operator = (TextBinValue & x) +{ + if (*this == x) return *this; + + mIsBinary_ = x.mIsBinary_; + mData_ = x.mData_; + mUrl_ = x.mUrl_; + + Value::operator = (x); + return *this; +} + + TextBinValue & +TextBinValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +TextBinValue::operator == (TextBinValue & x) +{ + x.parse(); + + if ( mIsBinary_ != x.mIsBinary_ ) return false; + if ( mData_ != x.mData_ ) return false; + if ( mUrl_ != x.mUrl_ ) return false; + + return true; +} + +TextBinValue::~TextBinValue() +{ +} + + TextBinValue * +TextBinValue::clone() +{ + return new TextBinValue( *this ); +} + + void +TextBinValue::_parse() +{ +} + + void +TextBinValue::_assemble() +{ + if ( mIsBinary_ ) { + strRep_ = KCodecs::base64Encode( mData_ ); + } else + strRep_ = mUrl_.utf8(); +} + diff --git a/tdeabc/vcard/TextListValue.cpp b/tdeabc/vcard/TextListValue.cpp new file mode 100644 index 000000000..2bec2e181 --- /dev/null +++ b/tdeabc/vcard/TextListValue.cpp @@ -0,0 +1,107 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardRToken.h> + +#include <VCardTextListValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +TextListValue::TextListValue() + : Value() +{ +} + +TextListValue::TextListValue(const TextListValue & x) + : Value(x) +{ +} + +TextListValue::TextListValue(const TQCString & s) + : Value(s) +{ +} + + TextListValue & +TextListValue::operator = (TextListValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + TextListValue & +TextListValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +TextListValue::operator == (TextListValue & x) +{ + x.parse(); + return false; +} + +TextListValue::~TextListValue() +{ +} + + void +TextListValue::_parse() +{ + RTokenise(strRep_, ";", valueList_); +} + + void +TextListValue::_assemble() +{ + bool first(true); + + TQStrListIterator it(valueList_); + + for (; it.current(); ++it) { + if (!first) strRep_ += ';'; + strRep_ += it.current(); + first = false; + } +} + + unsigned int +TextListValue::numValues() +{ + parse(); + return valueList_.count(); +} + + TQCString +TextListValue::value(unsigned int i) +{ + parse(); + return valueList_.at(i); +} + diff --git a/tdeabc/vcard/TextParam.cpp b/tdeabc/vcard/TextParam.cpp new file mode 100644 index 000000000..b353483ec --- /dev/null +++ b/tdeabc/vcard/TextParam.cpp @@ -0,0 +1,82 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardTextParam.h> + +#include <VCardParam.h> + +using namespace VCARD; + +TextParam::TextParam() + : Param() +{ +} + +TextParam::TextParam(const TextParam & x) + : Param(x) +{ +} + +TextParam::TextParam(const TQCString & s) + : Param(s) +{ +} + + TextParam & +TextParam::operator = (TextParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + TextParam & +TextParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +TextParam::operator == (TextParam & x) +{ + x.parse(); + + return false; +} + +TextParam::~TextParam() +{ +} + + void +TextParam::_parse() +{ +} + + void +TextParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/TextValue.cpp b/tdeabc/vcard/TextValue.cpp new file mode 100644 index 000000000..cf8e0673f --- /dev/null +++ b/tdeabc/vcard/TextValue.cpp @@ -0,0 +1,86 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardTextValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +TextValue::TextValue() + : Value() +{ +} + +TextValue::TextValue(const TextValue & x) + : Value(x) +{ +} + +TextValue::TextValue(const TQCString & s) + : Value(s) +{ +} + + TextValue & +TextValue::operator = (TextValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + TextValue & +TextValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +TextValue::operator == (TextValue & x) +{ + return strRep_ == x.strRep_; +} + +TextValue::~TextValue() +{ +} + + TextValue * +TextValue::clone() +{ + return new TextValue( *this ); +} + + void +TextValue::_parse() +{ +} + + void +TextValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/URIValue.cpp b/tdeabc/vcard/URIValue.cpp new file mode 100644 index 000000000..bba8db0fa --- /dev/null +++ b/tdeabc/vcard/URIValue.cpp @@ -0,0 +1,133 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardURIValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +URIValue::URIValue() + : Value() +{ +} + +URIValue::URIValue(const TQCString & scheme, const TQCString & schemeSpecificPart) + : Value(), + scheme_ (scheme), + schemeSpecificPart_ (schemeSpecificPart) +{ + parsed_ = true; +} + +URIValue::URIValue(const URIValue & x) + : Value (x), + scheme_ (x.scheme_), + schemeSpecificPart_ (x.schemeSpecificPart_) +{ +} + +URIValue::URIValue(const TQCString & s) + : Value(s) +{ +} + + URIValue & +URIValue::operator = (URIValue & x) +{ + if (*this == x) return *this; + + scheme_ = x.scheme_; + schemeSpecificPart_ = x.schemeSpecificPart_; + + Value::operator = (x); + return *this; +} + + URIValue & +URIValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +URIValue::operator == (URIValue & x) +{ + x.parse(); + return ( + (scheme_ == x.scheme_) && + (schemeSpecificPart_ == x.schemeSpecificPart_)); + + return false; +} + +URIValue::~URIValue() +{ +} + + void +URIValue::_parse() +{ + int split = strRep_.find(':'); + if (split == -1) + return; + + scheme_ = strRep_.left(split); + schemeSpecificPart_ = strRep_.mid(split + 1); +} + + void +URIValue::_assemble() +{ + strRep_ = scheme_ + ':' + schemeSpecificPart_; +} + + TQCString +URIValue::scheme() +{ + parse(); + return scheme_; +} + + TQCString +URIValue::schemeSpecificPart() +{ + parse(); + return schemeSpecificPart_; +} + + void +URIValue::setScheme(const TQCString & s) +{ + parse(); + scheme_ = s; +} + + void +URIValue::setSchemeSpecificPart(const TQCString & s) +{ + parse(); + schemeSpecificPart_ = s; +} + diff --git a/tdeabc/vcard/UTCValue.cpp b/tdeabc/vcard/UTCValue.cpp new file mode 100644 index 000000000..30473661f --- /dev/null +++ b/tdeabc/vcard/UTCValue.cpp @@ -0,0 +1,110 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardUTCValue.h> + +#include <VCardValue.h> + +using namespace VCARD; + +UTCValue::UTCValue() + : Value() +{ +} + +UTCValue::UTCValue(const UTCValue & x) + : Value(x), positive_(x.positive_), hour_(x.hour_), minute_(x.minute_) + +{ +} + +UTCValue::UTCValue(const TQCString & s) + : Value(s) +{ +} + + UTCValue & +UTCValue::operator = (UTCValue & x) +{ + if (*this == x) return *this; + + positive_ = x.positive_; + hour_ = x.hour_; + minute_ = x.minute_; + + Value::operator = (x); + return *this; +} + + UTCValue & +UTCValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +UTCValue::operator == (UTCValue & x) +{ + x.parse(); + + if (positive_ != x.positive_) return false; + if (hour_ != x.hour_) return false; + if (minute_ != x.minute_) return false; + + return true; +} + +UTCValue::~UTCValue() +{ +} + + UTCValue * +UTCValue::clone() +{ + return new UTCValue( *this ); +} + + void +UTCValue::_parse() +{ + if ( strRep_.isEmpty() ) + return; + + positive_ = ( strRep_[0] == '+' ); + + int colon = strRep_.find( ':' ); + + if ( colon == -1 ) // Not valid. + return; + + hour_ = strRep_.mid( 1, 2 ).toInt(); + minute_ = strRep_.right( 2 ).toInt(); +} + + void +UTCValue::_assemble() +{ + strRep_.sprintf( "%c%.2i:%.2i", (positive_ ? '+' : '-'), hour_, minute_ ); +} + diff --git a/tdeabc/vcard/VCard.cpp b/tdeabc/vcard/VCard.cpp new file mode 100644 index 000000000..eb3f57f6e --- /dev/null +++ b/tdeabc/vcard/VCard.cpp @@ -0,0 +1,283 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <tqcstring.h> +#include <tqstrlist.h> + +#include <VCardEntity.h> +#include <VCardVCard.h> +#include <VCardContentLine.h> +#include <VCardRToken.h> + +#include <VCardDefines.h> + +using namespace VCARD; + +VCard::VCard() + : Entity() +{ + contentLineList_.setAutoDelete( true ); +} + +VCard::VCard(const VCard & x) + : Entity(x), + group_(x.group_), + contentLineList_(x.contentLineList_) +{ +} + +VCard::VCard(const TQCString & s) + : Entity(s) +{ +} + + VCard & +VCard::operator = (VCard & x) +{ + if (*this == x) return *this; + + group_ = x.group(); + contentLineList_ = x.contentLineList_; + + Entity::operator = (x); + return *this; +} + + VCard & +VCard::operator = (const TQCString & s) +{ + Entity::operator = (s); + return *this; +} + + bool +VCard::operator == (VCard & x) +{ + x.parse(); + return false; +} + +VCard::~VCard() +{ +} + + void +VCard::_parse() +{ + vDebug("parse() called"); + TQStrList l; + + RTokenise(strRep_, "\r\n", l); + + if (l.count() < 3) { // Invalid VCARD ! + vDebug("Invalid vcard"); + return; + } + + // Get the first line + TQCString beginLine = TQCString(l.at(0)).stripWhiteSpace(); + + vDebug("Begin line == \"" + beginLine + "\""); + + // Remove extra blank lines + while (TQCString(l.last()).isEmpty()) + l.remove(l.last()); + + // Now we know this is the last line + TQCString endLine = l.last(); + + // Trash the first and last lines as we have seen them. + l.remove(0u); + l.remove(l.last()); + + /////////////////////////////////////////////////////////////// + // FIRST LINE + + int split = beginLine.find(':'); + + if (split == -1) { // invalid, no BEGIN + vDebug("No split"); + return; + } + + TQCString firstPart(beginLine.left(split)); + TQCString valuePart(beginLine.mid(split + 1)); + + split = firstPart.find('.'); + + if (split != -1) { + group_ = firstPart.left(split); + firstPart = firstPart.right(firstPart.length() - split - 1); + } + + if (tqstrnicmp(firstPart, "BEGIN", 5) != 0) { // No BEGIN ! + vDebug("No BEGIN"); + return; + } + + if (tqstrnicmp(valuePart, "VCARD", 5) != 0) { // Not a vcard ! + vDebug("No VCARD"); + return; + } + + /////////////////////////////////////////////////////////////// + // CONTENT LINES + // + vDebug("Content lines"); + + // Handle folded lines. + + TQStrList refolded; + + TQStrListIterator it(l); + + TQCString cur; + + for (; it.current(); ++it) { + + cur = it.current(); + + ++it; + + while ( + it.current() && + it.current()[0] == ' ' && + strlen(it.current()) != 1) + { + cur += it.current() + 1; + ++it; + } + + --it; + + refolded.append(cur); + } + + TQStrListIterator it2(refolded); + + for (; it2.current(); ++it2) { + + vDebug("New contentline using \"" + TQCString(it2.current()) + "\""); + ContentLine * cl = new ContentLine(it2.current()); + + cl->parse(); + + contentLineList_.append(cl); + } + + /////////////////////////////////////////////////////////////// + // LAST LINE + + split = endLine.find(':'); + + if (split == -1) // invalid, no END + return; + + firstPart = endLine.left(split); + valuePart = endLine.right(firstPart.length() - split - 1); + + split = firstPart.find('.'); + + if (split != -1) { + group_ = firstPart.left(split); + firstPart = firstPart.right(firstPart.length() - split - 1); + } + + if (tqstricmp(firstPart, "END") != 0) // No END ! + return; + + if (tqstricmp(valuePart, "VCARD") != 0) // Not a vcard ! + return; +} + + void +VCard::_assemble() +{ + vDebug("Assembling vcard"); + strRep_ = "BEGIN:VCARD\r\n"; + strRep_ += "VERSION:3.0\r\n"; + + TQPtrListIterator<ContentLine> it(contentLineList_); + + for (; it.current(); ++it) + strRep_ += it.current()->asString() + "\r\n"; + + strRep_ += "END:VCARD\r\n"; +} + + bool +VCard::has(EntityType t) +{ + parse(); + return contentLine(t) == 0 ? false : true; +} + + bool +VCard::has(const TQCString & s) +{ + parse(); + return contentLine(s) == 0 ? false : true; +} + + void +VCard::add(const ContentLine & cl) +{ + parse(); + ContentLine * c = new ContentLine(cl); + contentLineList_.append(c); +} + + void +VCard::add(const TQCString & s) +{ + parse(); + ContentLine * c = new ContentLine(s); + contentLineList_.append(c); +} + + ContentLine * +VCard::contentLine(EntityType t) +{ + parse(); + TQPtrListIterator<ContentLine> it(contentLineList_); + + for (; it.current(); ++it) + if (it.current()->entityType() == t) + return it.current(); + + return 0; +} + + ContentLine * +VCard::contentLine(const TQCString & s) +{ + parse(); + TQPtrListIterator<ContentLine> it(contentLineList_); + + for (; it.current(); ++it) + if (it.current()->entityType() == EntityNameToEntityType(s)) + return it.current(); + + return 0; +} + diff --git a/tdeabc/vcard/VCardEntity.cpp b/tdeabc/vcard/VCardEntity.cpp new file mode 100644 index 000000000..1f8cea5b1 --- /dev/null +++ b/tdeabc/vcard/VCardEntity.cpp @@ -0,0 +1,119 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <tqregexp.h> + +#include <VCardDefines.h> +#include <VCardVCardEntity.h> + +using namespace VCARD; + +VCardEntity::VCardEntity() + : Entity() +{ +} + +VCardEntity::VCardEntity(const VCardEntity & x) + : Entity(x) +{ +} + +VCardEntity::VCardEntity(const TQCString & s) + : Entity(s) +{ +} + + VCardEntity & +VCardEntity::operator = (VCardEntity & x) +{ + if (*this == x) return *this; + + Entity::operator = (x); + return *this; +} + + VCardEntity & +VCardEntity::operator = (const TQCString & s) +{ + Entity::operator = (s); + return *this; +} + + bool +VCardEntity::operator == (VCardEntity & x) +{ + x.parse(); + return false; +} + +VCardEntity::~VCardEntity() +{ +} + + void +VCardEntity::_parse() +{ + vDebug("parse"); + TQCString s(strRep_); + + int i = s.find(TQRegExp("BEGIN:VCARD", false)); + + while (i != -1) { + + i = s.find(TQRegExp("BEGIN:VCARD", false), 11); + + TQCString cardStr(s.left(i)); + + VCard * v = new VCard(cardStr); + + cardList_.append(v); + + v->parse(); + + s.remove(0, i); + } +} + + void +VCardEntity::_assemble() +{ + VCardListIterator it(cardList_); + + for (; it.current(); ++it) + strRep_ += it.current()->asString() + "\r\n"; // One CRLF for luck. +} + + VCardList & +VCardEntity::cardList() +{ + parse(); + return cardList_; +} + + void +VCardEntity::setCardList(const VCardList & l) +{ + parse(); + cardList_ = l; +} + diff --git a/tdeabc/vcard/Value.cpp b/tdeabc/vcard/Value.cpp new file mode 100644 index 000000000..c95c0712b --- /dev/null +++ b/tdeabc/vcard/Value.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include <VCardEntity.h> +#include <VCardValue.h> + +using namespace VCARD; + +Value::Value() + : Entity() +{ +} + +Value::Value(const Value & x) + : Entity(x) +{ +} + +Value::Value(const TQCString & s) + : Entity(s) +{ +} + + Value & +Value::operator = (Value & x) +{ + if (*this == x) return *this; + + Entity::operator = (x); + return *this; +} + + Value & +Value::operator = (const TQCString & s) +{ + Entity::operator = (s); + return *this; +} + + bool +Value::operator == (Value & x) +{ + x.parse(); + return false; +} + +Value::~Value() +{ +} + + void +Value::_parse() +{ +} + + void +Value::_assemble() +{ + vDebug("Value::_assemble()"); +} + diff --git a/tdeabc/vcard/include/VCard.h b/tdeabc/vcard/include/VCard.h new file mode 100644 index 000000000..17b50e8f2 --- /dev/null +++ b/tdeabc/vcard/include/VCard.h @@ -0,0 +1,43 @@ +#ifndef VCARD_H +#define VCARD_H + +#include "VCardAdrParam.h" +#include "VCardAdrValue.h" +#include "VCardAgentParam.h" +#include "VCardAgentValue.h" +#include "VCardClassValue.h" +#include "VCardContentLine.h" +#include "VCardDateParam.h" +#include "VCardDateValue.h" +#include "VCardDefines.h" +#include "VCardEmailParam.h" +#include "VCardEntity.h" +#include "VCardEnum.h" +#include "VCardFloatValue.h" +#include "VCardGeoValue.h" +#include "VCardGroup.h" +#include "VCardImageParam.h" +#include "VCardImageValue.h" +#include "VCardImgValue.h" +#include "VCardLangValue.h" +#include "VCardNValue.h" +#include "VCardOrgValue.h" +#include "VCardParam.h" +#include "VCardPhoneNumberValue.h" +#include "VCardRToken.h" +#include "VCardSoundValue.h" +#include "VCardSourceParam.h" +#include "VCardTelParam.h" +#include "VCardTelValue.h" +#include "VCardTextBinParam.h" +#include "VCardTextBinValue.h" +#include "VCardTextListValue.h" +#include "VCardTextParam.h" +#include "VCardTextValue.h" +#include "VCardURIValue.h" +#include "VCardUTCValue.h" +#include "VCardVCard.h" +#include "VCardVCardEntity.h" +#include "VCardValue.h" + +#endif diff --git a/tdeabc/vcard/include/VCardAdrParam.h b/tdeabc/vcard/include/VCardAdrParam.h new file mode 100644 index 000000000..d40165f4a --- /dev/null +++ b/tdeabc/vcard/include/VCardAdrParam.h @@ -0,0 +1,64 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ADRPARAM_H +#define ADRPARAM_H + +#include <tqcstring.h> +#include <tqstrlist.h> + +#include <VCardParam.h> + +namespace VCARD +{ + +class KVCARD_EXPORT AdrParam : public Param +{ + +#include "AdrParam-generated.h" + + TQStrList adrTypeList() + { parse(); return adrTypeList_; } + + TQCString textParam() + { parse(); return textParam_; } + + void setAdrTypeList(const TQStrList & l) + { adrTypeList_ = l; assembled_ = false; } + + void setTextParam(const TQCString & s) + { textParam_ = s; assembled_ = false; } + + enum AdrType { + AdrDom, AdrIntl, AdrPostal, AdrParcel, AdrHome, AdrWork, AdrPref, + AdrIANA, AdrX + }; + + private: + + TQStrList adrTypeList_; + TQCString textParam_; +}; +} + +#endif diff --git a/tdeabc/vcard/include/VCardAdrValue.h b/tdeabc/vcard/include/VCardAdrValue.h new file mode 100644 index 000000000..94ed93aee --- /dev/null +++ b/tdeabc/vcard/include/VCardAdrValue.h @@ -0,0 +1,83 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ADRVALUE_H +#define ADRVALUE_H + +#include <tqstrlist.h> +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT AdrValue : public Value +{ + +#include "AdrValue-generated.h" + + AdrValue *clone(); + + void setPOBox(const TQCString & s) + { poBox_ = s; assembled_ = false; } + + void setExtAddress(const TQCString & s) + { extAddress_ = s; assembled_ = false; } + + void setStreet(const TQCString & s) + { street_ = s; assembled_ = false; } + + void setLocality(const TQCString & s) + { locality_ = s; assembled_ = false; } + + void setRegion(const TQCString & s) + { region_ = s; assembled_ = false; } + + void setPostCode(const TQCString & s) + { postCode_ = s; assembled_ = false; } + + void setCountryName(const TQCString & s) + { countryName_ = s; assembled_ = false; } + + TQCString poBox() { parse(); return poBox_; } + TQCString extAddress() { parse(); return extAddress_; } + TQCString street() { parse(); return street_; } + TQCString locality() { parse(); return locality_; } + TQCString region() { parse(); return region_; } + TQCString postCode() { parse(); return postCode_; } + TQCString countryName() { parse(); return countryName_; } + + private: + + TQCString poBox_; + TQCString extAddress_; + TQCString street_; + TQCString locality_; + TQCString region_; + TQCString postCode_; + TQCString countryName_; +}; + +} + +#endif + diff --git a/tdeabc/vcard/include/VCardAgentParam.h b/tdeabc/vcard/include/VCardAgentParam.h new file mode 100644 index 000000000..90c3bd528 --- /dev/null +++ b/tdeabc/vcard/include/VCardAgentParam.h @@ -0,0 +1,60 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef AGENTPARAM_H +#define AGENTPARAM_H + +#include <tqcstring.h> + +#include <VCardParam.h> +#include <VCardURIValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT AgentParam : public Param +{ + +#include "AgentParam-generated.h" + + bool refer() + { parse(); return refer_; } + + URIValue uri() + { parse(); return uri_; } + + void setRefer(bool b) + { refer_ = b; assembled_ = false; } + + void setURI(const TQCString & s) + { uri_ = s; assembled_ = false; } + + private: + + bool refer_; + URIValue uri_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardAgentValue.h b/tdeabc/vcard/include/VCardAgentValue.h new file mode 100644 index 000000000..dd68145c9 --- /dev/null +++ b/tdeabc/vcard/include/VCardAgentValue.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef AGENTVALUE_H +#define AGENTVALUE_H + +#include <tqcstring.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT AgentValue : public Value +{ + +#include "AgentValue-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardClassValue.h b/tdeabc/vcard/include/VCardClassValue.h new file mode 100644 index 000000000..5de79167b --- /dev/null +++ b/tdeabc/vcard/include/VCardClassValue.h @@ -0,0 +1,56 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef CLASSVALUE_H +#define CLASSVALUE_H + +#include <tqcstring.h> + +#include <VCardValue.h> + +#include <kdebug.h> + +namespace VCARD +{ + +class KVCARD_EXPORT ClassValue : public Value +{ + +#include "ClassValue-generated.h" + + enum ClassType { + Public, Private, Confidential, Other + }; + + ClassValue *clone(); + + void setType( int type ) { classType_ = type; assembled_ = false; parsed_ = true; } + int type() { parse(); return classType_; } + + private: + int classType_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardContentLine.h b/tdeabc/vcard/include/VCardContentLine.h new file mode 100644 index 000000000..ea59444a0 --- /dev/null +++ b/tdeabc/vcard/include/VCardContentLine.h @@ -0,0 +1,77 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef CONTENTLINE_H +#define CONTENTLINE_H + +#include <tqptrlist.h> + +#include "VCardEnum.h" +#include "VCardEntity.h" +#include "VCardParam.h" +#include "VCardValue.h" + +namespace VCARD +{ + +class KVCARD_EXPORT ContentLine : public Entity +{ + +#include "ContentLine-generated.h" + + TQCString group() { parse(); return group_; } + TQCString name() { parse(); return name_; } + Value * value() { parse(); return value_; } + ParamList paramList() { parse(); return paramList_; } + ParamType paramType() { parse(); return paramType_; } + ValueType valueType() { parse(); return valueType_; } + EntityType entityType() { parse(); return entityType_; } + + void setGroup (const TQCString & s) + { group_ = s; assembled_ = false; } + + void setName (const TQCString & s) + { name_ = s; assembled_ = false; } + + void setValue (Value *s) + { value_ = s; assembled_ = false; } + + void setParamList (const ParamList & l) + { paramList_ = l; assembled_ = false; } + + void clear (); + + private: + + TQCString group_; + TQCString name_; + TQPtrList<Param> paramList_; + Value * value_; + + ParamType paramType_; + ValueType valueType_; + EntityType entityType_; +}; +} + +#endif diff --git a/tdeabc/vcard/include/VCardDateParam.h b/tdeabc/vcard/include/VCardDateParam.h new file mode 100644 index 000000000..410eae6b7 --- /dev/null +++ b/tdeabc/vcard/include/VCardDateParam.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef DATEPARAM_H +#define DATEPARAM_H + +#include <tqcstring.h> + +#include <VCardParam.h> + +namespace VCARD +{ + +class KVCARD_EXPORT DateParam : public Param +{ + +#include "DateParam-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardDateValue.h b/tdeabc/vcard/include/VCardDateValue.h new file mode 100644 index 000000000..4f2e2fe7f --- /dev/null +++ b/tdeabc/vcard/include/VCardDateValue.h @@ -0,0 +1,99 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef DATEVALUE_H +#define DATEVALUE_H + +#include <tqcstring.h> +#include <tqdatetime.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT DateValue : public Value +{ +#include "DateValue-generated.h" + + DateValue( + unsigned int year, + unsigned int month, + unsigned int day, + unsigned int hour = 0, + unsigned int minute = 0, + unsigned int second = 0, + double secFrac = 0, + bool zonePositive = true, + unsigned int zoneHour = 0, + unsigned int zoneMinute = 0); + + DateValue(const TQDate &); + DateValue(const TQDateTime &); + + DateValue *clone(); + + bool hasTime(); + + unsigned int year(); + unsigned int month(); + unsigned int day(); + unsigned int hour(); + unsigned int minute(); + unsigned int second(); + double secondFraction(); + bool zonePositive(); + unsigned int zoneHour(); + unsigned int zoneMinute(); + + void setYear (unsigned int); + void setMonth (unsigned int); + void setDay (unsigned int); + void setHour (unsigned int); + void setMinute (unsigned int); + void setSecond (unsigned int); + void setSecondFraction (double); + void setZonePositive (bool); + void setZoneHour (unsigned int); + void setZoneMinute (unsigned int); + + TQDate qdate(); + TQTime qtime(); + TQDateTime qdt(); + + private: + + unsigned int year_, month_, day_, + hour_, minute_, second_, + zoneHour_, zoneMinute_; + + double secFrac_; + + bool zonePositive_; + + bool hasTime_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardDefines.h b/tdeabc/vcard/include/VCardDefines.h new file mode 100644 index 000000000..e778bc24f --- /dev/null +++ b/tdeabc/vcard/include/VCardDefines.h @@ -0,0 +1,52 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef VCARD_DEFINES_H +#define VCARD_DEFINES_H + +#include <kdebug.h> + +#ifdef VCARD_DEBUG +#define vDebug(a) kdDebug(5710) << a << endl; +#else +#define vDebug(a) +#endif + +#if 0 +#ifndef NDEBUG +# include <tqcstring.h> +# include <iostream> +# ifdef __GNUG__ +# define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \ + << __LINE__ << "): " << TQCString((a)).data() << endl; +# else +# define vDebug(a) cerr << className() << ": " \ + << TQCString((a)).data() << endl; +# endif +#else +# define vDebug(a) +#endif +#endif + +#endif // Included this file + diff --git a/tdeabc/vcard/include/VCardEmailParam.h b/tdeabc/vcard/include/VCardEmailParam.h new file mode 100644 index 000000000..1fe558afd --- /dev/null +++ b/tdeabc/vcard/include/VCardEmailParam.h @@ -0,0 +1,56 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef EMAILPARAM_H +#define EMAILPARAM_H + +#include <tqcstring.h> + +#include <VCardParam.h> + +namespace VCARD +{ + +class KVCARD_EXPORT EmailParam : public Param +{ + +#include "EmailParam-generated.h" + + TQCString emailType() { parse(); return emailType_; } + bool pref() { parse(); return pref_; } + + void setEmailType(const TQCString & s) + { emailType_ = s; assembled_ = false; } + + void setPref(bool b) + { pref_ = b; assembled_ = false; } + + private: + + TQCString emailType_; + bool pref_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardEntity.h b/tdeabc/vcard/include/VCardEntity.h new file mode 100644 index 000000000..e87c5f1a6 --- /dev/null +++ b/tdeabc/vcard/include/VCardEntity.h @@ -0,0 +1,68 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ENTITY_H +#define ENTITY_H + +#include <tqcstring.h> +#include <tdelibs_export.h> + +namespace VCARD +{ + +class KVCARD_EXPORT Entity +{ + public: + + Entity(); + Entity(const Entity & e); + Entity(const TQCString & s); + + virtual Entity & operator = (const Entity & e); + virtual Entity & operator = (const TQCString & s); + + virtual bool operator == (Entity & e); + virtual bool operator != (Entity & e); + virtual bool operator == (const TQCString & s); + virtual bool operator != (const TQCString & s); + + virtual ~Entity(); + + TQCString asString(); + + virtual void parse(); + virtual void assemble(); + + virtual void _parse() = 0; + virtual void _assemble() = 0; + + protected: + + TQCString strRep_; + bool parsed_; + bool assembled_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardEnum.h b/tdeabc/vcard/include/VCardEnum.h new file mode 100644 index 000000000..4552ccdbc --- /dev/null +++ b/tdeabc/vcard/include/VCardEnum.h @@ -0,0 +1,123 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ENUM_H +#define ENUM_H + +#include <tqcstring.h> + +#include <tdelibs_export.h> + +namespace VCARD +{ + +extern const TQCString paramNames []; + +enum EntityType { + EntityName, + EntityProfile, + EntitySource, + EntityFullName, + EntityN, + EntityNickname, + EntityPhoto, + EntityBirthday, + EntityAddress, + EntityLabel, + EntityTelephone, + EntityEmail, + EntityMailer, + EntityTimeZone, + EntityGeo, + EntityTitle, + EntityRole, + EntityLogo, + EntityAgent, + EntityOrganisation, + EntityCategories, + EntityNote, + EntityProductID, + EntityRevision, + EntitySortString, + EntitySound, + EntityUID, + EntityURI, + EntityURL, + EntityVersion, + EntityClass, + EntityKey, + EntityExtension, + EntityUnknown +}; + +enum ValueType { + ValueSound, + ValueAgent, + ValueAddress, + ValueTel, + ValueTextBin, + ValueOrg, + ValueN, + ValueUTC, + ValueURI, + ValueClass, + ValueFloat, + ValueImage, + ValueDate, + ValueTextList, + ValueText, + ValueGeo, + ValueUnknown +}; + +enum ParamType { + ParamUnknown, + ParamNone, + ParamSource, + ParamText, + ParamImage, + ParamDate, + ParamAddrText, + ParamTel, + ParamEmail, + ParamMailer, + ParamAgent, + ParamTextBin, + ParamTextNS, + ParamSound +}; + +extern const ParamType paramTypesTable[]; + +KVCARD_EXPORT ParamType EntityTypeToParamType(EntityType); +KVCARD_EXPORT ValueType EntityTypeToValueType(EntityType); +KVCARD_EXPORT TQCString EntityTypeToParamName(EntityType); +KVCARD_EXPORT EntityType EntityNameToEntityType(const TQCString &); + +KVCARD_EXPORT char * encodeBase64(const char *, unsigned long, unsigned long &); +KVCARD_EXPORT char * decodeBase64(const char *, unsigned long, unsigned long &); + +} + +#endif + diff --git a/tdeabc/vcard/include/VCardFloatValue.h b/tdeabc/vcard/include/VCardFloatValue.h new file mode 100644 index 000000000..45a6823be --- /dev/null +++ b/tdeabc/vcard/include/VCardFloatValue.h @@ -0,0 +1,51 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef FLOATVALUE_H +#define FLOATVALUE_H + +#include <tqcstring.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT FloatValue : public Value +{ + +#include "FloatValue-generated.h" + + FloatValue(float); + + float value(); + void setValue(float); + + private: + + float value_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardGeoValue.h b/tdeabc/vcard/include/VCardGeoValue.h new file mode 100644 index 000000000..4228587a4 --- /dev/null +++ b/tdeabc/vcard/include/VCardGeoValue.h @@ -0,0 +1,49 @@ +/* + This file is part of libvcard. + Copyright (c) 2002 Tobias Koenig <tokoe@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 GEOVALUE_H +#define GEOVALUE_H + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT GeoValue : public Value +{ + +#include "GeoValue-generated.h" + + GeoValue *clone(); + + void setLatitude( float lat ) { latitude_ = lat; assembled_ = false; } + void setLongitude( float lon ) { longitude_ = lon; assembled_ = false; } + + float latitude() { parse(); return latitude_; } + float longitude() { parse(); return longitude_; } + + private: + float latitude_; + float longitude_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardGroup.h b/tdeabc/vcard/include/VCardGroup.h new file mode 100644 index 000000000..ce884f100 --- /dev/null +++ b/tdeabc/vcard/include/VCardGroup.h @@ -0,0 +1,39 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef GROUP_H +#define GROUP_H + +#include <VCardEntity.h> + +namespace VCARD +{ + +class KVCARD_EXPORT Group : public Entity +{ +#include "Group-generated.h" +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardImageParam.h b/tdeabc/vcard/include/VCardImageParam.h new file mode 100644 index 000000000..10ab8a3f5 --- /dev/null +++ b/tdeabc/vcard/include/VCardImageParam.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef IMGPARAM_H +#define IMGPARAM_H + +#include <tqcstring.h> + +#include <VCardParam.h> + +namespace VCARD +{ + +class KVCARD_EXPORT ImageParam : public Param +{ + +#include "ImageParam-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardImageValue.h b/tdeabc/vcard/include/VCardImageValue.h new file mode 100644 index 000000000..45fbcad9c --- /dev/null +++ b/tdeabc/vcard/include/VCardImageValue.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef IMAGEVALUE_H +#define IMAGEVALUE_H + +#include <tqcstring.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT ImageValue : public Value +{ + +#include "ImageValue-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardImgValue.h b/tdeabc/vcard/include/VCardImgValue.h new file mode 100644 index 000000000..7d4bbfa2d --- /dev/null +++ b/tdeabc/vcard/include/VCardImgValue.h @@ -0,0 +1,39 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef IMGVALUE_H +#define IMGVALUE_H + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT ImgValue : public Value +{ +#include "ImgValue-generated.h" +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardLangValue.h b/tdeabc/vcard/include/VCardLangValue.h new file mode 100644 index 000000000..7767d52fa --- /dev/null +++ b/tdeabc/vcard/include/VCardLangValue.h @@ -0,0 +1,51 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef LANGVALUE_H +#define LANGVALUE_H + +#include <tqcstring.h> +#include <tqstrlist.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT LangValue : public Value +{ +#include "LangValue-generated.h" + + TQCString primary(); + TQStrList subtags(); + + void setPrimary(const TQCString &); + void setSubTags(const TQStrList &); + + TQCString primary_; + TQStrList subtags_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardNValue.h b/tdeabc/vcard/include/VCardNValue.h new file mode 100644 index 000000000..9db37fbbc --- /dev/null +++ b/tdeabc/vcard/include/VCardNValue.h @@ -0,0 +1,56 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef NVALUE_H +#define NVALUE_H + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT NValue : public Value +{ +#include "NValue-generated.h" + NValue *clone(); + + TQCString family() { parse(); return family_; } + TQCString given() { parse(); return given_; } + TQCString middle() { parse(); return middle_; } + TQCString prefix() { parse(); return prefix_; } + TQCString suffix() { parse(); return suffix_; } + + void setFamily (const TQCString & s) { family_ = s; assembled_ = false; } + void setGiven (const TQCString & s) { given_ = s; assembled_ = false; } + void setMiddle (const TQCString & s) { middle_ = s; assembled_ = false; } + void setPrefix (const TQCString & s) { prefix_ = s; assembled_ = false; } + void setSuffix (const TQCString & s) { suffix_ = s; assembled_ = false; } + + private: + + TQCString family_, given_, middle_, prefix_, suffix_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardOrgValue.h b/tdeabc/vcard/include/VCardOrgValue.h new file mode 100644 index 000000000..a2bd803e5 --- /dev/null +++ b/tdeabc/vcard/include/VCardOrgValue.h @@ -0,0 +1,50 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ORGVALUE_H +#define ORGVALUE_H + +#include <tqcstring.h> +#include <tqstrlist.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT OrgValue : public Value +{ + +#include "OrgValue-generated.h" + + unsigned int numValues(); + TQCString value(unsigned int); + + private: + + TQStrList valueList_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardParam.h b/tdeabc/vcard/include/VCardParam.h new file mode 100644 index 000000000..93d70f06b --- /dev/null +++ b/tdeabc/vcard/include/VCardParam.h @@ -0,0 +1,59 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef PARAM_H +#define PARAM_H + +#include <tqcstring.h> +#include <tqptrlist.h> + +#include <VCardEntity.h> + +namespace VCARD +{ + +class KVCARD_EXPORT Param : public Entity +{ + +#include "Param-generated.h" + + Param(const TQCString &name, const TQCString &value); + + void setName(const TQCString &); + void setValue(const TQCString &); + + TQCString name(); + TQCString value(); + + private: + + TQCString name_; + TQCString value_; +}; + +typedef TQPtrList<Param> ParamList; +typedef TQPtrListIterator<Param> ParamListIterator; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardPhoneNumberValue.h b/tdeabc/vcard/include/VCardPhoneNumberValue.h new file mode 100644 index 000000000..3f9e106ca --- /dev/null +++ b/tdeabc/vcard/include/VCardPhoneNumberValue.h @@ -0,0 +1,39 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef PHONENUMBERVALUE_H +#define PHONENUMBERVALUE_H + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT PhoneNumberValue : public Value +{ +#include "PhoneNumberValue-generated.h" +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardRToken.h b/tdeabc/vcard/include/VCardRToken.h new file mode 100644 index 000000000..17a3943d3 --- /dev/null +++ b/tdeabc/vcard/include/VCardRToken.h @@ -0,0 +1,40 @@ +/* + + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef RTOKEN_H +#define RTOKEN_H + +#include <tqstrlist.h> + +#include <tdelibs_export.h> + +namespace VCARD +{ + +KVCARD_EXPORT TQ_UINT32 RTokenise(const char * str, const char * delim, TQStrList & l); + +} + +#endif + diff --git a/tdeabc/vcard/include/VCardSndValue.h b/tdeabc/vcard/include/VCardSndValue.h new file mode 100644 index 000000000..09a3a8238 --- /dev/null +++ b/tdeabc/vcard/include/VCardSndValue.h @@ -0,0 +1,39 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef SNDVALUE_H +#define SNDVALUE_H + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT SndValue : public Value +{ +#include "SndValue-generated.h" +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardSoundValue.h b/tdeabc/vcard/include/VCardSoundValue.h new file mode 100644 index 000000000..61858f058 --- /dev/null +++ b/tdeabc/vcard/include/VCardSoundValue.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef SOUNDVALUE_H +#define SOUNDVALUE_H + +#include <tqcstring.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT SoundValue : public Value +{ + +#include "SoundValue-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardSourceParam.h b/tdeabc/vcard/include/VCardSourceParam.h new file mode 100644 index 000000000..1d9d03d47 --- /dev/null +++ b/tdeabc/vcard/include/VCardSourceParam.h @@ -0,0 +1,58 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef SOURCEPARAM_H +#define SOURCEPARAM_H + +#include <tqcstring.h> + +#include <VCardParam.h> + +namespace VCARD +{ + +class KVCARD_EXPORT SourceParam : public Param +{ + +#include "SourceParam-generated.h" + + enum SourceParamType { TypeUnknown, TypeValue, TypeContext, TypeX }; + + SourceParamType type() { parse(); return type_;} + TQCString par() { parse(); return par_; } + TQCString val() { parse(); return val_; } + + void setType(SourceParamType t) { type_ = t; assembled_ = false; } + void setPar(const TQCString & s) { par_ = s; assembled_ = false; } + void setVal(const TQCString & s) { val_ = s; assembled_ = false; } + + private: + + SourceParamType type_; + // May be "VALUE = uri" or "CONTEXT = word" or "x-name = *SAFE-CHAR" + TQCString par_, val_; // Sub-parameter, value +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTelParam.h b/tdeabc/vcard/include/VCardTelParam.h new file mode 100644 index 000000000..9eea5da2f --- /dev/null +++ b/tdeabc/vcard/include/VCardTelParam.h @@ -0,0 +1,51 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TELPARAM_H +#define TELPARAM_H + +#include <tqcstring.h> + +#include <VCardParam.h> + +namespace VCARD +{ + +class KVCARD_EXPORT TelParam : public Param +{ +#include "TelParam-generated.h" + + enum TelType { + TelHome, TelWork, TelPref, TelVoice, TelFex, TelMsg, TelCell, + TelPager, TelBBS, TelModem, TelCar, TelISDN, TelVideo, TelPCS, + TelIANA, TelX + }; + + private: + + TQPtrList<TelType> types_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTelValue.h b/tdeabc/vcard/include/VCardTelValue.h new file mode 100644 index 000000000..043a45aa9 --- /dev/null +++ b/tdeabc/vcard/include/VCardTelValue.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TELVALUE_H +#define TELVALUE_H + +#include <tqcstring.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT TelValue : public Value +{ + +#include "TelValue-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextBinParam.h b/tdeabc/vcard/include/VCardTextBinParam.h new file mode 100644 index 000000000..5a681ad48 --- /dev/null +++ b/tdeabc/vcard/include/VCardTextBinParam.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTBINPARAM_H +#define TEXTBINPARAM_H + +#include <tqcstring.h> + +#include <VCardParam.h> + +namespace VCARD +{ + +class KVCARD_EXPORT TextBinParam : public Param +{ + +#include "TextBinParam-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextBinValue.h b/tdeabc/vcard/include/VCardTextBinValue.h new file mode 100644 index 000000000..316fa7832 --- /dev/null +++ b/tdeabc/vcard/include/VCardTextBinValue.h @@ -0,0 +1,67 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTBINVALUE_H +#define TEXTBINVALUE_H + +#include <tqcstring.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT TextBinValue : public Value +{ + +#include "TextBinValue-generated.h" + + TextBinValue *clone(); + + bool isBinary() { parse(); return mIsBinary_; } + TQByteArray data() { parse(); return mData_; } + TQString url() { parse(); return mUrl_; } + + void setData( const TQByteArray &data ) + { + mData_ = data; + mIsBinary_ = true; + assembled_ = false; + } + + void setUrl( const TQString &url ) + { + mUrl_ = url; + mIsBinary_ = false; + assembled_ = false; + } + + private: + int mIsBinary_; + TQByteArray mData_; + TQString mUrl_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextListValue.h b/tdeabc/vcard/include/VCardTextListValue.h new file mode 100644 index 000000000..53760c75a --- /dev/null +++ b/tdeabc/vcard/include/VCardTextListValue.h @@ -0,0 +1,51 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTLISTVALUE_H +#define TEXTLISTVALUE_H + +#include <tqstrlist.h> + +#include <tqcstring.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT TextListValue : public Value +{ + +#include "TextListValue-generated.h" + + unsigned int numValues(); + TQCString value(unsigned int); + + private: + + TQStrList valueList_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextParam.h b/tdeabc/vcard/include/VCardTextParam.h new file mode 100644 index 000000000..d593c0578 --- /dev/null +++ b/tdeabc/vcard/include/VCardTextParam.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTPARAM_H +#define TEXTPARAM_H + +#include <tqcstring.h> + +#include <VCardParam.h> + +namespace VCARD +{ + +class KVCARD_EXPORT TextParam : public Param +{ + +#include "TextParam-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextValue.h b/tdeabc/vcard/include/VCardTextValue.h new file mode 100644 index 000000000..66eed32a8 --- /dev/null +++ b/tdeabc/vcard/include/VCardTextValue.h @@ -0,0 +1,41 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTVALUE_H +#define TEXTVALUE_H + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT TextValue : public Value +{ +#include "TextValue-generated.h" + + TextValue *clone(); +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardURIValue.h b/tdeabc/vcard/include/VCardURIValue.h new file mode 100644 index 000000000..696887774 --- /dev/null +++ b/tdeabc/vcard/include/VCardURIValue.h @@ -0,0 +1,52 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef URIVALUE_H +#define URIVALUE_H + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT URIValue : public Value +{ +#include "URIValue-generated.h" + + URIValue(const TQCString & scheme, const TQCString & schemeSpecificPart); + + TQCString scheme(); + TQCString schemeSpecificPart(); + + void setScheme (const TQCString &); + void setSchemeSpecificPart (const TQCString &); + + private: + + TQCString scheme_; + TQCString schemeSpecificPart_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardUTCValue.h b/tdeabc/vcard/include/VCardUTCValue.h new file mode 100644 index 000000000..cb09ccf00 --- /dev/null +++ b/tdeabc/vcard/include/VCardUTCValue.h @@ -0,0 +1,58 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef UTCVALUE_H +#define UTCVALUE_H + +#include <tqcstring.h> + +#include <VCardValue.h> + +namespace VCARD +{ + +class KVCARD_EXPORT UTCValue : public Value +{ + +#include "UTCValue-generated.h" + + UTCValue *clone(); + + void setPositive( int p ) { positive_ = p; assembled_ = false; } + void setHour( int h ) { hour_ = h; assembled_ = false; } + void setMinute( int m ) { minute_ = m; assembled_ = false; } + + bool positive() { parse(); return positive_; } + unsigned int hour() { parse(); return hour_; } + unsigned int minute() { parse(); return minute_; } + + private: + + bool positive_; + unsigned int hour_; + unsigned int minute_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardVCard.h b/tdeabc/vcard/include/VCardVCard.h new file mode 100644 index 000000000..53563e8c0 --- /dev/null +++ b/tdeabc/vcard/include/VCardVCard.h @@ -0,0 +1,63 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef VCARD_VCARD_H +#define VCARD_VCARD_H + +#include <tqstring.h> +#include <tqptrlist.h> + +#include <VCardEnum.h> +#include <VCardEntity.h> +#include <VCardContentLine.h> + +namespace VCARD +{ + +class KVCARD_EXPORT VCard : public Entity +{ + +#include "VCard-generated.h" + + bool has(EntityType); + bool has(const TQCString &); + + void add(const ContentLine &); + void add(const TQCString &); + + ContentLine * contentLine(EntityType); + ContentLine * contentLine(const TQCString &); + + TQCString group() { parse(); return group_; } + + TQPtrList<ContentLine> contentLineList() { parse(); return contentLineList_; } + + private: + + TQCString group_; + TQPtrList<ContentLine> contentLineList_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardVCardEntity.h b/tdeabc/vcard/include/VCardVCardEntity.h new file mode 100644 index 000000000..422790c22 --- /dev/null +++ b/tdeabc/vcard/include/VCardVCardEntity.h @@ -0,0 +1,56 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef VCARD_ENTITY_H +#define VCARD_ENTITY_H + +#include <tqstring.h> +#include <tqptrlist.h> + +#include <VCardEnum.h> +#include <VCardVCard.h> +#include <VCardEntity.h> + +namespace VCARD +{ + +typedef TQPtrList<VCard> VCardList; +typedef TQPtrListIterator<VCard> VCardListIterator; + +class KVCARD_EXPORT VCardEntity : public Entity +{ + +#include "VCardEntity-generated.h" + + void setCardList(const VCardList & l); + VCardList & cardList(); + + private: + + VCardList cardList_; + +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardValue.h b/tdeabc/vcard/include/VCardValue.h new file mode 100644 index 000000000..3c167d70a --- /dev/null +++ b/tdeabc/vcard/include/VCardValue.h @@ -0,0 +1,46 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef VALUE_H +#define VALUE_H + +#include <tqptrlist.h> + +#include <VCardEntity.h> + +namespace VCARD +{ + +class KVCARD_EXPORT Value : public Entity +{ +#include "Value-generated.h" + + virtual Value *clone() { return new Value( *this ); } +}; + +typedef TQPtrList<Value> ValueList; +typedef TQPtrListIterator<Value> ValueListIterator; + +} + +#endif diff --git a/tdeabc/vcard/include/generated/AdrParam-generated.h b/tdeabc/vcard/include/generated/AdrParam-generated.h new file mode 100644 index 000000000..1afdcd36a --- /dev/null +++ b/tdeabc/vcard/include/generated/AdrParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +AdrParam(); +AdrParam(const AdrParam&); +AdrParam(const TQCString&); +AdrParam & operator = (AdrParam&); +AdrParam & operator = (const TQCString&); +bool operator ==(AdrParam&); +bool operator !=(AdrParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {AdrParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~AdrParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "AdrParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/AdrValue-generated.h b/tdeabc/vcard/include/generated/AdrValue-generated.h new file mode 100644 index 000000000..9882d1186 --- /dev/null +++ b/tdeabc/vcard/include/generated/AdrValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +AdrValue(); +AdrValue(const AdrValue&); +AdrValue(const TQCString&); +AdrValue & operator = (AdrValue&); +AdrValue & operator = (const TQCString&); +bool operator ==(AdrValue&); +bool operator !=(AdrValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {AdrValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~AdrValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "AdrValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/AgentParam-generated.h b/tdeabc/vcard/include/generated/AgentParam-generated.h new file mode 100644 index 000000000..07b87d106 --- /dev/null +++ b/tdeabc/vcard/include/generated/AgentParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +AgentParam(); +AgentParam(const AgentParam&); +AgentParam(const TQCString&); +AgentParam & operator = (AgentParam&); +AgentParam & operator = (const TQCString&); +bool operator ==(AgentParam&); +bool operator !=(AgentParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {AgentParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~AgentParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "AgentParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/AgentValue-generated.h b/tdeabc/vcard/include/generated/AgentValue-generated.h new file mode 100644 index 000000000..e2866bb8f --- /dev/null +++ b/tdeabc/vcard/include/generated/AgentValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +AgentValue(); +AgentValue(const AgentValue&); +AgentValue(const TQCString&); +AgentValue & operator = (AgentValue&); +AgentValue & operator = (const TQCString&); +bool operator ==(AgentValue&); +bool operator !=(AgentValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {AgentValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~AgentValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "AgentValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ClassValue-generated.h b/tdeabc/vcard/include/generated/ClassValue-generated.h new file mode 100644 index 000000000..e10c65568 --- /dev/null +++ b/tdeabc/vcard/include/generated/ClassValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ClassValue(); +ClassValue(const ClassValue&); +ClassValue(const TQCString&); +ClassValue & operator = (ClassValue&); +ClassValue & operator = (const TQCString&); +bool operator ==(ClassValue&); +bool operator !=(ClassValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ClassValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ClassValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "ClassValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ContentLine-generated.h b/tdeabc/vcard/include/generated/ContentLine-generated.h new file mode 100644 index 000000000..ad2ac7649 --- /dev/null +++ b/tdeabc/vcard/include/generated/ContentLine-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ContentLine(); +ContentLine(const ContentLine&); +ContentLine(const TQCString&); +ContentLine & operator = (ContentLine&); +ContentLine & operator = (const TQCString&); +bool operator ==(ContentLine&); +bool operator !=(ContentLine& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ContentLine a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ContentLine(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "ContentLine"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/DateParam-generated.h b/tdeabc/vcard/include/generated/DateParam-generated.h new file mode 100644 index 000000000..75e7ad72d --- /dev/null +++ b/tdeabc/vcard/include/generated/DateParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +DateParam(); +DateParam(const DateParam&); +DateParam(const TQCString&); +DateParam & operator = (DateParam&); +DateParam & operator = (const TQCString&); +bool operator ==(DateParam&); +bool operator !=(DateParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {DateParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~DateParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "DateParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/DateValue-generated.h b/tdeabc/vcard/include/generated/DateValue-generated.h new file mode 100644 index 000000000..cf0eb40d8 --- /dev/null +++ b/tdeabc/vcard/include/generated/DateValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +DateValue(); +DateValue(const DateValue&); +DateValue(const TQCString&); +DateValue & operator = (DateValue&); +DateValue & operator = (const TQCString&); +bool operator ==(DateValue&); +bool operator !=(DateValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {DateValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~DateValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "DateValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/EmailParam-generated.h b/tdeabc/vcard/include/generated/EmailParam-generated.h new file mode 100644 index 000000000..46ae1f80f --- /dev/null +++ b/tdeabc/vcard/include/generated/EmailParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +EmailParam(); +EmailParam(const EmailParam&); +EmailParam(const TQCString&); +EmailParam & operator = (EmailParam&); +EmailParam & operator = (const TQCString&); +bool operator ==(EmailParam&); +bool operator !=(EmailParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {EmailParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~EmailParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "EmailParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/FloatValue-generated.h b/tdeabc/vcard/include/generated/FloatValue-generated.h new file mode 100644 index 000000000..155f52ae1 --- /dev/null +++ b/tdeabc/vcard/include/generated/FloatValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +FloatValue(); +FloatValue(const FloatValue&); +FloatValue(const TQCString&); +FloatValue & operator = (FloatValue&); +FloatValue & operator = (const TQCString&); +bool operator ==(FloatValue&); +bool operator !=(FloatValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {FloatValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~FloatValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "FloatValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/GeoValue-generated.h b/tdeabc/vcard/include/generated/GeoValue-generated.h new file mode 100644 index 000000000..b525e8c21 --- /dev/null +++ b/tdeabc/vcard/include/generated/GeoValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +GeoValue(); +GeoValue(const GeoValue&); +GeoValue(const TQCString&); +GeoValue & operator = (GeoValue&); +GeoValue & operator = (const TQCString&); +bool operator ==(GeoValue&); +bool operator !=(GeoValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {GeoValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~GeoValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "GeoValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/Group-generated.h b/tdeabc/vcard/include/generated/Group-generated.h new file mode 100644 index 000000000..38e1c2a3a --- /dev/null +++ b/tdeabc/vcard/include/generated/Group-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +Group(); +Group(const Group&); +Group(const TQCString&); +Group & operator = (Group&); +Group & operator = (const TQCString&); +bool operator ==(Group&); +bool operator !=(Group& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {Group a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~Group(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "Group"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ImageParam-generated.h b/tdeabc/vcard/include/generated/ImageParam-generated.h new file mode 100644 index 000000000..78a5a97cf --- /dev/null +++ b/tdeabc/vcard/include/generated/ImageParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ImageParam(); +ImageParam(const ImageParam&); +ImageParam(const TQCString&); +ImageParam & operator = (ImageParam&); +ImageParam & operator = (const TQCString&); +bool operator ==(ImageParam&); +bool operator !=(ImageParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ImageParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ImageParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "ImageParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ImageValue-generated.h b/tdeabc/vcard/include/generated/ImageValue-generated.h new file mode 100644 index 000000000..882081fbc --- /dev/null +++ b/tdeabc/vcard/include/generated/ImageValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ImageValue(); +ImageValue(const ImageValue&); +ImageValue(const TQCString&); +ImageValue & operator = (ImageValue&); +ImageValue & operator = (const TQCString&); +bool operator ==(ImageValue&); +bool operator !=(ImageValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ImageValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ImageValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "ImageValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ImgParam-generated.h b/tdeabc/vcard/include/generated/ImgParam-generated.h new file mode 100644 index 000000000..04132c857 --- /dev/null +++ b/tdeabc/vcard/include/generated/ImgParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ImgParam(); +ImgParam(const ImgParam&); +ImgParam(const TQCString&); +ImgParam & operator = (ImgParam&); +ImgParam & operator = (const TQCString&); +bool operator ==(ImgParam&); +bool operator !=(ImgParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ImgParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ImgParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +virtual const char * className() const { return "ImgParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ImgValue-generated.h b/tdeabc/vcard/include/generated/ImgValue-generated.h new file mode 100644 index 000000000..0774de9bf --- /dev/null +++ b/tdeabc/vcard/include/generated/ImgValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ImgValue(); +ImgValue(const ImgValue&); +ImgValue(const TQCString&); +ImgValue & operator = (ImgValue&); +ImgValue & operator = (const TQCString&); +bool operator ==(ImgValue&); +bool operator !=(ImgValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ImgValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ImgValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +virtual const char * className() const { return "ImgValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/LangValue-generated.h b/tdeabc/vcard/include/generated/LangValue-generated.h new file mode 100644 index 000000000..c4930c59e --- /dev/null +++ b/tdeabc/vcard/include/generated/LangValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +LangValue(); +LangValue(const LangValue&); +LangValue(const TQCString&); +LangValue & operator = (LangValue&); +LangValue & operator = (const TQCString&); +bool operator ==(LangValue&); +bool operator !=(LangValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {LangValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~LangValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "LangValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/NValue-generated.h b/tdeabc/vcard/include/generated/NValue-generated.h new file mode 100644 index 000000000..d78715ec0 --- /dev/null +++ b/tdeabc/vcard/include/generated/NValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +NValue(); +NValue(const NValue&); +NValue(const TQCString&); +NValue & operator = (NValue&); +NValue & operator = (const TQCString&); +bool operator ==(NValue&); +bool operator !=(NValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {NValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~NValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "NValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/Name-generated.h b/tdeabc/vcard/include/generated/Name-generated.h new file mode 100644 index 000000000..17d56e680 --- /dev/null +++ b/tdeabc/vcard/include/generated/Name-generated.h @@ -0,0 +1,22 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +V_Name(); +V_Name(const V_Name&); +V_Name(const TQCString&); +V_Name & operator = (V_Name&); +V_Name & operator = (const TQCString&); +bool operator ==(V_Name&); +bool operator !=(V_Name& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {V_Name a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~V_Name(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/OrgValue-generated.h b/tdeabc/vcard/include/generated/OrgValue-generated.h new file mode 100644 index 000000000..661ecf5a3 --- /dev/null +++ b/tdeabc/vcard/include/generated/OrgValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +OrgValue(); +OrgValue(const OrgValue&); +OrgValue(const TQCString&); +OrgValue & operator = (OrgValue&); +OrgValue & operator = (const TQCString&); +bool operator ==(OrgValue&); +bool operator !=(OrgValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {OrgValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~OrgValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "OrgValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/Param-generated.h b/tdeabc/vcard/include/generated/Param-generated.h new file mode 100644 index 000000000..bf63e7166 --- /dev/null +++ b/tdeabc/vcard/include/generated/Param-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +Param(); +Param(const Param&); +Param(const TQCString&); +Param & operator = (Param&); +Param & operator = (const TQCString&); +bool operator ==(Param&); +bool operator !=(Param& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {Param a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~Param(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "Param"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ParamName-generated.h b/tdeabc/vcard/include/generated/ParamName-generated.h new file mode 100644 index 000000000..60b1e12d5 --- /dev/null +++ b/tdeabc/vcard/include/generated/ParamName-generated.h @@ -0,0 +1,22 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +V_ParamName(); +V_ParamName(const V_ParamName&); +V_ParamName(const TQCString&); +V_ParamName & operator = (V_ParamName&); +V_ParamName & operator = (const TQCString&); +bool operator ==(V_ParamName&); +bool operator !=(V_ParamName& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {V_ParamName a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~V_ParamName(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ParamValue-generated.h b/tdeabc/vcard/include/generated/ParamValue-generated.h new file mode 100644 index 000000000..f31a166c6 --- /dev/null +++ b/tdeabc/vcard/include/generated/ParamValue-generated.h @@ -0,0 +1,22 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +V_ParamValue(); +V_ParamValue(const V_ParamValue&); +V_ParamValue(const TQCString&); +V_ParamValue & operator = (V_ParamValue&); +V_ParamValue & operator = (const TQCString&); +bool operator ==(V_ParamValue&); +bool operator !=(V_ParamValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {V_ParamValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~V_ParamValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/PhoneNumberValue-generated.h b/tdeabc/vcard/include/generated/PhoneNumberValue-generated.h new file mode 100644 index 000000000..f0eb6b4f4 --- /dev/null +++ b/tdeabc/vcard/include/generated/PhoneNumberValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +PhoneNumberValue(); +PhoneNumberValue(const PhoneNumberValue&); +PhoneNumberValue(const TQCString&); +PhoneNumberValue & operator = (PhoneNumberValue&); +PhoneNumberValue & operator = (const TQCString&); +bool operator ==(PhoneNumberValue&); +bool operator !=(PhoneNumberValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {PhoneNumberValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~PhoneNumberValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "PhoneNumberValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/SoundValue-generated.h b/tdeabc/vcard/include/generated/SoundValue-generated.h new file mode 100644 index 000000000..64081be0b --- /dev/null +++ b/tdeabc/vcard/include/generated/SoundValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +SoundValue(); +SoundValue(const SoundValue&); +SoundValue(const TQCString&); +SoundValue & operator = (SoundValue&); +SoundValue & operator = (const TQCString&); +bool operator ==(SoundValue&); +bool operator !=(SoundValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {SoundValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~SoundValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "SoundValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/SourceParam-generated.h b/tdeabc/vcard/include/generated/SourceParam-generated.h new file mode 100644 index 000000000..e3b13bca1 --- /dev/null +++ b/tdeabc/vcard/include/generated/SourceParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +SourceParam(); +SourceParam(const SourceParam&); +SourceParam(const TQCString&); +SourceParam & operator = (SourceParam&); +SourceParam & operator = (const TQCString&); +bool operator ==(SourceParam&); +bool operator !=(SourceParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {SourceParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~SourceParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "SourceParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TelParam-generated.h b/tdeabc/vcard/include/generated/TelParam-generated.h new file mode 100644 index 000000000..9f8f24270 --- /dev/null +++ b/tdeabc/vcard/include/generated/TelParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TelParam(); +TelParam(const TelParam&); +TelParam(const TQCString&); +TelParam & operator = (TelParam&); +TelParam & operator = (const TQCString&); +bool operator ==(TelParam&); +bool operator !=(TelParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TelParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TelParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TelParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TelValue-generated.h b/tdeabc/vcard/include/generated/TelValue-generated.h new file mode 100644 index 000000000..600da7727 --- /dev/null +++ b/tdeabc/vcard/include/generated/TelValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TelValue(); +TelValue(const TelValue&); +TelValue(const TQCString&); +TelValue & operator = (TelValue&); +TelValue & operator = (const TQCString&); +bool operator ==(TelValue&); +bool operator !=(TelValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TelValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TelValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TelValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextBinParam-generated.h b/tdeabc/vcard/include/generated/TextBinParam-generated.h new file mode 100644 index 000000000..37dc56e55 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextBinParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextBinParam(); +TextBinParam(const TextBinParam&); +TextBinParam(const TQCString&); +TextBinParam & operator = (TextBinParam&); +TextBinParam & operator = (const TQCString&); +bool operator ==(TextBinParam&); +bool operator !=(TextBinParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextBinParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextBinParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextBinParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextBinValue-generated.h b/tdeabc/vcard/include/generated/TextBinValue-generated.h new file mode 100644 index 000000000..4c9580421 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextBinValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextBinValue(); +TextBinValue(const TextBinValue&); +TextBinValue(const TQCString&); +TextBinValue & operator = (TextBinValue&); +TextBinValue & operator = (const TQCString&); +bool operator ==(TextBinValue&); +bool operator !=(TextBinValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextBinValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextBinValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextBinValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextListValue-generated.h b/tdeabc/vcard/include/generated/TextListValue-generated.h new file mode 100644 index 000000000..8babb0d9f --- /dev/null +++ b/tdeabc/vcard/include/generated/TextListValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextListValue(); +TextListValue(const TextListValue&); +TextListValue(const TQCString&); +TextListValue & operator = (TextListValue&); +TextListValue & operator = (const TQCString&); +bool operator ==(TextListValue&); +bool operator !=(TextListValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextListValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextListValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextListValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextNSParam-generated.h b/tdeabc/vcard/include/generated/TextNSParam-generated.h new file mode 100644 index 000000000..bd8e74b07 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextNSParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextNSParam(); +TextNSParam(const TextNSParam&); +TextNSParam(const TQCString&); +TextNSParam & operator = (TextNSParam&); +TextNSParam & operator = (const TQCString&); +bool operator ==(TextNSParam&); +bool operator !=(TextNSParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextNSParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextNSParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextNSParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextParam-generated.h b/tdeabc/vcard/include/generated/TextParam-generated.h new file mode 100644 index 000000000..54ae611a5 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextParam(); +TextParam(const TextParam&); +TextParam(const TQCString&); +TextParam & operator = (TextParam&); +TextParam & operator = (const TQCString&); +bool operator ==(TextParam&); +bool operator !=(TextParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextValue-generated.h b/tdeabc/vcard/include/generated/TextValue-generated.h new file mode 100644 index 000000000..5b56b54a7 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextValue(); +TextValue(const TextValue&); +TextValue(const TQCString&); +TextValue & operator = (TextValue&); +TextValue & operator = (const TQCString&); +bool operator ==(TextValue&); +bool operator !=(TextValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/URIValue-generated.h b/tdeabc/vcard/include/generated/URIValue-generated.h new file mode 100644 index 000000000..5a691e6d6 --- /dev/null +++ b/tdeabc/vcard/include/generated/URIValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +URIValue(); +URIValue(const URIValue&); +URIValue(const TQCString&); +URIValue & operator = (URIValue&); +URIValue & operator = (const TQCString&); +bool operator ==(URIValue&); +bool operator !=(URIValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {URIValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~URIValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "URIValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/UTCValue-generated.h b/tdeabc/vcard/include/generated/UTCValue-generated.h new file mode 100644 index 000000000..0c6edfb46 --- /dev/null +++ b/tdeabc/vcard/include/generated/UTCValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +UTCValue(); +UTCValue(const UTCValue&); +UTCValue(const TQCString&); +UTCValue & operator = (UTCValue&); +UTCValue & operator = (const TQCString&); +bool operator ==(UTCValue&); +bool operator !=(UTCValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {UTCValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~UTCValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "UTCValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/VCard-generated.h b/tdeabc/vcard/include/generated/VCard-generated.h new file mode 100644 index 000000000..4f36d11da --- /dev/null +++ b/tdeabc/vcard/include/generated/VCard-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +VCard(); +VCard(const VCard&); +VCard(const TQCString&); +VCard & operator = (VCard&); +VCard & operator = (const TQCString&); +bool operator ==(VCard&); +bool operator !=(VCard& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {VCard a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~VCard(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "VCard"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/VCardEntity-generated.h b/tdeabc/vcard/include/generated/VCardEntity-generated.h new file mode 100644 index 000000000..4e973e62a --- /dev/null +++ b/tdeabc/vcard/include/generated/VCardEntity-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +VCardEntity(); +VCardEntity(const VCardEntity&); +VCardEntity(const TQCString&); +VCardEntity & operator = (VCardEntity&); +VCardEntity & operator = (const TQCString&); +bool operator ==(VCardEntity&); +bool operator !=(VCardEntity& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {VCardEntity a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~VCardEntity(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "VCardEntity"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/Value-generated.h b/tdeabc/vcard/include/generated/Value-generated.h new file mode 100644 index 000000000..935d137b6 --- /dev/null +++ b/tdeabc/vcard/include/generated/Value-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +Value(); +Value(const Value&); +Value(const TQCString&); +Value & operator = (Value&); +Value & operator = (const TQCString&); +bool operator ==(Value&); +bool operator !=(Value& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {Value a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~Value(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "Value"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/generate b/tdeabc/vcard/include/generated/generate new file mode 100755 index 000000000..926dbf136 --- /dev/null +++ b/tdeabc/vcard/include/generated/generate @@ -0,0 +1,2 @@ +#!/bin/sh +cat headerBodies | awk -f generateHeaders.awk diff --git a/tdeabc/vcard/include/generated/generateHeaders.awk b/tdeabc/vcard/include/generated/generateHeaders.awk new file mode 100755 index 000000000..471db11b4 --- /dev/null +++ b/tdeabc/vcard/include/generated/generateHeaders.awk @@ -0,0 +1,41 @@ +#!/bin/awk -f + +{ + outfile = $1 "-generated.h" + name = $1 + + OFS="" + + print "// XXX Automatically generated. DO NOT EDIT! XXX //\n" > outfile + print "// WARNING! All changes made in this file will be lost!\n" > outfile + + if ($2 == "v") { pre = "virtual " } else { pre = "" } + + print "public:" >> outfile + print name "();" >> outfile + print name "(const " name "&);" >> outfile + print name "(const QCString&);" >> outfile + print pre name " & operator = (" name "&);" >> outfile + print pre name " & operator = (const QCString&);" >> outfile + print pre "bool operator ==(" name "&);" >> outfile + print pre "bool operator !=(" name "& x) {return !(*this==x);}" \ + >> outfile + print pre "bool operator ==(const QCString& s) {" name " a(s);" \ + "return(*this==a);} " >> outfile + print pre "bool operator != (const QCString& s) {return !(*this == s);}\n" \ + >> outfile + print "virtual ~" name "();" >> outfile + print pre "void parse() " \ + "{if(!parsed_) _parse();parsed_=true;assembled_=false;}\n" \ + >> outfile + print pre "void assemble() " \ + "{if(assembled_) return;parse();_assemble();assembled_=true;}\n" \ + >> outfile + print pre "void _parse();" >> outfile + print pre "void _assemble();" >> outfile + print pre "const char * className() const { return \"" name "\"; }" \ + >> outfile + + print "\n// End of automatically generated code //" >> outfile +} + diff --git a/tdeabc/vcard/include/generated/headerBodies b/tdeabc/vcard/include/generated/headerBodies new file mode 100644 index 000000000..5e77b2b5e --- /dev/null +++ b/tdeabc/vcard/include/generated/headerBodies @@ -0,0 +1,34 @@ +AdrParam Param +AdrValue Value +AgentParam Param +ContentLine Entity +DateParam Param +DateValue Value +EmailParam Param +GeoValue Value +Group Entity +ImageParam Param +ImageValue Value +LangValue Value +NValue Value +Param Entity +PhoneNumberValue Value +SourceParam Param +TelParam Param +TextParam Param +TextNSParam Param +TextValue Value +TextBinParam Param +URIValue Value +VCard Entity +VCardEntity Entity +Value Entity +SoundValue Value +AgentValue Value +TelValue Value +TextBinValue Value +OrgValue Value +UTCValue Value +ClassValue Value +FloatValue Value +TextListValue Value diff --git a/tdeabc/vcard/testread.cpp b/tdeabc/vcard/testread.cpp new file mode 100644 index 000000000..3a33c7d54 --- /dev/null +++ b/tdeabc/vcard/testread.cpp @@ -0,0 +1,129 @@ +#include <iostream> +#include <stdlib.h> +#include <assert.h> + +#include <tqfile.h> +#include <tqtextstream.h> + +#include <VCard.h> + +using namespace std; + +int main(int argc, char * argv[]) +{ + if (argc != 2) { + cerr << "Usage: " << argv[0] << " <filename>" << endl; + exit(1); + } + + TQFile f(argv[1]); + + TQCString str; + + if (!f.open(IO_ReadOnly)) { + cerr << "Couldn't open file \"" << argv[1] << endl; + exit(1); + } + + TQTextStream t(&f); + + while (!t.eof()) + str += t.readLine().utf8() + '\n'; + + using namespace VCARD; + + // Iterate through all vCards in the file. + + cout << "--------- begin ----------" << endl; + cout << str.data(); + cout << "--------- end ----------" << endl; + + VCardEntity e(str); + + VCardListIterator it(e.cardList()); + + for (; it.current(); ++it) { + + cerr << "****************** VCARD ********************" << endl; + + // Create a vcard using the string representation. + VCard & v (*it.current()); + + if (v.has(EntityEmail)) { + cerr << "Email parameter found" << endl; + + TQCString s = v.contentLine(EntityEmail)->value()->asString(); + + cerr << "Email value == " << s << endl; + } + + if (v.has(EntityNickname)) { + cerr << "Nickname parameter found" << endl; + + cerr << "Nickname value == " << + v.contentLine(EntityNickname)->value()->asString() << + endl; + } + + if (v.has(EntityRevision)) { + + cerr << "Revision parameter found" << endl; + + DateValue * d = + (DateValue *) + v.contentLine(EntityRevision)->value(); + + assert(d != 0); + + cerr << "Revision date: " << endl; + cerr << "Day : " << d->day() << endl; + cerr << "Month : " << d->month() << endl; + cerr << "Year : " << d->year() << endl; + + if (d->hasTime()) { + cerr << "Revision date has a time component" << endl; + cerr << "Revision time: " << endl; + cerr << "Hour : " << d->hour() << endl; + cerr << "Minute : " << d->minute() << endl; + cerr << "Second : " << d->second() << endl; + + } + else cerr << "Revision date does NOT have a time component" << endl; + } + + if (v.has(EntityURL)) { + cerr << "URL Parameter found" << endl; + + cerr << "URL Value == " << + v.contentLine(EntityURL)->value()->asString() << + endl; + + URIValue * urlVal = + (URIValue *)v.contentLine(EntityURL)->value(); + + assert(urlVal != 0); + + cerr << "URL scheme == " << + urlVal->scheme() << endl; + + cerr << "URL scheme specific part == " << + urlVal->schemeSpecificPart() << endl; + } + + if (v.has(EntityN)) { + cerr << "N Parameter found" << endl; + + NValue * n = + (NValue *)(v.contentLine(EntityN)->value()); + + cerr << "Family name == " << n->family() << endl; + cerr << "Given name == " << n->given() << endl; + cerr << "Middle name == " << n->middle() << endl; + cerr << "Prefix == " << n->prefix() << endl; + cerr << "Suffix == " << n->suffix() << endl; + } + + cerr << "***************** END VCARD ******************" << endl; + } +} + diff --git a/tdeabc/vcard/testwrite.cpp b/tdeabc/vcard/testwrite.cpp new file mode 100644 index 000000000..42b76c80f --- /dev/null +++ b/tdeabc/vcard/testwrite.cpp @@ -0,0 +1,41 @@ +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <kdebug.h> +#include <tdelocale.h> +#include <tdecmdlineargs.h> + +#include <VCard.h> + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + + TDEApplication app; + + kdDebug() << "Test Write VCard" << endl; + + using namespace VCARD; + + VCard v; + + ContentLine cl1; + cl1.setName(EntityTypeToParamName(EntityName)); + cl1.setValue(new TextValue("Hans Wurst")); + v.add(cl1); + + ContentLine cl2; + cl2.setName(EntityTypeToParamName(EntityTelephone)); + cl2.setValue(new TelValue("12345")); + ParamList p; + p.append( new TelParam("home") ); + p.append( new TelParam("fax") ); + cl2.setParamList( p ); + v.add(cl2); + + TQCString str = v.asString(); + + kdDebug() << "--- VCard begin ---" << endl + << str + << "--- VCard end ---" << endl; +} diff --git a/tdeabc/vcard/vCard-all.cpp b/tdeabc/vcard/vCard-all.cpp new file mode 100644 index 000000000..07bbcd2bb --- /dev/null +++ b/tdeabc/vcard/vCard-all.cpp @@ -0,0 +1,37 @@ +#include "AdrParam.cpp" +#include "AdrValue.cpp" +#include "AgentParam.cpp" +#include "AgentValue.cpp" +#include "ClassValue.cpp" +#include "ContentLine.cpp" +#include "DateParam.cpp" +#include "DateValue.cpp" +#include "EmailParam.cpp" +#include "Entity.cpp" +#include "Enum.cpp" +#include "FloatValue.cpp" +#include "GeoValue.cpp" +#include "ImageParam.cpp" +#include "ImageValue.cpp" +#include "ImgValue.cpp" +#include "LangValue.cpp" +#include "NValue.cpp" +#include "OrgValue.cpp" +#include "Param.cpp" +#include "PhoneNumberValue.cpp" +#include "RToken.cpp" +#include "SoundValue.cpp" +#include "SourceParam.cpp" +#include "TelParam.cpp" +#include "TelValue.cpp" +#include "TextBinParam.cpp" +#include "TextBinValue.cpp" +#include "TextListValue.cpp" +#include "TextParam.cpp" +#include "TextValue.cpp" +#include "URIValue.cpp" +#include "UTCValue.cpp" +#include "VCard.cpp" +#include "VCardEntity.cpp" +#include "Value.cpp" + diff --git a/tdeabc/vcard21parser.cpp b/tdeabc/vcard21parser.cpp new file mode 100644 index 000000000..8a3bfcaea --- /dev/null +++ b/tdeabc/vcard21parser.cpp @@ -0,0 +1,608 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Mark Westcott <mark@houseoffish.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 <tqmap.h> +#include <tqregexp.h> +#include <kmdcodec.h> + +#include "vcard21parser.h" +#include "vcardconverter.h" + +using namespace KABC; + +bool VCardLineX::isValid() const +{ + // Invalid: if it is "begin:vcard" or "end:vcard" + if ( name == VCARD_BEGIN_N || name == VCARD_END_N ) + return false; + + if ( name[0] == 'x' && name[1] == '-' ) // A custom x- line + return true; + + // This is long but it makes it a bit faster (and saves me from using + // a tree which is probably the ideal situation, but a bit memory heavy) + switch( name[0] ) { + case 'a': + if ( name == VCARD_ADR && qualified && + (qualifiers.contains(VCARD_ADR_DOM) || + qualifiers.contains(VCARD_ADR_INTL) || + qualifiers.contains(VCARD_ADR_POSTAL) || + qualifiers.contains(VCARD_ADR_HOME) || + qualifiers.contains(VCARD_ADR_WORK) || + qualifiers.contains(VCARD_ADR_PREF) + ) ) + return true; + + if ( name == VCARD_AGENT ) + return true; + break; + + case 'b': + if ( name == VCARD_BDAY ) + return true; + break; + + case 'c': + if ( name == VCARD_CATEGORIES ) + return true; + if ( name == VCARD_CLASS && qualified && + (qualifiers.contains(VCARD_CLASS_PUBLIC) || + qualifiers.contains(VCARD_CLASS_PRIVATE) || + qualifiers.contains(VCARD_CLASS_CONFIDENTIAL) + ) ) + return true; + break; + + case 'e': + if ( name == VCARD_EMAIL && qualified && + (qualifiers.contains(VCARD_EMAIL_INTERNET) || + qualifiers.contains(VCARD_EMAIL_PREF) || + qualifiers.contains(VCARD_EMAIL_X400) + ) ) + return true; + break; + + case 'f': + if ( name == VCARD_FN ) + return true; + break; + + case 'g': + if ( name == VCARD_GEO ) + return true; + break; + + case 'k': + if ( name == VCARD_KEY && qualified && + (qualifiers.contains(VCARD_KEY_X509) || + qualifiers.contains(VCARD_KEY_PGP) + ) ) + return true; + break; + + case 'l': + if ( name == VCARD_LABEL ) + return true; + if ( name == VCARD_LOGO ) + return true; + break; + + case 'm': + if ( name == VCARD_MAILER ) + return true; + break; + + case 'n': + if ( name == VCARD_N ) + return true; + if ( name == VCARD_NAME ) + return true; + if ( name == VCARD_NICKNAME ) + return true; + if ( name == VCARD_NOTE ) + return true; + break; + + case 'o': + if ( name == VCARD_ORG ) + return true; + break; + + case 'p': + if ( name == VCARD_PHOTO ) + return true; + if ( name == VCARD_PROFILE ) + return true; + if ( name == VCARD_PRODID ) + return true; + break; + + case 'r': + if ( name == VCARD_ROLE ) + return true; + if ( name == VCARD_REV ) + return true; + break; + + case 's': + if ( name == VCARD_SOURCE ) + return true; + if ( name == VCARD_SOUND ) + return true; + break; + + case 't': + if ( name == VCARD_TEL && qualified && + (qualifiers.contains(VCARD_TEL_HOME) || + qualifiers.contains(VCARD_TEL_WORK) || + qualifiers.contains(VCARD_TEL_PREF) || + qualifiers.contains(VCARD_TEL_VOICE) || + qualifiers.contains(VCARD_TEL_FAX) || + qualifiers.contains(VCARD_TEL_MSG) || + qualifiers.contains(VCARD_TEL_CELL) || + qualifiers.contains(VCARD_TEL_PAGER) || + qualifiers.contains(VCARD_TEL_BBS) || + qualifiers.contains(VCARD_TEL_MODEM) || + qualifiers.contains(VCARD_TEL_CAR) || + qualifiers.contains(VCARD_TEL_ISDN) || + qualifiers.contains(VCARD_TEL_VIDEO) || + qualifiers.contains(VCARD_TEL_PCS) + ) ) + return true; + if ( name == VCARD_TZ ) + return true; + if ( name == VCARD_TITLE ) + return true; + break; + + case 'u': + if ( name == VCARD_URL ) + return true; + if ( name == VCARD_UID ) + return true; + break; + + case 'v': + if ( name == VCARD_VERSION ) + return true; + break; + default: + break; + } + + return false; +} + + +VCard21Parser::VCard21Parser() +{ +} + +VCard21Parser::~VCard21Parser() +{ +} + +void VCard21Parser::readFromString(KABC::AddressBook *addressbook, const TQString &data) +{ + KABC::Addressee mAddressee = readFromString(data); + addressbook->insertAddressee(mAddressee); +} + +KABC::Addressee VCard21Parser::readFromString( const TQString &data) +{ + KABC::Addressee addressee; + VCard21ParserImpl *vCard = VCard21ParserImpl::parseVCard(data); + TQString tmpStr; + + // Check if parsing failed + if (vCard == 0) + { + kdDebug() << "Parsing failed" << endl; + return addressee; + } + //set the addressees name and formated name + TQStringList tmpList = vCard->getValues(VCARD_N); + TQString formattedName = ""; + if (tmpList.count() > 0) + addressee.setFamilyName(tmpList[0]); + if (tmpList.count() > 1) + addressee.setGivenName(tmpList[1]); + if (tmpList.count() > 2) + addressee.setAdditionalName(tmpList[2]); + if (tmpList.count() > 3) + addressee.setPrefix(tmpList[3]); + if (tmpList.count() > 4) + addressee.setSuffix(tmpList[4]); + + tmpStr = (vCard->getValue(VCARD_FN)); + if (!tmpStr.isEmpty()) + addressee.setFormattedName(tmpStr); + + //set the addressee's nick name + tmpStr = vCard->getValue(VCARD_NICKNAME); + addressee.setNickName(tmpStr); + //set the addressee's organization + tmpStr = vCard->getValue(VCARD_ORG); + addressee.setOrganization(tmpStr); + //set the addressee's title + tmpStr = vCard->getValue(VCARD_TITLE); + addressee.setTitle(tmpStr); + //set the addressee's email - we can only deal with two. The preferenced one and one other. + tmpStr = vCard->getValue(VCARD_EMAIL, VCARD_EMAIL_INTERNET); + addressee.insertEmail(tmpStr, false); + tmpStr = vCard->getValue(VCARD_EMAIL,VCARD_EMAIL_PREF); + addressee.insertEmail(tmpStr, true); + //set the addressee's url + tmpStr = vCard->getValue(VCARD_URL); + if (tmpStr.isEmpty()) tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_WORK); + if (tmpStr.isEmpty()) tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_HOME); + if (!tmpStr.isEmpty()) { + addressee.setUrl(KURL(tmpStr)); + } + + //set the addressee's birthday + tmpStr = vCard->getValue(VCARD_BDAY); + addressee.setBirthday(VCardStringToDate(tmpStr)); + + //set the addressee's phone numbers + for ( TQValueListIterator<VCardLineX> i = vCard->_vcdata->begin();i != vCard->_vcdata->end(); ++i ) { + if ( (*i).name == VCARD_TEL ) { + int type = 0; + if ( (*i).qualified ) { + if ( (*i).qualifiers.contains( VCARD_TEL_HOME ) ) + type |= PhoneNumber::Home; + if ( (*i).qualifiers.contains( VCARD_TEL_WORK ) ) + type |= PhoneNumber::Work; + if ( (*i).qualifiers.contains( VCARD_TEL_PREF ) ) + type |= PhoneNumber::Pref; + // if ( (*i).qualifiers.contains( VCARD_TEL_VOICE ) ) + // type |= PhoneNumber::Voice; + if ( (*i).qualifiers.contains( VCARD_TEL_FAX ) ) + type |= PhoneNumber::Fax; + if ( (*i).qualifiers.contains( VCARD_TEL_MSG ) ) + type |= PhoneNumber::Msg; + if ( (*i).qualifiers.contains( VCARD_TEL_CELL ) ) + type |= PhoneNumber::Cell; + if ( (*i).qualifiers.contains( VCARD_TEL_PAGER ) ) + type |= PhoneNumber::Pager; + if ( (*i).qualifiers.contains( VCARD_TEL_BBS ) ) + type |= PhoneNumber::Bbs; + if ( (*i).qualifiers.contains( VCARD_TEL_MODEM ) ) + type |= PhoneNumber::Modem; + if ( (*i).qualifiers.contains( VCARD_TEL_CAR ) ) + type |= PhoneNumber::Car; + if ( (*i).qualifiers.contains( VCARD_TEL_ISDN ) ) + type |= PhoneNumber::Isdn; + if ( (*i).qualifiers.contains( VCARD_TEL_VIDEO ) ) + type |= PhoneNumber::Video; + if ( (*i).qualifiers.contains( VCARD_TEL_PCS ) ) + type |= PhoneNumber::Pcs; + } + addressee.insertPhoneNumber( PhoneNumber( (*i).parameters[ 0 ], type ) ); + } + } + + //set the addressee's addresses + for ( TQValueListIterator<VCardLineX> i = vCard->_vcdata->begin();i != vCard->_vcdata->end(); ++i ) { + if ( (*i).name == VCARD_ADR ) { + int type = 0; + if ( (*i).qualified ) { + if ( (*i).qualifiers.contains( VCARD_ADR_DOM ) ) + type |= Address::Dom; + if ( (*i).qualifiers.contains( VCARD_ADR_INTL ) ) + type |= Address::Intl; + if ( (*i).qualifiers.contains( VCARD_ADR_POSTAL ) ) + type |= Address::Postal; + if ( (*i).qualifiers.contains( VCARD_ADR_PARCEL ) ) + type |= Address::Parcel; + if ( (*i).qualifiers.contains( VCARD_ADR_HOME ) ) + type |= Address::Home; + if ( (*i).qualifiers.contains( VCARD_ADR_WORK ) ) + type |= Address::Work; + if ( (*i).qualifiers.contains( VCARD_ADR_PREF ) ) + type |= Address::Pref; + } + addressee.insertAddress( readAddressFromQStringList( (*i).parameters, type ) ); + } + } + + //set the addressee's delivery label + tmpStr = vCard->getValue(VCARD_LABEL); + if (!tmpStr.isEmpty()) { + tmpStr.replace("\r\n","\n"); + Address tmpAddress; + tmpAddress.setLabel(tmpStr); + addressee.insertAddress(tmpAddress); + } + + //set the addressee's notes + tmpStr = vCard->getValue(VCARD_NOTE); + tmpStr.replace("\r\n","\n"); + addressee.setNote(tmpStr); + + //set the addressee's timezone + tmpStr = vCard->getValue(VCARD_TZ); + TimeZone tmpZone(tmpStr.toInt()); + addressee.setTimeZone(tmpZone); + + //set the addressee's geographical position + tmpList = vCard->getValues(VCARD_GEO); + if (tmpList.count()==2) + { + tmpStr = tmpList[0]; + float glat = tmpStr.toFloat(); + tmpStr = tmpList[1]; + float glong = tmpStr.toFloat(); + Geo tmpGeo(glat,glong); + addressee.setGeo(tmpGeo); + } + + //set the last revision date + tmpStr = vCard->getValue(VCARD_REV); + addressee.setRevision(VCardStringToDate(tmpStr)); + + //set the role of the addressee + tmpStr = vCard->getValue(VCARD_ROLE); + addressee.setRole(tmpStr); + + delete vCard; + + return addressee; +} + + + +KABC::Address VCard21Parser::readAddressFromQStringList ( const TQStringList &data, const int type ) +{ + KABC::Address mAddress; + mAddress.setType( type ); + + if ( data.count() > 0 ) + mAddress.setPostOfficeBox( data[0] ); + if ( data.count() > 1 ) + mAddress.setExtended( data[1] ); + if ( data.count() > 2 ) + mAddress.setStreet( data[2] ); + if ( data.count() > 3 ) + mAddress.setLocality( data[3] ); + if ( data.count() > 4 ) + mAddress.setRegion( data[4] ); + if ( data.count() > 5 ) + mAddress.setPostalCode( data[5] ); + if ( data.count() > 6 ) + mAddress.setCountry( data[6] ); + + return mAddress; +} + + +VCard21ParserImpl *VCard21ParserImpl::parseVCard( const TQString& vc, int *err ) +{ + int _err = 0; + int _state = VC_STATE_BEGIN; + + TQValueList<VCardLineX> *vcdata; + TQValueList<TQString> lines; + + vcdata = new TQValueList<VCardLineX>; + + lines = TQStringList::split( TQRegExp( "[\x0d\x0a]" ), vc ); + + // for each line in the vCard + for ( TQStringList::Iterator j = lines.begin(); j != lines.end(); ++j ) { + VCardLineX _vcl; + + // take spaces off the end - ugly but necessary hack + for ( int g = (*j).length()-1; g > 0 && (*j)[g].isSpace(); --g ) + (*j)[g] = 0; + + // first token: + // verify state, update if necessary + if ( _state & VC_STATE_BEGIN) { + if ( !tqstricmp( (*j).latin1(), VCARD_BEGIN ) ) { + _state = VC_STATE_BODY; + continue; + } else { + _err = VC_ERR_NO_BEGIN; + break; + } + } else if ( _state & VC_STATE_BODY ) { + if ( !tqstricmp( (*j).latin1(), VCARD_END ) ) { + _state |= VC_STATE_END; + break; + } + + // split into two tokens + int colon = (*j).find( ':' ); + if ( colon < 0 ) { + _err = VC_ERR_INVALID_LINE; + break; + } + + TQString key = (*j).left( colon ); + TQString value = (*j).mid( colon + 1 ); + + // check for qualifiers and + // set name, qualified, qualifier(s) + TQStringList keyTokens = TQStringList::split( ';', key ); + bool qp = false, first_pass = true; + bool b64 = false; + + if ( keyTokens.count() > 0 ) { + _vcl.qualified = false; + _vcl.name = keyTokens[ 0 ].lower(); + + for ( TQStringList::Iterator z = keyTokens.begin(); z != keyTokens.end(); ++z ) { + TQString zz = (*z).lower(); + if ( zz == VCARD_QUOTED_PRINTABLE || zz == VCARD_ENCODING_QUOTED_PRINTABLE ) { + qp = true; + } else if ( zz == VCARD_BASE64 ) { + b64 = true; + } else if ( !first_pass ) { + _vcl.qualified = true; + _vcl.qualifiers.append( zz ); + } + first_pass = false; + } + } else { + _err = VC_ERR_INVALID_LINE; + } + + if ( _err != 0 ) + break; + + if ( _vcl.name == VCARD_VERSION ) + _state |= VC_STATE_HAVE_VERSION; + + if ( _vcl.name == VCARD_N || _vcl.name == VCARD_FN ) + _state |= VC_STATE_HAVE_N; + + // second token: + // split into tokens by ; + // add to parameters vector + if ( b64 ) { + if ( value[ value.length() - 1 ] != '=' ) + do { + value += *( ++j ); + } while ( (*j)[ (*j).length() - 1 ] != '=' ); + } else { + if ( qp ) { // join any split lines + while ( value[ value.length() - 1 ] == '=' ) { + value.remove( value.length() - 1, 1 ); + value.append(*( ++j )); + } + } + _vcl.parameters = TQStringList::split( ';', value, true ); + if ( qp ) { // decode the quoted printable + for ( TQStringList::Iterator z = _vcl.parameters.begin(); z != _vcl.parameters.end(); ++z ) + *z = KCodecs::quotedPrintableDecode( TQCString((*z).latin1()) ); + } + } + } else { + _err = VC_ERR_INTERNAL; + break; + } + + // validate VCardLineX + if ( !_vcl.isValid() ) { + _err = VC_ERR_INVALID_LINE; + break; + } + + // add to vector + vcdata->append( _vcl ); + } + + // errors to check at the last minute (exit state related) + if ( _err == 0 ) { + if ( !( _state & VC_STATE_END ) ) // we have to have an end!! + _err = VC_ERR_NO_END; + + if ( !( _state & VC_STATE_HAVE_N ) || // we have to have the mandatories! + !( _state & VC_STATE_HAVE_VERSION ) ) + _err = VC_ERR_MISSING_MANDATORY; + } + + // set the error message if we can, and only return an object + // if the vCard was valid. + if ( err ) + *err = _err; + + if ( _err != 0 ) { + delete vcdata; + return 0; + } + + return new VCard21ParserImpl( vcdata ); +} + +VCard21ParserImpl::VCard21ParserImpl() + : _vcdata( 0 ) +{ +} + +VCard21ParserImpl::VCard21ParserImpl(TQValueList<VCardLineX> *_vcd) + : _vcdata(_vcd) +{ +} + +VCard21ParserImpl::~VCard21ParserImpl() +{ + delete _vcdata; + _vcdata = 0; +} + +TQString VCard21ParserImpl::getValue(const TQString& name, const TQString& qualifier) +{ + TQString failed; + const TQString lowname = name.lower(); + const TQString lowqualifier = qualifier.lower(); + + for (TQValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { + if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) { + if ((*i).parameters.count() > 0) + return (*i).parameters[0]; + else return failed; + } + } + return failed; +} + + +TQString VCard21ParserImpl::getValue(const TQString& name) +{ + TQString failed; + const TQString lowname = name.lower(); + + for (TQValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { + if ((*i).name == lowname && !(*i).qualified) { + if ((*i).parameters.count() > 0) + return (*i).parameters[0]; + else return failed; + } + } + return failed; +} + + +TQStringList VCard21ParserImpl::getValues(const TQString& name) +{ + const TQString lowname = name.lower(); + for (TQValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { + if ((*i).name == lowname && !(*i).qualified) + return (*i).parameters; + } + // failed. + return TQStringList(); +} + +TQStringList VCard21ParserImpl::getValues(const TQString& name, const TQString& qualifier) +{ + const TQString lowname = name.lower(); + const TQString lowqualifier = qualifier.lower(); + for (TQValueListIterator<VCardLineX> i = _vcdata->begin();i != _vcdata->end();++i) { + if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) + return (*i).parameters; + } + // failed. + return TQStringList(); +} + + diff --git a/tdeabc/vcard21parser.h b/tdeabc/vcard21parser.h new file mode 100644 index 000000000..0eb66fa93 --- /dev/null +++ b/tdeabc/vcard21parser.h @@ -0,0 +1,221 @@ +/* + This file is part of libkabc. + + Copyright (c) 2002 Mark Westcott <mark@houseoffish.org> + Copyright (c) 2000 George Staikos <staikos@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 KABC_VCARD21FORMAT_H +#define KABC_VCARD21FORMAT_H + +#include <tqdatetime.h> +#include <kdebug.h> +#include <tqregexp.h> +#include <tqstring.h> +#include <kurl.h> +#include <tqvaluelist.h> + +#include "addressee.h" +#include "addressbook.h" +#include "phonenumber.h" + + +#define VCARD_BEGIN "begin:vcard" +#define VCARD_END "end:vcard" +#define VCARD_BEGIN_N "begin" +#define VCARD_END_N "end" +#define VCARD_VERSION "version" + +#define VCARD_FN "fn" +#define VCARD_N "n" + +// optional +#define VCARD_NAME "name" +#define VCARD_NICKNAME "nickname" +#define VCARD_PHOTO "photo" +#define VCARD_BDAY "bday" +#define VCARD_ADR "adr" + +// types +#define VCARD_ADR_DOM "dom" +#define VCARD_ADR_INTL "intl" +#define VCARD_ADR_POSTAL "postal" +#define VCARD_ADR_PARCEL "parcel" +#define VCARD_ADR_HOME "home" +#define VCARD_ADR_WORK "work" +#define VCARD_ADR_PREF "pref" +// values +#define VCARD_ADR_POBOX "PO Box" +#define VCARD_ADR_EXTADR "Extended Address" +#define VCARD_ADR_STREET "Street" +#define VCARD_ADR_LOCALITY "Locality" +#define VCARD_ADR_REGION "Region" +#define VCARD_ADR_POSTCODE "Postal Code" +#define VCARD_ADR_COUNTRY "Country Name" +#define VCARD_LABEL "label" +#define VCARD_PROFILE "profile" +#define VCARD_SOURCE "source" +#define VCARD_TEL "tel" +// types +#define VCARD_TEL_HOME "home" +#define VCARD_TEL_WORK "work" +#define VCARD_TEL_PREF "pref" +#define VCARD_TEL_VOICE "voice" +#define VCARD_TEL_FAX "fax" +#define VCARD_TEL_MSG "msg" +#define VCARD_TEL_CELL "cell" +#define VCARD_TEL_PAGER "pager" +#define VCARD_TEL_BBS "bbs" +#define VCARD_TEL_MODEM "modem" +#define VCARD_TEL_CAR "car" +#define VCARD_TEL_ISDN "isdn" +#define VCARD_TEL_VIDEO "video" +#define VCARD_TEL_PCS "pcs" +#define VCARD_EMAIL "email" +// types +#define VCARD_EMAIL_PREF "pref" +#define VCARD_EMAIL_INTERNET "internet" +#define VCARD_EMAIL_X400 "x400" +#define VCARD_TZ "tz" +#define VCARD_GEO "geo" +#define VCARD_MAILER "mailer" +#define VCARD_TITLE "title" +#define VCARD_ROLE "role" +#define VCARD_LOGO "logo" +#define VCARD_AGENT "agent" +#define VCARD_ORG "org" +#define VCARD_CATEGORIES "categories" +#define VCARD_NOTE "note" +#define VCARD_PRODID "prodid" +#define VCARD_REV "rev" +#define VCARD_SOUND "sound" +#define VCARD_UID "uid" +#define VCARD_URL "url" +#define VCARD_CLASS "class" +#define VCARD_CLASS_PUBLIC "public" +#define VCARD_CLASS_PRIVATE "private" +#define VCARD_CLASS_CONFIDENTIAL "confidential" +#define VCARD_KEY "key" +// types +#define VCARD_KEY_X509 "x509" +#define VCARD_KEY_PGP "pgp" + +#define VCARD_QUOTED_PRINTABLE "quoted-printable" +// this one is a temporary hack until we support TYPE=VALUE +#define VCARD_ENCODING_QUOTED_PRINTABLE "encoding=quoted-printable" +#define VCARD_BASE64 "base64" + +#define VC_STATE_BEGIN 1 +#define VC_STATE_BODY 2 +#define VC_STATE_END 4 +#define VC_STATE_HAVE_N 8 +#define VC_STATE_HAVE_VERSION 16 + +#define VC_ERR_NO_BEGIN 1 +#define VC_ERR_NO_END 2 +#define VC_ERR_INVALID_LINE 3 +#define VC_ERR_INTERNAL 4 +#define VC_ERR_INVALID_NAME 5 +#define VC_ERR_MISSING_MANDATORY 6 + +namespace KABC { + +class AddressBook; + +/** + @deprecated use VCardConverter instead. + */ +class KABC_EXPORT_DEPRECATED VCard21Parser +{ +public: + + /** + * Constructor. + */ + VCard21Parser(); + + /** + * Destructor. + */ + virtual ~VCard21Parser(); + + /** + * Parses a string in vcard2.1 format and saves the single addressees + * to the address book. + * + * @param ab The address book. + * @param str The vcard string. + */ + void readFromString( KABC::AddressBook *ab, const TQString &str ); + + /** + * FIXME: we need a writeToString method + * TQString writeToString (KABC::AddressBook *); + */ + + /** + * Parses a string in vcard2.1 format and returns the inherent addressee. + */ + KABC::Addressee readFromString( const TQString &data); + + /** + * Helper method to store a address. + * + * @param data A string list, that is filled with 'street', 'house number' ... + * @param type The type of the returned address. + */ + static KABC::Address readAddressFromQStringList (const TQStringList &data, const int type); +}; + +} + +/** + * @short Helper class + */ +class KABC_EXPORT VCardLineX +{ +public: + TQString name; + bool qualified; + TQValueList<TQString> qualifiers; + TQValueList<TQString> parameters; + bool isValid() const; +}; + +/** + * @short Helper class + */ +class KABC_EXPORT VCard21ParserImpl +{ + friend class VCardLineX; + +public: + VCard21ParserImpl(); + virtual ~VCard21ParserImpl(); + static VCard21ParserImpl *parseVCard(const TQString& vc, int *err = NULL); + TQString getValue(const TQString& name, const TQString& qualifier); + TQString getValue(const TQString& name); + TQStringList getValues(const TQString& name, const TQString& qualifier); + TQStringList getValues(const TQString& name); + + TQValueList<VCardLineX> *_vcdata; + +private: + VCard21ParserImpl (TQValueList<VCardLineX> *_vcd); +}; + +#endif diff --git a/tdeabc/vcardconverter.cpp b/tdeabc/vcardconverter.cpp new file mode 100644 index 000000000..d575b019c --- /dev/null +++ b/tdeabc/vcardconverter.cpp @@ -0,0 +1,129 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 "vcard21parser.h" +#include "vcardformatimpl.h" +#include "vcardtool.h" + +#include "vcardconverter.h" + +using namespace KABC; + +struct VCardConverter::VCardConverterData +{ + VCard21Parser vcard21parser; + VCardFormatImpl vcard30parser; +}; + +VCardConverter::VCardConverter() + : d( new VCardConverterData ) +{ +} + +VCardConverter::~VCardConverter() +{ + delete d; + d = 0; +} + +TQString VCardConverter::createVCard( const Addressee &addr, Version version ) +{ + Addressee::List list; + list.append( addr ); + + return createVCards( list, version ); +} + +TQString VCardConverter::createVCards( Addressee::List list, Version version ) +{ + VCardTool tool; + + return tool.createVCards( list, ( version == v3_0 ? VCard::v3_0 : VCard::v2_1 ) ); +} + +Addressee VCardConverter::parseVCard( const TQString& vcard ) +{ + Addressee::List list = parseVCards( vcard ); + + return list[ 0 ]; +} + +Addressee::List VCardConverter::parseVCards( const TQString& vcard ) +{ + VCardTool tool; + + return tool.parseVCards( vcard ); +} + +// ---------------------------- deprecated stuff ---------------------------- // + +bool VCardConverter::vCardToAddressee( const TQString &str, Addressee &addr, Version version ) +{ + if ( version == v2_1 ) { + addr = d->vcard21parser.readFromString( str ); + return true; + } + + if ( version == v3_0 ) + return d->vcard30parser.readFromString( str, addr ); + + return false; +} + +bool VCardConverter::addresseeToVCard( const Addressee &addr, TQString &str, Version version ) +{ + if ( version == v2_1 ) + return false; + + if ( version == v3_0 ) + return d->vcard30parser.writeToString( addr, str ); + + return false; +} + + +/* Helper functions */ + +TQString KABC::dateToVCardString( const TQDateTime &dateTime ) +{ + return dateTime.toString("yyyyMMddThhmmssZ"); +} + +TQString KABC::dateToVCardString( const TQDate &date ) +{ + return date.toString("yyyyMMdd"); +} + +TQDateTime KABC::VCardStringToDate( const TQString &dateString ) +{ + TQDate date; + TQTime time; + TQString d( dateString ); + + d = d.remove('-').remove(':'); + + if (d.length()>=8) + date = TQDate( d.mid(0,4).toUInt(), d.mid(4,2).toUInt(), d.mid(6,2).toUInt() ); + if (d.length()>9 && d[8].upper()=='T') + time = TQTime( d.mid(9,2).toUInt(), d.mid(11,2).toUInt(), d.mid(13,2).toUInt() ); + + return TQDateTime( date, time ); +} + diff --git a/tdeabc/vcardconverter.h b/tdeabc/vcardconverter.h new file mode 100644 index 000000000..ab09279f2 --- /dev/null +++ b/tdeabc/vcardconverter.h @@ -0,0 +1,163 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig <tokoe@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 KABC_VCARDCONVERTER_H +#define KABC_VCARDCONVERTER_H + +#include <tqstring.h> + +#include "addressee.h" + +namespace KABC { + +/** + @short Class to converting contact objects into vCard format and vice versa. + + This class implements reading and writing of contact using from/to the + vCard format. Currently vCard version 2.1 and 3.0 is supported. + + Example: + + \code + + TQFile file( "myfile.vcf" ); + file.open( IO_ReadOnly ); + + TQString data = file.readAll(); + + VCardConverter converter; + Addressee::List list = converter.parseVCards( data ); + + // print formatted name of first contact + tqDebug( "name=%s", list[ 0 ].formattedName().latin1() ); + + \endcode +*/ +class KABC_EXPORT VCardConverter +{ + public: + + /** + @li v2_1 - VCard format version 2.1 + @li v3_0 - VCard format version 3.0 + */ + enum Version + { + v2_1, + v3_0 + }; + + /** + Constructor. + */ + VCardConverter(); + + /** + Destructor. + */ + ~VCardConverter(); + + /** + Creates a string in vCard format which contains the given + contact. + + @param addr The contact object + @param version The version of the generated vCard format + */ + TQString createVCard( const Addressee &addr, Version version = v3_0 ); + + /** + Creates a string in vCard format which contains the given + list of contact. + + @param list The list of contact objects + @param version The version of the generated vCard format + */ + // FIXME: Add error handling + TQString createVCards( Addressee::List list, Version version = v3_0 ); + + // FIXME: Add "createVCards( AddressBook * )" + + /** + Parses a string in vCard format and returns the first contact. + */ + Addressee parseVCard( const TQString& vcard ); + + /** + Parses a string in vCard format and returns a list of contact objects. + */ + // FIXME: Add error handling + Addressee::List parseVCards( const TQString& vcard ); + + // FIXME: Add "bool parseVCards( AddressBook *, const TQString &vcard )" + + /** + @deprecated + */ + bool vCardToAddressee( const TQString&, Addressee &, Version version = v3_0 ) KDE_DEPRECATED; + + /** + @deprecated + */ + bool addresseeToVCard( const Addressee&, TQString&, Version version = v3_0 ) KDE_DEPRECATED; + + private: + /** + Split a string and replaces escaped separators on the fly with + unescaped ones. + */ + TQStringList splitString( const TQChar &sep, const TQString &value ); + + struct VCardConverterData; + VCardConverterData *d; +}; + + +/** + Helper functions + */ + +/** + * Converts a TQDateTime to a date string as it is used in VCard and LDIF files. + * The return value is in the form "yyyyMMddThhmmssZ" (e.g. "20031201T120000Z") + * @param dateTime date and time to be converted + * @since 3.2 + */ +KABC_EXPORT TQString dateToVCardString( const TQDateTime &dateTime ); + +/** + * Converts a TQDate to a short date string as it is used in VCard and LDIF files. + * The return value is in the form "yyyyMMdd" (e.g. "20031201") + * @param date date to be converted + * @since 3.2 + */ +KABC_EXPORT TQString dateToVCardString( const TQDate &date ); + +/** + * Converts a date string as it is used in VCard and LDIF files to a TQDateTime value. + * If the date string does not contain a time value, it will be returned as 00:00:00. + * (e.g. "20031201T120000" will return a TQDateTime for 2003-12-01 at 12:00) + * @param dateString string representing the date and time. + * @since 3.2 + */ +KABC_EXPORT TQDateTime VCardStringToDate( const TQString &dateString ); + +} +#endif diff --git a/tdeabc/vcardformat.cpp b/tdeabc/vcardformat.cpp new file mode 100644 index 000000000..147aa4259 --- /dev/null +++ b/tdeabc/vcardformat.cpp @@ -0,0 +1,59 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 "vcardformatimpl.h" + +#include "vcardformat.h" + +using namespace KABC; + +VCardFormat::VCardFormat() +{ + mImpl = new VCardFormatImpl; +} + +VCardFormat::~VCardFormat() +{ + delete mImpl; +} + +bool VCardFormat::load( AddressBook *addressBook, const TQString &fileName ) +{ + TQFile f( fileName ); + if ( !f.open( IO_ReadOnly ) ) return false; + + bool result = mImpl->loadAll( addressBook, 0, &f ); + + f.close(); + + return result; +} + +bool VCardFormat::save( AddressBook *addressBook, const TQString &fileName ) +{ + TQFile f( fileName ); + if ( !f.open( IO_WriteOnly ) ) return false; + + mImpl->saveAll( addressBook, 0, &f ); + + f.close(); + + return true; +} diff --git a/tdeabc/vcardformat.h b/tdeabc/vcardformat.h new file mode 100644 index 000000000..8194056cb --- /dev/null +++ b/tdeabc/vcardformat.h @@ -0,0 +1,49 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_VCARDFORMAT_H +#define KABC_VCARDFORMAT_H + +#include <tqstring.h> + +#include "format.h" + +namespace KABC { + +class AddressBook; +class VCardFormatImpl; + +/** + @deprecated use VCardFormatPlugin instead. + */ +class KABC_EXPORT_DEPRECATED VCardFormat : public Format { + public: + VCardFormat(); + virtual ~VCardFormat(); + + bool load( AddressBook *, const TQString &fileName ); + bool save( AddressBook *, const TQString &fileName ); + + private: + VCardFormatImpl *mImpl; +}; + +} + +#endif diff --git a/tdeabc/vcardformatimpl.cpp b/tdeabc/vcardformatimpl.cpp new file mode 100644 index 000000000..c0d39bb95 --- /dev/null +++ b/tdeabc/vcardformatimpl.cpp @@ -0,0 +1,1001 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> +#include <tqregexp.h> + +#include <kdebug.h> +#include <kmdcodec.h> +#include <kstandarddirs.h> +#include <tdetempfile.h> + +#include <VCard.h> + +#include "addressbook.h" +#include "vcardformatimpl.h" + +using namespace KABC; +using namespace VCARD; + +bool VCardFormatImpl::load( Addressee &addressee, TQFile *file ) +{ + kdDebug(5700) << "VCardFormat::load()" << endl; + + TQByteArray fdata = file->readAll(); + TQCString data(fdata.data(), fdata.size()+1); + + VCardEntity e( data ); + + VCardListIterator it( e.cardList() ); + + if ( it.current() ) { + VCARD::VCard v(*it.current()); + loadAddressee( addressee, v ); + return true; + } + + return false; +} + +bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, TQFile *file ) +{ + kdDebug(5700) << "VCardFormat::loadAll()" << endl; + + TQByteArray fdata = file->readAll(); + TQCString data(fdata.data(), fdata.size()+1); + + VCardEntity e( data ); + + VCardListIterator it( e.cardList() ); + + for (; it.current(); ++it) { + VCARD::VCard v(*it.current()); + Addressee addressee; + loadAddressee( addressee, v ); + addressee.setResource( resource ); + addressBook->insertAddressee( addressee ); + } + + return true; +} + +void VCardFormatImpl::save( const Addressee &addressee, TQFile *file ) +{ + VCardEntity vcards; + VCardList vcardlist; + vcardlist.setAutoDelete( true ); + + VCARD::VCard *v = new VCARD::VCard; + + saveAddressee( addressee, v, false ); + + vcardlist.append( v ); + vcards.setCardList( vcardlist ); + + TQCString vcardData = vcards.asString(); + file->writeBlock( (const char*)vcardData, vcardData.length() ); +} + +void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, TQFile *file ) +{ + VCardEntity vcards; + VCardList vcardlist; + vcardlist.setAutoDelete( true ); + + AddressBook::Iterator it; + for ( it = ab->begin(); it != ab->end(); ++it ) { + if ( (*it).resource() == resource ) { + VCARD::VCard *v = new VCARD::VCard; + saveAddressee( (*it), v, false ); + (*it).setChanged( false ); + vcardlist.append( v ); + } + } + + vcards.setCardList( vcardlist ); + + TQCString vcardData = vcards.asString(); + file->writeBlock( (const char*)vcardData, vcardData.length() ); +} + +bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCARD::VCard &v ) +{ + TQPtrList<ContentLine> contentLines = v.contentLineList(); + ContentLine *cl; + + for( cl = contentLines.first(); cl; cl = contentLines.next() ) { + TQCString n = cl->name(); + if ( n.left( 2 ) == "X-" ) { + n = n.mid( 2 ); + int posDash = n.find( "-" ); + addressee.insertCustom( TQString::fromUtf8( n.left( posDash ) ), + TQString::fromUtf8( n.mid( posDash + 1 ) ), + TQString::fromUtf8( cl->value()->asString() ) ); + continue; + } + + EntityType type = cl->entityType(); + switch( type ) { + + case EntityUID: + addressee.setUid( readTextValue( cl ) ); + break; + + case EntityURI: + addressee.setUri( readTextValue( cl ) ); + break; + + case EntityEmail: + addressee.insertEmail( readTextValue( cl ) ); + break; + + case EntityName: + addressee.setName( readTextValue( cl ) ); + break; + + case EntityFullName: + addressee.setFormattedName( readTextValue( cl ) ); + break; + + case EntityURL: + addressee.setUrl( KURL( readTextValue( cl ) ) ); + break; + + case EntityNickname: + addressee.setNickName( readTextValue( cl ) ); + break; + + case EntityLabel: + // not yet supported by kabc + break; + + case EntityMailer: + addressee.setMailer( readTextValue( cl ) ); + break; + + case EntityTitle: + addressee.setTitle( readTextValue( cl ) ); + break; + + case EntityRole: + addressee.setRole( readTextValue( cl ) ); + break; + + case EntityOrganisation: + addressee.setOrganization( readTextValue( cl ) ); + break; + + case EntityNote: + addressee.setNote( readTextValue( cl ) ); + break; + + case EntityProductID: + addressee.setProductId( readTextValue( cl ) ); + break; + + case EntitySortString: + addressee.setSortString( readTextValue( cl ) ); + break; + + case EntityN: + readNValue( cl, addressee ); + break; + + case EntityAddress: + addressee.insertAddress( readAddressValue( cl ) ); + break; + + case EntityTelephone: + addressee.insertPhoneNumber( readTelephoneValue( cl ) ); + break; + + case EntityCategories: + addressee.setCategories( TQStringList::split( ",", readTextValue( cl ) ) ); + break; + + case EntityBirthday: + addressee.setBirthday( readDateValue( cl ) ); + break; + + case EntityRevision: + addressee.setRevision( readDateTimeValue( cl ) ); + break; + + case EntityGeo: + addressee.setGeo( readGeoValue( cl ) ); + break; + + case EntityTimeZone: + addressee.setTimeZone( readUTCValue( cl ) ); + break; + + case EntityVersion: + break; + + case EntityClass: + addressee.setSecrecy( readClassValue( cl ) ); + break; + + case EntityKey: + addressee.insertKey( readKeyValue( cl ) ); + break; + + case EntityPhoto: + addressee.setPhoto( readPictureValue( cl, EntityPhoto, addressee ) ); + break; + + case EntityLogo: + addressee.setLogo( readPictureValue( cl, EntityLogo, addressee ) ); + break; + + case EntityAgent: + addressee.setAgent( readAgentValue( cl ) ); + break; + + case EntitySound: + addressee.setSound( readSoundValue( cl, addressee ) ); + break; + + default: + kdDebug(5700) << "VCardFormat::load(): Unsupported entity: " + << int( type ) << ": " << cl->asString() << endl; + break; + } + } + + for( cl = contentLines.first(); cl; cl = contentLines.next() ) { + EntityType type = cl->entityType(); + if ( type == EntityLabel ) { + int type = readAddressParam( cl ); + Address address = addressee.address( type ); + if ( address.isEmpty() ) + address.setType( type ); + + address.setLabel( TQString::fromUtf8( cl->value()->asString() ) ); + addressee.insertAddress( address ); + } + } + + return true; +} + +void VCardFormatImpl::saveAddressee( const Addressee &addressee, VCARD::VCard *v, bool intern ) +{ + ContentLine cl; + TQString value; + + addTextValue( v, EntityName, addressee.name() ); + addTextValue( v, EntityUID, addressee.uid() ); + addTextValue( v, EntityURI, addressee.uri() ); + addTextValue( v, EntityFullName, addressee.formattedName() ); + + TQStringList emails = addressee.emails(); + TQStringList::ConstIterator it4; + for( it4 = emails.begin(); it4 != emails.end(); ++it4 ) { + addTextValue( v, EntityEmail, *it4 ); + } + + TQStringList customs = addressee.customs(); + TQStringList::ConstIterator it5; + for( it5 = customs.begin(); it5 != customs.end(); ++it5 ) { + addCustomValue( v, *it5 ); + } + + addTextValue( v, EntityURL, addressee.url().url() ); + + addNValue( v, addressee ); + + addTextValue( v, EntityNickname, addressee.nickName() ); + addTextValue( v, EntityMailer, addressee.mailer() ); + addTextValue( v, EntityTitle, addressee.title() ); + addTextValue( v, EntityRole, addressee.role() ); + addTextValue( v, EntityOrganisation, addressee.organization() ); + addTextValue( v, EntityNote, addressee.note() ); + addTextValue( v, EntityProductID, addressee.productId() ); + addTextValue( v, EntitySortString, addressee.sortString() ); + + Address::List addresses = addressee.addresses(); + Address::List::ConstIterator it3; + for( it3 = addresses.begin(); it3 != addresses.end(); ++it3 ) { + addAddressValue( v, *it3 ); + addLabelValue( v, *it3 ); + } + + PhoneNumber::List phoneNumbers = addressee.phoneNumbers(); + PhoneNumber::List::ConstIterator it2; + for( it2 = phoneNumbers.begin(); it2 != phoneNumbers.end(); ++it2 ) { + addTelephoneValue( v, *it2 ); + } + + Key::List keys = addressee.keys(); + Key::List::ConstIterator it6; + for( it6 = keys.begin(); it6 != keys.end(); ++it6 ) { + addKeyValue( v, *it6 ); + } + + addTextValue( v, EntityCategories, addressee.categories().join(",") ); + + addDateValue( v, EntityBirthday, TQT_TQDATE_OBJECT(addressee.birthday().date()) ); + addDateTimeValue( v, EntityRevision, TQT_TQDATETIME_OBJECT(addressee.revision()) ); + addGeoValue( v, addressee.geo() ); + addUTCValue( v, addressee.timeZone() ); + + addClassValue( v, addressee.secrecy() ); + + addPictureValue( v, EntityPhoto, addressee.photo(), addressee, intern ); + addPictureValue( v, EntityLogo, addressee.logo(), addressee, intern ); + + addAgentValue( v, addressee.agent() ); + + addSoundValue( v, addressee.sound(), addressee, intern ); +} + +void VCardFormatImpl::addCustomValue( VCARD::VCard *v, const TQString &txt ) +{ + if ( txt.isEmpty() ) return; + + ContentLine cl; + cl.setName( "X-" + txt.left( txt.find( ":" ) ).utf8() ); + TQString value = txt.mid( txt.find( ":" ) + 1 ); + if ( value.isEmpty() ) + return; + cl.setValue( new TextValue( value.utf8() ) ); + v->add(cl); +} + +void VCardFormatImpl::addTextValue( VCARD::VCard *v, EntityType type, const TQString &txt ) +{ + if ( txt.isEmpty() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( type ) ); + cl.setValue( new TextValue( txt.utf8() ) ); + v->add(cl); +} + +void VCardFormatImpl::addDateValue( VCARD::VCard *vcard, EntityType type, + const TQDate &date ) +{ + if ( !date.isValid() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( type ) ); + + DateValue *v = new DateValue( date ); + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::addDateTimeValue( VCARD::VCard *vcard, EntityType type, + const TQDateTime &dateTime ) +{ + if ( !dateTime.isValid() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( type ) ); + + DateValue *v = new DateValue( dateTime ); + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::addAddressValue( VCARD::VCard *vcard, const Address &a ) +{ + if ( a.isEmpty() ) + return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityAddress ) ); + + AdrValue *v = new AdrValue; + v->setPOBox( a.postOfficeBox().utf8() ); + v->setExtAddress( a.extended().utf8() ); + v->setStreet( a.street().utf8() ); + v->setLocality( a.locality().utf8() ); + v->setRegion( a.region().utf8() ); + v->setPostCode( a.postalCode().utf8() ); + v->setCountryName( a.country().utf8() ); + cl.setValue( v ); + + addAddressParam( &cl, a.type() ); + + vcard->add( cl ); +} + +void VCardFormatImpl::addLabelValue( VCARD::VCard *vcard, const Address &a ) +{ + if ( a.label().isEmpty() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityLabel ) ); + cl.setValue( new TextValue( a.label().utf8() ) ); + + addAddressParam( &cl, a.type() ); + + vcard->add( cl ); +} + +void VCardFormatImpl::addAddressParam( ContentLine *cl, int type ) +{ + ParamList params; + if ( type & Address::Dom ) params.append( new Param( "TYPE", "dom" ) ); + if ( type & Address::Intl ) params.append( new Param( "TYPE", "intl" ) ); + if ( type & Address::Parcel ) params.append( new Param( "TYPE", "parcel" ) ); + if ( type & Address::Postal ) params.append( new Param( "TYPE", "postal" ) ); + if ( type & Address::Work ) params.append( new Param( "TYPE", "work" ) ); + if ( type & Address::Home ) params.append( new Param( "TYPE", "home" ) ); + if ( type & Address::Pref ) params.append( new Param( "TYPE", "pref" ) ); + cl->setParamList( params ); +} + +void VCardFormatImpl::addGeoValue( VCARD::VCard *vcard, const Geo &geo ) +{ + if ( !geo.isValid() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityGeo ) ); + + GeoValue *v = new GeoValue; + v->setLatitude( geo.latitude() ); + v->setLongitude( geo.longitude() ); + + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::addUTCValue( VCARD::VCard *vcard, const TimeZone &tz ) +{ + if ( !tz.isValid() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityTimeZone ) ); + + UTCValue *v = new UTCValue; + + v->setPositive( tz.offset() >= 0 ); + v->setHour( (tz.offset() / 60) * ( tz.offset() >= 0 ? 1 : -1 ) ); + v->setMinute( (tz.offset() % 60) * ( tz.offset() >= 0 ? 1 : -1 ) ); + + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::addClassValue( VCARD::VCard *vcard, const Secrecy &secrecy ) +{ + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityClass ) ); + + ClassValue *v = new ClassValue; + switch ( secrecy.type() ) { + case Secrecy::Public: + v->setType( (int)ClassValue::Public ); + break; + case Secrecy::Private: + v->setType( (int)ClassValue::Private ); + break; + case Secrecy::Confidential: + v->setType( (int)ClassValue::Confidential ); + break; + } + + cl.setValue( v ); + vcard->add(cl); +} + + +Address VCardFormatImpl::readAddressValue( ContentLine *cl ) +{ + Address a; + AdrValue *v = (AdrValue *)cl->value(); + a.setPostOfficeBox( TQString::fromUtf8( v->poBox() ) ); + a.setExtended( TQString::fromUtf8( v->extAddress() ) ); + a.setStreet( TQString::fromUtf8( v->street() ) ); + a.setLocality( TQString::fromUtf8( v->locality() ) ); + a.setRegion( TQString::fromUtf8( v->region() ) ); + a.setPostalCode( TQString::fromUtf8( v->postCode() ) ); + a.setCountry( TQString::fromUtf8( v->countryName() ) ); + + a.setType( readAddressParam( cl ) ); + + return a; +} + +int VCardFormatImpl::readAddressParam( ContentLine *cl ) +{ + int type = 0; + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "TYPE" ) { + if ( (*it)->value() == "dom" ) type |= Address::Dom; + else if ( (*it)->value() == "intl" ) type |= Address::Intl; + else if ( (*it)->value() == "parcel" ) type |= Address::Parcel; + else if ( (*it)->value() == "postal" ) type |= Address::Postal; + else if ( (*it)->value() == "work" ) type |= Address::Work; + else if ( (*it)->value() == "home" ) type |= Address::Home; + else if ( (*it)->value() == "pref" ) type |= Address::Pref; + } + } + return type; +} + +void VCardFormatImpl::addNValue( VCARD::VCard *vcard, const Addressee &a ) +{ + ContentLine cl; + cl.setName(EntityTypeToParamName( EntityN ) ); + NValue *v = new NValue; + v->setFamily( TQString(a.familyName()).utf8() ); + v->setGiven( TQString(a.givenName()).utf8() ); + v->setMiddle( TQString(a.additionalName()).utf8() ); + v->setPrefix( TQString(a.prefix()).utf8() ); + v->setSuffix( TQString(a.suffix()).utf8() ); + + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::readNValue( ContentLine *cl, Addressee &a ) +{ + NValue *v = (NValue *)cl->value(); + a.setFamilyName( TQString::fromUtf8( v->family() ) ); + a.setGivenName( TQString::fromUtf8( v->given() ) ); + a.setAdditionalName( TQString::fromUtf8( v->middle() ) ); + a.setPrefix( TQString::fromUtf8( v->prefix() ) ); + a.setSuffix( TQString::fromUtf8( v->suffix() ) ); +} + +void VCardFormatImpl::addTelephoneValue( VCARD::VCard *v, const PhoneNumber &p ) +{ + if ( p.number().isEmpty() ) + return; + + ContentLine cl; + cl.setName(EntityTypeToParamName(EntityTelephone)); + cl.setValue(new TelValue( p.number().utf8() )); + + ParamList params; + if( p.type() & PhoneNumber::Home ) params.append( new Param( "TYPE", "home" ) ); + if( p.type() & PhoneNumber::Work ) params.append( new Param( "TYPE", "work" ) ); + if( p.type() & PhoneNumber::Msg ) params.append( new Param( "TYPE", "msg" ) ); + if( p.type() & PhoneNumber::Pref ) params.append( new Param( "TYPE", "pref" ) ); + if( p.type() & PhoneNumber::Voice ) params.append( new Param( "TYPE", "voice" ) ); + if( p.type() & PhoneNumber::Fax ) params.append( new Param( "TYPE", "fax" ) ); + if( p.type() & PhoneNumber::Cell ) params.append( new Param( "TYPE", "cell" ) ); + if( p.type() & PhoneNumber::Video ) params.append( new Param( "TYPE", "video" ) ); + if( p.type() & PhoneNumber::Bbs ) params.append( new Param( "TYPE", "bbs" ) ); + if( p.type() & PhoneNumber::Modem ) params.append( new Param( "TYPE", "modem" ) ); + if( p.type() & PhoneNumber::Car ) params.append( new Param( "TYPE", "car" ) ); + if( p.type() & PhoneNumber::Isdn ) params.append( new Param( "TYPE", "isdn" ) ); + if( p.type() & PhoneNumber::Pcs ) params.append( new Param( "TYPE", "pcs" ) ); + if( p.type() & PhoneNumber::Pager ) params.append( new Param( "TYPE", "pager" ) ); + cl.setParamList( params ); + + v->add(cl); +} + +PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl ) +{ + PhoneNumber p; + TelValue *value = (TelValue *)cl->value(); + p.setNumber( TQString::fromUtf8( value->asString() ) ); + + int type = 0; + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "TYPE" ) { + if ( (*it)->value() == "home" ) type |= PhoneNumber::Home; + else if ( (*it)->value() == "work" ) type |= PhoneNumber::Work; + else if ( (*it)->value() == "msg" ) type |= PhoneNumber::Msg; + else if ( (*it)->value() == "pref" ) type |= PhoneNumber::Pref; + else if ( (*it)->value() == "voice" ) type |= PhoneNumber::Voice; + else if ( (*it)->value() == "fax" ) type |= PhoneNumber::Fax; + else if ( (*it)->value() == "cell" ) type |= PhoneNumber::Cell; + else if ( (*it)->value() == "video" ) type |= PhoneNumber::Video; + else if ( (*it)->value() == "bbs" ) type |= PhoneNumber::Bbs; + else if ( (*it)->value() == "modem" ) type |= PhoneNumber::Modem; + else if ( (*it)->value() == "car" ) type |= PhoneNumber::Car; + else if ( (*it)->value() == "isdn" ) type |= PhoneNumber::Isdn; + else if ( (*it)->value() == "pcs" ) type |= PhoneNumber::Pcs; + else if ( (*it)->value() == "pager" ) type |= PhoneNumber::Pager; + } + } + p.setType( type ); + + return p; +} + +TQString VCardFormatImpl::readTextValue( ContentLine *cl ) +{ + VCARD::Value *value = cl->value(); + if ( value ) { + return TQString::fromUtf8( value->asString() ); + } else { + kdDebug(5700) << "No value: " << cl->asString() << endl; + return TQString::null; + } +} + +TQDate VCardFormatImpl::readDateValue( ContentLine *cl ) +{ + DateValue *dateValue = (DateValue *)cl->value(); + if ( dateValue ) + return dateValue->qdate(); + else + return TQDate(); +} + +TQDateTime VCardFormatImpl::readDateTimeValue( ContentLine *cl ) +{ + DateValue *dateValue = (DateValue *)cl->value(); + if ( dateValue ) + return dateValue->qdt(); + else + return TQDateTime(); +} + +Geo VCardFormatImpl::readGeoValue( ContentLine *cl ) +{ + GeoValue *geoValue = (GeoValue *)cl->value(); + if ( geoValue ) { + Geo geo( geoValue->latitude(), geoValue->longitude() ); + return geo; + } else + return Geo(); +} + +TimeZone VCardFormatImpl::readUTCValue( ContentLine *cl ) +{ + UTCValue *utcValue = (UTCValue *)cl->value(); + if ( utcValue ) { + TimeZone tz; + tz.setOffset(((utcValue->hour()*60)+utcValue->minute())*(utcValue->positive() ? 1 : -1)); + return tz; + } else + return TimeZone(); +} + +Secrecy VCardFormatImpl::readClassValue( ContentLine *cl ) +{ + ClassValue *classValue = (ClassValue *)cl->value(); + if ( classValue ) { + Secrecy secrecy; + switch ( classValue->type() ) { + case ClassValue::Public: + secrecy.setType( Secrecy::Public ); + break; + case ClassValue::Private: + secrecy.setType( Secrecy::Private ); + break; + case ClassValue::Confidential: + secrecy.setType( Secrecy::Confidential ); + break; + } + + return secrecy; + } else + return Secrecy(); +} + +void VCardFormatImpl::addKeyValue( VCARD::VCard *vcard, const Key &key ) +{ + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityKey ) ); + + ParamList params; + if ( key.isBinary() ) { + cl.setValue( new TextValue( KCodecs::base64Encode( key.binaryData() ) ) ); + params.append( new Param( "ENCODING", "b" ) ); + } else { + cl.setValue( new TextValue( key.textData().utf8() ) ); + } + + switch ( key.type() ) { + case Key::X509: + params.append( new Param( "TYPE", "X509" ) ); + break; + case Key::PGP: + params.append( new Param( "TYPE", "PGP" ) ); + break; + case Key::Custom: + params.append( new Param( "TYPE", key.customTypeString().utf8() ) ); + break; + } + + cl.setParamList( params ); + vcard->add( cl ); +} + +Key VCardFormatImpl::readKeyValue( VCARD::ContentLine *cl ) +{ + Key key; + bool isBinary = false; + TextValue *v = (TextValue *)cl->value(); + + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) + isBinary = true; + if ( (*it)->name() == "TYPE" ) { + if ( (*it)->value().isEmpty() ) + continue; + if ( (*it)->value() == "X509" ) + key.setType( Key::X509 ); + else if ( (*it)->value() == "PGP" ) + key.setType( Key::PGP ); + else { + key.setType( Key::Custom ); + key.setCustomTypeString( TQString::fromUtf8( (*it)->value() ) ); + } + } + } + + + if ( isBinary ) { + TQByteArray data; + KCodecs::base64Decode( v->asString().stripWhiteSpace(), data ); + key.setBinaryData( data ); + } else { + key.setTextData( TQString::fromUtf8( v->asString() ) ); + } + + return key; +} + + +void VCardFormatImpl::addAgentValue( VCARD::VCard *vcard, const Agent &agent ) +{ + if ( agent.isIntern() && !agent.addressee() ) + return; + + if ( !agent.isIntern() && agent.url().isEmpty() ) + return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityAgent ) ); + + ParamList params; + if ( agent.isIntern() ) { + TQString vstr; + Addressee *addr = agent.addressee(); + if ( addr ) { + writeToString( (*addr), vstr ); + vstr.replace( ":", "\\:" ); + vstr.replace( ",", "\\," ); + vstr.replace( ";", "\\;" ); + vstr.replace( "\r\n", "\\n" ); + cl.setValue( new TextValue( vstr.utf8() ) ); + } else + return; + } else { + cl.setValue( new TextValue( agent.url().utf8() ) ); + params.append( new Param( "VALUE", "uri" ) ); + } + + cl.setParamList( params ); + vcard->add( cl ); +} + +Agent VCardFormatImpl::readAgentValue( VCARD::ContentLine *cl ) +{ + Agent agent; + bool isIntern = true; + TextValue *v = (TextValue *)cl->value(); + + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "VALUE" && (*it)->value() == "uri" ) + isIntern = false; + } + + if ( isIntern ) { + TQString vstr = TQString::fromUtf8( v->asString() ); + vstr.replace( "\\n", "\r\n" ); + vstr.replace( "\\:", ":" ); + vstr.replace( "\\,", "," ); + vstr.replace( "\\;", ";" ); + Addressee *addr = new Addressee; + readFromString( vstr, *addr ); + agent.setAddressee( addr ); + } else { + agent.setUrl( TQString::fromUtf8( v->asString() ) ); + } + + return agent; +} + +void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType type, const Picture &pic, const Addressee &addr, bool intern ) +{ + ContentLine cl; + cl.setName( EntityTypeToParamName( type ) ); + + if ( pic.isIntern() && pic.data().isNull() ) + return; + + if ( !pic.isIntern() && pic.url().isEmpty() ) + return; + + ParamList params; + if ( pic.isIntern() ) { + TQImage img = pic.data(); + if ( intern ) { // only for vCard export we really write the data inline + TQByteArray data; + TQDataStream s( data, IO_WriteOnly ); + s.setVersion( 4 ); // to produce valid png files + s << img; + cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); + } else { // save picture in cache + TQString dir; + if ( type == EntityPhoto ) + dir = "photos"; + if ( type == EntityLogo ) + dir = "logos"; + + img.save( locateLocal( "data", "tdeabc/" + dir + "/" + addr.uid() ), pic.type().utf8() ); + cl.setValue( new TextValue( "<dummy>" ) ); + } + params.append( new Param( "ENCODING", "b" ) ); + if ( !pic.type().isEmpty() ) + params.append( new Param( "TYPE", pic.type().utf8() ) ); + } else { + cl.setValue( new TextValue( pic.url().utf8() ) ); + params.append( new Param( "VALUE", "uri" ) ); + } + + cl.setParamList( params ); + vcard->add( cl ); +} + +Picture VCardFormatImpl::readPictureValue( VCARD::ContentLine *cl, VCARD::EntityType type, const Addressee &addr ) +{ + Picture pic; + bool isInline = false; + TQString picType; + TextValue *v = (TextValue *)cl->value(); + + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) + isInline = true; + if ( (*it)->name() == "TYPE" && !(*it)->value().isEmpty() ) + picType = TQString::fromUtf8( (*it)->value() ); + } + + if ( isInline ) { + TQImage img; + if ( v->asString() == "<dummy>" ) { // no picture inline stored => picture is in cache + TQString dir; + if ( type == EntityPhoto ) + dir = "photos"; + if ( type == EntityLogo ) + dir = "logos"; + + img.load( locateLocal( "data", "tdeabc/" + dir + "/" + addr.uid() ) ); + } else { + TQByteArray data; + KCodecs::base64Decode( v->asString(), data ); + img.loadFromData( data ); + } + pic.setData( img ); + pic.setType( picType ); + } else { + pic.setUrl( TQString::fromUtf8( v->asString() ) ); + } + + return pic; +} + +void VCardFormatImpl::addSoundValue( VCARD::VCard *vcard, const Sound &sound, const Addressee &addr, bool intern ) +{ + ContentLine cl; + cl.setName( EntityTypeToParamName( EntitySound ) ); + + if ( sound.isIntern() && sound.data().isNull() ) + return; + + if ( !sound.isIntern() && sound.url().isEmpty() ) + return; + + ParamList params; + if ( sound.isIntern() ) { + TQByteArray data = sound.data(); + if ( intern ) { // only for vCard export we really write the data inline + cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); + } else { // save sound in cache + TQFile file( locateLocal( "data", "tdeabc/sounds/" + addr.uid() ) ); + if ( file.open( IO_WriteOnly ) ) { + file.writeBlock( data ); + } + cl.setValue( new TextValue( "<dummy>" ) ); + } + params.append( new Param( "ENCODING", "b" ) ); + } else { + cl.setValue( new TextValue( sound.url().utf8() ) ); + params.append( new Param( "VALUE", "uri" ) ); + } + + cl.setParamList( params ); + vcard->add( cl ); +} + +Sound VCardFormatImpl::readSoundValue( VCARD::ContentLine *cl, const Addressee &addr ) +{ + Sound sound; + bool isInline = false; + TextValue *v = (TextValue *)cl->value(); + + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) + isInline = true; + } + + if ( isInline ) { + TQByteArray data; + if ( v->asString() == "<dummy>" ) { // no sound inline stored => sound is in cache + TQFile file( locateLocal( "data", "tdeabc/sounds/" + addr.uid() ) ); + if ( file.open( IO_ReadOnly ) ) { + data = file.readAll(); + file.close(); + } + } else { + KCodecs::base64Decode( v->asString(), data ); + } + sound.setData( data ); + } else { + sound.setUrl( TQString::fromUtf8( v->asString() ) ); + } + + return sound; +} + +bool VCardFormatImpl::readFromString( const TQString &vcard, Addressee &addressee ) +{ + VCardEntity e( vcard.utf8() ); + VCardListIterator it( e.cardList() ); + + if ( it.current() ) { + VCARD::VCard v(*it.current()); + loadAddressee( addressee, v ); + return true; + } + + return false; +} + +bool VCardFormatImpl::writeToString( const Addressee &addressee, TQString &vcard ) +{ + VCardEntity vcards; + VCardList vcardlist; + vcardlist.setAutoDelete( true ); + + VCARD::VCard *v = new VCARD::VCard; + + saveAddressee( addressee, v, true ); + + vcardlist.append( v ); + vcards.setCardList( vcardlist ); + vcard = TQString::fromUtf8( vcards.asString() ); + + return true; +} diff --git a/tdeabc/vcardformatimpl.h b/tdeabc/vcardformatimpl.h new file mode 100644 index 000000000..78c466a86 --- /dev/null +++ b/tdeabc/vcardformatimpl.h @@ -0,0 +1,106 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_VCARDFORMATIMPL_H +#define KABC_VCARDFORMATIMPL_H + +#include <tqstring.h> +#include <tqfile.h> + +#include "address.h" +#include "addressee.h" + +#ifdef __CYGWIN__ +#include <vcard/include/VCard.h> +#else +#include <VCard.h> +#endif + +namespace KABC { + +class AddressBook; + +/** + @deprecated use VCardFormatPlugin instead. + */ +class KABC_EXPORT_DEPRECATED VCardFormatImpl +{ + public: + bool load( Addressee &, TQFile *file ); + bool loadAll( AddressBook *, Resource *, TQFile *file ); + void save( const Addressee &, TQFile *file ); + void saveAll( AddressBook *, Resource *, TQFile *file ); + + bool readFromString( const TQString &vcard, Addressee &addr ); + bool writeToString( const Addressee &addressee, TQString &vcard ); + + protected: + bool loadAddressee( Addressee &, VCARD::VCard & ); + void saveAddressee( const Addressee &, VCARD::VCard *, bool intern ); + + void addTextValue (VCARD::VCard *, VCARD::EntityType, const TQString & ); + TQString readTextValue( VCARD::ContentLine * ); + + void addDateValue( VCARD::VCard *, VCARD::EntityType, const TQDate & ); + TQDate readDateValue( VCARD::ContentLine * ); + + void addDateTimeValue( VCARD::VCard *, VCARD::EntityType, const TQDateTime & ); + TQDateTime readDateTimeValue( VCARD::ContentLine * ); + + void addAddressValue( VCARD::VCard *, const Address & ); + Address readAddressValue( VCARD::ContentLine * ); + + void addLabelValue( VCARD::VCard *, const Address & ); + + void addTelephoneValue( VCARD::VCard *, const PhoneNumber & ); + PhoneNumber readTelephoneValue( VCARD::ContentLine * ); + + void addNValue( VCARD::VCard *, const Addressee & ); + void readNValue( VCARD::ContentLine *, Addressee & ); + + void addCustomValue( VCARD::VCard *, const TQString & ); + + void addAddressParam( VCARD::ContentLine *, int ); + int readAddressParam( VCARD::ContentLine * ); + + void addGeoValue( VCARD::VCard *, const Geo & ); + Geo readGeoValue( VCARD::ContentLine * ); + + void addUTCValue( VCARD::VCard *, const TimeZone & ); + TimeZone readUTCValue( VCARD::ContentLine * ); + + void addClassValue( VCARD::VCard *, const Secrecy & ); + Secrecy readClassValue( VCARD::ContentLine * ); + + void addKeyValue( VCARD::VCard *, const Key & ); + Key readKeyValue( VCARD::ContentLine * ); + + void addPictureValue( VCARD::VCard *, VCARD::EntityType, const Picture &, const Addressee &, bool ); + Picture readPictureValue( VCARD::ContentLine *, VCARD::EntityType, const Addressee &addr ); + + void addSoundValue( VCARD::VCard *, const Sound &, const Addressee &, bool ); + Sound readSoundValue( VCARD::ContentLine *, const Addressee &addr ); + + void addAgentValue( VCARD::VCard *, const Agent & ); + Agent readAgentValue( VCARD::ContentLine * ); +}; + +} +#endif diff --git a/tdeabc/vcardformatplugin.cpp b/tdeabc/vcardformatplugin.cpp new file mode 100644 index 000000000..6194cd0fe --- /dev/null +++ b/tdeabc/vcardformatplugin.cpp @@ -0,0 +1,120 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 <tqfile.h> + +#include "address.h" +#include "addressee.h" +#include "vcardconverter.h" + +#include "vcardformatplugin.h" + +using namespace KABC; + +VCardFormatPlugin::VCardFormatPlugin() +{ +} + +VCardFormatPlugin::~VCardFormatPlugin() +{ +} + +bool VCardFormatPlugin::load( Addressee &addressee, TQFile *file ) +{ + TQString data; + + TQTextStream t( file ); + t.setEncoding( TQTextStream::Latin1 ); + data = t.read(); + + VCardConverter converter; + Addressee::List l = converter.parseVCards( data ); + + if ( ! l.first().isEmpty() ) { + addressee = l.first(); + return true; + } + + return false; +} + +bool VCardFormatPlugin::loadAll( AddressBook*, Resource *resource, TQFile *file ) +{ + TQString data; + + TQTextStream t( file ); + t.setEncoding( TQTextStream::Latin1 ); + data = t.read(); + + VCardConverter converter; + + Addressee::List l = converter.parseVCards( data ); + + Addressee::List::iterator itr; + for ( itr = l.begin(); itr != l.end(); ++itr) { + Addressee addressee = *itr; + addressee.setResource( resource ); + addressee.setChanged( false ); + resource->insertAddressee( addressee ); + } + + return true; +} + +void VCardFormatPlugin::save( const Addressee &addressee, TQFile *file ) +{ + VCardConverter converter ; + Addressee::List vcardlist; + + + vcardlist.append( addressee ); + + TQTextStream t( file ); + t.setEncoding( TQTextStream::UnicodeUTF8 ); + t << converter.createVCards( vcardlist ); +} + +void VCardFormatPlugin::saveAll( AddressBook*, Resource *resource, TQFile *file ) +{ + VCardConverter converter; + Addressee::List vcardlist; + + Resource::Iterator it; + for ( it = resource->begin(); it != resource->end(); ++it ) { + (*it).setChanged( false ); + vcardlist.append( *it ); + } + + TQTextStream t( file ); + t.setEncoding( TQTextStream::UnicodeUTF8 ); + t << converter.createVCards( vcardlist ); +} + +bool VCardFormatPlugin::checkFormat( TQFile *file ) const +{ + TQString line; + + file->readLine( line, 1024 ); + line = line.stripWhiteSpace(); + if ( line == "BEGIN:VCARD" ) + return true; + else + return false; +} diff --git a/tdeabc/vcardformatplugin.h b/tdeabc/vcardformatplugin.h new file mode 100644 index 000000000..5ac7e49c2 --- /dev/null +++ b/tdeabc/vcardformatplugin.h @@ -0,0 +1,56 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher <schumacher@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 KABC_VCARDFORMATPLUGIN_H +#define KABC_VCARDFORMATPLUGIN_H + +#include "formatplugin.h" + +namespace KABC { + +class AddressBook; +class Addressee; + +/** + @short Interface of vCard backend for address book. + + This class implements the file format interface of address book entries for + the vCard format. +*/ +class KABC_EXPORT VCardFormatPlugin : public FormatPlugin +{ + public: + VCardFormatPlugin(); + virtual ~VCardFormatPlugin(); + + bool load( Addressee &, TQFile *file ); + bool loadAll( AddressBook *, Resource *, TQFile *file ); + void save( const Addressee &, TQFile *file ); + void saveAll( AddressBook *, Resource *, TQFile *file ); + + bool checkFormat( TQFile *file ) const; + + private: + struct VCardFormatPrivate; + VCardFormatPrivate *d; +}; + +} +#endif diff --git a/tdeabc/vcardparser/CMakeLists.txt b/tdeabc/vcardparser/CMakeLists.txt new file mode 100644 index 000000000..2c6fa112a --- /dev/null +++ b/tdeabc/vcardparser/CMakeLists.txt @@ -0,0 +1,40 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdecore +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + vcard.h vcardline.h vcardparser.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### vcards #################################### + +set( target vcards ) + +set( ${target}_SRCS + vcard.cpp vcardline.cpp vcardparser.cpp +) + +tde_add_library( ${target} STATIC_PIC + SOURCES ${${target}_SRCS} +) diff --git a/tdeabc/vcardparser/Makefile.am b/tdeabc/vcardparser/Makefile.am new file mode 100644 index 000000000..a855c9756 --- /dev/null +++ b/tdeabc/vcardparser/Makefile.am @@ -0,0 +1,31 @@ +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) + +noinst_LTLIBRARIES = libvcards.la +libvcards_la_SOURCES = vcard.cpp vcardline.cpp vcardparser.cpp + +vcardsincludedir = $(includedir)/kabc +vcardsinclude_HEADERS = vcard.h vcardline.h vcardparser.h + +check_PROGRAMS = testread testwrite testread2 + +testread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testread_LDADD = libvcards.la $(top_builddir)/tdeabc/libkabc.la +testread_SOURCES = testread.cpp + +testread2_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testread2_LDADD = libvcards.la $(top_builddir)/tdeabc/libkabc.la +testread2_SOURCES = testread2.cpp testutils.cpp + +testwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testwrite_LDADD = libvcards.la $(top_builddir)/tdeabc/libkabc.la +testwrite_SOURCES = testwrite.cpp + +TESTFILES = vcard1.vcf vcard2.vcf vcard3.vcf vcard4.vcf vcard6.vcf vcard7.vcf + +check-local: testread + rm -f FAILED; \ + for i in $(TESTFILES); \ + do perl $(top_srcdir)/tdeabc/vcardparser/checkvcard.pl \ + $(top_srcdir)/tdeabc/vcardparser/tests/$$i; \ + done; \ + [ ! -e FAILED ] diff --git a/tdeabc/vcardparser/README.testing b/tdeabc/vcardparser/README.testing new file mode 100644 index 000000000..a7794931d --- /dev/null +++ b/tdeabc/vcardparser/README.testing @@ -0,0 +1,15 @@ +For testing the vcardparser there are some test files and a small testsuite +automatically checking for regressions. The tests directory contains some vCard +files and correpsonding reference output files (with an additional ".ref" +suffix). For running the geression test do "make check". This will compile some +test programs, parse the test files, write them out as vCard again and compare +the output to the reference file. The check fails, if there are unexpected +differences and shows which lines differed. + +For creating a new test put a vCard file to be parsed into the tests directory. +Create a reference file by running "testread" on the test file. It will put out +the parsed data as vCard again on stdout. Carefully check the output, manually +correct any errors and save the result as reference file in the tests directory. +Now add the filename to the TESTFILES variable in Makefile.am and run "make +check". If the check fails adapt the reference file or fix the bugs in the +parser, whatever is appropriate. diff --git a/tdeabc/vcardparser/checkvcard.pl b/tdeabc/vcardparser/checkvcard.pl new file mode 100755 index 000000000..67160ea4a --- /dev/null +++ b/tdeabc/vcardparser/checkvcard.pl @@ -0,0 +1,75 @@ +#!/usr/bin/perl + +if ( @ARGV != 1 ) { + print STDERR "Missing arg: filename\n"; + exit 1; +} + +$file = $ARGV[0]; + +if ( !open( IN, "$file" ) ) { + print STDERR "Unable to open '$file'\n"; + exit 1; +} + +while( <IN> ) { + if (/^VERSION:(.*)$/ ) { + $version = $1; + if ( $version eq "2.1" ) { $options = "--vcard21"; } + } +} + +close IN; + +$ref = "$file.ref"; + +if ( !open( REF, "$ref" ) ) { + print STDERR "Unable to open $ref\n"; + exit 1; +} + +while( <REF> ) { + push @ref, $_; +} + +close REF; + +if ( !open( READ, "./testread $file $options 2> /dev/null |" ) ) { + print STDERR "Unable to open testread\n"; + exit 1; +} + +print "Checking '$file':\n"; + +$gotsomething = 0; +$error = 0; +$i = 0; +while( <READ> ) { + $gotsomething = 1; + $out = $_; + $ref = @ref[$i++]; + + if ( $out ne $ref ) { + if ( $ref =~ /^UID/ && $out =~ /^UID/ ) { next; } + $error++; + print " Expected : $ref"; + print " Parser output : $out"; + } +} + +close READ; + +if ( $gotsomething == 0 ) { + print "\n FAILED: testread didn't output anything\n"; + system "touch FAILED"; + exit 1; +} +if ( $error > 0 ) { + print "\n FAILED: $error errors found.\n"; + system "touch FAILED"; + exit 1; +} else { + print " OK\n"; +} + +exit 0; diff --git a/tdeabc/vcardparser/testread.cpp b/tdeabc/vcardparser/testread.cpp new file mode 100644 index 000000000..fd3524b56 --- /dev/null +++ b/tdeabc/vcardparser/testread.cpp @@ -0,0 +1,89 @@ +/* + This file is part of libkabc. + + 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 <iostream> +#include <stdlib.h> + +#include <tqfile.h> +#include <tqtextstream.h> + +#include <kprocess.h> +#include <kdebug.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> +#include <tdelocale.h> +#include <tdeaboutdata.h> + +#include "vcardconverter.h" +#include "vcard.h" + +static const TDECmdLineOptions options[] = +{ + {"vcard21", I18N_NOOP("vCard 2.1"), 0}, + {"+inputfile", I18N_NOOP("Input file"), 0}, + TDECmdLineLastOption +}; + +int main( int argc, char **argv ) +{ + TDEApplication::disableAutoDcopRegistration(); + + TDEAboutData aboutData( "testread", "vCard test reader", "0.1" ); + aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); + + TDECmdLineArgs::init( argc, argv, &aboutData ); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app( false, false ); + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + if ( args->count() != 1 ) { + std::cerr << "Missing argument" << std::endl; + return 1; + } + + TQString inputFile( args->arg( 0 ) ); + + TQFile file( inputFile ); + if ( !file.open( IO_ReadOnly ) ) { + tqDebug( "Unable to open file '%s' for reading!", file.name().latin1() ); + return 1; + } + + TQString text; + + TQTextStream s( &file ); + s.setEncoding( TQTextStream::Latin1 ); + text = s.read(); + file.close(); + + KABC::VCardConverter converter; + KABC::Addressee::List list = converter.parseVCards( text ); + + if ( args->isSet( "vcard21" ) ) { + text = converter.createVCards( list, KABC::VCardConverter::v2_1 ); // uses version 2.1 + } else { + text = converter.createVCards( list ); // uses version 3.0 + } + + std::cout << text.utf8(); + + return 0; +} diff --git a/tdeabc/vcardparser/testread2.cpp b/tdeabc/vcardparser/testread2.cpp new file mode 100644 index 000000000..ea278602c --- /dev/null +++ b/tdeabc/vcardparser/testread2.cpp @@ -0,0 +1,42 @@ +#include "testutils.h" +#include <tdeabc/addressee.h> +#include <vcardconverter.h> +#include <kdebug.h> + +using namespace KABC; + +int +main() +{ + Addressee::List l = vCardsAsAddresseeList(); + TQString vcards = vCardsAsText(); + + VCardConverter vct; + + Addressee::List parsed = vct.parseVCards( vcards ); + + if ( l.size() != parsed.size() ) { + kdDebug()<<"\tSize - FAILED : "<<l.size()<<" vs. parsed "<<parsed.size()<<endl; + } else { + kdDebug()<<"\tSize - PASSED"<<endl; + } + + Addressee::List::iterator itr1; + Addressee::List::iterator itr2; + for ( itr1 = l.begin(), itr2 = parsed.begin(); + itr1 != l.end(); ++itr1, ++itr2 ) { + if ( (*itr1).fullEmail() == (*itr2).fullEmail() && + (*itr1).organization() == (*itr2).organization() && + (*itr1).phoneNumbers() == (*itr2).phoneNumbers() && + (*itr1).emails() == (*itr2).emails() && + (*itr1).role() == (*itr2).role() ) { + kdDebug()<<"\tAddressee - PASSED"<<endl; + kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl; + } else { + kdDebug()<<"\tAddressee - FAILED"<<endl; + (*itr1).dump(); + (*itr2).dump(); + //kdDebug()<<"\t\t"<< (*itr1).fullEmail() << " VS. " << (*itr2).fullEmail()<<endl; + } + } +} diff --git a/tdeabc/vcardparser/tests/vcard1.vcf b/tdeabc/vcardparser/tests/vcard1.vcf new file mode 100644 index 000000000..2c77b094c --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard1.vcf @@ -0,0 +1,13 @@ +BEGIN:vCard +VERSION:3.0 +FN:Frank Dawson +ORG:Lotus Development Corporation +ADR;TYPE=WORK,POSTAL,PARCEL:;;6544 Battleford Drive + ;Raleigh;NC;27613-3502;U.S.A. +TEL;TYPE=VOICE,MSG,WORK:+1-919-676-9515 +TEL;TYPE=FAX,WORK:+1-919-676-9564 +EMAIL;TYPE=INTERNET,PREF:Frank_Dawson@Lotus.com +EMAIL;TYPE=INTERNET:fdawson@earthlink.net +URL:http://home.earthlink.net/~fdawson +END:vCard + diff --git a/tdeabc/vcardparser/tests/vcard1.vcf.ref b/tdeabc/vcardparser/tests/vcard1.vcf.ref new file mode 100644 index 000000000..073a7f31d --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard1.vcf.ref @@ -0,0 +1,15 @@ +BEGIN:VCARD +ADR;TYPE=parcel;TYPE=postal;TYPE=work:;;6544 Battleford Drive;Raleigh;NC;27 + 613-3502;U.S.A. +EMAIL;TYPE=PREF:Frank_Dawson@Lotus.com +EMAIL:fdawson@earthlink.net +FN:Frank Dawson +N:;;;; +ORG:Lotus Development Corporation +TEL;TYPE=MSG;TYPE=VOICE;TYPE=WORK:+1-919-676-9515 +TEL;TYPE=FAX;TYPE=WORK:+1-919-676-9564 +UID:gDVbA6LY3t +URL:http://home.earthlink.net/~fdawson +VERSION:3.0 +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard2.vcf b/tdeabc/vcardparser/tests/vcard2.vcf new file mode 100644 index 000000000..a4136b1b8 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard2.vcf @@ -0,0 +1,11 @@ +BEGIN:vCard +VERSION:3.0 +FN:Tim Howes +ORG:Netscape Communications Corp. +ADR;TYPE=WORK:;;501 E. Middlefield Rd.;Mountain View; + CA; 94043;U.S.A. +TEL;TYPE=VOICE,MSG,WORK:+1-415-937-3419 +TEL;TYPE=FAX,WORK:+1-415-528-4164 +EMAIL;TYPE=INTERNET:howes@netscape.com +END:vCard + diff --git a/tdeabc/vcardparser/tests/vcard2.vcf.ref b/tdeabc/vcardparser/tests/vcard2.vcf.ref new file mode 100644 index 000000000..55151c797 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard2.vcf.ref @@ -0,0 +1,12 @@ +BEGIN:VCARD +ADR;TYPE=work:;;501 E. Middlefield Rd.;Mountain View;CA; 94043;U.S.A. +EMAIL:howes@netscape.com +FN:Tim Howes +N:;;;; +ORG:Netscape Communications Corp. +TEL;TYPE=MSG;TYPE=VOICE;TYPE=WORK:+1-415-937-3419 +TEL;TYPE=FAX;TYPE=WORK:+1-415-528-4164 +UID:1UgvYejJMs +VERSION:3.0 +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard3.vcf b/tdeabc/vcardparser/tests/vcard3.vcf new file mode 100644 index 000000000..f3f649784 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard3.vcf @@ -0,0 +1,11 @@ +begin:vcard +n:geiser;ian +x-mozilla-html:FALSE +org:Source eXtreme +version:2.1 +email;internet:geiseri@yahoo.com +title:VP of Engineering +x-mozilla-cpt:;0 +fn:ian geiser +end:vcard + diff --git a/tdeabc/vcardparser/tests/vcard3.vcf.ref b/tdeabc/vcardparser/tests/vcard3.vcf.ref new file mode 100644 index 000000000..c91351769 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard3.vcf.ref @@ -0,0 +1,12 @@ +BEGIN:VCARD +EMAIL:geiseri@yahoo.com +FN:ian geiser +N:geiser;ian;;; +ORG:Source eXtreme +TITLE:VP of Engineering +UID:ebvq9Wo9rO +VERSION:3.0 +X-mozilla-cpt:;0 +X-mozilla-html:FALSE +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard4.vcf b/tdeabc/vcardparser/tests/vcard4.vcf new file mode 100644 index 000000000..7152ceb05 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard4.vcf @@ -0,0 +1,14 @@ +BEGIN:VCARD +X-EVOLUTION-FILE-AS:Ximian, Inc. +FN +N: +LABEL;QUOTED-PRINTABLE;WORK:401 Park Drive 3 West=0ABoston, MA 02215=0AUSA +TEL;WORK;VOICE:(617) 236-0442 +TEL;WORK;FAX:(617) 236-8630 +EMAIL;INTERNET:hello@ximian.com +URL:www.ximian.com/ +ORG:Ximian, Inc. +NOTE:Welcome to the Ximian Addressbook. +UID:pas-id-3E136F9B00000000 +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard4.vcf.ref b/tdeabc/vcardparser/tests/vcard4.vcf.ref new file mode 100644 index 000000000..fc3b7a500 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard4.vcf.ref @@ -0,0 +1,14 @@ +BEGIN:VCARD +EMAIL:hello@ximian.com +LABEL;TYPE=work:401 Park Drive 3 West\nBoston\, MA 02215\nUSA +N:;;;; +NOTE:Welcome to the Ximian Addressbook. +ORG:Ximian\, Inc. +TEL;TYPE=VOICE;TYPE=WORK:(617) 236-0442 +TEL;TYPE=FAX;TYPE=WORK:(617) 236-8630 +UID:pas-id-3E136F9B00000000 +URL:www.ximian.com/ +VERSION:3.0 +X-EVOLUTION-FILE-AS:Ximian\, Inc. +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard5.vcf b/tdeabc/vcardparser/tests/vcard5.vcf new file mode 100644 index 000000000..957a1e552 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard5.vcf @@ -0,0 +1,313 @@ +BEGIN:VCARD +ADR;TYPE=home;TYPE=pref:;;Buehlauer Strasse 45;Dresden;Sachsen;01327;German + y +ADR;TYPE=work:;;Prager Strasse 55;Dresden;Sachsen;01066;Germany +BDAY:1955-07-19T00:00:00Z +CATEGORIES:Friend +CLASS:CONFIDENTIAL +EMAIL;TYPE=PREF:heiko.mustermann@freenet.org +EMAIL:heiko8@tst.inf.tu-dresden.de +FN:Mustermann, Heiko +GEO:19.283333;166.616669 +LOGO;ENCODING=b;TYPE=image/png:iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVU + AAAOW0lEQVR4nO1df2hb1xX+OlyQwQEJXJAgBQlaiEwDsdqO2l1H47RjMe2gbjOoszG2dozG7aC + YMIqTjS7NYKSmbE1StsQpWxMXmsSF1WhlTeSwJlZY06gsSVXWUAkakKAGPajBDxrQ/jjnez8k27 + EjJdyU+/0jPz29X9L57jnnO+deAxYWFhYWFhYWFu3Hbe082XT2ZF3+WgAAdHZ0AgBqTg0A4H7DT + 7oAgNSdKQDAg99/sK33caPB53RqFQBA5PYIAMBdkOf6yc9+ct3P852W786irWjJMs/8+0wdACpV + sZTS50V5vSLb1UoVQMCCvnFDx0c65f3BHw4CABJ3RL19mwYfM4Y1e/+0V5h/VbbPXzwPACiVSgA + A15XnikVjAIB44Dli3TIKjL+2e0XPYxliGFZshSdzZ+r8OyKGjdl8AQCQfe84AKBaFUaUrojlRL + vEUpx5h0eGjo9EZH+kQ7Yz9/d71+vdkAYApO+W16d+/NQNZ8ye8T11ACiV5TkcR5jufCX3XyrLc + 9XmxUe6bvi5XH3OaNRnSKRL9vWsywAAstNTyz6HZYhhsD+IYbjmMPDxfz6uA0BMqQcAR96eAgBM + vSevtTkJa6tzQnVSNn2XOLSZ03ljHHQ7MLxlSIa2kg5pOrTVHHHu/hANRDrke4t2y3cy+KgEMPs + P7F/0O7EMMQzXtNxLn16qA8DUu1nvvcm3DgEAFlxxbo4jFpFYK4woXix8qxhxLYxuH6sDQG5Gvq + NSueLtcxwdNTTASemoUTi3+HdkGWIYlrTkj2clzC1ckGRv3xv7vH2VK7QAlUDuktA0f/bG+YpL5 + 4WpDDXv7TdPbjm472AdACbe9L+r4mdMHuW+42uTAIByuWwZciugY6kdER3zzn8iMkFt3pc93Kvy + d0QzvHYxI5h8Qq/BiK1YLur78nJw4mBIznj2V88ueg+HjxyrA0BEdE7EumLePp773u/e25b7jyb + kfAObh7z3SleELS40SVZ/u+2F0ToA7H99PHRtyxDD0GQZZ9RKKxUZ+/YdmAAAFD4peJ9hbF2dq7 + aHGSpn12p+dJI7PQsAcDS3YcxfmZPXnrt65F40P+pd3wsgwF69x/xHedlWNkfX+PlUep0ck0omA + ACxO+R10w82tfRch8leAJOas82ek+cho/sfkGtnT8xYhpiMJh9CiytVZayjYIgO37KCmWgrOPy3 + w3UAKKpsf/zd496+wkVhpOu5Lje0XS6X9X5lbJ49KxZIJqSSEu+Xrsj9V1Xw5OcBIPJBDoCfPw0 + 9IVn0sanpOgA8NXR9JYBILO7/rd8n/RV9SM1tPg6wDDEOTQxhFEKLYjbuBljBX9tjzyox/Q+xQO + crOf7I20cAAIVz+cCnVNJu8Alo3Nb43nEjoSfa8dIOAMDs6Zy+3wcAyM3kvCtUyZ6qXLd0WZj6z + E+fAeAX4FZbYo5Fmt9zXfeanwEsQ4xDE0Nqbi203ZhztANVZUb2PdF+imqZLgLX0OvSd7lLbPO+ + OFan1B8wGotEE3pCYfpWtX4A2L1rZ+gcHN+Pa8EtEpX3mR9tGlieKSf/dVJ9Ysl7j/fhMYTfuDa + ANMIyxDA0Z+r6Qy7MC1Mi3lge1PijTYetBNNTkjUfOjQJAMi+LzE6S7nJtX50krknE74hZQZbij + o19U7eKcfQAKuaP7lam+hRdZXl19kZX7Xe+PBG2acM7YzE9Bpi1UfeFN9G7Y6+77EfLR59UdGtV + X2G8D7IEPrf7PtZq2XdCmhiCBsUYnGxLJfxP5rzkI0Pb6wDwMypmWXHVupOk0eFEfQZIy+MAQB6 + 79OGhnSvd0yk4c5o4c7Xamlrwj7Nqck9uVf5eblGVnONqIY1W38+4h3DyJH1i6j6jFi3+B1GaPm + 8RGFsa9qrqu7zI6KfHXtHmM8KKq8ZfNZg/rMcLEMMQ5NlH/zLwVDz28SbomVRUxI0RDZJZrqici + biYmHFz8Q6cmox6bR8bsfOVwD44ylzH47dgK9lTf5dqpOzZ0V1Hnh0AIDfXMdmO7Zx0h8MaO2aT + JtQf7D16Se9a9CS0+uEofQVmV7ZjqhPmXhrIvQcnV2doeemv6UfIysAeNoVg9TMfdLqZH3ILYIl + x36Oi/v+Knp+/mwhsFfHcR0X2W3Su0Gy4ZrG3tU5GaOHtwhzXv3jqwB8ZgFiaezamFVWAMDO30u + OQAsjfvFL8QHpdFLOoPE8FQXG99UvxecMbhameOrCnB8tbh0WtjA3IZuYl6TXC1PoY/b9eRwAUL + hYDH3emXdD20EwX4p3SzS4VKWQsAwxDPYHMQxLlnDpJNlbSyEO8BvjvDKrJnZFlcxJ+biGkRT6Y + nf45VMAqHypXfMa0uY+8JM2Fpycr+QzfQ+JM0+nhPoMBHit3FFxuHT6FB8rGsYnusWZVsoBAVOH + QzrlkoqlcW1qSyQkOMmsE+c9sk2Gy+d//Xzo+Ago40RD3wsARKMrG6oIyxDDsCRDOAtodLsU44M + d3QtXKcnzLGELoXN7cos4y3jcl0QAYOFrOZ4ySLGooWqgOYBs4XVp+Qw9i2XZX1GyZtIJvQdhRi + Il23S4ntgYSNB67xcWTs2ouDmn97FRrlX6MlzUSt8jo8XQlq0AgMm3J8Ln1OfmnBBg9U2DliGGY + UmGEON7pE1lVNtWAGD2IwlPK1fF6jhziGMxE8eR54QhnWtUatY5hpS5ixfCPmexsDHRLedOeDK6 + YOARsdLxabHqVJIiozbvqQzvsZnvJ33r7dkgfuXQBWHC6NMSIrvqZ+grOTOsX+evPLlZRMlCXsv + GGsZn1osgOt7Q2rMaWIYYhmsyhAj+6tue2ybNZ59ruVfl5k614igL+90NvoNz9LT5jkJgKiVWS5 + 8CAOVSGYAv9FU0eezXaItsHHkkCQBI360RnDKBzODx7iKNGcPa1FCZk3JArZzT53FC5yB4DxGN8 + IY04d3+m+23AcDMqZmma6wWliGGYcUMCWL/G+HJJsNbhkPtPBxrGwv5pcufAgDcrzlPXayX430w + D2GMTx/CQlkqqUzokGO8MpZGUwtagqbASTAScuZ8ATOVlGa7wT6Jnnb/QacTaO4CFR0JFsXiiXj + oGrte3lUHgJ2/29ly46BliGG4LoY0YvLoZMgyjr9zXCKyTrEozuemsEfRjtEZfUq+4MvWjFxojd + ympTNqamq+iKjP8LJlln6VGQGxkj4hpS2lbJYeXC++xZuQpOxjO2hCi3f0lSxVtAOWIYahLQxpB + KXmijJjQed1R9nbptbNAhbbgRBoQYomxAobW0M5jvuWrpGQRj7MyFlsYg6RSDCS863ZnZf3EmuF + VcNPDMv9/FNKsfsPHAoxf/RFmbpWLLBtVa5JNvY90FcHWpueYRliGNrKkC/+90Ud8EucLjR7dtQ + 3qALLaCz7vsT9nO6V7vVXcqBi6jYUqHB7wyvCDWccz6kGpFU1ZqNCENWaKAWOMjZzn8RsbOTDgU + Ohz690vZJWYBliGNr6i1/6r0zM9LQqVXGZI3yqeQjfZ4ae2SCWyaY3QbhldOB7kqHHEuGaSiNe+ + a3UXlh2zeiaKYOPS7nW19uA8dekPB3TXGf0xVEAgXKv1oCok+VOCcs2DbY2oWc5WIYYhrb4kOms + tFgWL0tUlf9QNB0ygcwoXw5XzQY3D9YBIK7M4MQZwM87HM1dSmzP1KgrFgv7joUFNjlwqSF5efV + 1YUHurFj32PYx75gdL+uUhbyuf6UZeq9WFznJv6KqL33fjYRliGFoiSGc0FLUxQW8VsolmsAa4U + VCSRnng1PlqBPFNO/gKnVs76RP6WRuo35q6HHJsqkKsPZOto7v2e1dY+QF8RkDfaqIdZCVmsOo+ + swIjbX/GwnLEMPQEkPatZoomdE47QsAoHX6aDRcm+B4X/K6YbT+oYxg/ZttopzKxsmhgF8zrzR0 + 0bDjhp/l8iL508s3lbcDliGGwf4ghsGIFXWONaxHAvgrDMVUhmGLEfuA4xoiT70rgQQdrteBr6X + bktcoF94G/GY6hrO5U9pipAEAz1mttmfFipXAMsQw3BD5fbVwuJbUGl868UJMXdNEa0eIdocLUJ + wH8souSfI8eV7DYcr2lPqDgUNlPtzKSqawIMXQ+3rn418PLEMMgxE+hNirCxkDQK82SrgqBqY5K + 1eZUanK+94ahrpaUfGCyCCDm0VMpDBImb4SaHKgD/FWFVVmMGFl6Tl3Qgpok0eXXwS5HbAMMQxG + MSSIsZekXNp7v8zKymzo0T26WpHO42MjNxsmGHWx6a6/rz/0uWDBi+coFJRdnDHLiI4rTqxQCmo + HLEMMgxFR1mJgMOQ1YHO7S14b1zQhQ5iHsLXoiM6g9SbTICDPdIRbiLw5kyqpNK72djNgGWIYjG + VIPB5e+cBrauvSdh5tGWKbEHMJFrn6HxDf0bNOfE+Na7cEWaFPT+m+oNMjip9J/pE90Xrz9GphG + WIYjGUIW/zZyMysOcrGuTjXVAwXjbgST0WjKbZ70nXkC77VFy9r/jEXZteC077W0NXCMsQwGJuH + NGJsp+QlfZqXsHWHKi4n1xS0YZvToWc+lPLr+U+k2BSqgV31MnNjvgfLEMNgjGWsFFytiM3WcZW + BOUWgoj6kqv/Ii00RXBm7GljViBFXwaD/d2IZYhiMjbKWgreUhlb3OAFz4CHZz6aGWHd4hTnHFc + WWjeBAeJKpKbAMMQy3HEO45Mfecfl3qNSyuB5iRtt/XP43hK5w3nK+4rcBNa7FZQIsQwyDMdFFq + xh9UZb+6HtIlr1wF8SHFM6JPsVGueDiMzej8W21sAwxDPYHMQy3nFNfCmltrKuWRDrhv0HlUMWV + 8Rrn1JsGyxDDYLS1XA927ZZWooL+MzC29sycuHmNCq3AMsQwfGt8CFHISwEqskbDWwPlkeVgGWJ + xczH20lidTXe3AixDLCwsLCwsviX4P68/8cprSSqmAAAAAElFTkSuQmCC +N:Mustermann;Heiko;;; +NICKNAME:clown +NOTE:I'm a friendly note text,\nplease copy me to your address book... +ORG:KDE +PHOTO;ENCODING=b;TYPE=image/png:iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pV + UAAAOW0lEQVR4nO1df2hb1xX+OlyQwQEJXJAgBQlaiEwDsdqO2l1H47RjMe2gbjOoszG2dozG7a + CYMIqTjS7NYKSmbE1StsQpWxMXmsSF1WhlTeSwJlZY06gsSVXWUAkakKAGPajBDxrQ/jjnez8k2 + 7EjJdyU+/0jPz29X9L57jnnO+deAxYWFhYWFhYWFu3Hbe082XT2ZF3+WgAAdHZ0AgBqTg0A4H7D + T7oAgNSdKQDAg99/sK33caPB53RqFQBA5PYIAMBdkOf6yc9+ct3P852W786irWjJMs/8+0wdACp + VsZTS50V5vSLb1UoVQMCCvnFDx0c65f3BHw4CABJ3RL19mwYfM4Y1e/+0V5h/VbbPXzwPACiVSg + AA15XnikVjAIB44Dli3TIKjL+2e0XPYxliGFZshSdzZ+r8OyKGjdl8AQCQfe84AKBaFUaUrojlR + LvEUpx5h0eGjo9EZH+kQ7Yz9/d71+vdkAYApO+W16d+/NQNZ8ye8T11ACiV5TkcR5jufCX3XyrL + c9XmxUe6bvi5XH3OaNRnSKRL9vWsywAAstNTyz6HZYhhsD+IYbjmMPDxfz6uA0BMqQcAR96eAgB + MvSevtTkJa6tzQnVSNn2XOLSZ03ljHHQ7MLxlSIa2kg5pOrTVHHHu/hANRDrke4t2y3cy+KgEMP + sP7F/0O7EMMQzXtNxLn16qA8DUu1nvvcm3DgEAFlxxbo4jFpFYK4woXix8qxhxLYxuH6sDQG5Gv + qNSueLtcxwdNTTASemoUTi3+HdkGWIYlrTkj2clzC1ckGRv3xv7vH2VK7QAlUDuktA0f/bG+YpL + 54WpDDXv7TdPbjm472AdACbe9L+r4mdMHuW+42uTAIByuWwZciugY6kdER3zzn8iMkFt3pc93Kv + yd0QzvHYxI5h8Qq/BiK1YLur78nJw4mBIznj2V88ueg+HjxyrA0BEdE7EumLePp773u/e25b7jy + bkfAObh7z3SleELS40SVZ/u+2F0ToA7H99PHRtyxDD0GQZZ9RKKxUZ+/YdmAAAFD4peJ9hbF2dq + 7aHGSpn12p+dJI7PQsAcDS3YcxfmZPXnrt65F40P+pd3wsgwF69x/xHedlWNkfX+PlUep0ck0om + AACxO+R10w82tfRch8leAJOas82ek+cho/sfkGtnT8xYhpiMJh9CiytVZayjYIgO37KCmWgrOPy + 3w3UAKKpsf/zd496+wkVhpOu5Lje0XS6X9X5lbJ49KxZIJqSSEu+Xrsj9V1Xw5OcBIPJBDoCfPw + 09IVn0sanpOgA8NXR9JYBILO7/rd8n/RV9SM1tPg6wDDEOTQxhFEKLYjbuBljBX9tjzyox/Q+xQ + OcrOf7I20cAAIVz+cCnVNJu8Alo3Nb43nEjoSfa8dIOAMDs6Zy+3wcAyM3kvCtUyZ6qXLd0WZj6 + zE+fAeAX4FZbYo5Fmt9zXfeanwEsQ4xDE0Nqbi203ZhztANVZUb2PdF+imqZLgLX0OvSd7lLbPO + +OFan1B8wGotEE3pCYfpWtX4A2L1rZ+gcHN+Pa8EtEpX3mR9tGlieKSf/dVJ9Ysl7j/fhMYTfuD + aANMIyxDA0Z+r6Qy7MC1Mi3lge1PijTYetBNNTkjUfOjQJAMi+LzE6S7nJtX50krknE74hZQZbi + jo19U7eKcfQAKuaP7lam+hRdZXl19kZX7Xe+PBG2acM7YzE9Bpi1UfeFN9G7Y6+77EfLR59UdGt + VX2G8D7IEPrf7PtZq2XdCmhiCBsUYnGxLJfxP5rzkI0Pb6wDwMypmWXHVupOk0eFEfQZIy+MAQB + 679OGhnSvd0yk4c5o4c7Xamlrwj7Nqck9uVf5eblGVnONqIY1W38+4h3DyJH1i6j6jFi3+B1GaP + m8RGFsa9qrqu7zI6KfHXtHmM8KKq8ZfNZg/rMcLEMMQ5NlH/zLwVDz28SbomVRUxI0RDZJZrqic + ibiYmHFz8Q6cmox6bR8bsfOVwD44ylzH47dgK9lTf5dqpOzZ0V1Hnh0AIDfXMdmO7Zx0h8MaO2a + TJtQf7D16Se9a9CS0+uEofQVmV7ZjqhPmXhrIvQcnV2doeemv6UfIysAeNoVg9TMfdLqZH3ILYI + lx36Oi/v+Knp+/mwhsFfHcR0X2W3Su0Gy4ZrG3tU5GaOHtwhzXv3jqwB8ZgFiaezamFVWAMDO30 + uOQAsjfvFL8QHpdFLOoPE8FQXG99UvxecMbhameOrCnB8tbh0WtjA3IZuYl6TXC1PoY/b9eRwAU + LhYDH3emXdD20EwX4p3SzS4VKWQsAwxDPYHMQxLlnDpJNlbSyEO8BvjvDKrJnZFlcxJ+biGkRT6 + Ynf45VMAqHypXfMa0uY+8JM2Fpycr+QzfQ+JM0+nhPoMBHit3FFxuHT6FB8rGsYnusWZVsoBAVO + HQzrlkoqlcW1qSyQkOMmsE+c9sk2Gy+d//Xzo+Ago40RD3wsARKMrG6oIyxDDsCRDOAtodLsU44 + Md3QtXKcnzLGELoXN7cos4y3jcl0QAYOFrOZ4ySLGooWqgOYBs4XVp+Qw9i2XZX1GyZtIJvQdhR + iIl23S4ntgYSNB67xcWTs2ouDmn97FRrlX6MlzUSt8jo8XQlq0AgMm3J8Ln1OfmnBBg9U2DliGG + YUmGEON7pE1lVNtWAGD2IwlPK1fF6jhziGMxE8eR54QhnWtUatY5hpS5ixfCPmexsDHRLedOeDK + 6YOARsdLxabHqVJIiozbvqQzvsZnvJ33r7dkgfuXQBWHC6NMSIrvqZ+grOTOsX+evPLlZRMlCXs + vGGsZn1osgOt7Q2rMaWIYYhmsyhAj+6tue2ybNZ59ruVfl5k614igL+90NvoNz9LT5jkJgKiVWS + 58CAOVSGYAv9FU0eezXaItsHHkkCQBI360RnDKBzODx7iKNGcPa1FCZk3JArZzT53FC5yB4DxGN + 8IY04d3+m+23AcDMqZmma6wWliGGYcUMCWL/G+HJJsNbhkPtPBxrGwv5pcufAgDcrzlPXayX430 + wD2GMTx/CQlkqqUzokGO8MpZGUwtagqbASTAScuZ8ATOVlGa7wT6Jnnb/QacTaO4CFR0JFsXiiX + joGrte3lUHgJ2/29ly46BliGG4LoY0YvLoZMgyjr9zXCKyTrEozuemsEfRjtEZfUq+4MvWjFxoj + dympTNqamq+iKjP8LJlln6VGQGxkj4hpS2lbJYeXC++xZuQpOxjO2hCi3f0lSxVtAOWIYahLQxp + BKXmijJjQed1R9nbptbNAhbbgRBoQYomxAobW0M5jvuWrpGQRj7MyFlsYg6RSDCS863ZnZf3Emu + FVcNPDMv9/FNKsfsPHAoxf/RFmbpWLLBtVa5JNvY90FcHWpueYRliGNrKkC/+90Ud8EucLjR7dt + Q3qALLaCz7vsT9nO6V7vVXcqBi6jYUqHB7wyvCDWccz6kGpFU1ZqNCENWaKAWOMjZzn8RsbOTDg + UOhz690vZJWYBliGNr6i1/6r0zM9LQqVXGZI3yqeQjfZ4ae2SCWyaY3QbhldOB7kqHHEuGaSiNe + +a3UXlh2zeiaKYOPS7nW19uA8dekPB3TXGf0xVEAgXKv1oCok+VOCcs2DbY2oWc5WIYYhrb4kOm + stFgWL0tUlf9QNB0ygcwoXw5XzQY3D9YBIK7M4MQZwM87HM1dSmzP1KgrFgv7joUFNjlwqSF5ef + V1YUHurFj32PYx75gdL+uUhbyuf6UZeq9WFznJv6KqL33fjYRliGFoiSGc0FLUxQW8VsolmsAa4 + UVCSRnng1PlqBPFNO/gKnVs76RP6WRuo35q6HHJsqkKsPZOto7v2e1dY+QF8RkDfaqIdZCVmsOo + +swIjbX/GwnLEMPQEkPatZoomdE47QsAoHX6aDRcm+B4X/K6YbT+oYxg/ZttopzKxsmhgF8zrzR + 00bDjhp/l8iL508s3lbcDliGGwf4ghsGIFXWONaxHAvgrDMVUhmGLEfuA4xoiT70rgQQdrteBr6 + XbktcoF94G/GY6hrO5U9pipAEAz1mttmfFipXAMsQw3BD5fbVwuJbUGl868UJMXdNEa0eIdocLU + JwH8souSfI8eV7DYcr2lPqDgUNlPtzKSqawIMXQ+3rn418PLEMMgxE+hNirCxkDQK82SrgqBqY5 + K1eZUanK+94ahrpaUfGCyCCDm0VMpDBImb4SaHKgD/FWFVVmMGFl6Tl3Qgpok0eXXwS5HbAMMQx + GMSSIsZekXNp7v8zKymzo0T26WpHO42MjNxsmGHWx6a6/rz/0uWDBi+coFJRdnDHLiI4rTqxQCm + oHLEMMgxFR1mJgMOQ1YHO7S14b1zQhQ5iHsLXoiM6g9SbTICDPdIRbiLw5kyqpNK72djNgGWIYj + GVIPB5e+cBrauvSdh5tGWKbEHMJFrn6HxDf0bNOfE+Na7cEWaFPT+m+oNMjip9J/pE90Xrz9Gph + GWIYjGUIW/zZyMysOcrGuTjXVAwXjbgST0WjKbZ70nXkC77VFy9r/jEXZteC077W0NXCMsQwGJu + HNGJsp+QlfZqXsHWHKi4n1xS0YZvToWc+lPLr+U+k2BSqgV31MnNjvgfLEMNgjGWsFFytiM3WcZ + WBOUWgoj6kqv/Ii00RXBm7GljViBFXwaD/d2IZYhiMjbKWgreUhlb3OAFz4CHZz6aGWHd4hTnHF + cWWjeBAeJKpKbAMMQy3HEO45Mfecfl3qNSyuB5iRtt/XP43hK5w3nK+4rcBNa7FZQIsQwyDMdFF + qxh9UZb+6HtIlr1wF8SHFM6JPsVGueDiMzej8W21sAwxDPYHMQy3nFNfCmltrKuWRDrhv0HlUMW + V8Rrn1JsGyxDDYLS1XA927ZZWooL+MzC29sycuHmNCq3AMsQwfGt8CFHISwEqskbDWwPlkeVgGW + JxczH20lidTXe3AixDLCwsLCwsviX4P68/8cprSSqmAAAAAElFTkSuQmCC +ROLE:Developer +SOUND;ENCODING=b:UklGRiQgAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAgAA + B/f39/f39/f39/f39/f4B/gH+Af4CAgIGBgYGBgYGBgYGBgYGBgYGBgIGAgICBgYGBgYGBgYCAg + YGAgICAgICAgIGBgICAgYCAgICBgICAgICAgICAgIGAgICAgYCAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAf4CAgICAgICAgICAgICAgIB/f4CAgICAgICAgIB/f4B/f39/f39/f3+AgICAf4CAf3 + 9/gIB/f4CAgH9/gICAgH+AgICAgICAgICAf4CAgIB/gICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgIB/gICAf39/f39/f3+Af4CAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgH9/f39/f39/f39/f39/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgYCAgICB + gICAgYGBgICAgICAgICAgIGAgICBgICBgYGBgYGBgYGAgYGBgYCBgYGBgYGBgYGBgYGBgYGBgYG + BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgICAgYGBgIGBgYGAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYGAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgH+AgICAgICAgICAgICAgICAgICAf4CAgIB/gH+Af4B/f39/f39/f + 39/f39/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgYG + BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgY + GBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAgIGBgYCAgICBgYCAgYGBgYCAgICBg + YCAgICAgICAgICAgICAgIGAgICAgICAgICAgICAgYGBgYGAgICAgIGBgYCAgICBgYGAgICAgIGA + gICAgICAgIGBgYCBgYGAgYGBgYGBgoGBgYGCgoGAgICBgYGBgYCBgYKCgYGBgYGBgYGAgYGBgH9 + /gIB/f3+AgIB/gH9/gICAf4CBgYB/f35+gIB/f4CBgX9/gYCAgYKCgYCAgYOBgICAgoGAf4GCgn + 9/gIB/gICBgH5/f4GAfX+BgYB+fn9/fn+Afn6Af39+f35+fn9+fn6AgH9/f4CAgYCAgYKCgH9/g + IKBf3+AgYJ/f4GCg4F/gIGCgoOBfoCDgYF/fH+BgYGAfn6Af4CCgn58gIN/fX+AgICBgYGAgYCB + goOCgICBgYB/fXyBhIGAgH5+f4GBgX9/f35+gIKCgXt9goN/f318f4GAf4B/fHt9fn5+fXx+fn5 + /gH9+fHx/gHx9f4CAfn18gIB9e4GBfn5+foCBfHyAgoGAfX6CgYCBgH+DgHt9gYN/fX2BhYB7en + 6AgH98foKCgH18foCAfoCAf4CAf31+fn+AgH1+goJ/fX5/gIKAgIGAfH6CgX17foCBf3+BgoB/g + YOBgIB/f4KDgoJ+e3+ChIOBfn1/gX+BfX2BgH59foCCfn1/gX99fICAgoB/f39/gISCf36AgoSB + foCBgYGAf4CCf4CCgX5/gYKDgYB/gH+BhIOBgYB/gIOEhIF9foGCg4OBgICBgoOCgICChIOBg4O + CgoSDgoKAgYKBgoODhISBf4CCg4SEgoGCg4SEgH6BhIWEgX+EhYKAgoKFhIB+gIKChYKAgYOCgo + B+gYWFhIKAg4WEg4ODhIWFhYaGhIWGhYWGh4eHhYOCgoSFg4B/gIB+fX1+fn57e3t7fHt6fH5/f + 4GDhYiMkJGQj5GVmZycmZiXlZGIfXRwcnZ4d3Nva2hoamppaWxvc3R0dXl+iJCPjZShqrCzvNHi + rFYxOmKSrJ6UmJOAbV1ZboSMjI6JfnNjW2JweYGFg4B/e3Z0c3Btc3p9fHp4fIGBf3+Dh4qLjJG + YnZuWkY6MhnpwbnN6fHlya2hlZmdmaW9ycXFzd3t/g42cpquzvMzd/sRADiBZkL6xpLa1jFpANV + iHoJ2ioJWGbEQ2VHaOm5aHhIFuYmZzgoVxZFxfdJCSgnt/kKewr7bDsopcSV6JopyRjpOQfmNXZ + HmGhYB8fXtvXExKXnyKgnJsc3t8fZC0ysfK0+vHTxEeXY6yr6rAxJRSNTdbh5+fp7KjglQ6PVx3 + ho6Ph3dmW15oa2x0hIuNkK3R18jJ0Ys8LUlxkqais8WtdlBFT2yDjpywro9mS0VVaXaBiIdyX2J + rcG5udYKKjaXT4dfV2Y82JkBpiaKkvdO2eE9GTGZ4hZu6u51yTUNOX2l9kZWKdl5PXG93dHeAip + KZut7j2tacRjJIYHCOo77XvoRdVlFYZniVuL+kfl9ST1Rcb4mTjoNxW1pqdXd5fH6CiKHN4d7k2 + 4E4N05Yaoqo1eO0emVbTU5ZdKDCuZV9b1tMSVlyiYp8dHl7cmpqdYCCgIqixNTR2OqnRTlPXFt3 + ksbnw4lzcFdKS2KMtLWZiIZwV0lPZXZ1b3uNinZqbXJ3dX2XxOPg4/zDUDRCTUhmiMXx1p+If1g + +O1J7pK+yspN3W0pGVGdugYmCen54b21rb3V9i6vZ7vD92WpAS0gzSny04tq3qp5qPDhHX3uVrs + KukXVhT0hRYnF/gnuCh31ubG9zdHeMs+Dr8P7KalFVOylJeq7QzMPIqmtIRUZOY4KovqicknhZS + 1BWXWh6gIeLiH91b21vc4GcyuXt/umTZGhGIjJfh6y+yt7LkGlfTD1GYYOipKKwnXhkXldVUFhs + dYOMjYWBem9ucoCWvNTm9+2weHdZMSpQboujvtnUrY6BZEdDUmV4jZypppeFd2dcWVFWWWh8hYS + Ii393c3Z7iJ3A1ePp3aGDfVYyOVZkfJe5zsavpJNsU1BTVmR9kpmcn5uGdGxoWU5VVGZ0fIKLh4 + F/d3Z6g4ufuc3e3depjoViPz9VWm2FqLu8tLGifmphWlJZbH+Lj5+elod+c19WU0xUZW11gISEg + nx6e3h6g4qWp7zM3NrSpZGIYkRFVVVlfZ6vsbW3qIl7b2BUWGVwe4ybn52TkIRuX2BVRVFjZmp7 + hIF9fX12cnZ6eX6LlZyousfP0c++jot6X0ZRXF9sgaCnqa6yn4eAdGZZYGlvd4mcnqCWnY91aWN + cSUtYYmJxf399f351cXFzcHF4foOIlZ+hp7CytLm8uLKNg4RtYF5oanN8j5qZnqGaioV9dGpqb3 + J1f42Rk5iZjIKAcmFcW1RXYGhwdXt+e3Z2c25tcXJxd3yChY2Tl5udn6Gho6ioq6uonoaHbWNzZ + GdxgoGPlZqdj5CJgHFzcWxwdH1/hYqOioSFfnFpaWBdX2Jqb3N5fHh4eHNxcXFxc3d7foOJjI6Q + lZOSlZOTl5eYnJucnpyZkYiEfnd1dnZ5fYKHio6QkIyHg394dHRzc3Z5fHt2enJrcG5obG9sbW9 + ucHJzdnh3eXp5eXt9foCDhoeJjI6OkJGSk5aYmZudn6Gjn5qLh4J3cnJ0dHR5g4GEi42Ih4aBfH + h4dXR1eHl4dXhuaW5rZ2ltaWttbW5vcnR1dHZ2dXV2d3d7fn+BhIeIiYuOjpCTlJWZnJueoKarr + ZuJhntvaW1ucnh+hIWJi4qFg4F7d3V1c3R3fH1/gHlvbXJnXmdpYmdtamtxcW9vbm9tamxtbG5z + dXZ5fHx7fX9+fH6AgoWHioyNj5CRlZeYmp2TiYyGenp9eXh9fX19foB/fH1/e3p8e3l5e3x7e3x + 6d3FxcnBwcG9vb29vb29wb25tbWxsbW5vb3Fyc3N1dXV1dnd4ent9fn+BgoGAgoWEhoqJiYyLi4 + yPioaLiYSEh4WDhIOCgoKAgX58fXx5eXp4eHl4dXZ1cnN0dHR1cnJycXBxcnJycW9ubGxsbW1ub + m5ub29vcXNzdHZ2dXh6enp+fn5/gYCBhIKFiYeGiomJi4qKjIuLjIyLiomKh4aKioeIiIWDgYB9 + fHx7e3l4eHh2dnd3d3l7enp6enp5ent7e3x7enl6e3t7fHx7e3p8fX5/gIKDg4GCg4KCg4OEhoe + Hh4iJiomLjIqLi4uLi46Pjo2OjouJiomHh4aDgH9/fXp5eXh3d3h4eHh4d3V2d3Z0dnd0dXd3d3 + p7fH59fX19fH5+fn+Af4CAf3+Af359f4KDgoSIiIeJjI6PkJOUk5SYmZiYmZqZmJqamJiZmJaWl + ZSTkZCQj46Ni4qHh4iFgoKBfn9+fn+AgYCAgYOCgoSEg4SFhIODg4OCgICBf35/gICAgYKCgYGD + hIOBgYOCgYGAgIGBgIGCgoKBgoSEg4KCgH9/f318fHt6e3t7enl5eHh5fH18foCAf4GDg4OFhoa + GhoeJh4aJioiIiYiIhoWGh4aGh4eHiImHh4mIiIeHh4iIiIqJioqJh4mKh4eJiYiHh4eHhoWGhY + OEhYWEhYWDg4SFhYWEg4SDgYKCgH+AgICBgoOCgYGBgYKEhoaGhoiIh4eJiYmKioqKiomKioiJi + oqJiYmJiIiIiYiHh4eHh4eGhYWFhISDgoKCgoKCgYGAf31+fXx9fn58e3x8fHx9fX19fX19fX19 + fHx9fn5/gICBgYGCgoKCg4OCgoODgoKDg4OCgoKCgoGBgYGBgYGCgYCBgIGCgoKDg4KCg4OEhIS + FhYWFhYWFhYWFhoWGhoWEhISDg4ODg4ODg4ODg4SDgoKDg4OCg4SDgoKDgoGBgoGAgIB/f35+fn + 9+fn9/f35+fn5/gICAgIGBgYKCg4ODg4SEg4OEhIODhIODhIODg4ODg4OCgoKBgoKCg4OCgoODg + 4ODg4OEhISEhIWEhIWFhISEhISEhIWEhISEhIODhISEg4ODg4ODg4ODg4ODgoKCgoKCg4KCgoKC + goKCgoKCgoOCgoKCgoKBgYKCgoKCgoGBgYGAgICAgYGBgYCAf39/f39/f3+Af39/f39/f39/gIC + AgIB/f39/f39/gICAgIB/f39/gIB/f39/gH9/f39/f39/fn5+f39/f39/fn5+fn5/f39/f39/fn + 5+fn9/f39/f35+fn5+fn9/f35/f39+fn5+fn9/fn5+fn5+fn5+f39+fn5+fn19fX5+fn5+fn5+f + X5+fn5+fn5+fn19fn5+fn5+fX19fX59fn5+fn19fX19fX1+fX19fX19fX19fX19fX19fX19fX19 + fX19fX19fX19fX19fX19fX19fX19fX19fXx9fX18fH19fXx8fXx9fXx8fHx8fHx8fH19fX19fXx + 9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX + 19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f + X19fX19fX19fX19fX19fX19fX19fX19fX1+fX5+fn19fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ + fn5+fn5+fn5+fn5+f39/fn5/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f3 + 9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f + 39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/ + f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f39/f39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 + 9/f39/f39/f39/f39/f39/f35+fn5+f35/f39/f39/f39/f39/f39/f39/f39/f39/f39/f35+f + 39+fn5/fn5+f39/fn9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/ + f39/f39/f39/f39/f39+fn9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f4CAf39/f39/f39/gIB/f39/f39/f4B/f4CAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgIB/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAgIC + AgICAgICAgICAgICAgICAgICAgICAgIGBgYGAgYGBgICAgIGAgICBgYGAgYGBgYGBgYGBgYGBgY + GBgYGBgYGBgYGBgYGBgYGAgYCAgICAgICAgICAgICAgICAgICAgICAgICAgH+AgICAf39/gH9/f + 3+Af39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4CAgH9/gIB/f39/f4B/f3+AgICAf4CA + gICAgICAgICAgICAgH9/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgIB/f39/f39/f39/f4CAf39/f39/f39/f39/f39/f39+fn + 9/fn5+fn5+fn5+fn5+fX19fX19fX19fX19fX19fX19fn5+fn5+fn9/f39/f4CAgICAgICBgYGBg + YGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICAgICAgICAgICAgICAgYGAgICA + gICAgICAgICAgICBgYGAgICAgICAgICAgICAgICAgICAgICAgIB/gICAgH9/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAgICAf39/f39/gH+AgI + CAgICAgIB/f39/f39/f4B/f39/f39/f39/f39/f39/f39/f39/f39/f39/fn9/f39/f39/f39+f + 39/f39/f39/f39/f39/f39/f39/f4B/f4CAgICAf39/f39/gICAf39/gICAgICAgICAgICAgICA + gICAgIGAgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICBgYGBgYGBgYCBgYGBgYCAgIG + BgICAgICAgICAgICAgICAgICAgICAgICAgICBgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAf3+AgIB/f4CAf39/f39/f3+AgICAgH+AgICAf3+AgICAgICAgH9/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 + 9/f39/f39/gH9/gICAgICAgICAgIB/gICAgH+AgIB/f39/f39/gICAgICAgH9/f3+AgH9/f4B/f + 39/f39/f39/f39/f3+AgICAgICAf3+AgIB/f4CAgIB/f4CAgICAgICAgICAf39/f3+AgIB/f4CA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAf39/f39 + /f4CAgH9/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f39/f39/gIB/f39/f39/f39/gH9/f3 + 9/f4CAgICAgIB/gICAgICAgICAgICAgICAgICAgICAgICAgH+AgICAf4CAgICAgICAgIB/gICAf + 4CAgICAgH+Af4CAgH9/f39/f39/f39/gICAgICAgICAgICAf39/f39/f4CAgH9/gICAf3+AgICA + gICAgICAgICAgICAgICAgICAgIB/f39/gIB/f4CAgIB/f4CAgH9/gICAf39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 + 9/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAf39/gH9/f3+AgH9/f39/f39/f39/f39/f + 39/f39/f39/f39/f39/f39/f39/gICAf3+AgH9/f3+AgH9/f4CAgH9/gICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICBgYGBgIGBgYCAgYGAgICAgYCAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAf39/f39/f4CAgIB/f4CAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAf39/f3+Af39/f39/f39/f4B/f39/f4CAgICAgICAgICAgA== +TEL;TYPE=HOME:0351 223344 +TEL;TYPE=WORK:0351 443322 +TEL;TYPE=CELL:0173 223344 +UID:P9HXg34Oav +URL:http://www.mustermann.de/~heiko/ +VERSION:3.0 +X-KADDRESSBOOK-X-Anniversary:1982-07-07 +X-KADDRESSBOOK-X-AssistantsName:Mr. Smithers +X-KADDRESSBOOK-X-Department:Edutainment +X-KADDRESSBOOK-X-IMAddress:122334455 +X-KADDRESSBOOK-X-ManagersName:Mr. Burnes +X-KADDRESSBOOK-X-Office:223 2nd stage +X-KADDRESSBOOK-X-Profession:Clown +X-KADDRESSBOOK-X-SpousesName:femal clown +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard5.vcf.ref b/tdeabc/vcardparser/tests/vcard5.vcf.ref new file mode 100644 index 000000000..712b49494 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard5.vcf.ref @@ -0,0 +1,313 @@ +BEGIN:VCARD +ADR;TYPE=home;TYPE=pref:;;Buehlauer Strasse 45;Dresden;Sachsen;01327;German + y +ADR;TYPE=work:;;Prager Strasse 55;Dresden;Sachsen;01066;Germany +BDAY:1955-07-19T00:00:00Z +CATEGORIES:Friend +CLASS:CONFIDENTIAL +EMAIL;TYPE=PREF:heiko.mustermann@freenet.org +EMAIL:heiko8@tst.inf.tu-dresden.de +FN:Mustermann, Heiko +GEO:19.283333;166.616669 +LOGO;ENCODING=b;TYPE=image/png:iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVU + AAAOW0lEQVR4nO1df2hb1xX+OlyQwQEJXJAgBQlaiEwDsdqO2l1H47RjMe2gbjOoszG2dozG7aC + YMIqTjS7NYKSmbE1StsQpWxMXmsSF1WhlTeSwJlZY06gsSVXWUAkakKAGPajBDxrQ/jjnez8k27 + EjJdyU+/0jPz29X9L57jnnO+deAxYWFhYWFhYWFu3Hbe082XT2ZF3+WgAAdHZ0AgBqTg0A4H7DT + 7oAgNSdKQDAg99/sK33caPB53RqFQBA5PYIAMBdkOf6yc9+ct3P852W786irWjJMs/8+0wdACpV + sZTS50V5vSLb1UoVQMCCvnFDx0c65f3BHw4CABJ3RL19mwYfM4Y1e/+0V5h/VbbPXzwPACiVSgA + A15XnikVjAIB44Dli3TIKjL+2e0XPYxliGFZshSdzZ+r8OyKGjdl8AQCQfe84AKBaFUaUrojlRL + vEUpx5h0eGjo9EZH+kQ7Yz9/d71+vdkAYApO+W16d+/NQNZ8ye8T11ACiV5TkcR5jufCX3XyrLc + 9XmxUe6bvi5XH3OaNRnSKRL9vWsywAAstNTyz6HZYhhsD+IYbjmMPDxfz6uA0BMqQcAR96eAgBM + vSevtTkJa6tzQnVSNn2XOLSZ03ljHHQ7MLxlSIa2kg5pOrTVHHHu/hANRDrke4t2y3cy+KgEMPs + P7F/0O7EMMQzXtNxLn16qA8DUu1nvvcm3DgEAFlxxbo4jFpFYK4woXix8qxhxLYxuH6sDQG5Gvq + NSueLtcxwdNTTASemoUTi3+HdkGWIYlrTkj2clzC1ckGRv3xv7vH2VK7QAlUDuktA0f/bG+YpL5 + 4WpDDXv7TdPbjm472AdACbe9L+r4mdMHuW+42uTAIByuWwZciugY6kdER3zzn8iMkFt3pc93Kvy + d0QzvHYxI5h8Qq/BiK1YLur78nJw4mBIznj2V88ueg+HjxyrA0BEdE7EumLePp773u/e25b7jyb + kfAObh7z3SleELS40SVZ/u+2F0ToA7H99PHRtyxDD0GQZZ9RKKxUZ+/YdmAAAFD4peJ9hbF2dq7 + aHGSpn12p+dJI7PQsAcDS3YcxfmZPXnrt65F40P+pd3wsgwF69x/xHedlWNkfX+PlUep0ck0omA + ACxO+R10w82tfRch8leAJOas82ek+cho/sfkGtnT8xYhpiMJh9CiytVZayjYIgO37KCmWgrOPy3 + w3UAKKpsf/zd496+wkVhpOu5Lje0XS6X9X5lbJ49KxZIJqSSEu+Xrsj9V1Xw5OcBIPJBDoCfPw0 + 9IVn0sanpOgA8NXR9JYBILO7/rd8n/RV9SM1tPg6wDDEOTQxhFEKLYjbuBljBX9tjzyox/Q+xQO + crOf7I20cAAIVz+cCnVNJu8Alo3Nb43nEjoSfa8dIOAMDs6Zy+3wcAyM3kvCtUyZ6qXLd0WZj6z + E+fAeAX4FZbYo5Fmt9zXfeanwEsQ4xDE0Nqbi203ZhztANVZUb2PdF+imqZLgLX0OvSd7lLbPO+ + OFan1B8wGotEE3pCYfpWtX4A2L1rZ+gcHN+Pa8EtEpX3mR9tGlieKSf/dVJ9Ysl7j/fhMYTfuDa + ANMIyxDA0Z+r6Qy7MC1Mi3lge1PijTYetBNNTkjUfOjQJAMi+LzE6S7nJtX50krknE74hZQZbij + o19U7eKcfQAKuaP7lam+hRdZXl19kZX7Xe+PBG2acM7YzE9Bpi1UfeFN9G7Y6+77EfLR59UdGtV + X2G8D7IEPrf7PtZq2XdCmhiCBsUYnGxLJfxP5rzkI0Pb6wDwMypmWXHVupOk0eFEfQZIy+MAQB6 + 79OGhnSvd0yk4c5o4c7Xamlrwj7Nqck9uVf5eblGVnONqIY1W38+4h3DyJH1i6j6jFi3+B1GaPm + 8RGFsa9qrqu7zI6KfHXtHmM8KKq8ZfNZg/rMcLEMMQ5NlH/zLwVDz28SbomVRUxI0RDZJZrqici + biYmHFz8Q6cmox6bR8bsfOVwD44ylzH47dgK9lTf5dqpOzZ0V1Hnh0AIDfXMdmO7Zx0h8MaO2aT + JtQf7D16Se9a9CS0+uEofQVmV7ZjqhPmXhrIvQcnV2doeemv6UfIysAeNoVg9TMfdLqZH3ILYIl + x36Oi/v+Knp+/mwhsFfHcR0X2W3Su0Gy4ZrG3tU5GaOHtwhzXv3jqwB8ZgFiaezamFVWAMDO30u + OQAsjfvFL8QHpdFLOoPE8FQXG99UvxecMbhameOrCnB8tbh0WtjA3IZuYl6TXC1PoY/b9eRwAUL + hYDH3emXdD20EwX4p3SzS4VKWQsAwxDPYHMQxLlnDpJNlbSyEO8BvjvDKrJnZFlcxJ+biGkRT6Y + nf45VMAqHypXfMa0uY+8JM2Fpycr+QzfQ+JM0+nhPoMBHit3FFxuHT6FB8rGsYnusWZVsoBAVOH + QzrlkoqlcW1qSyQkOMmsE+c9sk2Gy+d//Xzo+Ago40RD3wsARKMrG6oIyxDDsCRDOAtodLsU44M + d3QtXKcnzLGELoXN7cos4y3jcl0QAYOFrOZ4ySLGooWqgOYBs4XVp+Qw9i2XZX1GyZtIJvQdhRi + Il23S4ntgYSNB67xcWTs2ouDmn97FRrlX6MlzUSt8jo8XQlq0AgMm3J8Ln1OfmnBBg9U2DliGGY + UmGEON7pE1lVNtWAGD2IwlPK1fF6jhziGMxE8eR54QhnWtUatY5hpS5ixfCPmexsDHRLedOeDK6 + YOARsdLxabHqVJIiozbvqQzvsZnvJ33r7dkgfuXQBWHC6NMSIrvqZ+grOTOsX+evPLlZRMlCXsv + GGsZn1osgOt7Q2rMaWIYYhmsyhAj+6tue2ybNZ59ruVfl5k614igL+90NvoNz9LT5jkJgKiVWS5 + 8CAOVSGYAv9FU0eezXaItsHHkkCQBI360RnDKBzODx7iKNGcPa1FCZk3JArZzT53FC5yB4DxGN8 + IY04d3+m+23AcDMqZmma6wWliGGYcUMCWL/G+HJJsNbhkPtPBxrGwv5pcufAgDcrzlPXayX430w + D2GMTx/CQlkqqUzokGO8MpZGUwtagqbASTAScuZ8ATOVlGa7wT6Jnnb/QacTaO4CFR0JFsXiiXj + oGrte3lUHgJ2/29ly46BliGG4LoY0YvLoZMgyjr9zXCKyTrEozuemsEfRjtEZfUq+4MvWjFxojd + ympTNqamq+iKjP8LJlln6VGQGxkj4hpS2lbJYeXC++xZuQpOxjO2hCi3f0lSxVtAOWIYahLQxpB + KXmijJjQed1R9nbptbNAhbbgRBoQYomxAobW0M5jvuWrpGQRj7MyFlsYg6RSDCS863ZnZf3EmuF + VcNPDMv9/FNKsfsPHAoxf/RFmbpWLLBtVa5JNvY90FcHWpueYRliGNrKkC/+90Ud8EucLjR7dtQ + 3qALLaCz7vsT9nO6V7vVXcqBi6jYUqHB7wyvCDWccz6kGpFU1ZqNCENWaKAWOMjZzn8RsbOTDgU + Ohz690vZJWYBliGNr6i1/6r0zM9LQqVXGZI3yqeQjfZ4ae2SCWyaY3QbhldOB7kqHHEuGaSiNe+ + a3UXlh2zeiaKYOPS7nW19uA8dekPB3TXGf0xVEAgXKv1oCok+VOCcs2DbY2oWc5WIYYhrb4kOms + tFgWL0tUlf9QNB0ygcwoXw5XzQY3D9YBIK7M4MQZwM87HM1dSmzP1KgrFgv7joUFNjlwqSF5efV + 1YUHurFj32PYx75gdL+uUhbyuf6UZeq9WFznJv6KqL33fjYRliGFoiSGc0FLUxQW8VsolmsAa4U + VCSRnng1PlqBPFNO/gKnVs76RP6WRuo35q6HHJsqkKsPZOto7v2e1dY+QF8RkDfaqIdZCVmsOo+ + swIjbX/GwnLEMPQEkPatZoomdE47QsAoHX6aDRcm+B4X/K6YbT+oYxg/ZttopzKxsmhgF8zrzR0 + 0bDjhp/l8iL508s3lbcDliGGwf4ghsGIFXWONaxHAvgrDMVUhmGLEfuA4xoiT70rgQQdrteBr6X + bktcoF94G/GY6hrO5U9pipAEAz1mttmfFipXAMsQw3BD5fbVwuJbUGl868UJMXdNEa0eIdocLUJ + wH8souSfI8eV7DYcr2lPqDgUNlPtzKSqawIMXQ+3rn418PLEMMgxE+hNirCxkDQK82SrgqBqY5K + 1eZUanK+94ahrpaUfGCyCCDm0VMpDBImb4SaHKgD/FWFVVmMGFl6Tl3Qgpok0eXXwS5HbAMMQxG + MSSIsZekXNp7v8zKymzo0T26WpHO42MjNxsmGHWx6a6/rz/0uWDBi+coFJRdnDHLiI4rTqxQCmo + HLEMMgxFR1mJgMOQ1YHO7S14b1zQhQ5iHsLXoiM6g9SbTICDPdIRbiLw5kyqpNK72djNgGWIYjG + VIPB5e+cBrauvSdh5tGWKbEHMJFrn6HxDf0bNOfE+Na7cEWaFPT+m+oNMjip9J/pE90Xrz9GphG + WIYjGUIW/zZyMysOcrGuTjXVAwXjbgST0WjKbZ70nXkC77VFy9r/jEXZteC077W0NXCMsQwGJuH + NGJsp+QlfZqXsHWHKi4n1xS0YZvToWc+lPLr+U+k2BSqgV31MnNjvgfLEMNgjGWsFFytiM3WcZW + BOUWgoj6kqv/Ii00RXBm7GljViBFXwaD/d2IZYhiMjbKWgreUhlb3OAFz4CHZz6aGWHd4hTnHFc + WWjeBAeJKpKbAMMQy3HEO45Mfecfl3qNSyuB5iRtt/XP43hK5w3nK+4rcBNa7FZQIsQwyDMdFFq + xh9UZb+6HtIlr1wF8SHFM6JPsVGueDiMzej8W21sAwxDPYHMQy3nFNfCmltrKuWRDrhv0HlUMWV + 8Rrn1JsGyxDDYLS1XA927ZZWooL+MzC29sycuHmNCq3AMsQwfGt8CFHISwEqskbDWwPlkeVgGWJ + xczH20lidTXe3AixDLCwsLCwsviX4P68/8cprSSqmAAAAAElFTkSuQmCC +N:Mustermann;Heiko;;; +NICKNAME:clown +NOTE:I'm a friendly note text,\nplease copy me to your address book... +ORG:KDE +PHOTO;ENCODING=b;TYPE=image/png:iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pV + UAAAOW0lEQVR4nO1df2hb1xX+OlyQwQEJXJAgBQlaiEwDsdqO2l1H47RjMe2gbjOoszG2dozG7a + CYMIqTjS7NYKSmbE1StsQpWxMXmsSF1WhlTeSwJlZY06gsSVXWUAkakKAGPajBDxrQ/jjnez8k2 + 7EjJdyU+/0jPz29X9L57jnnO+deAxYWFhYWFhYWFu3Hbe082XT2ZF3+WgAAdHZ0AgBqTg0A4H7D + T7oAgNSdKQDAg99/sK33caPB53RqFQBA5PYIAMBdkOf6yc9+ct3P852W786irWjJMs/8+0wdACp + VsZTS50V5vSLb1UoVQMCCvnFDx0c65f3BHw4CABJ3RL19mwYfM4Y1e/+0V5h/VbbPXzwPACiVSg + AA15XnikVjAIB44Dli3TIKjL+2e0XPYxliGFZshSdzZ+r8OyKGjdl8AQCQfe84AKBaFUaUrojlR + LvEUpx5h0eGjo9EZH+kQ7Yz9/d71+vdkAYApO+W16d+/NQNZ8ye8T11ACiV5TkcR5jufCX3XyrL + c9XmxUe6bvi5XH3OaNRnSKRL9vWsywAAstNTyz6HZYhhsD+IYbjmMPDxfz6uA0BMqQcAR96eAgB + MvSevtTkJa6tzQnVSNn2XOLSZ03ljHHQ7MLxlSIa2kg5pOrTVHHHu/hANRDrke4t2y3cy+KgEMP + sP7F/0O7EMMQzXtNxLn16qA8DUu1nvvcm3DgEAFlxxbo4jFpFYK4woXix8qxhxLYxuH6sDQG5Gv + qNSueLtcxwdNTTASemoUTi3+HdkGWIYlrTkj2clzC1ckGRv3xv7vH2VK7QAlUDuktA0f/bG+YpL + 54WpDDXv7TdPbjm472AdACbe9L+r4mdMHuW+42uTAIByuWwZciugY6kdER3zzn8iMkFt3pc93Kv + yd0QzvHYxI5h8Qq/BiK1YLur78nJw4mBIznj2V88ueg+HjxyrA0BEdE7EumLePp773u/e25b7jy + bkfAObh7z3SleELS40SVZ/u+2F0ToA7H99PHRtyxDD0GQZZ9RKKxUZ+/YdmAAAFD4peJ9hbF2dq + 7aHGSpn12p+dJI7PQsAcDS3YcxfmZPXnrt65F40P+pd3wsgwF69x/xHedlWNkfX+PlUep0ck0om + AACxO+R10w82tfRch8leAJOas82ek+cho/sfkGtnT8xYhpiMJh9CiytVZayjYIgO37KCmWgrOPy + 3w3UAKKpsf/zd496+wkVhpOu5Lje0XS6X9X5lbJ49KxZIJqSSEu+Xrsj9V1Xw5OcBIPJBDoCfPw + 09IVn0sanpOgA8NXR9JYBILO7/rd8n/RV9SM1tPg6wDDEOTQxhFEKLYjbuBljBX9tjzyox/Q+xQ + OcrOf7I20cAAIVz+cCnVNJu8Alo3Nb43nEjoSfa8dIOAMDs6Zy+3wcAyM3kvCtUyZ6qXLd0WZj6 + zE+fAeAX4FZbYo5Fmt9zXfeanwEsQ4xDE0Nqbi203ZhztANVZUb2PdF+imqZLgLX0OvSd7lLbPO + +OFan1B8wGotEE3pCYfpWtX4A2L1rZ+gcHN+Pa8EtEpX3mR9tGlieKSf/dVJ9Ysl7j/fhMYTfuD + aANMIyxDA0Z+r6Qy7MC1Mi3lge1PijTYetBNNTkjUfOjQJAMi+LzE6S7nJtX50krknE74hZQZbi + jo19U7eKcfQAKuaP7lam+hRdZXl19kZX7Xe+PBG2acM7YzE9Bpi1UfeFN9G7Y6+77EfLR59UdGt + VX2G8D7IEPrf7PtZq2XdCmhiCBsUYnGxLJfxP5rzkI0Pb6wDwMypmWXHVupOk0eFEfQZIy+MAQB + 679OGhnSvd0yk4c5o4c7Xamlrwj7Nqck9uVf5eblGVnONqIY1W38+4h3DyJH1i6j6jFi3+B1GaP + m8RGFsa9qrqu7zI6KfHXtHmM8KKq8ZfNZg/rMcLEMMQ5NlH/zLwVDz28SbomVRUxI0RDZJZrqic + ibiYmHFz8Q6cmox6bR8bsfOVwD44ylzH47dgK9lTf5dqpOzZ0V1Hnh0AIDfXMdmO7Zx0h8MaO2a + TJtQf7D16Se9a9CS0+uEofQVmV7ZjqhPmXhrIvQcnV2doeemv6UfIysAeNoVg9TMfdLqZH3ILYI + lx36Oi/v+Knp+/mwhsFfHcR0X2W3Su0Gy4ZrG3tU5GaOHtwhzXv3jqwB8ZgFiaezamFVWAMDO30 + uOQAsjfvFL8QHpdFLOoPE8FQXG99UvxecMbhameOrCnB8tbh0WtjA3IZuYl6TXC1PoY/b9eRwAU + LhYDH3emXdD20EwX4p3SzS4VKWQsAwxDPYHMQxLlnDpJNlbSyEO8BvjvDKrJnZFlcxJ+biGkRT6 + Ynf45VMAqHypXfMa0uY+8JM2Fpycr+QzfQ+JM0+nhPoMBHit3FFxuHT6FB8rGsYnusWZVsoBAVO + HQzrlkoqlcW1qSyQkOMmsE+c9sk2Gy+d//Xzo+Ago40RD3wsARKMrG6oIyxDDsCRDOAtodLsU44 + Md3QtXKcnzLGELoXN7cos4y3jcl0QAYOFrOZ4ySLGooWqgOYBs4XVp+Qw9i2XZX1GyZtIJvQdhR + iIl23S4ntgYSNB67xcWTs2ouDmn97FRrlX6MlzUSt8jo8XQlq0AgMm3J8Ln1OfmnBBg9U2DliGG + YUmGEON7pE1lVNtWAGD2IwlPK1fF6jhziGMxE8eR54QhnWtUatY5hpS5ixfCPmexsDHRLedOeDK + 6YOARsdLxabHqVJIiozbvqQzvsZnvJ33r7dkgfuXQBWHC6NMSIrvqZ+grOTOsX+evPLlZRMlCXs + vGGsZn1osgOt7Q2rMaWIYYhmsyhAj+6tue2ybNZ59ruVfl5k614igL+90NvoNz9LT5jkJgKiVWS + 58CAOVSGYAv9FU0eezXaItsHHkkCQBI360RnDKBzODx7iKNGcPa1FCZk3JArZzT53FC5yB4DxGN + 8IY04d3+m+23AcDMqZmma6wWliGGYcUMCWL/G+HJJsNbhkPtPBxrGwv5pcufAgDcrzlPXayX430 + wD2GMTx/CQlkqqUzokGO8MpZGUwtagqbASTAScuZ8ATOVlGa7wT6Jnnb/QacTaO4CFR0JFsXiiX + joGrte3lUHgJ2/29ly46BliGG4LoY0YvLoZMgyjr9zXCKyTrEozuemsEfRjtEZfUq+4MvWjFxoj + dympTNqamq+iKjP8LJlln6VGQGxkj4hpS2lbJYeXC++xZuQpOxjO2hCi3f0lSxVtAOWIYahLQxp + BKXmijJjQed1R9nbptbNAhbbgRBoQYomxAobW0M5jvuWrpGQRj7MyFlsYg6RSDCS863ZnZf3Emu + FVcNPDMv9/FNKsfsPHAoxf/RFmbpWLLBtVa5JNvY90FcHWpueYRliGNrKkC/+90Ud8EucLjR7dt + Q3qALLaCz7vsT9nO6V7vVXcqBi6jYUqHB7wyvCDWccz6kGpFU1ZqNCENWaKAWOMjZzn8RsbOTDg + UOhz690vZJWYBliGNr6i1/6r0zM9LQqVXGZI3yqeQjfZ4ae2SCWyaY3QbhldOB7kqHHEuGaSiNe + +a3UXlh2zeiaKYOPS7nW19uA8dekPB3TXGf0xVEAgXKv1oCok+VOCcs2DbY2oWc5WIYYhrb4kOm + stFgWL0tUlf9QNB0ygcwoXw5XzQY3D9YBIK7M4MQZwM87HM1dSmzP1KgrFgv7joUFNjlwqSF5ef + V1YUHurFj32PYx75gdL+uUhbyuf6UZeq9WFznJv6KqL33fjYRliGFoiSGc0FLUxQW8VsolmsAa4 + UVCSRnng1PlqBPFNO/gKnVs76RP6WRuo35q6HHJsqkKsPZOto7v2e1dY+QF8RkDfaqIdZCVmsOo + +swIjbX/GwnLEMPQEkPatZoomdE47QsAoHX6aDRcm+B4X/K6YbT+oYxg/ZttopzKxsmhgF8zrzR + 00bDjhp/l8iL508s3lbcDliGGwf4ghsGIFXWONaxHAvgrDMVUhmGLEfuA4xoiT70rgQQdrteBr6 + XbktcoF94G/GY6hrO5U9pipAEAz1mttmfFipXAMsQw3BD5fbVwuJbUGl868UJMXdNEa0eIdocLU + JwH8souSfI8eV7DYcr2lPqDgUNlPtzKSqawIMXQ+3rn418PLEMMgxE+hNirCxkDQK82SrgqBqY5 + K1eZUanK+94ahrpaUfGCyCCDm0VMpDBImb4SaHKgD/FWFVVmMGFl6Tl3Qgpok0eXXwS5HbAMMQx + GMSSIsZekXNp7v8zKymzo0T26WpHO42MjNxsmGHWx6a6/rz/0uWDBi+coFJRdnDHLiI4rTqxQCm + oHLEMMgxFR1mJgMOQ1YHO7S14b1zQhQ5iHsLXoiM6g9SbTICDPdIRbiLw5kyqpNK72djNgGWIYj + GVIPB5e+cBrauvSdh5tGWKbEHMJFrn6HxDf0bNOfE+Na7cEWaFPT+m+oNMjip9J/pE90Xrz9Gph + GWIYjGUIW/zZyMysOcrGuTjXVAwXjbgST0WjKbZ70nXkC77VFy9r/jEXZteC077W0NXCMsQwGJu + HNGJsp+QlfZqXsHWHKi4n1xS0YZvToWc+lPLr+U+k2BSqgV31MnNjvgfLEMNgjGWsFFytiM3WcZ + WBOUWgoj6kqv/Ii00RXBm7GljViBFXwaD/d2IZYhiMjbKWgreUhlb3OAFz4CHZz6aGWHd4hTnHF + cWWjeBAeJKpKbAMMQy3HEO45Mfecfl3qNSyuB5iRtt/XP43hK5w3nK+4rcBNa7FZQIsQwyDMdFF + qxh9UZb+6HtIlr1wF8SHFM6JPsVGueDiMzej8W21sAwxDPYHMQy3nFNfCmltrKuWRDrhv0HlUMW + V8Rrn1JsGyxDDYLS1XA927ZZWooL+MzC29sycuHmNCq3AMsQwfGt8CFHISwEqskbDWwPlkeVgGW + JxczH20lidTXe3AixDLCwsLCwsviX4P68/8cprSSqmAAAAAElFTkSuQmCC +ROLE:Developer +SOUND;ENCODING=b:UklGRiQgAABXQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQAgAA + B/f39/f39/f39/f39/f4B/gH+Af4CAgIGBgYGBgYGBgYGBgYGBgYGBgIGAgICBgYGBgYGBgYCAg + YGAgICAgICAgIGBgICAgYCAgICBgICAgICAgICAgIGAgICAgYCAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAf4CAgICAgICAgICAgICAgIB/f4CAgICAgICAgIB/f4B/f39/f39/f3+AgICAf4CAf3 + 9/gIB/f4CAgH9/gICAgH+AgICAgICAgICAf4CAgIB/gICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgIB/gICAf39/f39/f3+Af4CAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgH9/f39/f39/f39/f39/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgIGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgYCAgICB + gICAgYGBgICAgICAgICAgIGAgICBgICBgYGBgYGBgYGAgYGBgYCBgYGBgYGBgYGBgYGBgYGBgYG + BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgICAgYGBgIGBgYGAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYGAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgH+AgICAgICAgICAgICAgICAgICAf4CAgIB/gH+Af4B/f39/f39/f + 39/f39/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgYG + BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgY + GBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGAgIGBgYCAgICBgYCAgYGBgYCAgICBg + YCAgICAgICAgICAgICAgIGAgICAgICAgICAgICAgYGBgYGAgICAgIGBgYCAgICBgYGAgICAgIGA + gICAgICAgIGBgYCBgYGAgYGBgYGBgoGBgYGCgoGAgICBgYGBgYCBgYKCgYGBgYGBgYGAgYGBgH9 + /gIB/f3+AgIB/gH9/gICAf4CBgYB/f35+gIB/f4CBgX9/gYCAgYKCgYCAgYOBgICAgoGAf4GCgn + 9/gIB/gICBgH5/f4GAfX+BgYB+fn9/fn+Afn6Af39+f35+fn9+fn6AgH9/f4CAgYCAgYKCgH9/g + IKBf3+AgYJ/f4GCg4F/gIGCgoOBfoCDgYF/fH+BgYGAfn6Af4CCgn58gIN/fX+AgICBgYGAgYCB + goOCgICBgYB/fXyBhIGAgH5+f4GBgX9/f35+gIKCgXt9goN/f318f4GAf4B/fHt9fn5+fXx+fn5 + /gH9+fHx/gHx9f4CAfn18gIB9e4GBfn5+foCBfHyAgoGAfX6CgYCBgH+DgHt9gYN/fX2BhYB7en + 6AgH98foKCgH18foCAfoCAf4CAf31+fn+AgH1+goJ/fX5/gIKAgIGAfH6CgX17foCBf3+BgoB/g + YOBgIB/f4KDgoJ+e3+ChIOBfn1/gX+BfX2BgH59foCCfn1/gX99fICAgoB/f39/gISCf36AgoSB + foCBgYGAf4CCf4CCgX5/gYKDgYB/gH+BhIOBgYB/gIOEhIF9foGCg4OBgICBgoOCgICChIOBg4O + CgoSDgoKAgYKBgoODhISBf4CCg4SEgoGCg4SEgH6BhIWEgX+EhYKAgoKFhIB+gIKChYKAgYOCgo + B+gYWFhIKAg4WEg4ODhIWFhYaGhIWGhYWGh4eHhYOCgoSFg4B/gIB+fX1+fn57e3t7fHt6fH5/f + 4GDhYiMkJGQj5GVmZycmZiXlZGIfXRwcnZ4d3Nva2hoamppaWxvc3R0dXl+iJCPjZShqrCzvNHi + rFYxOmKSrJ6UmJOAbV1ZboSMjI6JfnNjW2JweYGFg4B/e3Z0c3Btc3p9fHp4fIGBf3+Dh4qLjJG + YnZuWkY6MhnpwbnN6fHlya2hlZmdmaW9ycXFzd3t/g42cpquzvMzd/sRADiBZkL6xpLa1jFpANV + iHoJ2ioJWGbEQ2VHaOm5aHhIFuYmZzgoVxZFxfdJCSgnt/kKewr7bDsopcSV6JopyRjpOQfmNXZ + HmGhYB8fXtvXExKXnyKgnJsc3t8fZC0ysfK0+vHTxEeXY6yr6rAxJRSNTdbh5+fp7KjglQ6PVx3 + ho6Ph3dmW15oa2x0hIuNkK3R18jJ0Ys8LUlxkqais8WtdlBFT2yDjpywro9mS0VVaXaBiIdyX2J + rcG5udYKKjaXT4dfV2Y82JkBpiaKkvdO2eE9GTGZ4hZu6u51yTUNOX2l9kZWKdl5PXG93dHeAip + KZut7j2tacRjJIYHCOo77XvoRdVlFYZniVuL+kfl9ST1Rcb4mTjoNxW1pqdXd5fH6CiKHN4d7k2 + 4E4N05Yaoqo1eO0emVbTU5ZdKDCuZV9b1tMSVlyiYp8dHl7cmpqdYCCgIqixNTR2OqnRTlPXFt3 + ksbnw4lzcFdKS2KMtLWZiIZwV0lPZXZ1b3uNinZqbXJ3dX2XxOPg4/zDUDRCTUhmiMXx1p+If1g + +O1J7pK+yspN3W0pGVGdugYmCen54b21rb3V9i6vZ7vD92WpAS0gzSny04tq3qp5qPDhHX3uVrs + KukXVhT0hRYnF/gnuCh31ubG9zdHeMs+Dr8P7KalFVOylJeq7QzMPIqmtIRUZOY4KovqicknhZS + 1BWXWh6gIeLiH91b21vc4GcyuXt/umTZGhGIjJfh6y+yt7LkGlfTD1GYYOipKKwnXhkXldVUFhs + dYOMjYWBem9ucoCWvNTm9+2weHdZMSpQboujvtnUrY6BZEdDUmV4jZypppeFd2dcWVFWWWh8hYS + Ii393c3Z7iJ3A1ePp3aGDfVYyOVZkfJe5zsavpJNsU1BTVmR9kpmcn5uGdGxoWU5VVGZ0fIKLh4 + F/d3Z6g4ufuc3e3depjoViPz9VWm2FqLu8tLGifmphWlJZbH+Lj5+elod+c19WU0xUZW11gISEg + nx6e3h6g4qWp7zM3NrSpZGIYkRFVVVlfZ6vsbW3qIl7b2BUWGVwe4ybn52TkIRuX2BVRVFjZmp7 + hIF9fX12cnZ6eX6LlZyousfP0c++jot6X0ZRXF9sgaCnqa6yn4eAdGZZYGlvd4mcnqCWnY91aWN + cSUtYYmJxf399f351cXFzcHF4foOIlZ+hp7CytLm8uLKNg4RtYF5oanN8j5qZnqGaioV9dGpqb3 + J1f42Rk5iZjIKAcmFcW1RXYGhwdXt+e3Z2c25tcXJxd3yChY2Tl5udn6Gho6ioq6uonoaHbWNzZ + GdxgoGPlZqdj5CJgHFzcWxwdH1/hYqOioSFfnFpaWBdX2Jqb3N5fHh4eHNxcXFxc3d7foOJjI6Q + lZOSlZOTl5eYnJucnpyZkYiEfnd1dnZ5fYKHio6QkIyHg394dHRzc3Z5fHt2enJrcG5obG9sbW9 + ucHJzdnh3eXp5eXt9foCDhoeJjI6OkJGSk5aYmZudn6Gjn5qLh4J3cnJ0dHR5g4GEi42Ih4aBfH + h4dXR1eHl4dXhuaW5rZ2ltaWttbW5vcnR1dHZ2dXV2d3d7fn+BhIeIiYuOjpCTlJWZnJueoKarr + ZuJhntvaW1ucnh+hIWJi4qFg4F7d3V1c3R3fH1/gHlvbXJnXmdpYmdtamtxcW9vbm9tamxtbG5z + dXZ5fHx7fX9+fH6AgoWHioyNj5CRlZeYmp2TiYyGenp9eXh9fX19foB/fH1/e3p8e3l5e3x7e3x + 6d3FxcnBwcG9vb29vb29wb25tbWxsbW5vb3Fyc3N1dXV1dnd4ent9fn+BgoGAgoWEhoqJiYyLi4 + yPioaLiYSEh4WDhIOCgoKAgX58fXx5eXp4eHl4dXZ1cnN0dHR1cnJycXBxcnJycW9ubGxsbW1ub + m5ub29vcXNzdHZ2dXh6enp+fn5/gYCBhIKFiYeGiomJi4qKjIuLjIyLiomKh4aKioeIiIWDgYB9 + fHx7e3l4eHh2dnd3d3l7enp6enp5ent7e3x7enl6e3t7fHx7e3p8fX5/gIKDg4GCg4KCg4OEhoe + Hh4iJiomLjIqLi4uLi46Pjo2OjouJiomHh4aDgH9/fXp5eXh3d3h4eHh4d3V2d3Z0dnd0dXd3d3 + p7fH59fX19fH5+fn+Af4CAf3+Af359f4KDgoSIiIeJjI6PkJOUk5SYmZiYmZqZmJqamJiZmJaWl + ZSTkZCQj46Ni4qHh4iFgoKBfn9+fn+AgYCAgYOCgoSEg4SFhIODg4OCgICBf35/gICAgYKCgYGD + hIOBgYOCgYGAgIGBgIGCgoKBgoSEg4KCgH9/f318fHt6e3t7enl5eHh5fH18foCAf4GDg4OFhoa + GhoeJh4aJioiIiYiIhoWGh4aGh4eHiImHh4mIiIeHh4iIiIqJioqJh4mKh4eJiYiHh4eHhoWGhY + OEhYWEhYWDg4SFhYWEg4SDgYKCgH+AgICBgoOCgYGBgYKEhoaGhoiIh4eJiYmKioqKiomKioiJi + oqJiYmJiIiIiYiHh4eHh4eGhYWFhISDgoKCgoKCgYGAf31+fXx9fn58e3x8fHx9fX19fX19fX19 + fHx9fn5/gICBgYGCgoKCg4OCgoODgoKDg4OCgoKCgoGBgYGBgYGCgYCBgIGCgoKDg4KCg4OEhIS + FhYWFhYWFhYWFhoWGhoWEhISDg4ODg4ODg4ODg4SDgoKDg4OCg4SDgoKDgoGBgoGAgIB/f35+fn + 9+fn9/f35+fn5/gICAgIGBgYKCg4ODg4SEg4OEhIODhIODhIODg4ODg4OCgoKBgoKCg4OCgoODg + 4ODg4OEhISEhIWEhIWFhISEhISEhIWEhISEhIODhISEg4ODg4ODg4ODg4ODgoKCgoKCg4KCgoKC + goKCgoKCgoOCgoKCgoKBgYKCgoKCgoGBgYGAgICAgYGBgYCAf39/f39/f3+Af39/f39/f39/gIC + AgIB/f39/f39/gICAgIB/f39/gIB/f39/gH9/f39/f39/fn5+f39/f39/fn5+fn5/f39/f39/fn + 5+fn9/f39/f35+fn5+fn9/f35/f39+fn5+fn9/fn5+fn5+fn5+f39+fn5+fn19fX5+fn5+fn5+f + X5+fn5+fn5+fn19fn5+fn5+fX19fX59fn5+fn19fX19fX1+fX19fX19fX19fX19fX19fX19fX19 + fX19fX19fX19fX19fX19fX19fX19fX19fXx9fX18fH19fXx8fXx9fXx8fHx8fHx8fH19fX19fXx + 9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX + 19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f + X19fX19fX19fX19fX19fX19fX19fX19fX1+fX5+fn19fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ + fn5+fn5+fn5+fn5+f39/fn5/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f3 + 9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f + 39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/ + f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f39/f39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 + 9/f39/f39/f39/f39/f39/f35+fn5+f35/f39/f39/f39/f39/f39/f39/f39/f39/f39/f35+f + 39+fn5/fn5+f39/fn9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/ + f39/f39/f39/f39/f39+fn9/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f4CAf39/f39/f39/gIB/f39/f39/f4B/f4CAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgIB/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAgIC + AgICAgICAgICAgICAgICAgICAgICAgIGBgYGAgYGBgICAgIGAgICBgYGAgYGBgYGBgYGBgYGBgY + GBgYGBgYGBgYGBgYGBgYGAgYCAgICAgICAgICAgICAgICAgICAgICAgICAgH+AgICAf39/gH9/f + 3+Af39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f4CAgH9/gIB/f39/f4B/f3+AgICAf4CA + gICAgICAgICAgICAgH9/f4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgIB/f39/f39/f39/f4CAf39/f39/f39/f39/f39/f39+fn + 9/fn5+fn5+fn5+fn5+fX19fX19fX19fX19fX19fX19fn5+fn5+fn9/f39/f4CAgICAgICBgYGBg + YGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICAgICAgICAgICAgICAgYGAgICA + gICAgICAgICAgICBgYGAgICAgICAgICAgICAgICAgICAgICAgIB/gICAgH9/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAgICAf39/f39/gH+AgI + CAgICAgIB/f39/f39/f4B/f39/f39/f39/f39/f39/f39/f39/f39/f39/fn9/f39/f39/f39+f + 39/f39/f39/f39/f39/f39/f39/f4B/f4CAgICAf39/f39/gICAf39/gICAgICAgICAgICAgICA + gICAgIGAgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYCAgICBgYGBgYGBgYCBgYGBgYCAgIG + BgICAgICAgICAgICAgICAgICAgICAgICAgICBgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAf3+AgIB/f4CAf39/f39/f3+AgICAgH+AgICAf3+AgICAgICAgH9/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 + 9/f39/f39/gH9/gICAgICAgICAgIB/gICAgH+AgIB/f39/f39/gICAgICAgH9/f3+AgH9/f4B/f + 39/f39/f39/f39/f3+AgICAgICAf3+AgIB/f4CAgIB/f4CAgICAgICAgICAf39/f3+AgIB/f4CA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAf39/f39 + /f4CAgH9/f39/f39/f39/f39/f39/f39/f39/f39/f4B/f39/f39/gIB/f39/f39/f39/gH9/f3 + 9/f4CAgICAgIB/gICAgICAgICAgICAgICAgICAgICAgICAgH+AgICAf4CAgICAgICAgIB/gICAf + 4CAgICAgH+Af4CAgH9/f39/f39/f39/gICAgICAgICAgICAf39/f39/f4CAgH9/gICAf3+AgICA + gICAgICAgICAgICAgICAgICAgIB/f39/gIB/f4CAgIB/f4CAgH9/gICAf39/f39/f39/f39/f39 + /f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f3 + 9/f39/f39/f39/f39/f39/f39/f39/f39/f39/gICAf39/gH9/f3+AgH9/f39/f39/f39/f39/f + 39/f39/f39/f39/f39/f39/f39/gICAf3+AgH9/f3+AgH9/f4CAgH9/gICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAgICAgICBgYGBgIGBgYCAgYGAgICAgYCAgICAgICAgICAgICAgICAg + ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA + gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC + AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI + CAgICAgICAgICAgICAgICAf39/f39/f4CAgIB/f4CAgICAgICAgICAgICAgICAgICAgICAgICAg + ICAf39/f3+Af39/f39/f39/f4B/f39/f4CAgICAgICAgICAgA== +TEL;TYPE=HOME:0351 223344 +TEL;TYPE=WORK:0351 443322 +TEL;TYPE=CELL:0173 223344 +UID:P9HXg34Oav +URL:http://www.mustermann.de/~heiko/ +VERSION:3.0 +X-KADDRESSBOOK-X-Anniversary:1982-07-07 +X-KADDRESSBOOK-X-AssistantsName:Mr. Smithers +X-KADDRESSBOOK-X-Department:Edutainment +X-KADDRESSBOOK-X-IMAddress:122334455 +X-KADDRESSBOOK-X-ManagersName:Mr. Burnes +X-KADDRESSBOOK-X-Office:223 2nd stage +X-KADDRESSBOOK-X-Profession:Clown +X-KADDRESSBOOK-X-SpousesName:femal clown +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard6.vcf b/tdeabc/vcardparser/tests/vcard6.vcf new file mode 100644 index 000000000..92339c798 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard6.vcf @@ -0,0 +1,10 @@ +BEGIN:VCARD +CLASS:PUBLIC +EMAIL;TYPE=PREF:email1@abc.de +EMAIL:email2@abc.de +FN:Test User +N:User;Test;;; +UID:uJTkVqH5Qt +VERSION:3.0 +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard6.vcf.ref b/tdeabc/vcardparser/tests/vcard6.vcf.ref new file mode 100644 index 000000000..3cfde20b9 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard6.vcf.ref @@ -0,0 +1,10 @@ +BEGIN:VCARD +CLASS:PUBLIC +EMAIL;TYPE=PREF:email1@abc.de +EMAIL:email2@abc.de +FN:Test User +N:User;Test;;; +UID:uJTkVqH5Qt +VERSION:3.0 +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard7.vcf b/tdeabc/vcardparser/tests/vcard7.vcf new file mode 100644 index 000000000..8b5be8ec7 --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard7.vcf @@ -0,0 +1,7 @@ +BEGIN:VCARD +N: +LABEL;QUOTED-PRINTABLE;WORK:401 Park Drive 3 West=0ABoston, MA 02215=0AUSA=0A= +Herecomesyetanotherline +UID:pas-id-3E136F9B00000000 +END:VCARD + diff --git a/tdeabc/vcardparser/tests/vcard7.vcf.ref b/tdeabc/vcardparser/tests/vcard7.vcf.ref new file mode 100644 index 000000000..84ed6236b --- /dev/null +++ b/tdeabc/vcardparser/tests/vcard7.vcf.ref @@ -0,0 +1,8 @@ +BEGIN:VCARD +LABEL;TYPE=work:401 Park Drive 3 West\nBoston\, MA 02215\nUSA\nHerecomesye + tanotherline +N:;;;; +UID:pas-id-3E136F9B00000000 +VERSION:3.0 +END:VCARD + diff --git a/tdeabc/vcardparser/testutils.cpp b/tdeabc/vcardparser/testutils.cpp new file mode 100644 index 000000000..62d1b4121 --- /dev/null +++ b/tdeabc/vcardparser/testutils.cpp @@ -0,0 +1,99 @@ +#include <vcardparser.h> +#include <tdeabc/addressee.h> +#include <tqfile.h> + +using namespace KABC; + +Addressee +vcard1() +{ + Addressee addr; + + addr.setName( "Frank Dawson" ); + addr.setOrganization( "Lotus Development Corporation" ); + addr.setUrl( KURL( "http://home.earthlink.net/~fdawson") ); + addr.insertEmail( "fdawson@earthlink.net" ); + addr.insertEmail( "Frank_Dawson@Lotus.com", true ); + addr.insertPhoneNumber( PhoneNumber("+1-919-676-9515",PhoneNumber::Voice|PhoneNumber::Msg + |PhoneNumber::Work ) ); + addr.insertPhoneNumber( PhoneNumber("+1-919-676-9564",PhoneNumber::Fax |PhoneNumber::Work )); + Address a( Address::Work | Address::Postal | Address::Parcel ); + a.setStreet( "6544 Battleford Drive" ); + a.setLocality( "Raleigh" ); + a.setRegion( "NC" ); + a.setPostalCode( "27613-3502" ); + a.setCountry( "U.S.A." ); + addr.insertAddress( a ); + return addr; +} + +Addressee +vcard2() +{ + Addressee addr; + + addr.setName( "Tim Howes" ); + addr.setOrganization( "Netscape Communications Corp." ); + addr.insertEmail( "howes@netscape.com" ); + addr.insertPhoneNumber( PhoneNumber("+1-415-937-3419",PhoneNumber::Voice|PhoneNumber::Msg + |PhoneNumber::Work) ); + addr.insertPhoneNumber( PhoneNumber("+1-415-528-4164",PhoneNumber::Fax |PhoneNumber::Work) ); + Address a( Address::Work ); + a.setStreet( "501 E. Middlefield Rd." ); + a.setLocality( "Mountain View" ); + a.setRegion( "CA" ); + a.setPostalCode( "94043" ); + a.setCountry( "U.S.A." ); + addr.insertAddress( a ); + return addr; +} + +Addressee +vcard3() +{ + Addressee addr; + + addr.setName( "ian geiser" ); + addr.setOrganization( "Source eXtreme" ); + addr.insertEmail( "geiseri@yahoo.com" ); + addr.setTitle( "VP of Engineering" ); + return addr; +} + + +QString +vcardAsText( const TQString& location ) +{ + TQString line; + TQFile file( location ); + if ( file.open( IO_ReadOnly ) ) { + TQTextStream stream( &file ); + if ( !stream.eof() ) { + line = stream.read(); + } + file.close(); + } + return line; +} + +Addressee::List +vCardsAsAddresseeList() +{ + Addressee::List l; + + l.append( vcard1() ); + l.append( vcard2() ); + l.append( vcard3() ); + + return l; +} + +QString +vCardsAsText() +{ + TQString vcards = vcardAsText( "tests/vcard1.vcf" ); + vcards += vcardAsText( "tests/vcard2.vcf" ); + vcards += vcardAsText( "tests/vcard3.vcf" ); + + return vcards; +} diff --git a/tdeabc/vcardparser/testutils.h b/tdeabc/vcardparser/testutils.h new file mode 100644 index 000000000..c8218b7ba --- /dev/null +++ b/tdeabc/vcardparser/testutils.h @@ -0,0 +1,14 @@ +#ifndef TESTUTILS_H +#define TESTUTILS_H + +#include <tdeabc/addressee.h> +#include <tqstring.h> + +KABC::Addressee vcard1(); +KABC::Addressee vcard2(); +KABC::Addressee vcard3(); +KABC::Addressee::List vCardsAsAddresseeList(); +TQString vCardAsText( const TQString& location ); +TQString vCardsAsText(); + +#endif diff --git a/tdeabc/vcardparser/testwrite.cpp b/tdeabc/vcardparser/testwrite.cpp new file mode 100644 index 000000000..e40ffe4d0 --- /dev/null +++ b/tdeabc/vcardparser/testwrite.cpp @@ -0,0 +1,134 @@ +/* + This file is part of libkabc. + + 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 <tdeabc/addressee.h> +#include <tdeabc/phonenumber.h> +#include <tdeabc/address.h> +#include <tdeabc/key.h> +#include <tdeabc/picture.h> +#include <tdeabc/sound.h> +#include <tdeabc/secrecy.h> +#include <tdeaboutdata.h> +#include <tdeapplication.h> +#include <tdecmdlineargs.h> + +#include <tqfile.h> +#include <tqtextstream.h> + +#include "vcardconverter.h" + +int main( int argc, char **argv ) +{ + TDEAboutData aboutData( "testwrite", "vCard test writer", "0.1" ); + + TDECmdLineArgs::init( argc, argv, &aboutData ); + + TDEApplication app( false, false ); + + + KABC::Addressee addressee; + + addressee.setNameFromString( "Mr. Tobias Koenig Jr." ); + addressee.setNickName( "tokoe" ); + addressee.setBirthday( TQDate( 1982, 7, 19 ) ); + addressee.setMailer( "mutt1.2" ); + addressee.setTimeZone( KABC::TimeZone( +2 ) ); + + KABC::Geo geo; + geo.setLatitude( 30 ); + geo.setLongitude( 51 ); + addressee.setGeo( geo ); + + addressee.setTitle( "nerd" ); + addressee.setRole( "Maintainer" ); + addressee.setOrganization( "KDE" ); + addressee.setNote( "nerver\ntouch a running system" ); + addressee.setProductId( "testId" ); + addressee.setRevision( TQDateTime::currentDateTime() ); + addressee.setSortString( "koenig" ); + addressee.setUrl( KURL( "http://wgess16.dyndns.org") ); + addressee.setSecrecy( KABC::Secrecy( KABC::Secrecy::Confidential ) ); +/* + TQImage img; + img.load( "testimg.png", "PNG" ); + KABC::Picture photo; + photo.setData( img ); + addressee.setPhoto( photo ); + + TQImage img2; + img2.load( "testimg.png", "PNG" ); + KABC::Picture logo; + logo.setData( img2 ); + addressee.setLogo( logo ); + + TQFile soundFile( "testsound.wav" ); + soundFile.open( IO_ReadOnly ); + TQByteArray data = soundFile.readAll(); + soundFile.close(); + KABC::Sound sound; + sound.setData( data ); + addressee.setSound( sound ); +*/ + addressee.insertEmail( "tokoe@kde.org", true ); + addressee.insertEmail( "tokoe82@yahoo.de", true ); + + KABC::PhoneNumber phone1( "3541523475", KABC::PhoneNumber::Pref | KABC::PhoneNumber::Home ); + KABC::PhoneNumber phone2( "+46745673475", KABC::PhoneNumber::Work ); + addressee.insertPhoneNumber( phone1 ); + addressee.insertPhoneNumber( phone2 ); + + KABC::Key key( "secret key", KABC::Key::X509 ); + addressee.insertKey( key ); + + TQStringList categories; + categories << "Friends" << "School" << "KDE"; + addressee.setCategories( categories ); + + KABC::Address a( KABC::Address::Work | KABC::Address::Postal | KABC::Address::Parcel ); + a.setStreet( "6544 Battleford Drive" ); + a.setLocality( "Raleigh" ); + a.setRegion( "NC" ); + a.setPostalCode( "27613-3502" ); + a.setCountry( "U.S.A." ); + addressee.insertAddress( a ); + + addressee.insertCustom( "1hsdf", "ertuer", "iurt" ); + addressee.insertCustom( "2hsdf", "ertuer", "iurt" ); + addressee.insertCustom( "3hsdf", "ertuer", "iurt" ); + + KABC::Addressee::List list; + for ( int i = 0; i < 1000; ++i ) { + KABC::Addressee addr = addressee; + addr.setUid( TQString::number( i ) ); + list.append( addr ); + } + + KABC::VCardConverter converter; + TQString txt = converter.createVCards( list ); + + TQFile file( "out.vcf" ); + file.open( IO_WriteOnly ); + + TQTextStream s( &file ); + s.setEncoding( TQTextStream::UnicodeUTF8 ); + s << txt; + file.close(); + + return 0; +} diff --git a/tdeabc/vcardparser/vcard.cpp b/tdeabc/vcardparser/vcard.cpp new file mode 100644 index 000000000..30a8e1c49 --- /dev/null +++ b/tdeabc/vcardparser/vcard.cpp @@ -0,0 +1,109 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 "vcard.h" + +using namespace KABC; + +VCard::VCard() +{ +} + +VCard::VCard( const VCard& vcard ) +{ + mLineMap = vcard.mLineMap; +} + +VCard::~VCard() +{ +} + +VCard& VCard::operator=( const VCard& vcard ) +{ + if ( &vcard == this ) + return *this; + + mLineMap = vcard.mLineMap; + + return *this; +} + +void VCard::clear() +{ + mLineMap.clear(); +} + +TQStringList VCard::identifiers() const +{ + return mLineMap.keys(); +} + +void VCard::addLine( const VCardLine& line ) +{ + mLineMap[ line.identifier() ].append( line ); +} + +VCardLine::List VCard::lines( const TQString& identifier ) const +{ + LineMap::ConstIterator it = mLineMap.find( identifier ); + if ( it == mLineMap.end() ) + return VCardLine::List(); + + return *it; +} + +VCardLine VCard::line( const TQString& identifier ) const +{ + LineMap::ConstIterator it = mLineMap.find( identifier ); + if ( it == mLineMap.end() ) + return VCardLine(); + + if ( (*it).isEmpty() ) + return VCardLine(); + else + return (*it).first(); +} + +void VCard::setVersion( Version version ) +{ + mLineMap.erase( "VERSION" ); + + VCardLine line; + line.setIdentifier( "VERSION" ); + if ( version == v2_1 ) + line.setIdentifier( "2.1" ); + else if ( version == v3_0 ) + line.setIdentifier( "3.0" ); + + mLineMap[ "VERSION" ].append( line ); +} + +VCard::Version VCard::version() const +{ + LineMap::ConstIterator versionEntry = mLineMap.find( "VERSION" ); + if ( versionEntry == mLineMap.end() ) + return v3_0; + + VCardLine line = ( *versionEntry )[ 0 ]; + if ( line.value() == "2.1" ) + return v2_1; + else + return v3_0; +} diff --git a/tdeabc/vcardparser/vcard.h b/tdeabc/vcardparser/vcard.h new file mode 100644 index 000000000..6afeeda26 --- /dev/null +++ b/tdeabc/vcardparser/vcard.h @@ -0,0 +1,91 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 VCARDPARSER_VCARD_H +#define VCARDPARSER_VCARD_H + +#include "vcardline.h" +#include <tqmap.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> + +namespace KABC { + +class VCard +{ + public: + typedef TQValueList<VCard> List; + typedef TQMap< TQString, VCardLine::List > LineMap; + + enum Version { v2_1, v3_0 }; + + VCard(); + VCard( const VCard& ); + + ~VCard(); + + VCard& operator=( const VCard& ); + + /** + * Removes all lines from the vCard. + */ + void clear(); + + /** + * Returns a list of all identifiers that exists in the + * vCard. + */ + TQStringList identifiers() const; + + /** + * Adds a VCardLine to the VCard + */ + void addLine( const VCardLine& line ); + + /** + * Returns all lines of the vcard with a special identifier. + */ + VCardLine::List lines( const TQString& identifier ) const; + + /** + * Returns only the first line of the vcard with a special identifier. + */ + VCardLine line( const TQString& identifier ) const; + + /** + * Set the version of the vCard. + */ + void setVersion( Version version ); + + /** + * Returns the version of this vCard. + */ + Version version() const; + + private: + LineMap mLineMap; + + class VCardPrivate; + VCardPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/vcardparser/vcardline.cpp b/tdeabc/vcardparser/vcardline.cpp new file mode 100644 index 000000000..6680cf7d0 --- /dev/null +++ b/tdeabc/vcardparser/vcardline.cpp @@ -0,0 +1,151 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 "vcardline.h" + +using namespace KABC; + +class VCardLine::VCardLinePrivate +{ + public: + TQString mGroup; +}; + +VCardLine::VCardLine() + : d( 0 ) +{ +} + +VCardLine::VCardLine( const TQString &identifier ) + : d( 0 ) +{ + mIdentifier = identifier; +} + +VCardLine::VCardLine( const TQString &identifier, const TQVariant &value ) + : d( 0 ) +{ + mIdentifier = identifier; + mValue = value; +} + +VCardLine::VCardLine( const VCardLine& line ) + : d( 0 ) +{ + mParamMap = line.mParamMap; + mValue = line.mValue; + mIdentifier = line.mIdentifier; +} + +VCardLine::~VCardLine() +{ + delete d; + d = 0; +} + +VCardLine& VCardLine::operator=( const VCardLine& line ) +{ + if ( &line == this ) + return *this; + + mParamMap = line.mParamMap; + mValue = line.mValue; + mIdentifier = line.mIdentifier; + + return *this; +} + +void VCardLine::setIdentifier( const TQString& identifier ) +{ + mIdentifier = identifier; +} + +TQString VCardLine::identifier() const +{ + return mIdentifier; +} + +void VCardLine::setValue( const TQVariant& value ) +{ + mValue = value; +} + +TQVariant VCardLine::value() const +{ + return mValue; +} + +void VCardLine::setGroup( const TQString& group ) +{ + if ( !d ) + d = new VCardLinePrivate(); + + d->mGroup = group; +} + +TQString VCardLine::group() const +{ + if ( d ) + return d->mGroup; + else + return TQString(); +} + +bool VCardLine::hasGroup() const +{ + if ( !d ) + return false; + else + return d->mGroup.isEmpty(); +} + +TQStringList VCardLine::parameterList() const +{ + return mParamMap.keys(); +} + +void VCardLine::addParameter( const TQString& param, const TQString& value ) +{ + TQStringList &list = mParamMap[ param ]; + if ( list.findIndex( value ) == -1 ) // not included yet + list.append( value ); +} + +TQStringList VCardLine::parameters( const TQString& param ) const +{ + ParamMap::ConstIterator it = mParamMap.find( param ); + if ( it == mParamMap.end() ) + return TQStringList(); + else + return *it; +} + +TQString VCardLine::parameter( const TQString& param ) const +{ + ParamMap::ConstIterator it = mParamMap.find( param ); + if ( it == mParamMap.end() ) + return TQString::null; + else { + if ( (*it).isEmpty() ) + return TQString::null; + else + return (*it).first(); + } +} diff --git a/tdeabc/vcardparser/vcardline.h b/tdeabc/vcardparser/vcardline.h new file mode 100644 index 000000000..92fe743f6 --- /dev/null +++ b/tdeabc/vcardparser/vcardline.h @@ -0,0 +1,115 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 VCARDLINE_H +#define VCARDLINE_H + +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqvariant.h> +#include <tqmap.h> +#include <tqstring.h> + +namespace KABC { + +class VCardLine +{ + public: + typedef TQValueList<VCardLine> List; + typedef TQMap<TQString, TQStringList> ParamMap; + + VCardLine(); + VCardLine( const TQString &identifier ); + VCardLine( const TQString &identifier, const TQVariant &value ); + VCardLine( const VCardLine& ); + + ~VCardLine(); + + VCardLine& operator=( const VCardLine& ); + + /** + * Sets the identifier of this line e.g. UID, FN, CLASS + */ + void setIdentifier( const TQString& identifier ); + + /** + * Returns the identifier of this line. + */ + TQString identifier() const; + + /** + * Sets the value of of this line. + */ + void setValue( const TQVariant& value ); + + /** + * Returns the value of this line. + */ + TQVariant value() const; + + /** + * Sets the group the line belongs to. + */ + void setGroup( const TQString& group ); + + /** + * Returns the group the line belongs to. + */ + TQString group() const; + + /** + * Returns whether the line belongs to a group. + */ + bool hasGroup() const; + + /** + * Returns all parameters. + */ + TQStringList parameterList() const; + + /** + * Add a new parameter to the line. + */ + void addParameter( const TQString& param, const TQString& value ); + + /** + * Returns the values of a special parameter. + * You can get a list of all parameters with paramList(). + */ + TQStringList parameters( const TQString& param ) const; + + /** + * Returns only the first value of a special parameter. + * You can get a list of all parameters with paramList(). + */ + TQString parameter( const TQString& param ) const; + + private: + ParamMap mParamMap; + TQString mIdentifier; + TQVariant mValue; + + class VCardLinePrivate; + VCardLinePrivate *d; +}; + +} + +#endif diff --git a/tdeabc/vcardparser/vcardparser.cpp b/tdeabc/vcardparser/vcardparser.cpp new file mode 100644 index 000000000..aed9ebd39 --- /dev/null +++ b/tdeabc/vcardparser/vcardparser.cpp @@ -0,0 +1,297 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 <tqregexp.h> +#include <tqtextcodec.h> + +#include <kmdcodec.h> + +#include "vcardparser.h" + +#define FOLD_WIDTH 75 + +using namespace KABC; + +static TQString backslash( "\\\\" ); +static TQString comma( "\\," ); +static TQString newline( "\\n" ); +static TQString cr( "\\r" ); + +static void addEscapes( TQString &str ) +{ + str.replace( '\\', backslash ); + str.replace( ',', comma ); + str.replace( '\r', cr ); + str.replace( '\n', newline ); +} + +static void removeEscapes( TQString &str ) +{ + str.replace( cr, "\\r" ); + str.replace( newline, "\n" ); + str.replace( comma, "," ); + str.replace( backslash, "\\" ); +} + +VCardParser::VCardParser() +{ +} + +VCardParser::~VCardParser() +{ +} + +VCard::List VCardParser::parseVCards( const TQString& text ) +{ + static TQRegExp sep( "[\x0d\x0a]" ); + + VCard currentVCard; + VCard::List vCardList; + TQString currentLine; + + const TQStringList lines = TQStringList::split( sep, text ); + TQStringList::ConstIterator it; + + bool inVCard = false; + TQStringList::ConstIterator linesEnd( lines.end() ); + for ( it = lines.begin(); it != linesEnd; ++it ) { + + if ( (*it).isEmpty() ) // empty line + continue; + + if ( (*it)[ 0 ] == ' ' || (*it)[ 0 ] == '\t' ) { // folded line => append to previous + currentLine += TQString( *it ).remove( 0, 1 ); + continue; + } else { + if ( inVCard && !currentLine.isEmpty() ) { // now parse the line + int colon = currentLine.find( ':' ); + if ( colon == -1 ) { // invalid line + currentLine = (*it); + continue; + } + + VCardLine vCardLine; + const TQString key = currentLine.left( colon ).stripWhiteSpace(); + TQString value = currentLine.mid( colon + 1 ); + + TQStringList params = TQStringList::split( ';', key ); + + // check for group + if ( params[0].find( '.' ) != -1 ) { + const TQStringList groupList = TQStringList::split( '.', params[0] ); + vCardLine.setGroup( groupList[0] ); + vCardLine.setIdentifier( groupList[1] ); + } else + vCardLine.setIdentifier( params[0] ); + + if ( params.count() > 1 ) { // find all parameters + TQStringList::ConstIterator paramIt = params.begin(); + for ( ++paramIt; paramIt != params.end(); ++paramIt ) { + TQStringList pair = TQStringList::split( '=', *paramIt ); + if ( pair.size() == 1 ) { + // correct the 2.1 'standard' + if ( pair[0].lower() == "quoted-printable" ) { + pair[0] = "encoding"; + pair[1] = "quoted-printable"; + } else if ( pair[0].lower() == "base64" ) { + pair[0] = "encoding"; + pair[1] = "base64"; + } else { + pair.prepend( "type" ); + } + } + // This is pretty much a faster pair[1].contains( ',' )... + if ( pair[1].find( ',' ) != -1 ) { // parameter in type=x,y,z format + const TQStringList args = TQStringList::split( ',', pair[ 1 ] ); + TQStringList::ConstIterator argIt; + for ( argIt = args.begin(); argIt != args.end(); ++argIt ) + vCardLine.addParameter( pair[0].lower(), *argIt ); + } else + vCardLine.addParameter( pair[0].lower(), pair[1] ); + } + } + + removeEscapes( value ); + + TQByteArray output; + bool wasBase64Encoded = false; + + params = vCardLine.parameterList(); + if ( params.findIndex( "encoding" ) != -1 ) { // have to decode the data + TQByteArray input; + input = TQCString(value.latin1()); + if ( vCardLine.parameter( "encoding" ).lower() == "b" || + vCardLine.parameter( "encoding" ).lower() == "base64" ) { + KCodecs::base64Decode( input, output ); + wasBase64Encoded = true; + } + else if ( vCardLine.parameter( "encoding" ).lower() == "quoted-printable" ) { + // join any qp-folded lines + while ( value.at( value.length() - 1 ) == '=' && it != linesEnd ) { + value = value.remove( value.length() - 1, 1 ) + (*it); + ++it; + } + input = TQCString(value.latin1()); + KCodecs::quotedPrintableDecode( input, output ); + } + } else { + output = TQCString(value.latin1()); + } + + if ( params.findIndex( "charset" ) != -1 ) { // have to convert the data + TQTextCodec *codec = + TQTextCodec::codecForName( vCardLine.parameter( "charset" ).latin1() ); + if ( codec ) { + vCardLine.setValue( codec->toUnicode( output ) ); + } else { + vCardLine.setValue( TQString(TQString::fromUtf8( output )) ); + } + } else if ( wasBase64Encoded ) { + vCardLine.setValue( output ); + } else { // if charset not given, assume it's in UTF-8 (as used in previous KDE versions) + vCardLine.setValue( TQString(TQString::fromUtf8( output )) ); + } + + currentVCard.addLine( vCardLine ); + } + + // we do not save the start and end tag as vcardline + if ( (*it).lower().startsWith( "begin:vcard" ) ) { + inVCard = true; + currentLine.setLength( 0 ); + currentVCard.clear(); // flush vcard + continue; + } + + if ( (*it).lower().startsWith( "end:vcard" ) ) { + inVCard = false; + vCardList.append( currentVCard ); + currentLine.setLength( 0 ); + currentVCard.clear(); // flush vcard + continue; + } + + currentLine = (*it); + } + } + + return vCardList; +} + +TQString VCardParser::createVCards( const VCard::List& list ) +{ + TQString text; + TQString textLine; + TQString encodingType; + TQStringList idents; + TQStringList params; + TQStringList values; + TQStringList::ConstIterator identIt; + TQStringList::Iterator paramIt; + TQStringList::ConstIterator valueIt; + + VCardLine::List lines; + VCardLine::List::ConstIterator lineIt; + VCard::List::ConstIterator cardIt; + + bool hasEncoding; + + text.reserve( list.size() * 300 ); // reserve memory to be more efficient + + // iterate over the cards + VCard::List::ConstIterator listEnd( list.end() ); + for ( cardIt = list.begin(); cardIt != listEnd; ++cardIt ) { + text.append( "BEGIN:VCARD\r\n" ); + + idents = (*cardIt).identifiers(); + for ( identIt = idents.constBegin(); identIt != idents.constEnd(); ++identIt ) { + lines = (*cardIt).lines( (*identIt) ); + + // iterate over the lines + for ( lineIt = lines.constBegin(); lineIt != lines.constEnd(); ++lineIt ) { + if ( !(*lineIt).value().asString().isEmpty() ) { + if ((*lineIt).identifier() != TQString("URI")) { + if ( (*lineIt).hasGroup() ) + textLine = (*lineIt).group() + "." + (*lineIt).identifier(); + else + textLine = (*lineIt).identifier(); + + params = (*lineIt).parameterList(); + hasEncoding = false; + if ( params.count() > 0 ) { // we have parameters + for ( paramIt = params.begin(); paramIt != params.end(); ++paramIt ) { + if ( (*paramIt) == "encoding" ) { + hasEncoding = true; + encodingType = (*lineIt).parameter( "encoding" ).lower(); + } + + values = (*lineIt).parameters( *paramIt ); + for ( valueIt = values.constBegin(); valueIt != values.constEnd(); ++valueIt ) { + textLine.append( ";" + (*paramIt).upper() ); + if ( !(*valueIt).isEmpty() ) + textLine.append( "=" + (*valueIt) ); + } + } + } + + if ( hasEncoding ) { // have to encode the data + TQByteArray input, output; + if ( encodingType == "b" ) { + input = (*lineIt).value().toByteArray(); + KCodecs::base64Encode( input, output ); + } else if ( encodingType == "quoted-printable" ) { + input = (*lineIt).value().toString().utf8(); + input.resize( input.size() - 1 ); // strip \0 + KCodecs::quotedPrintableEncode( input, output, false ); + } + + TQString value( output ); + addEscapes( value ); + textLine.append( ":" + value ); + } else { + TQString value( (*lineIt).value().asString() ); + addEscapes( value ); + textLine.append( ":" + value ); + } + + if ( textLine.length() > FOLD_WIDTH ) { // we have to fold the line + for ( uint i = 0; i <= ( textLine.length() / FOLD_WIDTH ); ++i ) + text.append( ( i == 0 ? "" : " " ) + textLine.mid( i * FOLD_WIDTH, FOLD_WIDTH ) + "\r\n" ); + } else + text.append( textLine + "\r\n" ); + } + else { + // URIs can be full of weird symbols, etc. so bypass all checks + textLine = (*lineIt).identifier(); + TQString value( (*lineIt).value().asString() ); + addEscapes( value ); + textLine.append( ":" + value ); + text.append( textLine + "\r\n" ); + } + } + } + } + + text.append( "END:VCARD\r\n" ); + text.append( "\r\n" ); + } + + return text; +} diff --git a/tdeabc/vcardparser/vcardparser.h b/tdeabc/vcardparser/vcardparser.h new file mode 100644 index 000000000..da5fdd46e --- /dev/null +++ b/tdeabc/vcardparser/vcardparser.h @@ -0,0 +1,44 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 VCARDPARSER_H +#define VCARDPARSER_H + +#include "vcard.h" + +namespace KABC { + +class VCardParser +{ + public: + VCardParser(); + ~VCardParser(); + + static VCard::List parseVCards( const TQString& text ); + static TQString createVCards( const VCard::List& list ); + + private: + class VCardParserPrivate; + VCardParserPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/vcardtool.cpp b/tdeabc/vcardtool.cpp new file mode 100644 index 000000000..295360a03 --- /dev/null +++ b/tdeabc/vcardtool.cpp @@ -0,0 +1,896 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 <tqbuffer.h> +#include <tqdatastream.h> +#include <tqstring.h> + +#include "agent.h" +#include "key.h" +#include "picture.h" +#include "secrecy.h" +#include "sound.h" + +#include "vcardtool.h" + +using namespace KABC; + +static bool needsEncoding( const TQString &value ) +{ + uint length = value.length(); + for ( uint i = 0; i < length; ++i ) { + char c = value.at( i ).latin1(); + if ( (c < 33 || c > 126) && c != ' ' && c != '=' ) + return true; + } + + return false; +} + +VCardTool::VCardTool() +{ + mAddressTypeMap.insert( "dom", Address::Dom ); + mAddressTypeMap.insert( "intl", Address::Intl ); + mAddressTypeMap.insert( "postal", Address::Postal ); + mAddressTypeMap.insert( "parcel", Address::Parcel ); + mAddressTypeMap.insert( "home", Address::Home ); + mAddressTypeMap.insert( "work", Address::Work ); + mAddressTypeMap.insert( "pref", Address::Pref ); + + mPhoneTypeMap.insert( "HOME", PhoneNumber::Home ); + mPhoneTypeMap.insert( "WORK", PhoneNumber::Work ); + mPhoneTypeMap.insert( "MSG", PhoneNumber::Msg ); + mPhoneTypeMap.insert( "PREF", PhoneNumber::Pref ); + mPhoneTypeMap.insert( "VOICE", PhoneNumber::Voice ); + mPhoneTypeMap.insert( "FAX", PhoneNumber::Fax ); + mPhoneTypeMap.insert( "CELL", PhoneNumber::Cell ); + mPhoneTypeMap.insert( "VIDEO", PhoneNumber::Video ); + mPhoneTypeMap.insert( "BBS", PhoneNumber::Bbs ); + mPhoneTypeMap.insert( "MODEM", PhoneNumber::Modem ); + mPhoneTypeMap.insert( "CAR", PhoneNumber::Car ); + mPhoneTypeMap.insert( "ISDN", PhoneNumber::Isdn ); + mPhoneTypeMap.insert( "PCS", PhoneNumber::Pcs ); + mPhoneTypeMap.insert( "PAGER", PhoneNumber::Pager ); +} + +VCardTool::~VCardTool() +{ +} + +// TODO: make list a const& +TQString VCardTool::createVCards( Addressee::List list, VCard::Version version ) +{ + VCard::List vCardList; + + Addressee::List::ConstIterator addrIt; + Addressee::List::ConstIterator listEnd( list.constEnd() ); + for ( addrIt = list.constBegin(); addrIt != listEnd; ++addrIt ) { + VCard card; + TQStringList::ConstIterator strIt; + + // ADR + LABEL + const Address::List addresses = (*addrIt).addresses(); + for ( Address::List::ConstIterator it = addresses.begin(); it != addresses.end(); ++it ) { + TQStringList address; + + bool isEmpty = ( (*it).postOfficeBox().isEmpty() && + (*it).extended().isEmpty() && + (*it).street().isEmpty() && + (*it).locality().isEmpty() && + (*it).region().isEmpty() && + (*it).postalCode().isEmpty() && + (*it).country().isEmpty() ); + + address.append( (*it).postOfficeBox().replace( ';', "\\;" ) ); + address.append( (*it).extended().replace( ';', "\\;" ) ); + address.append( (*it).street().replace( ';', "\\;" ) ); + address.append( (*it).locality().replace( ';', "\\;" ) ); + address.append( (*it).region().replace( ';', "\\;" ) ); + address.append( (*it).postalCode().replace( ';', "\\;" ) ); + address.append( (*it).country().replace( ';', "\\;" ) ); + + VCardLine adrLine( "ADR", address.join( ";" ) ); + if ( version == VCard::v2_1 && needsEncoding( address.join( ";" ) ) ) { + adrLine.addParameter( "charset", "UTF-8" ); + adrLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + + VCardLine labelLine( "LABEL", (*it).label() ); + if ( version == VCard::v2_1 && needsEncoding( (*it).label() ) ) { + labelLine.addParameter( "charset", "UTF-8" ); + labelLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + + bool hasLabel = !(*it).label().isEmpty(); + TQMap<TQString, int>::ConstIterator typeIt; + for ( typeIt = mAddressTypeMap.constBegin(); typeIt != mAddressTypeMap.constEnd(); ++typeIt ) { + if ( typeIt.data() & (*it).type() ) { + adrLine.addParameter( "TYPE", typeIt.key() ); + if ( hasLabel ) + labelLine.addParameter( "TYPE", typeIt.key() ); + } + } + + if ( !isEmpty ) + card.addLine( adrLine ); + if ( hasLabel ) + card.addLine( labelLine ); + } + + // AGENT + card.addLine( createAgent( version, (*addrIt).agent() ) ); + + // BDAY + card.addLine( VCardLine( "BDAY", createDateTime( TQT_TQDATETIME_OBJECT((*addrIt).birthday()) ) ) ); + + // CATEGORIES + if ( version == VCard::v3_0 ) { + TQStringList categories = (*addrIt).categories(); + TQStringList::Iterator catIt; + for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) + (*catIt).replace( ',', "\\," ); + + VCardLine catLine( "CATEGORIES", categories.join( "," ) ); + if ( version == VCard::v2_1 && needsEncoding( categories.join( "," ) ) ) { + catLine.addParameter( "charset", "UTF-8" ); + catLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + + card.addLine( catLine ); + } + + // CLASS + if ( version == VCard::v3_0 ) { + card.addLine( createSecrecy( (*addrIt).secrecy() ) ); + } + + // EMAIL + const TQStringList emails = (*addrIt).emails(); + bool pref = true; + for ( strIt = emails.begin(); strIt != emails.end(); ++strIt ) { + VCardLine line( "EMAIL", *strIt ); + if ( pref == true && emails.count() > 1 ) { + line.addParameter( "TYPE", "PREF" ); + pref = false; + } + card.addLine( line ); + } + + // FN + VCardLine fnLine( "FN", TQString((*addrIt).formattedName()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).formattedName() ) ) { + fnLine.addParameter( "charset", "UTF-8" ); + fnLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( fnLine ); + + // GEO + Geo geo = (*addrIt).geo(); + if ( geo.isValid() ) { + TQString str; + str.sprintf( "%.6f;%.6f", geo.latitude(), geo.longitude() ); + card.addLine( VCardLine( "GEO", str ) ); + } + + // KEY + const Key::List keys = (*addrIt).keys(); + Key::List::ConstIterator keyIt; + for ( keyIt = keys.begin(); keyIt != keys.end(); ++keyIt ) + card.addLine( createKey( *keyIt ) ); + + // LOGO + card.addLine( createPicture( "LOGO", (*addrIt).logo() ) ); + + // MAILER + VCardLine mailerLine( "MAILER", TQString((*addrIt).mailer()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).mailer() ) ) { + mailerLine.addParameter( "charset", "UTF-8" ); + mailerLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( mailerLine ); + + // N + TQStringList name; + name.append( (*addrIt).familyName().replace( ';', "\\;" ) ); + name.append( (*addrIt).givenName().replace( ';', "\\;" ) ); + name.append( (*addrIt).additionalName().replace( ';', "\\;" ) ); + name.append( (*addrIt).prefix().replace( ';', "\\;" ) ); + name.append( (*addrIt).suffix().replace( ';', "\\;" ) ); + + VCardLine nLine( "N", name.join( ";" ) ); + if ( version == VCard::v2_1 && needsEncoding( name.join( ";" ) ) ) { + nLine.addParameter( "charset", "UTF-8" ); + nLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( nLine ); + + // NAME + VCardLine nameLine( "NAME", TQString((*addrIt).name()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).name() ) ) { + nameLine.addParameter( "charset", "UTF-8" ); + nameLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( nameLine ); + + // NICKNAME + if ( version == VCard::v3_0 ) + card.addLine( VCardLine( "NICKNAME", TQString((*addrIt).nickName()) ) ); + + // NOTE + VCardLine noteLine( "NOTE", TQString((*addrIt).note()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).note() ) ) { + noteLine.addParameter( "charset", "UTF-8" ); + noteLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( noteLine ); + + // ORG + TQStringList organization; + organization.append( ( *addrIt ).organization().replace( ';', "\\;" ) ); + if ( !( *addrIt ).department().isEmpty() ) + organization.append( ( *addrIt ).department().replace( ';', "\\;" ) ); + VCardLine orgLine( "ORG", organization.join( ";" ) ); + if ( version == VCard::v2_1 && needsEncoding( organization.join( ";" ) ) ) { + orgLine.addParameter( "charset", "UTF-8" ); + orgLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( orgLine ); + + // PHOTO + card.addLine( createPicture( "PHOTO", (*addrIt).photo() ) ); + + // PROID + if ( version == VCard::v3_0 ) + card.addLine( VCardLine( "PRODID", TQString((*addrIt).productId()) ) ); + + // REV + card.addLine( VCardLine( "REV", createDateTime( TQT_TQDATETIME_OBJECT((*addrIt).revision()) ) ) ); + + // ROLE + VCardLine roleLine( "ROLE", TQString((*addrIt).role()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).role() ) ) { + roleLine.addParameter( "charset", "UTF-8" ); + roleLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( roleLine ); + + // SORT-STRING + if ( version == VCard::v3_0 ) + card.addLine( VCardLine( "SORT-STRING", TQString((*addrIt).sortString()) ) ); + + // SOUND + card.addLine( createSound( (*addrIt).sound() ) ); + + // TEL + const PhoneNumber::List phoneNumbers = (*addrIt).phoneNumbers(); + PhoneNumber::List::ConstIterator phoneIt; + for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { + VCardLine line( "TEL", (*phoneIt).number() ); + + TQMap<TQString, int>::ConstIterator typeIt; + for ( typeIt = mPhoneTypeMap.constBegin(); typeIt != mPhoneTypeMap.constEnd(); ++typeIt ) { + if ( typeIt.data() & (*phoneIt).type() ) + line.addParameter( "TYPE", typeIt.key() ); + } + + card.addLine( line ); + } + + // TITLE + VCardLine titleLine( "TITLE", TQString((*addrIt).title()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).title() ) ) { + titleLine.addParameter( "charset", "UTF-8" ); + titleLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( titleLine ); + + // TZ + TimeZone timeZone = (*addrIt).timeZone(); + if ( timeZone.isValid() ) { + TQString str; + + int neg = 1; + if ( timeZone.offset() < 0 ) + neg = -1; + + str.sprintf( "%c%02d:%02d", ( timeZone.offset() >= 0 ? '+' : '-' ), + ( timeZone.offset() / 60 ) * neg, + ( timeZone.offset() % 60 ) * neg ); + + card.addLine( VCardLine( "TZ", str ) ); + } + + // UID + card.addLine( VCardLine( "UID", (*addrIt).uid() ) ); + + // UID + card.addLine( VCardLine( "URI", (*addrIt).uri() ) ); + + // URL + card.addLine( VCardLine( "URL", (*addrIt).url().url() ) ); + + // VERSION + if ( version == VCard::v2_1 ) + card.addLine( VCardLine( "VERSION", "2.1" ) ); + if ( version == VCard::v3_0 ) + card.addLine( VCardLine( "VERSION", "3.0" ) ); + + // X- + const TQStringList customs = (*addrIt).customs(); + for ( strIt = customs.begin(); strIt != customs.end(); ++strIt ) { + TQString identifier = "X-" + (*strIt).left( (*strIt).find( ":" ) ); + TQString value = (*strIt).mid( (*strIt).find( ":" ) + 1 ); + if ( value.isEmpty() ) + continue; + + VCardLine line( identifier, value ); + if ( version == VCard::v2_1 && needsEncoding( value ) ) { + line.addParameter( "charset", "UTF-8" ); + line.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( line ); + } + + vCardList.append( card ); + } + + return VCardParser::createVCards( vCardList ); +} + +Addressee::List VCardTool::parseVCards( const TQString& vcard ) +{ + static const TQChar semicolonSep( ';' ); + static const TQChar commaSep( ',' ); + TQString identifier; + + Addressee::List addrList; + const VCard::List vCardList = VCardParser::parseVCards( vcard ); + + VCard::List::ConstIterator cardIt; + VCard::List::ConstIterator listEnd( vCardList.end() ); + for ( cardIt = vCardList.begin(); cardIt != listEnd; ++cardIt ) { + Addressee addr; + + const TQStringList idents = (*cardIt).identifiers(); + TQStringList::ConstIterator identIt; + TQStringList::ConstIterator identEnd( idents.end() ); + for ( identIt = idents.begin(); identIt != identEnd; ++identIt ) { + const VCardLine::List lines = (*cardIt).lines( (*identIt) ); + VCardLine::List::ConstIterator lineIt; + + // iterate over the lines + for ( lineIt = lines.begin(); lineIt != lines.end(); ++lineIt ) { + identifier = (*lineIt).identifier().lower(); + // ADR + if ( identifier == "adr" ) { + Address address; + const TQStringList addrParts = splitString( semicolonSep, (*lineIt).value().asString() ); + if ( addrParts.count() > 0 ) + address.setPostOfficeBox( addrParts[ 0 ] ); + if ( addrParts.count() > 1 ) + address.setExtended( addrParts[ 1 ] ); + if ( addrParts.count() > 2 ) + address.setStreet( addrParts[ 2 ] ); + if ( addrParts.count() > 3 ) + address.setLocality( addrParts[ 3 ] ); + if ( addrParts.count() > 4 ) + address.setRegion( addrParts[ 4 ] ); + if ( addrParts.count() > 5 ) + address.setPostalCode( addrParts[ 5 ] ); + if ( addrParts.count() > 6 ) + address.setCountry( addrParts[ 6 ] ); + + int type = 0; + + const TQStringList types = (*lineIt).parameters( "type" ); + for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) + type += mAddressTypeMap[ (*it).lower() ]; + + address.setType( type ); + addr.insertAddress( address ); + } + + // AGENT + else if ( identifier == "agent" ) + addr.setAgent( parseAgent( *lineIt ) ); + + // BDAY + else if ( identifier == "bday" ) + addr.setBirthday( parseDateTime( (*lineIt).value().asString() ) ); + + // CATEGORIES + else if ( identifier == "categories" ) { + const TQStringList categories = splitString( commaSep, (*lineIt).value().asString() ); + addr.setCategories( categories ); + } + + // CLASS + else if ( identifier == "class" ) + addr.setSecrecy( parseSecrecy( *lineIt ) ); + + // EMAIL + else if ( identifier == "email" ) { + const TQStringList types = (*lineIt).parameters( "type" ); + addr.insertEmail( (*lineIt).value().asString(), types.findIndex( "PREF" ) != -1 ); + } + + // FN + else if ( identifier == "fn" ) + addr.setFormattedName( (*lineIt).value().asString() ); + + // GEO + else if ( identifier == "geo" ) { + Geo geo; + + const TQStringList geoParts = TQStringList::split( ';', (*lineIt).value().asString(), true ); + geo.setLatitude( geoParts[ 0 ].toFloat() ); + geo.setLongitude( geoParts[ 1 ].toFloat() ); + + addr.setGeo( geo ); + } + + // KEY + else if ( identifier == "key" ) + addr.insertKey( parseKey( *lineIt ) ); + + // LABEL + else if ( identifier == "label" ) { + int type = 0; + + const TQStringList types = (*lineIt).parameters( "type" ); + for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) + type += mAddressTypeMap[ (*it).lower() ]; + + bool available = false; + KABC::Address::List addressList = addr.addresses(); + KABC::Address::List::Iterator it; + for ( it = addressList.begin(); it != addressList.end(); ++it ) { + if ( (*it).type() == type ) { + (*it).setLabel( (*lineIt).value().asString() ); + addr.insertAddress( *it ); + available = true; + break; + } + } + + if ( !available ) { // a standalone LABEL tag + KABC::Address address( type ); + address.setLabel( (*lineIt).value().asString() ); + addr.insertAddress( address ); + } + } + + // LOGO + else if ( identifier == "logo" ) + addr.setLogo( parsePicture( *lineIt ) ); + + // MAILER + else if ( identifier == "mailer" ) + addr.setMailer( (*lineIt).value().asString() ); + + // N + else if ( identifier == "n" ) { + const TQStringList nameParts = splitString( semicolonSep, (*lineIt).value().asString() ); + if ( nameParts.count() > 0 ) + addr.setFamilyName( nameParts[ 0 ] ); + if ( nameParts.count() > 1 ) + addr.setGivenName( nameParts[ 1 ] ); + if ( nameParts.count() > 2 ) + addr.setAdditionalName( nameParts[ 2 ] ); + if ( nameParts.count() > 3 ) + addr.setPrefix( nameParts[ 3 ] ); + if ( nameParts.count() > 4 ) + addr.setSuffix( nameParts[ 4 ] ); + } + + // NAME + else if ( identifier == "name" ) + addr.setName( (*lineIt).value().asString() ); + + // NICKNAME + else if ( identifier == "nickname" ) + addr.setNickName( (*lineIt).value().asString() ); + + // NOTE + else if ( identifier == "note" ) + addr.setNote( (*lineIt).value().asString() ); + + // ORGANIZATION + else if ( identifier == "org" ) { + const TQStringList orgParts = splitString( semicolonSep, (*lineIt).value().asString() ); + if ( orgParts.count() > 0 ) + addr.setOrganization( orgParts[ 0 ] ); + if ( orgParts.count() > 1 ) + addr.setDepartment( orgParts[ 1 ] ); + } + + // PHOTO + else if ( identifier == "photo" ) + addr.setPhoto( parsePicture( *lineIt ) ); + + // PROID + else if ( identifier == "prodid" ) + addr.setProductId( (*lineIt).value().asString() ); + + // REV + else if ( identifier == "rev" ) + addr.setRevision( parseDateTime( (*lineIt).value().asString() ) ); + + // ROLE + else if ( identifier == "role" ) + addr.setRole( (*lineIt).value().asString() ); + + // SORT-STRING + else if ( identifier == "sort-string" ) + addr.setSortString( (*lineIt).value().asString() ); + + // SOUND + else if ( identifier == "sound" ) + addr.setSound( parseSound( *lineIt ) ); + + // TEL + else if ( identifier == "tel" ) { + PhoneNumber phone; + phone.setNumber( (*lineIt).value().asString() ); + + int type = 0; + + const TQStringList types = (*lineIt).parameters( "type" ); + for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) + type += mPhoneTypeMap[(*it).upper()]; + + phone.setType( type ); + + addr.insertPhoneNumber( phone ); + } + + // TITLE + else if ( identifier == "title" ) + addr.setTitle( (*lineIt).value().asString() ); + + // TZ + else if ( identifier == "tz" ) { + TimeZone tz; + const TQString date = (*lineIt).value().asString(); + + int hours = date.mid( 1, 2).toInt(); + int minutes = date.mid( 4, 2 ).toInt(); + int offset = ( hours * 60 ) + minutes; + offset = offset * ( date[ 0 ] == '+' ? 1 : -1 ); + + tz.setOffset( offset ); + addr.setTimeZone( tz ); + } + + // UID + else if ( identifier == "uid" ) + addr.setUid( (*lineIt).value().asString() ); + + // URI + else if ( identifier == "uri" ) + addr.setUri( (*lineIt).value().asString() ); + + // URL + else if ( identifier == "url" ) + addr.setUrl( KURL( (*lineIt).value().asString() ) ); + + // X- + else if ( identifier.startsWith( "x-" ) ) { + const TQString key = (*lineIt).identifier().mid( 2 ); + int dash = key.find( "-" ); + addr.insertCustom( key.left( dash ), key.mid( dash + 1 ), (*lineIt).value().asString() ); + } + } + } + + addrList.append( addr ); + } + + return addrList; +} + +TQDateTime VCardTool::parseDateTime( const TQString &str ) +{ + TQDateTime dateTime; + + if ( str.find( '-' ) == -1 ) { // is base format (yyyymmdd) + dateTime.setDate( TQDate( str.left( 4 ).toInt(), str.mid( 4, 2 ).toInt(), + str.mid( 6, 2 ).toInt() ) ); + + if ( str.find( 'T' ) ) // has time information yyyymmddThh:mm:ss + dateTime.setTime( TQTime( str.mid( 11, 2 ).toInt(), str.mid( 14, 2 ).toInt(), + str.mid( 17, 2 ).toInt() ) ); + + } else { // is extended format yyyy-mm-dd + dateTime.setDate( TQDate( str.left( 4 ).toInt(), str.mid( 5, 2 ).toInt(), + str.mid( 8, 2 ).toInt() ) ); + + if ( str.find( 'T' ) ) // has time information yyyy-mm-ddThh:mm:ss + dateTime.setTime( TQTime( str.mid( 11, 2 ).toInt(), str.mid( 14, 2 ).toInt(), + str.mid( 17, 2 ).toInt() ) ); + } + + return dateTime; +} + +TQString VCardTool::createDateTime( const TQDateTime &dateTime ) +{ + TQString str; + + if ( dateTime.date().isValid() ) { + str.sprintf( "%4d-%02d-%02d", dateTime.date().year(), dateTime.date().month(), + dateTime.date().day() ); + if ( dateTime.time().isValid() ) { + TQString tmp; + tmp.sprintf( "T%02d:%02d:%02dZ", dateTime.time().hour(), dateTime.time().minute(), + dateTime.time().second() ); + str += tmp; + } + } + + return str; +} + +Picture VCardTool::parsePicture( const VCardLine &line ) +{ + Picture pic; + + const TQStringList params = line.parameterList(); + if ( params.findIndex( "encoding" ) != -1 ) { + TQImage img; + img.loadFromData( line.value().asByteArray() ); + pic.setData( img ); + } else if ( params.findIndex( "value" ) != -1 ) { + if ( line.parameter( "value" ).lower() == "uri" ) + pic.setUrl( line.value().asString() ); + } + + if ( params.findIndex( "type" ) != -1 ) + pic.setType( line.parameter( "type" ) ); + + return pic; +} + +VCardLine VCardTool::createPicture( const TQString &identifier, const Picture &pic ) +{ + VCardLine line( identifier ); + + if ( pic.isIntern() ) { + if ( !pic.data().isNull() ) { + TQByteArray input; + TQBuffer buffer( input ); + buffer.open( IO_WriteOnly ); + + TQImageIO iio( &buffer, "JPEG" ); + iio.setImage( pic.data() ); + iio.setQuality( 100 ); + iio.write(); + + line.setValue( input ); + line.addParameter( "encoding", "b" ); + line.addParameter( "type", "image/jpeg" ); + } + } else if ( !pic.url().isEmpty() ) { + line.setValue( pic.url() ); + line.addParameter( "value", "URI" ); + } + + return line; +} + +Sound VCardTool::parseSound( const VCardLine &line ) +{ + Sound snd; + + const TQStringList params = line.parameterList(); + if ( params.findIndex( "encoding" ) != -1 ) + snd.setData( line.value().asByteArray() ); + else if ( params.findIndex( "value" ) != -1 ) { + if ( line.parameter( "value" ).lower() == "uri" ) + snd.setUrl( line.value().asString() ); + } + +/* TODO: support sound types + if ( params.contains( "type" ) ) + snd.setType( line.parameter( "type" ) ); +*/ + + return snd; +} + +VCardLine VCardTool::createSound( const Sound &snd ) +{ + VCardLine line( "SOUND" ); + + if ( snd.isIntern() ) { + if ( !snd.data().isEmpty() ) { + line.setValue( snd.data() ); + line.addParameter( "encoding", "b" ); + // TODO: need to store sound type!!! + } + } else if ( !snd.url().isEmpty() ) { + line.setValue( snd.url() ); + line.addParameter( "value", "URI" ); + } + + return line; +} + +Key VCardTool::parseKey( const VCardLine &line ) +{ + Key key; + + const TQStringList params = line.parameterList(); + if ( params.findIndex( "encoding" ) != -1 ) + key.setBinaryData( line.value().asByteArray() ); + else + key.setTextData( line.value().asString() ); + + if ( params.findIndex( "type" ) != -1 ) { + if ( line.parameter( "type" ).lower() == "x509" ) + key.setType( Key::X509 ); + else if ( line.parameter( "type" ).lower() == "pgp" ) + key.setType( Key::PGP ); + else { + key.setType( Key::Custom ); + key.setCustomTypeString( line.parameter( "type" ) ); + } + } + + return key; +} + +VCardLine VCardTool::createKey( const Key &key ) +{ + VCardLine line( "KEY" ); + + if ( key.isBinary() ) { + if ( !key.binaryData().isEmpty() ) { + line.setValue( key.binaryData() ); + line.addParameter( "encoding", "b" ); + } + } else if ( !key.textData().isEmpty() ) + line.setValue( key.textData() ); + + if ( key.type() == Key::X509 ) + line.addParameter( "type", "X509" ); + else if ( key.type() == Key::PGP ) + line.addParameter( "type", "PGP" ); + else if ( key.type() == Key::Custom ) + line.addParameter( "type", key.customTypeString() ); + + return line; +} + +Secrecy VCardTool::parseSecrecy( const VCardLine &line ) +{ + Secrecy secrecy; + + if ( line.value().asString().lower() == "public" ) + secrecy.setType( Secrecy::Public ); + if ( line.value().asString().lower() == "private" ) + secrecy.setType( Secrecy::Private ); + if ( line.value().asString().lower() == "confidential" ) + secrecy.setType( Secrecy::Confidential ); + + return secrecy; +} + +VCardLine VCardTool::createSecrecy( const Secrecy &secrecy ) +{ + VCardLine line( "CLASS" ); + + int type = secrecy.type(); + + if ( type == Secrecy::Public ) + line.setValue( "PUBLIC" ); + else if ( type == Secrecy::Private ) + line.setValue( "PRIVATE" ); + else if ( type == Secrecy::Confidential ) + line.setValue( "CONFIDENTIAL" ); + + return line; +} + +Agent VCardTool::parseAgent( const VCardLine &line ) +{ + Agent agent; + + const TQStringList params = line.parameterList(); + if ( params.findIndex( "value" ) != -1 ) { + if ( line.parameter( "value" ).lower() == "uri" ) + agent.setUrl( line.value().asString() ); + } else { + TQString str = line.value().asString(); + str.replace( "\\n", "\r\n" ); + str.replace( "\\N", "\r\n" ); + str.replace( "\\;", ";" ); + str.replace( "\\:", ":" ); + str.replace( "\\,", "," ); + + const Addressee::List list = parseVCards( str ); + if ( list.count() > 0 ) { + Addressee *addr = new Addressee; + *addr = list[ 0 ]; + agent.setAddressee( addr ); + } + } + + return agent; +} + +VCardLine VCardTool::createAgent( VCard::Version version, const Agent &agent ) +{ + VCardLine line( "AGENT" ); + + if ( agent.isIntern() ) { + if ( agent.addressee() != 0 ) { + Addressee::List list; + list.append( *agent.addressee() ); + + TQString str = createVCards( list, version ); + str.replace( "\r\n", "\\n" ); + str.replace( ";", "\\;" ); + str.replace( ":", "\\:" ); + str.replace( ",", "\\," ); + line.setValue( str ); + } + } else if ( !agent.url().isEmpty() ) { + line.setValue( agent.url() ); + line.addParameter( "value", "URI" ); + } + + return line; +} + +TQStringList VCardTool::splitString( const TQChar &sep, const TQString &str ) +{ + TQStringList list; + TQString value( str ); + + int start = 0; + int pos = value.find( sep, start ); + + while ( pos != -1 ) { + if ( value[ pos - 1 ] != '\\' ) { + if ( pos > start && pos <= (int)value.length() ) + list << value.mid( start, pos - start ); + else + list << TQString::null; + + start = pos + 1; + pos = value.find( sep, start ); + } else { + if ( pos != 0 ) { + value.replace( pos - 1, 2, sep ); + pos = value.find( sep, pos ); + } else + pos = value.find( sep, pos + 1 ); + } + } + + int l = value.length() - 1; + if ( value.mid( start, l - start + 1 ).length() > 0 ) + list << value.mid( start, l - start + 1 ); + else + list << TQString::null; + + return list; +} diff --git a/tdeabc/vcardtool.h b/tdeabc/vcardtool.h new file mode 100644 index 000000000..fbf959613 --- /dev/null +++ b/tdeabc/vcardtool.h @@ -0,0 +1,88 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig <tokoe@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 KABC_VCARDTOOL_H +#define KABC_VCARDTOOL_H + +#include "addressee.h" +#include "vcardparser.h" + +class TQDateTime; + +namespace KABC { + +class Agent; +class Key; +class Picture; +class Secrecy; +class Sound; + +class KABC_EXPORT VCardTool +{ + public: + VCardTool(); + ~VCardTool(); + + /** + Creates a string that contains the addressees from the list in + the vCard format. + */ + TQString createVCards( Addressee::List list, VCard::Version version = VCard::v3_0 ); + + /** + Parses the string and returns a list of addressee objects. + */ + Addressee::List parseVCards( const TQString& vcard ); + + private: + /** + Split a string and replaces escaped separators on the fly with + unescaped ones. + */ + TQStringList splitString( const TQChar &sep, const TQString &value ); + + TQDateTime parseDateTime( const TQString &str ); + TQString createDateTime( const TQDateTime &dateTime ); + + Picture parsePicture( const VCardLine &line ); + VCardLine createPicture( const TQString &identifier, const Picture &pic ); + + Sound parseSound( const VCardLine &line ); + VCardLine createSound( const Sound &snd ); + + Key parseKey( const VCardLine &line ); + VCardLine createKey( const Key &key ); + + Secrecy parseSecrecy( const VCardLine &line ); + VCardLine createSecrecy( const Secrecy &secrecy ); + + Agent parseAgent( const VCardLine &line ); + VCardLine createAgent( VCard::Version version, const Agent &agent ); + + TQMap<TQString, int> mAddressTypeMap; + TQMap<TQString, int> mPhoneTypeMap; + + class VCardToolPrivate; + VCardToolPrivate *d; +}; + +} + +#endif diff --git a/tdecert/tdecertpart.cc b/tdecert/tdecertpart.cc index 7c84f31d1..9a50e6e29 100644 --- a/tdecert/tdecertpart.cc +++ b/tdecert/tdecertpart.cc @@ -24,14 +24,14 @@ #include <kinstance.h> #include <tdeaboutdata.h> #include <tqframe.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tqlabel.h> #include <tqlayout.h> #include <tqbutton.h> #include <tqpushbutton.h> #include <tqcombobox.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kpassdlg.h> #include <ksslall.h> #include <kopenssl.h> diff --git a/tdecmshell/main.cpp b/tdecmshell/main.cpp index 3d54abc45..72f3c66f2 100644 --- a/tdecmshell/main.cpp +++ b/tdecmshell/main.cpp @@ -37,12 +37,12 @@ #include <kdebug.h> #include <kdialogbase.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kservice.h> #include <kservicegroup.h> -#include <kstartupinfo.h> +#include <tdestartupinfo.h> #include <twin.h> -#include <kglobal.h> +#include <tdeglobal.h> #include "main.h" #include "main.moc" diff --git a/tdeconf_update/tdeconf_update.cpp b/tdeconf_update/tdeconf_update.cpp index 458b3b523..814e68a16 100644 --- a/tdeconf_update/tdeconf_update.cpp +++ b/tdeconf_update/tdeconf_update.cpp @@ -30,13 +30,13 @@ #include <tdeconfig.h> #include <ksimpleconfig.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <tdeaboutdata.h> #include <kinstance.h> -#include <ktempfile.h> +#include <tdetempfile.h> static TDECmdLineOptions options[] = { diff --git a/tdecore/CMakeLists.txt b/tdecore/CMakeLists.txt index 850bb10f2..b8f512873 100644 --- a/tdecore/CMakeLists.txt +++ b/tdecore/CMakeLists.txt @@ -74,19 +74,19 @@ install( FILES kurl.h ksock.h tdeaboutdata.h tdecmdlineargs.h tdeconfigbackend.h kapp.h tdeapplication.h kuniqueapp.h kuniqueapplication.h kcharsets.h tdeversion.h kpty.h kprocess.h kprocctrl.h - klocale.h kicontheme.h kiconloader.h kdebug.h twinmodule.h + tdelocale.h kicontheme.h kiconloader.h kdebug.h twinmodule.h twin.h krootprop.h tdeshortcut.h kkeynative.h tdeaccel.h kglobalaccel.h tdestdaccel.h tdeshortcutlist.h kcatalogue.h kregexp.h kcompletion.h kstringhandler.h kstddirs.h - kstandarddirs.h kglobal.h kglobalsettings.h ksharedptr.h + kstandarddirs.h tdeglobal.h tdeglobalsettings.h ksharedptr.h kallocator.h kvmallocator.h kcrash.h krfcdate.h kinstance.h - kpalette.h kipc.h klibloader.h ktempfile.h ksavefile.h + kpalette.h kipc.h klibloader.h tdetempfile.h ksavefile.h krandomsequence.h knotifyclient.h kiconeffect.h kaudioplayer.h kdcoppropertyproxy.h netwm.h tdeaccelmanager.h netwm_def.h kpixmapprovider.h kunload.h kstaticdeleter.h kextsock.h kextendedsocket.h ksockaddr.h kprocio.h kasyncio.h kbufferedio.h kurldrag.h kmimesourcefactory.h kmdcodec.h ksocks.h tdesycoca.h - tdesycocaentry.h tdesycocatype.h kxmessages.h kstartupinfo.h + tdesycocaentry.h tdesycocatype.h kxmessages.h tdestartupinfo.h klargefile.h tdemultipledrag.h kgenericfactory.h kgenericfactory.tcc ktypelist.h ksortablevaluelist.h kdebugclasses.h kclipboard.h kcalendarsystem.h kcalendarsystemfactory.h kmacroexpander.h @@ -123,15 +123,15 @@ set( ${target}_SRCS libintl.cpp tdeapplication.cpp kdebug.cpp netwm.cpp tdeconfigbase.cpp tdeconfig.cpp ksimpleconfig.cpp tdeconfigbackend.cpp kmanagerselection.cpp kdesktopfile.cpp kstandarddirs.cpp - ksock.cpp kpty.cpp kprocess.cpp kprocctrl.cpp klocale.cpp + ksock.cpp kpty.cpp kprocess.cpp kprocctrl.cpp tdelocale.cpp krfcdate.cpp kiconeffect.cpp kicontheme.cpp kiconloader.cpp twin.cpp twinmodule.cpp krootprop.cpp kcharsets.cpp kckey.cpp tdeshortcut.cpp kkeynative_x11.cpp kkeyserver_x11.cpp tdeaccelaction.cpp tdeshortcutmenu.cpp tdeaccelbase.cpp tdeaccel.cpp kglobalaccel_x11.cpp kglobalaccel.cpp tdestdaccel.cpp tdeshortcutlist.cpp - kcrash.cpp kurl.cpp kregexp.cpp kglobal.cpp kglobalsettings.cpp + kcrash.cpp kurl.cpp kregexp.cpp tdeglobal.cpp tdeglobalsettings.cpp kallocator.cpp kvmallocator.cpp kmimesourcefactory.cpp - kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp ktempfile.cpp + kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp tdetempfile.cpp kuniqueapplication.cpp tdeaccelmanager.cpp ksavefile.cpp krandomsequence.cpp kstringhandler.cpp kcompletion.cpp tdecmdlineargs.cpp tdeaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp @@ -139,7 +139,7 @@ set( ${target}_SRCS kextsock.cpp netsupp.cpp kprocio.cpp kbufferedio.cpp kpixmapprovider.cpp kurldrag.cpp kmdcodec.cpp ksocks.cpp fakes.c vsnprintf.c tdesycoca.cpp tdesycocadict.cpp tdesycoca.skel - tdesycocafactory.cpp kxmessages.cpp kstartupinfo.cpp + tdesycocafactory.cpp kxmessages.cpp tdestartupinfo.cpp kcatalogue.cpp kasyncio.cpp tdemultipledrag.cpp kstaticdeleter.cpp kappdcopiface.cpp kappdcopiface.skel kclipboard.cpp kcheckaccelerators.cpp tdeversion.cpp kdebugdcopiface.cpp diff --git a/tdecore/MAINTAINERS b/tdecore/MAINTAINERS index e4a9ad80d..ae94ecd7c 100644 --- a/tdecore/MAINTAINERS +++ b/tdecore/MAINTAINERS @@ -27,10 +27,10 @@ kcrash.cpp Waldo Bastian <bastian@kde.org> kdcoppropertyproxy.cpp kdebug.cpp Stephan Kulow <coolo@kde.org> kdesktopfile.cpp -kglobal.cpp Stephan Kulow <coolo@kde.org> +tdeglobal.cpp Stephan Kulow <coolo@kde.org> kglobalaccel.cpp Ellis Whitehead <ellis@kde.org> kglobalaccel_x11.cpp Ellis Whitehead <ellis@kde.org> -kglobalsettings.cpp David Faure <faure@kde.org> +tdeglobalsettings.cpp David Faure <faure@kde.org> kiconeffect.cpp kiconloader.cpp kicontheme.cpp @@ -41,7 +41,7 @@ kkeynative_x11.cpp Ellis Whitehead <ellis@kde.org> kkeysequence.cpp Ellis Whitehead <ellis@kde.org> kkeysequence_emb.cpp Ellis Whitehead <ellis@kde.org> klibloader.cpp -klocale.cpp Hans Petter Bieker <bieker@kde.org> +tdelocale.cpp Hans Petter Bieker <bieker@kde.org> kmdcodec.cpp kmimesourcefactory.cpp tdemultipledrag.cpp David Faure <faure@kde.org> @@ -60,14 +60,14 @@ tdeshortcut.cpp Ellis Whitehead <ellis@kde.org> ksimpleconfig.cpp Waldo Bastian <bastian@kde.org> ksocks.cpp kstandarddirs.cpp Waldo Bastian <bastian@kde.org> -kstartupinfo.cpp Lubos Lunak <l.lunak@kde.org> +tdestartupinfo.cpp Lubos Lunak <l.lunak@kde.org> kstaticdeleter.cpp Stephan Kulow <coolo@kde.org> tdestdaccel.cpp Ellis Whitehead <ellis@kde.org> kstringhandler.cpp tdesycoca.cpp Waldo Bastian <bastian@kde.org> tdesycocadict.cpp Waldo Bastian <bastian@kde.org> tdesycocafactory.cpp Waldo Bastian <bastian@kde.org> -ktempfile.cpp Waldo Bastian <bastian@kde.org> +tdetempfile.cpp Waldo Bastian <bastian@kde.org> kuniqueapplication.cpp Waldo Bastian <bastian@kde.org> kurl.cpp Waldo Bastian <bastian@kde.org> kurldrag.cpp David Faure <faure@kde.org> diff --git a/tdecore/Makefile.am b/tdecore/Makefile.am index ae5048ed9..c04ee4c6d 100644 --- a/tdecore/Makefile.am +++ b/tdecore/Makefile.am @@ -41,19 +41,19 @@ include_HEADERS = tdeconfig.h tdeconfigskeleton.h \ tdeconfigbase.h kdesktopfile.h kurl.h ksock.h tdeaboutdata.h \ tdecmdlineargs.h tdeconfigbackend.h kapp.h tdeapplication.h kuniqueapp.h \ kuniqueapplication.h kcharsets.h tdeversion.h kpty.h kprocess.h \ - kprocctrl.h klocale.h kicontheme.h kiconloader.h kdebug.h \ + kprocctrl.h tdelocale.h kicontheme.h kiconloader.h kdebug.h \ twinmodule.h twin.h krootprop.h tdeshortcut.h kkeynative.h tdeaccel.h \ kglobalaccel.h tdestdaccel.h tdeshortcutlist.h kcatalogue.h \ kregexp.h kcompletion.h kstringhandler.h \ - kstddirs.h kstandarddirs.h kglobal.h kglobalsettings.h ksharedptr.h \ + kstddirs.h kstandarddirs.h tdeglobal.h tdeglobalsettings.h ksharedptr.h \ kallocator.h kvmallocator.h kcrash.h krfcdate.h \ - kinstance.h kpalette.h kipc.h klibloader.h ktempfile.h ksavefile.h \ + kinstance.h kpalette.h kipc.h klibloader.h tdetempfile.h ksavefile.h \ krandomsequence.h knotifyclient.h kiconeffect.h \ kaudioplayer.h kdcoppropertyproxy.h netwm.h tdeaccelmanager.h \ netwm_def.h kpixmapprovider.h kunload.h kstaticdeleter.h \ kextsock.h kextendedsocket.h ksockaddr.h kprocio.h kasyncio.h \ kbufferedio.h kurldrag.h kmimesourcefactory.h kmdcodec.h ksocks.h \ - tdesycoca.h tdesycocaentry.h tdesycocatype.h kxmessages.h kstartupinfo.h \ + tdesycoca.h tdesycocaentry.h tdesycocatype.h kxmessages.h tdestartupinfo.h \ klargefile.h tdemultipledrag.h kgenericfactory.h kgenericfactory.tcc \ ktypelist.h ksortablevaluelist.h kdebugclasses.h kclipboard.h \ kcalendarsystem.h kcalendarsystemfactory.h kmacroexpander.h \ @@ -93,14 +93,14 @@ libtdecore_la_SOURCES = libintl.cpp tdeapplication.cpp \ kdebug.cpp netwm.cpp tdeconfigbase.cpp tdeconfig.cpp ksimpleconfig.cpp \ tdeconfigbackend.cpp kmanagerselection.cpp kdesktopfile.cpp \ kstandarddirs.cpp ksock.cpp kpty.cpp kprocess.cpp kprocctrl.cpp \ - klocale.cpp krfcdate.cpp kiconeffect.cpp kicontheme.cpp \ + tdelocale.cpp krfcdate.cpp kiconeffect.cpp kicontheme.cpp \ kiconloader.cpp twin.cpp twinmodule.cpp krootprop.cpp kcharsets.cpp \ kckey.cpp tdeshortcut.cpp kkeynative_x11.cpp kkeyserver_x11.cpp \ tdeaccelaction.cpp tdeshortcutmenu.cpp tdeaccelbase.cpp tdeaccel.cpp \ kglobalaccel_x11.cpp kglobalaccel.cpp tdestdaccel.cpp tdeshortcutlist.cpp \ - kcrash.cpp kurl.cpp kregexp.cpp kglobal.cpp kglobalsettings.cpp \ + kcrash.cpp kurl.cpp kregexp.cpp tdeglobal.cpp tdeglobalsettings.cpp \ kallocator.cpp kvmallocator.cpp kmimesourcefactory.cpp \ - kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp ktempfile.cpp \ + kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp tdetempfile.cpp \ kuniqueapplication.cpp tdeaccelmanager.cpp \ ksavefile.cpp krandomsequence.cpp kstringhandler.cpp kcompletion.cpp \ tdecmdlineargs.cpp tdeaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp \ @@ -109,7 +109,7 @@ libtdecore_la_SOURCES = libintl.cpp tdeapplication.cpp \ kpixmapprovider.cpp kurldrag.cpp \ kmdcodec.cpp ksocks.cpp fakes.c vsnprintf.c \ tdesycoca.cpp tdesycocadict.cpp tdesycocafactory.cpp tdesycoca.skel \ - kxmessages.cpp kstartupinfo.cpp kcatalogue.cpp kasyncio.cpp \ + kxmessages.cpp tdestartupinfo.cpp kcatalogue.cpp kasyncio.cpp \ tdemultipledrag.cpp kstaticdeleter.cpp kappdcopiface.cpp \ kappdcopiface.skel kclipboard.cpp kcheckaccelerators.cpp \ tdeversion.cpp kdebugdcopiface.cpp kdebugdcopiface.skel \ diff --git a/tdecore/kappdcopiface.cpp b/tdecore/kappdcopiface.cpp index 31bc8dd5b..ed6e26163 100644 --- a/tdecore/kappdcopiface.cpp +++ b/tdecore/kappdcopiface.cpp @@ -20,7 +20,7 @@ #include "kappdcopiface.h" #include <tdeapplication.h> #include <dcopclient.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> diff --git a/tdecore/kapplication_win.cpp b/tdecore/kapplication_win.cpp index 940bc379e..38bafaef8 100644 --- a/tdecore/kapplication_win.cpp +++ b/tdecore/kapplication_win.cpp @@ -19,7 +19,7 @@ #include <tdeapplication.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> #include <kurl.h> #include "kcheckaccelerators.h" diff --git a/tdecore/kcalendarsystem.cpp b/tdecore/kcalendarsystem.cpp index 39331e170..20d00d181 100644 --- a/tdecore/kcalendarsystem.cpp +++ b/tdecore/kcalendarsystem.cpp @@ -22,10 +22,10 @@ // systems. // Also default gregorian and factory classes -#include <kglobal.h> +#include <tdeglobal.h> #include "kcalendarsystem.h" -#include "klocale.h" +#include "tdelocale.h" class KCalendarSystemPrivate { diff --git a/tdecore/kcalendarsystemgregorian.cpp b/tdecore/kcalendarsystemgregorian.cpp index ead1aca66..9d4d14661 100644 --- a/tdecore/kcalendarsystemgregorian.cpp +++ b/tdecore/kcalendarsystemgregorian.cpp @@ -24,7 +24,7 @@ #include <tqdatetime.h> #include <tqstring.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include "kcalendarsystemgregorian.h" diff --git a/tdecore/kcalendarsystemhebrew.cpp b/tdecore/kcalendarsystemhebrew.cpp index a0db927f4..2f0aa111a 100644 --- a/tdecore/kcalendarsystemhebrew.cpp +++ b/tdecore/kcalendarsystemhebrew.cpp @@ -21,7 +21,7 @@ // Derived hebrew kde calendar class -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include "kcalendarsystemhebrew.h" diff --git a/tdecore/kcalendarsystemhijri.cpp b/tdecore/kcalendarsystemhijri.cpp index 8c9fac471..cc66805e0 100644 --- a/tdecore/kcalendarsystemhijri.cpp +++ b/tdecore/kcalendarsystemhijri.cpp @@ -23,7 +23,7 @@ #include <tqdatetime.h> #include <tqstring.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include "kcalendarsystemhijri.h" diff --git a/tdecore/kcalendarsystemjalali.cpp b/tdecore/kcalendarsystemjalali.cpp index 559ebb39c..631693e45 100644 --- a/tdecore/kcalendarsystemjalali.cpp +++ b/tdecore/kcalendarsystemjalali.cpp @@ -26,8 +26,8 @@ #include <tqstringlist.h> #include <math.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kdebug.h> #include <stdio.h> diff --git a/tdecore/kcharsets.cpp b/tdecore/kcharsets.cpp index fa623b693..23786c53e 100644 --- a/tdecore/kcharsets.cpp +++ b/tdecore/kcharsets.cpp @@ -22,8 +22,8 @@ #include "kentities.c" #include <tdeapplication.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <tqfontinfo.h> diff --git a/tdecore/kcheckaccelerators.cpp b/tdecore/kcheckaccelerators.cpp index b7e113f4b..306591e67 100644 --- a/tdecore/kcheckaccelerators.cpp +++ b/tdecore/kcheckaccelerators.cpp @@ -41,9 +41,9 @@ #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeshortcut.h> -#include <klocale.h> +#include <tdelocale.h> /* diff --git a/tdecore/kclipboard.cpp b/tdecore/kclipboard.cpp index 54d051486..8ab23cccc 100644 --- a/tdecore/kclipboard.cpp +++ b/tdecore/kclipboard.cpp @@ -18,7 +18,7 @@ #include <tdeapplication.h> #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> #include "kclipboard.h" diff --git a/tdecore/kcompletion.cpp b/tdecore/kcompletion.cpp index a5349b3ee..4a80d85df 100644 --- a/tdecore/kcompletion.cpp +++ b/tdecore/kcompletion.cpp @@ -20,9 +20,9 @@ #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <knotifyclient.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tqptrvector.h> diff --git a/tdecore/kcompletion.h b/tdecore/kcompletion.h index e6d7f5314..2bce648fb 100644 --- a/tdecore/kcompletion.h +++ b/tdecore/kcompletion.h @@ -28,7 +28,7 @@ #include <tqguardedptr.h> #include "tdelibs_export.h" -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <ksortablevaluelist.h> #include <tdeshortcut.h> diff --git a/tdecore/kcrash.cpp b/tdecore/kcrash.cpp index 2eed7c282..08abe75c7 100644 --- a/tdecore/kcrash.cpp +++ b/tdecore/kcrash.cpp @@ -44,7 +44,7 @@ #include <errno.h> #include <tqwindowdefs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kinstance.h> #include <tdeaboutdata.h> #include <kdebug.h> diff --git a/tdecore/kdebug.areas b/tdecore/kdebug.areas index b6e742489..5653a9a03 100644 --- a/tdecore/kdebug.areas +++ b/tdecore/kdebug.areas @@ -184,7 +184,7 @@ 5602 kontact (plugins) 5650 tderesources 5700 kabc -5710 kabc/vcard +5710 tdeabc/vcard 5720 kaddressbook 5800 libkcal 5850 korganizer diff --git a/tdecore/kdebug.cpp b/tdecore/kdebug.cpp index 062864fca..656edf6f9 100644 --- a/tdecore/kdebug.cpp +++ b/tdecore/kdebug.cpp @@ -28,12 +28,12 @@ #include "kdebugdcopiface.h" #include "tdeapplication.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kinstance.h" #include "kstandarddirs.h" #include <tqmessagebox.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqfile.h> #include <tqintdict.h> #include <tqstring.h> diff --git a/tdecore/kdebugrc b/tdecore/kdebugrc index e1317ddfb..dbf3ed53f 100644 --- a/tdecore/kdebugrc +++ b/tdecore/kdebugrc @@ -96,7 +96,7 @@ InfoOutput=4 [5400] InfoOutput=4 -# kabc/vcard +# tdeabc/vcard [5710] InfoOutput=4 diff --git a/tdecore/kdesktopfile.cpp b/tdecore/kdesktopfile.cpp index a5a57cdd8..b385eeb18 100644 --- a/tdecore/kdesktopfile.cpp +++ b/tdecore/kdesktopfile.cpp @@ -35,7 +35,7 @@ #include "kstandarddirs.h" #include "kmountpoint.h" #include "kcatalogue.h" -#include "klocale.h" +#include "tdelocale.h" #include "kdesktopfile.h" #include "kdesktopfile.moc" diff --git a/tdecore/kdetcompmgr.cpp b/tdecore/kdetcompmgr.cpp index d78d76b34..964cd49be 100644 --- a/tdecore/kdetcompmgr.cpp +++ b/tdecore/kdetcompmgr.cpp @@ -24,7 +24,7 @@ #include <tdeapplication.h> #include <tdeaboutdata.h> #include <tdecmdlineargs.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tdeconfig.h> diff --git a/tdecore/kgenericfactory.h b/tdecore/kgenericfactory.h index 426b29ef1..7f2b7b453 100644 --- a/tdecore/kgenericfactory.h +++ b/tdecore/kgenericfactory.h @@ -23,8 +23,8 @@ #include <ktypelist.h> #include <kinstance.h> #include <kgenericfactory.tcc> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kdebug.h> /* @internal */ diff --git a/tdecore/kglobal.cpp b/tdecore/kglobal.cpp index 965a537a3..f8639d526 100644 --- a/tdecore/kglobal.cpp +++ b/tdecore/kglobal.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ /* -* kglobal.cpp -- Implementation of class TDEGlobal. +* tdeglobal.cpp -- Implementation of class TDEGlobal. * Author: Sirtaj Singh Kang * Version: $Id$ * Generated: Sat May 1 02:08:43 EST 1999 @@ -25,13 +25,13 @@ #include <tqglobal.h> #include <tqdict.h> #include <tqptrlist.h> -#include "kglobal.h" +#include "tdeglobal.h" #include <tdeapplication.h> #include <tdeaboutdata.h> #include <kdebug.h> #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> #include <kcharsets.h> #include <kiconloader.h> #include <tdehardwaredevices.h> diff --git a/tdecore/kglobalaccel.cpp b/tdecore/kglobalaccel.cpp index 6af97065d..746721e40 100644 --- a/tdecore/kglobalaccel.cpp +++ b/tdecore/kglobalaccel.cpp @@ -32,7 +32,7 @@ #include "tdeaccelbase.h" #include <kdebug.h> #include <tdeshortcut.h> -#include <klocale.h> +#include <tdelocale.h> //---------------------------------------------------- diff --git a/tdecore/kglobalsettings.cpp b/tdecore/kglobalsettings.cpp index a103c4652..c0c6329c7 100644 --- a/tdecore/kglobalsettings.cpp +++ b/tdecore/kglobalsettings.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ #include "config.h" -#include "kglobalsettings.h" +#include "tdeglobalsettings.h" #include <tqdir.h> #include <tqpixmap.h> @@ -40,12 +40,12 @@ static QRgb qt_colorref2qrgb(COLORREF col) #endif #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeshortcut.h> #include <kstandarddirs.h> #include <kcharsets.h> #include <tdeaccel.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqfontinfo.h> #include <stdlib.h> #include <kprotocolinfo.h> diff --git a/tdecore/kiconeffect.cpp b/tdecore/kiconeffect.cpp index e865a1317..c1a4a8ca5 100644 --- a/tdecore/kiconeffect.cpp +++ b/tdecore/kiconeffect.cpp @@ -29,9 +29,9 @@ #include <tqrect.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kicontheme.h> #include "kiconeffect.h" diff --git a/tdecore/kiconloader.cpp b/tdecore/kiconloader.cpp index be44a921f..e81293986 100644 --- a/tdecore/kiconloader.cpp +++ b/tdecore/kiconloader.cpp @@ -30,7 +30,7 @@ #include <kipc.h> #include <kdebug.h> #include <kstandarddirs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <ksimpleconfig.h> #include <kinstance.h> diff --git a/tdecore/kiconloader.h b/tdecore/kiconloader.h index 0c7e67a26..434a3d976 100644 --- a/tdecore/kiconloader.h +++ b/tdecore/kiconloader.h @@ -27,7 +27,7 @@ #undef TDEIconLoaderXStatus #endif -#include <kglobal.h> +#include <tdeglobal.h> #include <kinstance.h> #include <kicontheme.h> diff --git a/tdecore/kicontheme.cpp b/tdecore/kicontheme.cpp index 9d5d2b7d0..544eefe01 100644 --- a/tdecore/kicontheme.cpp +++ b/tdecore/kicontheme.cpp @@ -30,7 +30,7 @@ #include <kdebug.h> #include <kstandarddirs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <ksimpleconfig.h> #include <kinstance.h> diff --git a/tdecore/kinstance.cpp b/tdecore/kinstance.cpp index cf0b35791..6760c95a0 100644 --- a/tdecore/kinstance.cpp +++ b/tdecore/kinstance.cpp @@ -21,7 +21,7 @@ #include <unistd.h> #include "tdeconfig.h" -#include "klocale.h" +#include "tdelocale.h" #include "kcharsets.h" #include "kiconloader.h" #include "tdehardwaredevices.h" @@ -29,7 +29,7 @@ #include "tdeaboutdata.h" #include "kstandarddirs.h" #include "kdebug.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kmimesourcefactory.h" #include <tqfont.h> diff --git a/tdecore/kkeynative_x11.cpp b/tdecore/kkeynative_x11.cpp index 64635acc3..a44305dad 100644 --- a/tdecore/kkeynative_x11.cpp +++ b/tdecore/kkeynative_x11.cpp @@ -32,7 +32,7 @@ #include <tqstringlist.h> #include "kckey.h" #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #ifdef Q_WS_X11 #define XK_MISCELLANY diff --git a/tdecore/kkeyserver_x11.cpp b/tdecore/kkeyserver_x11.cpp index cd4abb6fb..64bfe383d 100644 --- a/tdecore/kkeyserver_x11.cpp +++ b/tdecore/kkeyserver_x11.cpp @@ -33,8 +33,8 @@ #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #ifdef Q_WS_X11 # define XK_MISCELLANY diff --git a/tdecore/klibloader.cpp b/tdecore/klibloader.cpp index f7e63c215..aed2c06af 100644 --- a/tdecore/klibloader.cpp +++ b/tdecore/klibloader.cpp @@ -29,7 +29,7 @@ #include "klibloader.h" #include "kstandarddirs.h" #include "kdebug.h" -#include "klocale.h" +#include "tdelocale.h" #include "ltdl.h" diff --git a/tdecore/klibloader.h b/tdecore/klibloader.h index 3e8f9ff45..d9e632184 100644 --- a/tdecore/klibloader.h +++ b/tdecore/klibloader.h @@ -23,7 +23,7 @@ #include <tqstringlist.h> #include <tqasciidict.h> #include <tqptrlist.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <stdlib.h> // For backwards compatibility diff --git a/tdecore/klocale.cpp b/tdecore/klocale.cpp index 3e169ba03..4402dd183 100644 --- a/tdecore/klocale.cpp +++ b/tdecore/klocale.cpp @@ -33,7 +33,7 @@ #include <tqregexp.h> #include "kcatalogue.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kstandarddirs.h" #include "ksimpleconfig.h" #include "kinstance.h" @@ -41,7 +41,7 @@ #include "kdebug.h" #include "kcalendarsystem.h" #include "kcalendarsystemfactory.h" -#include "klocale.h" +#include "tdelocale.h" #ifdef Q_WS_WIN #include <windows.h> diff --git a/tdecore/klocale.h b/tdecore/klocale.h index 65a21d13d..94cf704f1 100644 --- a/tdecore/klocale.h +++ b/tdecore/klocale.h @@ -39,7 +39,7 @@ class KCatalogue; class KCalendarSystem; /** - * \file klocale.h + * \file tdelocale.h */ #ifndef I18N_NOOP diff --git a/tdecore/klockfile.cpp b/tdecore/klockfile.cpp index ee09a06c8..1f4f8337e 100644 --- a/tdecore/klockfile.cpp +++ b/tdecore/klockfile.cpp @@ -39,8 +39,8 @@ #include <kde_file.h> #include <tdeapplication.h> #include <tdecmdlineargs.h> -#include <kglobal.h> -#include <ktempfile.h> +#include <tdeglobal.h> +#include <tdetempfile.h> // TODO: http://www.spinnaker.de/linux/nfs-locking.html // TODO: Make regression test diff --git a/tdecore/kmimesourcefactory.cpp b/tdecore/kmimesourcefactory.cpp index f08cb249a..8ed02941e 100644 --- a/tdecore/kmimesourcefactory.cpp +++ b/tdecore/kmimesourcefactory.cpp @@ -19,7 +19,7 @@ */ #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kinstance.h> #include <kiconloader.h> diff --git a/tdecore/kmimesourcefactory.h b/tdecore/kmimesourcefactory.h index 16302dfe4..8292cda42 100644 --- a/tdecore/kmimesourcefactory.h +++ b/tdecore/kmimesourcefactory.h @@ -23,7 +23,7 @@ #define KMIMESOURCEFACTORY_H #include <tqmime.h> -#include <kglobal.h> +#include <tdeglobal.h> class KMimeSourceFactoryPrivate; class TDEInstance; diff --git a/tdecore/kpalette.cpp b/tdecore/kpalette.cpp index c06184221..7335e8e14 100644 --- a/tdecore/kpalette.cpp +++ b/tdecore/kpalette.cpp @@ -24,7 +24,7 @@ #include <tqfile.h> #include <tqtextstream.h> #include <kstandarddirs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <ksavefile.h> #include <kstringhandler.h> diff --git a/tdecore/kprotocolinfo_tdecore.cpp b/tdecore/kprotocolinfo_tdecore.cpp index 8cc5091c5..86a9a6fcc 100644 --- a/tdecore/kprotocolinfo_tdecore.cpp +++ b/tdecore/kprotocolinfo_tdecore.cpp @@ -26,7 +26,7 @@ #include "kprotocolinfofactory.h" #include <kstandarddirs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeapplication.h> #include <kdebug.h> #include <ksimpleconfig.h> diff --git a/tdecore/kprotocolinfofactory.cpp b/tdecore/kprotocolinfofactory.cpp index 4daab08dd..115a44f25 100644 --- a/tdecore/kprotocolinfofactory.cpp +++ b/tdecore/kprotocolinfofactory.cpp @@ -18,7 +18,7 @@ */ #include <kstandarddirs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeapplication.h> #include <kdebug.h> #include <tdesycoca.h> diff --git a/tdecore/krootprop.cpp b/tdecore/krootprop.cpp index bb15462dd..c717a1823 100644 --- a/tdecore/krootprop.cpp +++ b/tdecore/krootprop.cpp @@ -23,8 +23,8 @@ #ifdef Q_WS_X11 // not needed anyway :-) #include "krootprop.h" -#include "kglobal.h" -#include "klocale.h" +#include "tdeglobal.h" +#include "tdelocale.h" #include "kcharsets.h" #include "tdeapplication.h" #include <tqtextstream.h> diff --git a/tdecore/ksavefile.h b/tdecore/ksavefile.h index e035115a9..282652dea 100644 --- a/tdecore/ksavefile.h +++ b/tdecore/ksavefile.h @@ -23,7 +23,7 @@ #include <tqstring.h> #include <stdio.h> #include <errno.h> -#include <ktempfile.h> +#include <tdetempfile.h> class KSaveFilePrivate; diff --git a/tdecore/ksimpleconfig.cpp b/tdecore/ksimpleconfig.cpp index 55cf7485b..dc359f17e 100644 --- a/tdecore/ksimpleconfig.cpp +++ b/tdecore/ksimpleconfig.cpp @@ -31,7 +31,7 @@ #include <tqfileinfo.h> #include <tqdir.h> -#include "kglobal.h" +#include "tdeglobal.h" #include "kstandarddirs.h" #include "tdeconfigbackend.h" diff --git a/tdecore/ksimpledirwatch.cpp b/tdecore/ksimpledirwatch.cpp index f39a94221..835566268 100644 --- a/tdecore/ksimpledirwatch.cpp +++ b/tdecore/ksimpledirwatch.cpp @@ -46,7 +46,7 @@ #include <tdeapplication.h> #include <kdebug.h> #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstaticdeleter.h> #include <kde_file.h> diff --git a/tdecore/ksockaddr.cpp b/tdecore/ksockaddr.cpp index cd2f9c93c..a645b3aa9 100644 --- a/tdecore/ksockaddr.cpp +++ b/tdecore/ksockaddr.cpp @@ -38,7 +38,7 @@ #include <tqfile.h> #include "kdebug.h" -#include "klocale.h" +#include "tdelocale.h" //#include "kextsock.h" #ifndef HAVE_STRUCT_SOCKADDR_IN6 diff --git a/tdecore/ksocks.cpp b/tdecore/ksocks.cpp index 95e36dc15..a6ecc37d2 100644 --- a/tdecore/ksocks.cpp +++ b/tdecore/ksocks.cpp @@ -26,7 +26,7 @@ #include <tqstring.h> #include <tqmap.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include "klibloader.h" #include <tdeconfig.h> diff --git a/tdecore/kstandarddirs.h b/tdecore/kstandarddirs.h index 7eb654f42..7cdf44e37 100644 --- a/tdecore/kstandarddirs.h +++ b/tdecore/kstandarddirs.h @@ -26,7 +26,7 @@ #include <tqstring.h> #include <tqdict.h> #include <tqstringlist.h> -#include <kglobal.h> +#include <tdeglobal.h> class TDEConfig; class TDEStandardDirsPrivate; diff --git a/tdecore/kstartupinfo.cpp b/tdecore/kstartupinfo.cpp index a472de5fd..3d798cdc1 100644 --- a/tdecore/kstartupinfo.cpp +++ b/tdecore/kstartupinfo.cpp @@ -45,7 +45,7 @@ DEALINGS IN THE SOFTWARE. #define QT_CLEAN_NAMESPACE #endif -#include "kstartupinfo.h" +#include "tdestartupinfo.h" #include <unistd.h> #include <sys/time.h> @@ -1525,5 +1525,5 @@ static TQString escape_str( const TQString& str_P ) return ret; } -#include "kstartupinfo.moc" +#include "tdestartupinfo.moc" #endif diff --git a/tdecore/kstartupinfo.h b/tdecore/kstartupinfo.h index dcc80f978..3f8310f6b 100644 --- a/tdecore/kstartupinfo.h +++ b/tdecore/kstartupinfo.h @@ -49,7 +49,7 @@ class TDEStartupInfoPrivate; * * This class can be used to send information about started application, * change the information and receive this information. For detailed - * description, see tdelibs/tdecore/README.kstartupinfo. + * description, see tdelibs/tdecore/README.tdestartupinfo. * * You usually don't need to use this class for sending the notification * information, as KDE libraries should do this when an application is diff --git a/tdecore/kstaticdeleter.h b/tdecore/kstaticdeleter.h index dd759adf7..b6967268c 100644 --- a/tdecore/kstaticdeleter.h +++ b/tdecore/kstaticdeleter.h @@ -23,7 +23,7 @@ #ifndef _KSTATIC_DELETER_H_ #define _KSTATIC_DELETER_H_ -#include <kglobal.h> +#include <tdeglobal.h> /** * Static deleters are used to manage static resources. They can register diff --git a/tdecore/kstringhandler.cpp b/tdecore/kstringhandler.cpp index c562c539f..b19c5b875 100644 --- a/tdecore/kstringhandler.cpp +++ b/tdecore/kstringhandler.cpp @@ -18,7 +18,7 @@ */ #include "kstringhandler.h" -#include "kglobal.h" +#include "tdeglobal.h" static void parsePythonRange( const TQCString &range, uint &start, uint &end ) { diff --git a/tdecore/ktempdir.cpp b/tdecore/ktempdir.cpp index 53cc83f99..d16d2e185 100644 --- a/tdecore/ktempdir.cpp +++ b/tdecore/ktempdir.cpp @@ -47,7 +47,7 @@ #include <tqdatetime.h> #include <tqdir.h> -#include "kglobal.h" +#include "tdeglobal.h" #include "tdeapplication.h" #include "kinstance.h" #include "ktempdir.h" diff --git a/tdecore/ktempfile.cpp b/tdecore/ktempfile.cpp index 973e14070..805d315a1 100644 --- a/tdecore/ktempfile.cpp +++ b/tdecore/ktempfile.cpp @@ -48,10 +48,10 @@ #include <tqdatastream.h> #include <tqtextstream.h> -#include "kglobal.h" +#include "tdeglobal.h" #include "tdeapplication.h" #include "kinstance.h" -#include "ktempfile.h" +#include "tdetempfile.h" #include "kstandarddirs.h" #include "kde_file.h" #include "kdebug.h" diff --git a/tdecore/ktimezones.cpp b/tdecore/ktimezones.cpp index 6b21e0392..3436cdabb 100644 --- a/tdecore/ktimezones.cpp +++ b/tdecore/ktimezones.cpp @@ -24,7 +24,7 @@ #include <kmdcodec.h> #include <kprocess.h> #include <kstringhandler.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <tqdatetime.h> #include <tqfile.h> diff --git a/tdecore/kuniqueapplication.cpp b/tdecore/kuniqueapplication.cpp index 964c7c8c7..0a3a0962a 100644 --- a/tdecore/kuniqueapplication.cpp +++ b/tdecore/kuniqueapplication.cpp @@ -40,7 +40,7 @@ #if defined Q_WS_X11 #include <twin.h> -#include <kstartupinfo.h> +#include <tdestartupinfo.h> #endif #include <tdeconfig.h> diff --git a/tdecore/kurl.cpp b/tdecore/kurl.cpp index 9479029a9..2079c050b 100644 --- a/tdecore/kurl.cpp +++ b/tdecore/kurl.cpp @@ -27,7 +27,7 @@ // KDE_QT_ONLY is first used for dcop/client (e.g. marshalling) #ifndef KDE_QT_ONLY #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kidna.h> #include <kprotocolinfo.h> #endif diff --git a/tdecore/kurldrag.cpp b/tdecore/kurldrag.cpp index 20aa6388e..5e64d09b2 100644 --- a/tdecore/kurldrag.cpp +++ b/tdecore/kurldrag.cpp @@ -24,8 +24,8 @@ #include <unistd.h> #include <tdeversion.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kdebug.h> class KURLDragPrivate diff --git a/tdecore/kvmallocator.cpp b/tdecore/kvmallocator.cpp index 996d55791..3b887eeee 100644 --- a/tdecore/kvmallocator.cpp +++ b/tdecore/kvmallocator.cpp @@ -31,7 +31,7 @@ #include <tqintdict.h> #include <tqmap.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kdebug.h> #include "kvmallocator.h" diff --git a/tdecore/netsupp.cpp b/tdecore/netsupp.cpp index c7e968c16..0c072752c 100644 --- a/tdecore/netsupp.cpp +++ b/tdecore/netsupp.cpp @@ -37,7 +37,7 @@ #include "config.h" #include "kdebug.h" -#include "klocale.h" +#include "tdelocale.h" #ifndef IN6_IS_ADDR_V4MAPPED #define NEED_IN6_TESTS diff --git a/tdecore/network/kresolver.cpp b/tdecore/network/kresolver.cpp index 1c32e80ec..b9ac605c0 100644 --- a/tdecore/network/kresolver.cpp +++ b/tdecore/network/kresolver.cpp @@ -54,7 +54,7 @@ #endif // KDE -#include <klocale.h> +#include <tdelocale.h> // Us #include "kresolver.h" diff --git a/tdecore/network/kresolverstandardworkers.cpp b/tdecore/network/kresolverstandardworkers.cpp index cde24f752..96519d1aa 100644 --- a/tdecore/network/kresolverstandardworkers.cpp +++ b/tdecore/network/kresolverstandardworkers.cpp @@ -44,7 +44,7 @@ #include <tqfile.h> #include "kdebug.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kstandarddirs.h" #include "tdeapplication.h" diff --git a/tdecore/network/tdesocketaddress.cpp b/tdecore/network/tdesocketaddress.cpp index ff97699c8..a6da5f7c0 100644 --- a/tdecore/network/tdesocketaddress.cpp +++ b/tdecore/network/tdesocketaddress.cpp @@ -36,7 +36,7 @@ #include <tqfile.h> #include <tqobject.h> -#include "klocale.h" +#include "tdelocale.h" #include "tdesocketaddress.h" #include "netsupp.h" diff --git a/tdecore/network/tdesocketbase.cpp b/tdecore/network/tdesocketbase.cpp index 0eb31bbc1..66decb15d 100644 --- a/tdecore/network/tdesocketbase.cpp +++ b/tdecore/network/tdesocketbase.cpp @@ -24,7 +24,7 @@ #include <config.h> #include <tqmutex.h> -#include "klocale.h" +#include "tdelocale.h" #include "tdesocketbase.h" #include "tdesocketdevice.h" diff --git a/tdecore/networkbackends/network-manager/network-manager_p.h b/tdecore/networkbackends/network-manager/network-manager_p.h index 474f628bb..0e1fe4de8 100644 --- a/tdecore/networkbackends/network-manager/network-manager_p.h +++ b/tdecore/networkbackends/network-manager/network-manager_p.h @@ -27,7 +27,7 @@ /* TDE headers */ #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> /* TQDbus headers */ #include <tqdbusconnection.h> diff --git a/tdecore/tde-config.cpp.cmake b/tdecore/tde-config.cpp.cmake index 98481cefe..36e752f33 100644 --- a/tdecore/tde-config.cpp.cmake +++ b/tdecore/tde-config.cpp.cmake @@ -1,11 +1,11 @@ // -*- c++ -*- #include <tdecmdlineargs.h> -#include <klocale.h> +#include <tdelocale.h> #include <kinstance.h> #include <kstandarddirs.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <stdio.h> #include <tdeaboutdata.h> #include <config.h> diff --git a/tdecore/tde-config.cpp.in b/tdecore/tde-config.cpp.in index ac49e5c41..f86e5f5db 100644 --- a/tdecore/tde-config.cpp.in +++ b/tdecore/tde-config.cpp.in @@ -1,11 +1,11 @@ // -*- c++ -*- #include <tdecmdlineargs.h> -#include <klocale.h> +#include <tdelocale.h> #include <kinstance.h> #include <kstandarddirs.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <stdio.h> #include <tdeaboutdata.h> #include <config.h> diff --git a/tdecore/tdeaboutdata.h b/tdecore/tdeaboutdata.h index d5addac0a..db76287f2 100644 --- a/tdecore/tdeaboutdata.h +++ b/tdecore/tdeaboutdata.h @@ -22,7 +22,7 @@ #include <tqvaluelist.h> #include <tqstring.h> #include <tqimage.h> -#include <klocale.h> +#include <tdelocale.h> #ifndef _KABOUTDATA_H_ #define _KABOUTDATA_H_ diff --git a/tdecore/tdeaccel.cpp b/tdecore/tdeaccel.cpp index e019baafc..5430c2529 100644 --- a/tdecore/tdeaccel.cpp +++ b/tdecore/tdeaccel.cpp @@ -29,7 +29,7 @@ #include "tdeaccelbase.h" #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeshortcut.h> #include "tdeaccelprivate.h" diff --git a/tdecore/tdeaccelaction.cpp b/tdecore/tdeaccelaction.cpp index 93f17ae25..89d8efaa2 100644 --- a/tdecore/tdeaccelaction.cpp +++ b/tdecore/tdeaccelaction.cpp @@ -28,9 +28,9 @@ #include <tdeconfig.h> #include "kckey.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kkeynative.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeshortcutlist.h> //--------------------------------------------------------------------- diff --git a/tdecore/tdeaccelbase.cpp b/tdecore/tdeaccelbase.cpp index 434801f61..6673cabb4 100644 --- a/tdecore/tdeaccelbase.cpp +++ b/tdecore/tdeaccelbase.cpp @@ -29,10 +29,10 @@ #include <tdeconfig.h> #include "kckey.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kkeynative.h> #include "kkeyserver.h" -#include <klocale.h> +#include <tdelocale.h> #include "tdeshortcutmenu.h" //--------------------------------------------------------------------- diff --git a/tdecore/tdeapplication.cpp b/tdecore/tdeapplication.cpp index 24c77826b..58b010e4e 100644 --- a/tdecore/tdeapplication.cpp +++ b/tdecore/tdeapplication.cpp @@ -61,10 +61,10 @@ #include <tqsqlpropertymap.h> #endif -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdestyle.h> #include <kiconloader.h> #include <kclipboard.h> @@ -72,7 +72,7 @@ #include <ksimpleconfig.h> #include <tdecmdlineargs.h> #include <tdeaboutdata.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kcrash.h> #include <kdatastream.h> #include <klibloader.h> @@ -89,7 +89,7 @@ #include <kglobalaccel.h> #if defined Q_WS_X11 -#include <kstartupinfo.h> +#include <tdestartupinfo.h> #endif #include <dcopclient.h> diff --git a/tdecore/tdecmdlineargs.cpp b/tdecore/tdecmdlineargs.cpp index ad24467e2..46d1b9f4a 100644 --- a/tdecore/tdecmdlineargs.cpp +++ b/tdecore/tdecmdlineargs.cpp @@ -37,9 +37,9 @@ #include "tdecmdlineargs.h" #include <tdeaboutdata.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstringhandler.h> #include <kstaticdeleter.h> diff --git a/tdecore/tdeconfig.cpp b/tdecore/tdeconfig.cpp index 35c5b73bc..68307dc85 100644 --- a/tdecore/tdeconfig.cpp +++ b/tdecore/tdeconfig.cpp @@ -36,7 +36,7 @@ #include "tdeconfigbackend.h" #include "tdeconfig.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kstandarddirs.h" #include "kstaticdeleter.h" #include <tqtimer.h> diff --git a/tdecore/tdeconfig_compiler/example/autoexample.cpp b/tdecore/tdeconfig_compiler/example/autoexample.cpp index e25219787..6085fa6eb 100644 --- a/tdecore/tdeconfig_compiler/example/autoexample.cpp +++ b/tdecore/tdeconfig_compiler/example/autoexample.cpp @@ -27,9 +27,9 @@ #include <tdeaboutdata.h> #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <kstandarddirs.h> #include <tdeconfigdialog.h> diff --git a/tdecore/tdeconfig_compiler/example/example.cpp b/tdecore/tdeconfig_compiler/example/example.cpp index c08339d4a..157570d98 100644 --- a/tdecore/tdeconfig_compiler/example/example.cpp +++ b/tdecore/tdeconfig_compiler/example/example.cpp @@ -24,9 +24,9 @@ #include <tdeaboutdata.h> #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <kstandarddirs.h> diff --git a/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp b/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp index 753bae532..207a78402 100644 --- a/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp +++ b/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp @@ -30,9 +30,9 @@ #include <tdeaboutdata.h> #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> @@ -1151,7 +1151,7 @@ int main( int argc, char **argv ) if ( headerIncludes.count() > 0 ) h << endl; if ( !singleton && cfgFileNameArg && parameters.isEmpty() ) - h << "#include <kglobal.h>" << endl; + h << "#include <tdeglobal.h>" << endl; h << "#include <tdeconfigskeleton.h>" << endl; h << "#include <kdebug.h>" << endl << endl; @@ -1421,7 +1421,7 @@ int main( int argc, char **argv ) cpp << "#include \"" << headerFileName << "\"" << endl << endl; - if ( setUserTexts ) cpp << "#include <klocale.h>" << endl << endl; + if ( setUserTexts ) cpp << "#include <tdelocale.h>" << endl << endl; // Header required by singleton implementation if ( singleton ) diff --git a/tdecore/tdeconfig_compiler/tests/test2.cpp.ref b/tdecore/tdeconfig_compiler/tests/test2.cpp.ref index cc3f67b5e..e66c5b9da 100644 --- a/tdecore/tdeconfig_compiler/tests/test2.cpp.ref +++ b/tdecore/tdeconfig_compiler/tests/test2.cpp.ref @@ -3,7 +3,7 @@ #include "test2.h" -#include <klocale.h> +#include <tdelocale.h> Test2::Test2( ) : MyPrefs( TQString::fromLatin1( "korganizerrc" ) ) diff --git a/tdecore/tdeconfig_compiler/tests/test8a.h.ref b/tdecore/tdeconfig_compiler/tests/test8a.h.ref index 88686ca1b..a1e5b7e37 100644 --- a/tdecore/tdeconfig_compiler/tests/test8a.h.ref +++ b/tdecore/tdeconfig_compiler/tests/test8a.h.ref @@ -3,7 +3,7 @@ #ifndef TEST8A_H #define TEST8A_H -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfigskeleton.h> #include <kdebug.h> diff --git a/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref b/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref index 5aad12fe8..b3fde4334 100644 --- a/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref +++ b/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref @@ -3,7 +3,7 @@ #include "test_dpointer.h" -#include <klocale.h> +#include <tdelocale.h> #include <kstaticdeleter.h> diff --git a/tdecore/tdeconfigbackend.cpp b/tdecore/tdeconfigbackend.cpp index d050a2efe..6d5197ff7 100644 --- a/tdecore/tdeconfigbackend.cpp +++ b/tdecore/tdeconfigbackend.cpp @@ -42,9 +42,9 @@ #include "tdeconfigbackend.h" #include "tdeconfigbase.h" #include <tdeapplication.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kprocess.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <ksavefile.h> #include <kurl.h> diff --git a/tdecore/tdeconfigbackend.h b/tdecore/tdeconfigbackend.h index 71ba15288..83c8047bc 100644 --- a/tdecore/tdeconfigbackend.h +++ b/tdecore/tdeconfigbackend.h @@ -25,7 +25,7 @@ #include "tdeconfigdata.h" #include <tdeconfigbase.h> #include <klockfile.h> -#include <klocale.h> +#include <tdelocale.h> #include "tdelibs_export.h" class TQFile; diff --git a/tdecore/tdeconfigbase.cpp b/tdecore/tdeconfigbase.cpp index 668a688d8..a3b15185b 100644 --- a/tdecore/tdeconfigbase.cpp +++ b/tdecore/tdeconfigbase.cpp @@ -28,8 +28,8 @@ #include <tqtextstream.h> #include <tdeapplication.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kcharsets.h> #include "tdeconfigbase.h" diff --git a/tdecore/tdeconfigdialogmanager.cpp b/tdecore/tdeconfigdialogmanager.cpp index dfabefb59..9578c05c1 100644 --- a/tdecore/tdeconfigdialogmanager.cpp +++ b/tdecore/tdeconfigdialogmanager.cpp @@ -33,7 +33,7 @@ #include <tdeapplication.h> #include <tdeconfigskeleton.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <assert.h> diff --git a/tdecore/tdeconfigskeleton.cpp b/tdecore/tdeconfigskeleton.cpp index 1abaf388b..45a4b4112 100644 --- a/tdecore/tdeconfigskeleton.cpp +++ b/tdecore/tdeconfigskeleton.cpp @@ -24,8 +24,8 @@ #include <tdeconfig.h> #include <kstandarddirs.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kdebug.h> #include "kstringhandler.h" diff --git a/tdecore/tdeconfigskeleton.h b/tdecore/tdeconfigskeleton.h index ccbf4529b..b260db1e8 100644 --- a/tdecore/tdeconfigskeleton.h +++ b/tdecore/tdeconfigskeleton.h @@ -34,7 +34,7 @@ #include <tqstringlist.h> #include <tqvariant.h> #include <tdeconfig.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> /** * @short Class for storing a preferences setting diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp index 263bc5507..60f3efde9 100644 --- a/tdecore/tdehardwaredevices.cpp +++ b/tdecore/tdehardwaredevices.cpp @@ -23,10 +23,10 @@ #include <tqstringlist.h> #include <tqsocketnotifier.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tdeconfig.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <ksimpledirwatch.h> #include <kstandarddirs.h> diff --git a/tdecore/tdenetworkconnections.cpp b/tdecore/tdenetworkconnections.cpp index 2705343f7..2682aa991 100644 --- a/tdecore/tdenetworkconnections.cpp +++ b/tdecore/tdenetworkconnections.cpp @@ -23,7 +23,7 @@ #include <tqtimer.h> -#include <klocale.h> +#include <tdelocale.h> // #define DEBUG_SIGNAL_QUEUE 1 diff --git a/tdecore/tdeshortcut.cpp b/tdecore/tdeshortcut.cpp index 33797b0bc..bae897e98 100644 --- a/tdecore/tdeshortcut.cpp +++ b/tdecore/tdeshortcut.cpp @@ -25,8 +25,8 @@ #include <tqstringlist.h> #include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <ksimpleconfig.h> //---------------------------------------------------- diff --git a/tdecore/tdeshortcutlist.cpp b/tdecore/tdeshortcutlist.cpp index 645e69565..ffacd001c 100644 --- a/tdecore/tdeshortcutlist.cpp +++ b/tdecore/tdeshortcutlist.cpp @@ -5,7 +5,7 @@ #include "tdeaccelaction.h" #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kglobalaccel.h> #include <kinstance.h> #include <tdeshortcut.h> diff --git a/tdecore/tdeshortcutmenu.cpp b/tdecore/tdeshortcutmenu.cpp index 91061a734..c035c0df9 100644 --- a/tdecore/tdeshortcutmenu.cpp +++ b/tdecore/tdeshortcutmenu.cpp @@ -23,7 +23,7 @@ #include "tdeaccelaction.h" #include <kdebug.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include "tdeshortcutmenu.h" //#include <kkeynative.h> diff --git a/tdecore/tdestdaccel.cpp b/tdecore/tdestdaccel.cpp index f91d2ee66..ba3e64ca5 100644 --- a/tdecore/tdestdaccel.cpp +++ b/tdecore/tdestdaccel.cpp @@ -25,8 +25,8 @@ #include "tdeaccelbase.h" #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tdeshortcut.h> #include <tdeshortcutlist.h> diff --git a/tdecore/tdesycoca.cpp b/tdecore/tdesycoca.cpp index 16914c0bc..8f5ede967 100644 --- a/tdecore/tdesycoca.cpp +++ b/tdecore/tdesycoca.cpp @@ -28,7 +28,7 @@ #include <tdeapplication.h> #include <dcopclient.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <kprocess.h> #include <kstandarddirs.h> diff --git a/tdecore/tests/Makefile.am b/tdecore/tests/Makefile.am index 2911d3ab8..a831eb65c 100644 --- a/tdecore/tests/Makefile.am +++ b/tdecore/tests/Makefile.am @@ -41,7 +41,7 @@ LDADD = ../libtdecore.la tdeconfigtestgui_SOURCES = tdeconfigtestgui.cpp kdebugtest_SOURCES = kdebugtest.cpp klocaletest_SOURCES = klocaletest.cpp -#klocaletest2_SOURCES = klocaletest2.cpp klocale.cpp libintl.cpp kcatalogue.cpp +#klocaletest2_SOURCES = klocaletest2.cpp tdelocale.cpp libintl.cpp kcatalogue.cpp #kcatalogue_SOURCES = kcatalogue.cpp libintl.cpp ksimpleconfigtest_SOURCES = ksimpleconfigtest.cpp kurltest_SOURCES = kurltest.cpp diff --git a/tdecore/tests/kapptest.cpp b/tdecore/tests/kapptest.cpp index 0952f292c..6a3abace9 100644 --- a/tdecore/tests/kapptest.cpp +++ b/tdecore/tests/kapptest.cpp @@ -22,7 +22,7 @@ #include <tdecmdlineargs.h> #include <tdeaboutdata.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdesycoca.h> int diff --git a/tdecore/tests/kcalendartest.cpp b/tdecore/tests/kcalendartest.cpp index 12c9010e2..7dc2cc6d7 100644 --- a/tdecore/tests/kcalendartest.cpp +++ b/tdecore/tests/kcalendartest.cpp @@ -10,8 +10,8 @@ #include <tdeapplication.h> #include <tdeaboutdata.h> #include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> class TDELocale; diff --git a/tdecore/tests/kcmdlineargstest.cpp b/tdecore/tests/kcmdlineargstest.cpp index 8148e4208..5213e443f 100644 --- a/tdecore/tests/kcmdlineargstest.cpp +++ b/tdecore/tests/kcmdlineargstest.cpp @@ -1,5 +1,5 @@ #include <tdecmdlineargs.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> #include <stdio.h> diff --git a/tdecore/tests/kglobaltest.cpp b/tdecore/tests/kglobaltest.cpp index eaab091f9..852e2ba34 100644 --- a/tdecore/tests/kglobaltest.cpp +++ b/tdecore/tests/kglobaltest.cpp @@ -1,6 +1,6 @@ #include <config.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <stdio.h> #include <tdeapplication.h> #include <stdlib.h> diff --git a/tdecore/tests/klocaletest.cpp b/tdecore/tests/klocaletest.cpp index 0647a10d3..36f301d6c 100644 --- a/tdecore/tests/klocaletest.cpp +++ b/tdecore/tests/klocaletest.cpp @@ -11,9 +11,9 @@ #include <tqdatetime.h> #include <tqlabel.h> -#include <kglobal.h> -#include <kglobalsettings.h> -#include "klocale.h" +#include <tdeglobal.h> +#include <tdeglobalsettings.h> +#include "tdelocale.h" #include <tdeapplication.h> #include <kcharsets.h> #include <kdebug.h> diff --git a/tdecore/tests/kmdcodectest.cpp b/tdecore/tests/kmdcodectest.cpp index bd3162f52..571d3f10b 100644 --- a/tdecore/tests/kmdcodectest.cpp +++ b/tdecore/tests/kmdcodectest.cpp @@ -27,7 +27,7 @@ #include <tqfile.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> #include <tdeapplication.h> diff --git a/tdecore/tests/krfcdatetest.cpp b/tdecore/tests/krfcdatetest.cpp index 6ef0fe5e5..94358a8f1 100644 --- a/tdecore/tests/krfcdatetest.cpp +++ b/tdecore/tests/krfcdatetest.cpp @@ -2,7 +2,7 @@ #include <tdeapplication.h> #include <stdlib.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kcharsets.h> #include <tqtextcodec.h> #include <krfcdate.h> diff --git a/tdecore/tests/ksocktest.cpp b/tdecore/tests/ksocktest.cpp index 01a9c4c3a..a1ce8f86b 100644 --- a/tdecore/tests/ksocktest.cpp +++ b/tdecore/tests/ksocktest.cpp @@ -17,7 +17,7 @@ */ #include "kuniqueapplication.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kdebug.h" #include "ksock.h" #include "ksockaddr.h" diff --git a/tdecore/tests/ktempfiletest.cpp b/tdecore/tests/ktempfiletest.cpp index 20cd6b36d..5c2354fff 100644 --- a/tdecore/tests/ktempfiletest.cpp +++ b/tdecore/tests/ktempfiletest.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ -#include "ktempfile.h" +#include "tdetempfile.h" #include "tdeapplication.h" #include "kstandarddirs.h" #include <tqstring.h> diff --git a/tdecore/tests/kuniqueapptest.cpp b/tdecore/tests/kuniqueapptest.cpp index 60ac98b5a..13b8ca534 100644 --- a/tdecore/tests/kuniqueapptest.cpp +++ b/tdecore/tests/kuniqueapptest.cpp @@ -17,7 +17,7 @@ */ #include "kuniqueapplication.h" -#include "kglobalsettings.h" +#include "tdeglobalsettings.h" #include <unistd.h> #include <stdlib.h> diff --git a/tdecore/tests/kurltest.cpp b/tdecore/tests/kurltest.cpp index 6694d0d80..0f57dd97c 100644 --- a/tdecore/tests/kurltest.cpp +++ b/tdecore/tests/kurltest.cpp @@ -5,7 +5,7 @@ #include <tdeapplication.h> #include <stdlib.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kcharsets.h> #include <tqtextcodec.h> #include <tqdatastream.h> diff --git a/tdecore/tests/startserviceby.cpp b/tdecore/tests/startserviceby.cpp index 20fc95f34..67c535cec 100644 --- a/tdecore/tests/startserviceby.cpp +++ b/tdecore/tests/startserviceby.cpp @@ -21,7 +21,7 @@ #include <tdecmdlineargs.h> #include <tdeaboutdata.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kdebug.h> int diff --git a/tdecore/tests/testqtargs.cpp b/tdecore/tests/testqtargs.cpp index 8383f930e..d69b3f6f4 100644 --- a/tdecore/tests/testqtargs.cpp +++ b/tdecore/tests/testqtargs.cpp @@ -46,7 +46,7 @@ application palette (light and dark shades are\ncalculated)."), 0}, #include <tdeapplication.h> #include <tdecmdlineargs.h> #include <tdeaboutdata.h> -#include <klocale.h> +#include <tdelocale.h> static const TDECmdLineOptions options[] = { diff --git a/tdecore/twin.cpp b/tdecore/twin.cpp index 93352dacc..e96c25011 100644 --- a/tdecore/twin.cpp +++ b/tdecore/twin.cpp @@ -37,16 +37,16 @@ #include "twin.h" #include "tdeapplication.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> #include <kdebug.h> #include <kdatastream.h> -#include <klocale.h> +#include <tdelocale.h> #include <dcopclient.h> #include <dcopref.h> #ifdef Q_WS_X11 -#include <kstartupinfo.h> +#include <tdestartupinfo.h> #include <kxerrorhandler.h> #include <X11/Xlib.h> diff --git a/tdecore/twinmodule.cpp b/tdecore/twinmodule.cpp index 27b8b0cdd..a37370e58 100644 --- a/tdecore/twinmodule.cpp +++ b/tdecore/twinmodule.cpp @@ -30,7 +30,7 @@ #include "kdebug.h" #include <tqtl.h> #include <tqptrlist.h> -#include <klocale.h> +#include <tdelocale.h> #include <dcopclient.h> #include "netwm.h" diff --git a/tdefile-plugins/elf/tdefile_elf.cpp b/tdefile-plugins/elf/tdefile_elf.cpp index cad269713..7308a40d1 100644 --- a/tdefile-plugins/elf/tdefile_elf.cpp +++ b/tdefile-plugins/elf/tdefile_elf.cpp @@ -21,7 +21,7 @@ #include "tdefile_elf.h" #include <kprocess.h> -#include <klocale.h> +#include <tdelocale.h> #include <kgenericfactory.h> #include <kstringvalidator.h> #include <kdebug.h> diff --git a/tdehtml/css/csshelper.cpp b/tdehtml/css/csshelper.cpp index 02b5b3d39..a6ea9c38b 100644 --- a/tdehtml/css/csshelper.cpp +++ b/tdehtml/css/csshelper.cpp @@ -28,7 +28,7 @@ #include <tqfontdatabase.h> #include <kcharsets.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include "rendering/render_style.h" diff --git a/tdehtml/css/cssparser.cpp b/tdehtml/css/cssparser.cpp index b33151b59..8b11c78d2 100644 --- a/tdehtml/css/cssparser.cpp +++ b/tdehtml/css/cssparser.cpp @@ -26,7 +26,7 @@ #define YYDEBUG 0 #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kurl.h> #include "cssparser.h" diff --git a/tdehtml/css/cssstyleselector.cpp b/tdehtml/css/cssstyleselector.cpp index 2a1fb5477..79f8ba251 100644 --- a/tdehtml/css/cssstyleselector.cpp +++ b/tdehtml/css/cssstyleselector.cpp @@ -57,7 +57,7 @@ using namespace DOM; #include <kstandarddirs.h> #include <kcharsets.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <tqfile.h> #include <tqvaluelist.h> diff --git a/tdehtml/ecma/kjs_debugwin.cpp b/tdehtml/ecma/kjs_debugwin.cpp index f1b2b430d..b7bd23de3 100644 --- a/tdehtml/ecma/kjs_debugwin.cpp +++ b/tdehtml/ecma/kjs_debugwin.cpp @@ -41,17 +41,17 @@ #include <tqpainter.h> #include <tqscrollbar.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kiconloader.h> -#include <kglobal.h> -#include <kmessagebox.h> +#include <tdeglobal.h> +#include <tdemessagebox.h> #include <kguiitem.h> #include <tdepopupmenu.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdeaction.h> #include <tdeactioncollection.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdeshortcut.h> #include <tdeconfig.h> #include <tdeconfigbase.h> diff --git a/tdehtml/ecma/kjs_html.cpp b/tdehtml/ecma/kjs_html.cpp index 8a63ba943..abd059e75 100644 --- a/tdehtml/ecma/kjs_html.cpp +++ b/tdehtml/ecma/kjs_html.cpp @@ -56,9 +56,9 @@ #include "rendering/render_frames.h" #include "rendering/render_layer.h" -#include "kmessagebox.h" +#include "tdemessagebox.h" #include <kstringhandler.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> diff --git a/tdehtml/ecma/kjs_mozilla.cpp b/tdehtml/ecma/kjs_mozilla.cpp index 6fc7688dd..d26aabb5e 100644 --- a/tdehtml/ecma/kjs_mozilla.cpp +++ b/tdehtml/ecma/kjs_mozilla.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include "kjs_mozilla.h" diff --git a/tdehtml/ecma/kjs_navigator.cpp b/tdehtml/ecma/kjs_navigator.cpp index 03bc22987..296290744 100644 --- a/tdehtml/ecma/kjs_navigator.cpp +++ b/tdehtml/ecma/kjs_navigator.cpp @@ -21,13 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <tdeconfig.h> #include <kdebug.h> -#include <tdeio/kprotocolmanager.h> +#include <tdeio/tdeprotocolmanager.h> #include <tdeio/kmimetype.h> #include <tdeio/kservice.h> #include <tdeio/ktrader.h> diff --git a/tdehtml/ecma/kjs_proxy.cpp b/tdehtml/ecma/kjs_proxy.cpp index 578cd30f0..bdd7183fe 100644 --- a/tdehtml/ecma/kjs_proxy.cpp +++ b/tdehtml/ecma/kjs_proxy.cpp @@ -38,10 +38,10 @@ #include "xml/dom_nodeimpl.h" #include "tdehtmlpart_p.h" #include <tdehtml_part.h> -#include <kprotocolmanager.h> +#include <tdeprotocolmanager.h> #include <kdebug.h> -#include <kmessagebox.h> -#include <klocale.h> +#include <tdemessagebox.h> +#include <tdelocale.h> #include <unistd.h> #include <signal.h> #include <sys/time.h> diff --git a/tdehtml/ecma/kjs_window.cpp b/tdehtml/ecma/kjs_window.cpp index 1d38de27e..554781cb9 100644 --- a/tdehtml/ecma/kjs_window.cpp +++ b/tdehtml/ecma/kjs_window.cpp @@ -36,9 +36,9 @@ #include <tqpaintdevicemetrics.h> #include <tqapplication.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kinputdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <kmdcodec.h> #include <tdeparts/browserinterface.h> #include <twin.h> @@ -50,7 +50,7 @@ #ifndef KONQ_EMBEDDED #include <kbookmarkmanager.h> #endif -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <assert.h> #include <tqstyle.h> #include <tqobjectlist.h> diff --git a/tdehtml/html/dtd.cpp b/tdehtml/html/dtd.cpp index accc8b855..d3ea86d51 100644 --- a/tdehtml/html/dtd.cpp +++ b/tdehtml/html/dtd.cpp @@ -26,7 +26,7 @@ using namespace DOM; #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> // priority of tags. Closing tags of higher priority close tags of lower // priority. diff --git a/tdehtml/html/html_documentimpl.cpp b/tdehtml/html/html_documentimpl.cpp index e4f090973..52ada7a7b 100644 --- a/tdehtml/html/html_documentimpl.cpp +++ b/tdehtml/html/html_documentimpl.cpp @@ -47,9 +47,9 @@ #include <tdeapplication.h> #include <kdebug.h> #include <kurl.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kcharsets.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include "css/cssproperties.h" #include "css/cssstyleselector.h" diff --git a/tdehtml/html/html_elementimpl.cpp b/tdehtml/html/html_elementimpl.cpp index 1153e8b7f..fc116caf3 100644 --- a/tdehtml/html/html_elementimpl.cpp +++ b/tdehtml/html/html_elementimpl.cpp @@ -50,7 +50,7 @@ #include "xml/dom2_eventsimpl.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include "html_elementimpl.h" using namespace DOM; diff --git a/tdehtml/html/html_formimpl.cpp b/tdehtml/html/html_formimpl.cpp index 372904e0e..6fae233dd 100644 --- a/tdehtml/html/html_formimpl.cpp +++ b/tdehtml/html/html_formimpl.cpp @@ -47,12 +47,12 @@ #include "rendering/render_form.h" #include <kcharsets.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <kmimetype.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #ifndef TDEHTML_NO_WALLET #include <tdewallet.h> #endif diff --git a/tdehtml/html/html_imageimpl.cpp b/tdehtml/html/html_imageimpl.cpp index b1972aad4..a006b3bd0 100644 --- a/tdehtml/html/html_imageimpl.cpp +++ b/tdehtml/html/html_imageimpl.cpp @@ -29,7 +29,7 @@ #include "tdehtml_part.h" #include <kstringhandler.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include "rendering/render_image.h" diff --git a/tdehtml/html/html_tableimpl.cpp b/tdehtml/html/html_tableimpl.cpp index 71fe14773..f14ad8583 100644 --- a/tdehtml/html/html_tableimpl.cpp +++ b/tdehtml/html/html_tableimpl.cpp @@ -43,7 +43,7 @@ #include "rendering/render_table.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> using namespace tdehtml; using namespace DOM; diff --git a/tdehtml/html/htmlparser.cpp b/tdehtml/html/htmlparser.cpp index f7cc1daaf..31d3d4c17 100644 --- a/tdehtml/html/htmlparser.cpp +++ b/tdehtml/html/htmlparser.cpp @@ -56,7 +56,7 @@ #include "html/htmlparser.h" #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> using namespace DOM; using namespace tdehtml; diff --git a/tdehtml/html/htmltokenizer.cpp b/tdehtml/html/htmltokenizer.cpp index 62d3ffab6..292d1773d 100644 --- a/tdehtml/html/htmltokenizer.cpp +++ b/tdehtml/html/htmltokenizer.cpp @@ -50,7 +50,7 @@ #include "css/csshelper.h" #include "ecma/kjs_proxy.h" #include <kcharsets.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <ctype.h> #include <assert.h> #include <tqvariant.h> diff --git a/tdehtml/java/kjavaapplet.cpp b/tdehtml/java/kjavaapplet.cpp index 70a39afbc..a28e541e2 100644 --- a/tdehtml/java/kjavaapplet.cpp +++ b/tdehtml/java/kjavaapplet.cpp @@ -22,7 +22,7 @@ #include "kjavaappletwidget.h" #include "kjavaappletcontext.h" -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tdeparts/browserextension.h> diff --git a/tdehtml/java/kjavaappletcontext.cpp b/tdehtml/java/kjavaappletcontext.cpp index 76914a5dc..b644b67ca 100644 --- a/tdehtml/java/kjavaappletcontext.cpp +++ b/tdehtml/java/kjavaappletcontext.cpp @@ -23,8 +23,8 @@ #include "kjavaappletserver.h" #include "kjavaprocess.h" #include "kjavaapplet.h" -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kdebug.h> #include <tqmap.h> #include <tqguardedptr.h> diff --git a/tdehtml/java/kjavaappletserver.cpp b/tdehtml/java/kjavaappletserver.cpp index 5d108ffcf..952fe143b 100644 --- a/tdehtml/java/kjavaappletserver.cpp +++ b/tdehtml/java/kjavaappletserver.cpp @@ -27,13 +27,13 @@ #include <kdebug.h> #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeparts/browserextension.h> #include <tdeapplication.h> #include <kstandarddirs.h> #include <tdeio/job.h> -#include <tdeio/kprotocolmanager.h> +#include <tdeio/tdeprotocolmanager.h> #include <ksslcertificate.h> #include <ksslcertchain.h> #include <kssl.h> diff --git a/tdehtml/java/kjavaappletviewer.cpp b/tdehtml/java/kjavaappletviewer.cpp index 5d5b47fbf..f80690aa9 100644 --- a/tdehtml/java/kjavaappletviewer.cpp +++ b/tdehtml/java/kjavaappletviewer.cpp @@ -32,7 +32,7 @@ #include <klibloader.h> #include <tdeaboutdata.h> #include <kstaticdeleter.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstatusbar.h> #include <kiconloader.h> #include <tdeapplication.h> diff --git a/tdehtml/java/kjavaappletwidget.cpp b/tdehtml/java/kjavaappletwidget.cpp index c096261cd..a1f5b8f11 100644 --- a/tdehtml/java/kjavaappletwidget.cpp +++ b/tdehtml/java/kjavaappletwidget.cpp @@ -24,7 +24,7 @@ #include <twin.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqlabel.h> diff --git a/tdehtml/java/kjavaprocess.cpp b/tdehtml/java/kjavaprocess.cpp index 1ff68dd74..6b505c343 100644 --- a/tdehtml/java/kjavaprocess.cpp +++ b/tdehtml/java/kjavaprocess.cpp @@ -22,7 +22,7 @@ #include "kjavaprocess.h" #include <kdebug.h> -#include <tdeio/kprotocolmanager.h> +#include <tdeio/tdeprotocolmanager.h> #include <tqtextstream.h> #include <tqmap.h> diff --git a/tdehtml/misc/arena.cpp b/tdehtml/misc/arena.cpp index cfbce24ab..e2513ba36 100644 --- a/tdehtml/misc/arena.cpp +++ b/tdehtml/misc/arena.cpp @@ -45,7 +45,7 @@ #include <config.h> #include <stdlib.h> #include <string.h> -#include <kglobal.h> +#include <tdeglobal.h> #include "arena.h" #ifdef HAVE_GETPAGESIZE diff --git a/tdehtml/misc/decoder.cpp b/tdehtml/misc/decoder.cpp index 6000aa9cf..28c8a5e9d 100644 --- a/tdehtml/misc/decoder.cpp +++ b/tdehtml/misc/decoder.cpp @@ -39,12 +39,12 @@ using namespace tdehtml; #include <tqregexp.h> #include <tqtextcodec.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kcharsets.h> #include <ctype.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> diff --git a/tdehtml/misc/htmlhashes.cpp b/tdehtml/misc/htmlhashes.cpp index e073f0964..376007819 100644 --- a/tdehtml/misc/htmlhashes.cpp +++ b/tdehtml/misc/htmlhashes.cpp @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ -#include <kglobal.h> +#include <tdeglobal.h> #include "htmlhashes.h" #include "htmltags.c" diff --git a/tdehtml/misc/htmltags.h b/tdehtml/misc/htmltags.h index d8fbb3236..bf9a8ded8 100644 --- a/tdehtml/misc/htmltags.h +++ b/tdehtml/misc/htmltags.h @@ -5,7 +5,7 @@ #define TDEHTML_TAGS_H #include "dom/dom_string.h" -#include <kglobal.h> +#include <tdeglobal.h> KDE_NO_EXPORT const char* getTagName(unsigned short id); diff --git a/tdehtml/misc/knsplugininstaller.cpp b/tdehtml/misc/knsplugininstaller.cpp index 0edcc34ea..b8b94cd6b 100644 --- a/tdehtml/misc/knsplugininstaller.cpp +++ b/tdehtml/misc/knsplugininstaller.cpp @@ -24,11 +24,11 @@ #include "knsplugininstaller.moc" #include <kdebug.h> -#include <kdiroperator.h> +#include <tdediroperator.h> #include <tdelistview.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstddirs.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <netaccess.h> #include <tqbuttongroup.h> diff --git a/tdehtml/misc/loader.cpp b/tdehtml/misc/loader.cpp index b7f42aa29..7621b5e4f 100644 --- a/tdehtml/misc/loader.cpp +++ b/tdehtml/misc/loader.cpp @@ -59,7 +59,7 @@ #include <tdeapplication.h> #include <tdeio/job.h> #include <tdeio/jobclasses.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kimageio.h> #include <kcharsets.h> #include <kiconloader.h> @@ -71,7 +71,7 @@ #ifdef IMAGE_TITLES #include <tqfile.h> #include <tdefilemetainfo.h> -#include <ktempfile.h> +#include <tdetempfile.h> #endif #include "html/html_documentimpl.h" diff --git a/tdehtml/misc/loader_jpeg.cpp b/tdehtml/misc/loader_jpeg.cpp index 72816817f..9ee5378f9 100644 --- a/tdehtml/misc/loader_jpeg.cpp +++ b/tdehtml/misc/loader_jpeg.cpp @@ -37,7 +37,7 @@ #include <stdio.h> #include <setjmp.h> #include <tqdatetime.h> -#include <kglobal.h> +#include <tdeglobal.h> extern "C" { #define XMD_H diff --git a/tdehtml/misc/maketags b/tdehtml/misc/maketags index b2b472892..8a6abf0ed 100644 --- a/tdehtml/misc/maketags +++ b/tdehtml/misc/maketags @@ -41,7 +41,7 @@ print header <<EOF; #define TDEHTML_TAGS_H #include "dom/dom_string.h" -#include <kglobal.h> +#include <tdeglobal.h> KDE_NO_EXPORT const char* getTagName(unsigned short id); diff --git a/tdehtml/rendering/font.cpp b/tdehtml/rendering/font.cpp index b7632fc8d..c70073940 100644 --- a/tdehtml/rendering/font.cpp +++ b/tdehtml/rendering/font.cpp @@ -33,7 +33,7 @@ #include "tdehtml_settings.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tqpainter.h> #include <tqfontdatabase.h> diff --git a/tdehtml/rendering/render_applet.cpp b/tdehtml/rendering/render_applet.cpp index d14a93553..eb9762897 100644 --- a/tdehtml/rendering/render_applet.cpp +++ b/tdehtml/rendering/render_applet.cpp @@ -20,7 +20,7 @@ * */ #include <config.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> diff --git a/tdehtml/rendering/render_body.cpp b/tdehtml/rendering/render_body.cpp index 80a613000..820b1b872 100644 --- a/tdehtml/rendering/render_body.cpp +++ b/tdehtml/rendering/render_body.cpp @@ -25,7 +25,7 @@ #include "xml/dom_docimpl.h" #include "tdehtmlview.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> using namespace tdehtml; diff --git a/tdehtml/rendering/render_box.cpp b/tdehtml/rendering/render_box.cpp index d138d3ee2..85e1f6665 100644 --- a/tdehtml/rendering/render_box.cpp +++ b/tdehtml/rendering/render_box.cpp @@ -45,7 +45,7 @@ #include <tdehtmlview.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <assert.h> diff --git a/tdehtml/rendering/render_canvas.cpp b/tdehtml/rendering/render_canvas.cpp index a3dc548b2..862f374b2 100644 --- a/tdehtml/rendering/render_canvas.cpp +++ b/tdehtml/rendering/render_canvas.cpp @@ -29,7 +29,7 @@ #include "tdehtmlview.h" #include "tdehtml_part.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> using namespace tdehtml; diff --git a/tdehtml/rendering/render_flow.cpp b/tdehtml/rendering/render_flow.cpp index 272ceb2db..a535b218e 100644 --- a/tdehtml/rendering/render_flow.cpp +++ b/tdehtml/rendering/render_flow.cpp @@ -26,7 +26,7 @@ #include <kdebug.h> #include <assert.h> #include <tqpainter.h> -#include <kglobal.h> +#include <tdeglobal.h> #include "rendering/render_flow.h" #include "rendering/render_text.h" diff --git a/tdehtml/rendering/render_form.cpp b/tdehtml/rendering/render_form.cpp index 89f38a7b2..9d302bfc8 100644 --- a/tdehtml/rendering/render_form.cpp +++ b/tdehtml/rendering/render_form.cpp @@ -30,8 +30,8 @@ #include <kfind.h> #include <kfinddialog.h> #include <kiconloader.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kreplace.h> #include <kreplacedialog.h> #include <tdespell.h> diff --git a/tdehtml/rendering/render_frames.cpp b/tdehtml/rendering/render_frames.cpp index 12d0d75ec..68c66495a 100644 --- a/tdehtml/rendering/render_frames.cpp +++ b/tdehtml/rendering/render_frames.cpp @@ -39,9 +39,9 @@ #include "misc/knsplugininstaller.h" #include <tdeapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kmimetype.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tqtimer.h> #include <tqpainter.h> diff --git a/tdehtml/rendering/render_image.cpp b/tdehtml/rendering/render_image.cpp index b41911e3a..ad8f18bb3 100644 --- a/tdehtml/rendering/render_image.cpp +++ b/tdehtml/rendering/render_image.cpp @@ -32,7 +32,7 @@ #include <tdeapplication.h> #include <kdebug.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include "css/csshelper.h" #include "misc/helper.h" diff --git a/tdehtml/rendering/render_inline.cpp b/tdehtml/rendering/render_inline.cpp index aee43a817..15bc1b0df 100644 --- a/tdehtml/rendering/render_inline.cpp +++ b/tdehtml/rendering/render_inline.cpp @@ -23,7 +23,7 @@ * */ -#include <kglobal.h> +#include <tdeglobal.h> #include "rendering/render_arena.h" #include "rendering/render_inline.h" diff --git a/tdehtml/rendering/render_line.cpp b/tdehtml/rendering/render_line.cpp index b518d3a43..d8bc8d0e2 100644 --- a/tdehtml/rendering/render_line.cpp +++ b/tdehtml/rendering/render_line.cpp @@ -24,7 +24,7 @@ #include <kdebug.h> #include <assert.h> #include <tqpainter.h> -#include <kglobal.h> +#include <tdeglobal.h> #include "rendering/render_flow.h" #include "rendering/render_text.h" diff --git a/tdehtml/rendering/render_list.cpp b/tdehtml/rendering/render_list.cpp index 5af983a72..cc9ba4e5b 100644 --- a/tdehtml/rendering/render_list.cpp +++ b/tdehtml/rendering/render_list.cpp @@ -35,7 +35,7 @@ #include "xml/dom_docimpl.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tqvaluelist.h> //#define BOX_DEBUG diff --git a/tdehtml/rendering/render_object.cpp b/tdehtml/rendering/render_object.cpp index 1d16057a2..a979e1dc1 100644 --- a/tdehtml/rendering/render_object.cpp +++ b/tdehtml/rendering/render_object.cpp @@ -45,7 +45,7 @@ #include "misc/loader.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tqpainter.h> #include "tdehtmlview.h" #include <tdehtml_part.h> diff --git a/tdehtml/rendering/render_object.h b/tdehtml/rendering/render_object.h index 8d066201c..bf120ff84 100644 --- a/tdehtml/rendering/render_object.h +++ b/tdehtml/rendering/render_object.h @@ -32,7 +32,7 @@ #include <tqvaluelist.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include "xml/dom_docimpl.h" #include "misc/tdehtmllayout.h" diff --git a/tdehtml/rendering/render_replaced.cpp b/tdehtml/rendering/render_replaced.cpp index 5a96d06f0..2d991c3a2 100644 --- a/tdehtml/rendering/render_replaced.cpp +++ b/tdehtml/rendering/render_replaced.cpp @@ -35,7 +35,7 @@ #include <tqevent.h> #include <tqapplication.h> #include <tqlineedit.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tqobjectlist.h> #include <tqvaluevector.h> diff --git a/tdehtml/rendering/render_table.cpp b/tdehtml/rendering/render_table.cpp index 8a75c73f2..9f2cc3366 100644 --- a/tdehtml/rendering/render_table.cpp +++ b/tdehtml/rendering/render_table.cpp @@ -40,7 +40,7 @@ #include "rendering/render_line.h" #include "xml/dom_docimpl.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <tqapplication.h> #include <tqstyle.h> diff --git a/tdehtml/rendering/render_text.cpp b/tdehtml/rendering/render_text.cpp index d125b04c6..411f3f221 100644 --- a/tdehtml/rendering/render_text.cpp +++ b/tdehtml/rendering/render_text.cpp @@ -43,7 +43,7 @@ #include <tqimage.h> #include <tqpainter.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <assert.h> #include <limits.h> #include <math.h> diff --git a/tdehtml/rendering/table_layout.cpp b/tdehtml/rendering/table_layout.cpp index eb8153331..97a6a4c91 100644 --- a/tdehtml/rendering/table_layout.cpp +++ b/tdehtml/rendering/table_layout.cpp @@ -23,7 +23,7 @@ #include "table_layout.h" #include "render_table.h" -#include <kglobal.h> +#include <tdeglobal.h> using namespace tdehtml; diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index 3cc65676d..b7dfb8a42 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -44,7 +44,7 @@ #include <tqdragobject.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdefiledialog.h> #include <tdeio/job.h> #include <kprocess.h> @@ -54,7 +54,7 @@ #include <kurldrag.h> #include <kstringhandler.h> #include <tdeapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kstandarddirs.h> #include <krun.h> #include <kurifilter.h> diff --git a/tdehtml/tdehtml_factory.cpp b/tdehtml/tdehtml_factory.cpp index b52476ea1..4094030c6 100644 --- a/tdehtml/tdehtml_factory.cpp +++ b/tdehtml/tdehtml_factory.cpp @@ -31,7 +31,7 @@ #include <kinstance.h> #include <tdeaboutdata.h> -#include <klocale.h> +#include <tdelocale.h> #include <assert.h> diff --git a/tdehtml/tdehtml_pagecache.cpp b/tdehtml/tdehtml_pagecache.cpp index c2e0a89e1..319dd8162 100644 --- a/tdehtml/tdehtml_pagecache.cpp +++ b/tdehtml/tdehtml_pagecache.cpp @@ -21,7 +21,7 @@ #include "tdehtml_pagecache.h" #include <kstaticdeleter.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kstandarddirs.h> #include <tqintdict.h> diff --git a/tdehtml/tdehtml_part.cpp b/tdehtml/tdehtml_part.cpp index c4bba759c..28b15c7d1 100644 --- a/tdehtml/tdehtml_part.cpp +++ b/tdehtml/tdehtml_part.cpp @@ -78,18 +78,18 @@ using namespace DOM; #include <tdeio/job.h> #include <tdeio/global.h> #include <tdeio/netaccess.h> -#include <kprotocolmanager.h> +#include <tdeprotocolmanager.h> #include <kdebug.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kcharsets.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kstdaction.h> #include <tdefiledialog.h> #include <ktrader.h> #include <kdatastream.h> -#include <ktempfile.h> -#include <kglobalsettings.h> +#include <tdetempfile.h> +#include <tdeglobalsettings.h> #include <kurldrag.h> #include <tdeapplication.h> #include <tdeparts/browserinterface.h> diff --git a/tdehtml/tdehtml_printsettings.cpp b/tdehtml/tdehtml_printsettings.cpp index 251c3403f..19fe7bdbf 100644 --- a/tdehtml/tdehtml_printsettings.cpp +++ b/tdehtml/tdehtml_printsettings.cpp @@ -19,7 +19,7 @@ #include "tdehtml_printsettings.h" -#include <klocale.h> +#include <tdelocale.h> #include <tqcheckbox.h> #include <tqlayout.h> #include <tqwhatsthis.h> diff --git a/tdehtml/tdehtml_run.cpp b/tdehtml/tdehtml_run.cpp index 2a5fd1861..499616cce 100644 --- a/tdehtml/tdehtml_run.cpp +++ b/tdehtml/tdehtml_run.cpp @@ -24,7 +24,7 @@ #include "tdehtml_run.h" #include <tdeio/job.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include "tdehtml_ext.h" #include <tqwidget.h> diff --git a/tdehtml/tdehtml_settings.cc b/tdehtml/tdehtml_settings.cc index 8e36f5891..7f799e311 100644 --- a/tdehtml/tdehtml_settings.cc +++ b/tdehtml/tdehtml_settings.cc @@ -21,14 +21,14 @@ #include "tdehtml_settings.h" #include "tdehtmldefaults.h" -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdeconfig.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kdebug.h> #include <tqregexp.h> #include <tqvaluevector.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> /** * @internal diff --git a/tdehtml/tdehtmlimage.cpp b/tdehtml/tdehtmlimage.cpp index bf05d8495..31311cb3d 100644 --- a/tdehtml/tdehtmlimage.cpp +++ b/tdehtml/tdehtmlimage.cpp @@ -32,7 +32,7 @@ #include <tdeio/job.h> #include <kinstance.h> #include <kmimetype.h> -#include <klocale.h> +#include <tdelocale.h> K_EXPORT_COMPONENT_FACTORY( tdehtmlimagefactory /*NOT the part name, see Makefile.am*/, TDEHTMLImageFactory ) diff --git a/tdehtml/tdehtmlview.cpp b/tdehtml/tdehtmlview.cpp index 010075f2a..16b274cbd 100644 --- a/tdehtml/tdehtmlview.cpp +++ b/tdehtml/tdehtmlview.cpp @@ -67,7 +67,7 @@ #include <kdialogbase.h> #include <kiconloader.h> #include <kimageio.h> -#include <klocale.h> +#include <tdelocale.h> #include <knotifyclient.h> #include <kprinter.h> #include <ksimpleconfig.h> diff --git a/tdehtml/tdemultipart/tdemultipart.cpp b/tdehtml/tdemultipart/tdemultipart.cpp index dd864d65b..201f1ef60 100644 --- a/tdehtml/tdemultipart/tdemultipart.cpp +++ b/tdehtml/tdemultipart/tdemultipart.cpp @@ -22,11 +22,11 @@ #include <tqvbox.h> #include <kinstance.h> #include <kmimetype.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeio/job.h> #include <tqfile.h> -#include <ktempfile.h> -#include <kmessagebox.h> +#include <tdetempfile.h> +#include <tdemessagebox.h> #include <tdeparts/componentfactory.h> #include <tdeparts/genericfactory.h> #include <tdehtml_part.h> diff --git a/tdehtml/test_regression.cpp b/tdehtml/test_regression.cpp index 028fadc36..62842e086 100644 --- a/tdehtml/test_regression.cpp +++ b/tdehtml/test_regression.cpp @@ -65,7 +65,7 @@ #include <tdeio/job.h> #include <tdemainwindow.h> #include <ksimpleconfig.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tqcolor.h> #include <tqcursor.h> diff --git a/tdehtml/xml/dom_docimpl.cpp b/tdehtml/xml/dom_docimpl.cpp index 47836b41e..423a2a51e 100644 --- a/tdehtml/xml/dom_docimpl.cpp +++ b/tdehtml/xml/dom_docimpl.cpp @@ -46,7 +46,7 @@ #include <tqptrstack.h> #include <tqpaintdevicemetrics.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstaticdeleter.h> #include "rendering/counter_tree.h" @@ -60,7 +60,7 @@ #include "tdehtmlview.h" #include "tdehtml_part.h" -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kstringhandler.h> #include <krfcdate.h> #include "tdehtml_settings.h" diff --git a/tdehtml/xml/dom_nodeimpl.cpp b/tdehtml/xml/dom_nodeimpl.cpp index ac8ca630e..7e2e1bc5f 100644 --- a/tdehtml/xml/dom_nodeimpl.cpp +++ b/tdehtml/xml/dom_nodeimpl.cpp @@ -33,7 +33,7 @@ #include "xml/dom_nodeimpl.h" #include "xml/dom_restyler.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include "rendering/render_text.h" diff --git a/tdehtml/xml/xml_tokenizer.cpp b/tdehtml/xml/xml_tokenizer.cpp index 44f90673f..2ee90097b 100644 --- a/tdehtml/xml/xml_tokenizer.cpp +++ b/tdehtml/xml/xml_tokenizer.cpp @@ -36,7 +36,7 @@ #include "tdehtml_part.h" #include <tqvariant.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> using namespace DOM; using namespace tdehtml; diff --git a/tdeio/bookmarks/kbookmark.cc b/tdeio/bookmarks/kbookmark.cc index e6bef2e02..8bbaa5e43 100644 --- a/tdeio/bookmarks/kbookmark.cc +++ b/tdeio/bookmarks/kbookmark.cc @@ -25,8 +25,8 @@ #include <kmimetype.h> #include <kstringhandler.h> #include <kinputdialog.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <assert.h> #include <tdeapplication.h> #include <dcopclient.h> diff --git a/tdeio/bookmarks/kbookmarkexporter.cc b/tdeio/bookmarks/kbookmarkexporter.cc index 30c52bdb8..ee33612a2 100644 --- a/tdeio/bookmarks/kbookmarkexporter.cc +++ b/tdeio/bookmarks/kbookmarkexporter.cc @@ -24,7 +24,7 @@ #include <tqstylesheet.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include "kbookmarkmanager.h" #include "kbookmarkexporter.h" diff --git a/tdeio/bookmarks/kbookmarkimporter.cc b/tdeio/bookmarks/kbookmarkimporter.cc index 366802905..513f89b40 100644 --- a/tdeio/bookmarks/kbookmarkimporter.cc +++ b/tdeio/bookmarks/kbookmarkimporter.cc @@ -20,7 +20,7 @@ #include <tdefiledialog.h> #include <kstringhandler.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kcharsets.h> #include <tqtextcodec.h> diff --git a/tdeio/bookmarks/kbookmarkimporter_crash.cc b/tdeio/bookmarks/kbookmarkimporter_crash.cc index 0443b3b1c..9b0cacf25 100644 --- a/tdeio/bookmarks/kbookmarkimporter_crash.cc +++ b/tdeio/bookmarks/kbookmarkimporter_crash.cc @@ -22,7 +22,7 @@ #include <tdefiledialog.h> #include <kstringhandler.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tdeapplication.h> #include <kstandarddirs.h> diff --git a/tdeio/bookmarks/kbookmarkimporter_ie.cc b/tdeio/bookmarks/kbookmarkimporter_ie.cc index 092ebe596..d588517a3 100644 --- a/tdeio/bookmarks/kbookmarkimporter_ie.cc +++ b/tdeio/bookmarks/kbookmarkimporter_ie.cc @@ -20,7 +20,7 @@ #include <tdefiledialog.h> #include <kstringhandler.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tqtextcodec.h> diff --git a/tdeio/bookmarks/kbookmarkimporter_kde1.cc b/tdeio/bookmarks/kbookmarkimporter_kde1.cc index 6aca22b84..95937f890 100644 --- a/tdeio/bookmarks/kbookmarkimporter_kde1.cc +++ b/tdeio/bookmarks/kbookmarkimporter_kde1.cc @@ -21,7 +21,7 @@ #include "kbookmarkimporter_kde1.h" #include <tdefiledialog.h> #include <kstringhandler.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kcharsets.h> #include <tqtextcodec.h> diff --git a/tdeio/bookmarks/kbookmarkimporter_ns.cc b/tdeio/bookmarks/kbookmarkimporter_ns.cc index 8ce06a79b..29960ce51 100644 --- a/tdeio/bookmarks/kbookmarkimporter_ns.cc +++ b/tdeio/bookmarks/kbookmarkimporter_ns.cc @@ -25,7 +25,7 @@ #include "kbookmarkmanager.h" #include <tdefiledialog.h> #include <kstringhandler.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kcharsets.h> #include <tqtextcodec.h> diff --git a/tdeio/bookmarks/kbookmarkimporter_opera.cc b/tdeio/bookmarks/kbookmarkimporter_opera.cc index 57b5d6208..0609c7a3b 100644 --- a/tdeio/bookmarks/kbookmarkimporter_opera.cc +++ b/tdeio/bookmarks/kbookmarkimporter_opera.cc @@ -20,7 +20,7 @@ #include <tdefiledialog.h> #include <kstringhandler.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tqtextcodec.h> diff --git a/tdeio/bookmarks/kbookmarkmanager.cc b/tdeio/bookmarks/kbookmarkmanager.cc index 205d879ab..60d4f2932 100644 --- a/tdeio/bookmarks/kbookmarkmanager.cc +++ b/tdeio/bookmarks/kbookmarkmanager.cc @@ -29,9 +29,9 @@ #include <ksavefile.h> #include <dcopref.h> #include <tqregexp.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kprocess.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> #include <dcopclient.h> #include <tqfile.h> diff --git a/tdeio/bookmarks/kbookmarkmenu.cc b/tdeio/bookmarks/kbookmarkmenu.cc index 0468bcd5a..e1b00bc40 100644 --- a/tdeio/bookmarks/kbookmarkmenu.cc +++ b/tdeio/bookmarks/kbookmarkmenu.cc @@ -32,8 +32,8 @@ #include <kdialogbase.h> #include <kiconloader.h> #include <klineedit.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tdepopupmenu.h> #include <tdestdaccel.h> #include <kstdaction.h> diff --git a/tdeio/bookmarks/kbookmarkmenu.h b/tdeio/bookmarks/kbookmarkmenu.h index 0c1ebb27c..aeed441b0 100644 --- a/tdeio/bookmarks/kbookmarkmenu.h +++ b/tdeio/bookmarks/kbookmarkmenu.h @@ -30,7 +30,7 @@ #include <tqlistview.h> #include <kdialogbase.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaction.h> #include "kbookmark.h" diff --git a/tdeio/bookmarks/kbookmarkmenu_p.h b/tdeio/bookmarks/kbookmarkmenu_p.h index fc34e9029..b47af8ebf 100644 --- a/tdeio/bookmarks/kbookmarkmenu_p.h +++ b/tdeio/bookmarks/kbookmarkmenu_p.h @@ -30,7 +30,7 @@ #include <tqlistview.h> #include <kdialogbase.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaction.h> #include "kbookmark.h" diff --git a/tdeio/httpfilter/httpfilter.cc b/tdeio/httpfilter/httpfilter.cc index 21086d613..0f6a45790 100644 --- a/tdeio/httpfilter/httpfilter.cc +++ b/tdeio/httpfilter/httpfilter.cc @@ -19,7 +19,7 @@ #include <tdeio/global.h> -#include <klocale.h> +#include <tdelocale.h> #include "httpfilter.h" diff --git a/tdeio/kpasswdserver/kpasswdserver.cpp b/tdeio/kpasswdserver/kpasswdserver.cpp index 4986eb45a..cf4e0530c 100644 --- a/tdeio/kpasswdserver/kpasswdserver.cpp +++ b/tdeio/kpasswdserver/kpasswdserver.cpp @@ -30,8 +30,8 @@ #include <tqtimer.h> #include <tdeapplication.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kdebug.h> #include <tdeio/passdlg.h> #include <tdewallet.h> diff --git a/tdeio/kssl/kssl.cc b/tdeio/kssl/kssl.cc index 66cc503d5..874da6aa6 100644 --- a/tdeio/kssl/kssl.cc +++ b/tdeio/kssl/kssl.cc @@ -48,7 +48,7 @@ #include <ksslx509v3.h> #include <ksslpkcs12.h> #include <ksslsession.h> -#include <klocale.h> +#include <tdelocale.h> #include <ksocks.h> #define sk_dup d->kossl->sk_dup diff --git a/tdeio/kssl/ksslcertdlg.cc b/tdeio/kssl/ksslcertdlg.cc index ea3c29556..26550e715 100644 --- a/tdeio/kssl/ksslcertdlg.cc +++ b/tdeio/kssl/ksslcertdlg.cc @@ -30,9 +30,9 @@ #include <tqlabel.h> #include <tdeapplication.h> -#include <kglobal.h> -#include <klocale.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdelocale.h> +#include <tdeglobalsettings.h> #include <kpushbutton.h> #include <kstdguiitem.h> #include <kseparator.h> diff --git a/tdeio/kssl/ksslcertificate.cc b/tdeio/kssl/ksslcertificate.cc index e7310ccdc..1f95c3912 100644 --- a/tdeio/kssl/ksslcertificate.cc +++ b/tdeio/kssl/ksslcertificate.cc @@ -37,9 +37,9 @@ #include <kstandarddirs.h> #include <kmdcodec.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqdatetime.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <sys/types.h> diff --git a/tdeio/kssl/ksslinfodlg.cc b/tdeio/kssl/ksslinfodlg.cc index 03a1300e8..7567b8595 100644 --- a/tdeio/kssl/ksslinfodlg.cc +++ b/tdeio/kssl/ksslinfodlg.cc @@ -31,11 +31,11 @@ #include <tqfile.h> #include <tdeapplication.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kprocess.h> #include <kiconloader.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <ksqueezedtextlabel.h> #include <kurllabel.h> #include <kstdguiitem.h> diff --git a/tdeio/kssl/ksslkeygen.cc b/tdeio/kssl/ksslkeygen.cc index 93d6d2da4..654444994 100644 --- a/tdeio/kssl/ksslkeygen.cc +++ b/tdeio/kssl/ksslkeygen.cc @@ -25,12 +25,12 @@ #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kopenssl.h> #include <kprogress.h> #include <kstandarddirs.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <tdewallet.h> #include <tqlineedit.h> diff --git a/tdeio/kssl/ksslpemcallback.cc b/tdeio/kssl/ksslpemcallback.cc index 2dfbb9146..207949a0c 100644 --- a/tdeio/kssl/ksslpemcallback.cc +++ b/tdeio/kssl/ksslpemcallback.cc @@ -23,7 +23,7 @@ #endif #include <kpassdlg.h> -#include <klocale.h> +#include <tdelocale.h> #include "ksslpemcallback.h" int KSSLPemCallback(char *buf, int size, int rwflag, void *userdata) { diff --git a/tdeio/kssl/ksslpkcs12.cc b/tdeio/kssl/ksslpkcs12.cc index b8b23cf1c..9521e907b 100644 --- a/tdeio/kssl/ksslpkcs12.cc +++ b/tdeio/kssl/ksslpkcs12.cc @@ -29,7 +29,7 @@ #include <tqfile.h> #include <ksslall.h> #include <kdebug.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kmdcodec.h> #include <assert.h> diff --git a/tdeio/kssl/ksslpkcs7.cc b/tdeio/kssl/ksslpkcs7.cc index 8db0000f0..cb66eb468 100644 --- a/tdeio/kssl/ksslpkcs7.cc +++ b/tdeio/kssl/ksslpkcs7.cc @@ -29,7 +29,7 @@ #include <tqfile.h> #include <ksslall.h> #include <kdebug.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kmdcodec.h> #include <assert.h> diff --git a/tdeio/kssl/ksslsettings.cc b/tdeio/kssl/ksslsettings.cc index 9895a702b..fbf10b476 100644 --- a/tdeio/kssl/ksslsettings.cc +++ b/tdeio/kssl/ksslsettings.cc @@ -33,7 +33,7 @@ #include <tqsortedlist.h> #include "ksslsettings.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kdebug.h> diff --git a/tdeio/kssl/ksslutils.cc b/tdeio/kssl/ksslutils.cc index 80651757f..444e5dd4a 100644 --- a/tdeio/kssl/ksslutils.cc +++ b/tdeio/kssl/ksslutils.cc @@ -22,8 +22,8 @@ #include "ksslutils.h" #include <tqstring.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tqdatetime.h> #include "kopenssl.h" diff --git a/tdeio/misc/kpac/discovery.cpp b/tdeio/misc/kpac/discovery.cpp index 4f33d1389..533c4fcca 100644 --- a/tdeio/misc/kpac/discovery.cpp +++ b/tdeio/misc/kpac/discovery.cpp @@ -41,7 +41,7 @@ #include <tqtimer.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprocio.h> #include <kurl.h> diff --git a/tdeio/misc/kpac/downloader.cpp b/tdeio/misc/kpac/downloader.cpp index c94cc9b72..483e836cb 100644 --- a/tdeio/misc/kpac/downloader.cpp +++ b/tdeio/misc/kpac/downloader.cpp @@ -24,8 +24,8 @@ #include <tqtextcodec.h> #include <kcharsets.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tdeio/job.h> #include "downloader.moc" diff --git a/tdeio/misc/kpac/proxyscout.cpp b/tdeio/misc/kpac/proxyscout.cpp index a010d328e..dfb682005 100644 --- a/tdeio/misc/kpac/proxyscout.cpp +++ b/tdeio/misc/kpac/proxyscout.cpp @@ -23,9 +23,9 @@ #include <dcopclient.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <knotifyclient.h> -#include <kprotocolmanager.h> +#include <tdeprotocolmanager.h> #include "proxyscout.moc" #include "discovery.h" diff --git a/tdeio/misc/kssld/kssld.cpp b/tdeio/misc/kssld/kssld.cpp index d41041636..d47845bbb 100644 --- a/tdeio/misc/kssld/kssld.cpp +++ b/tdeio/misc/kssld/kssld.cpp @@ -42,7 +42,7 @@ #include <unistd.h> #include <tqfile.h> #include <tqsortedlist.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kdebug.h> #include <tqdatetime.h> diff --git a/tdeio/misc/tdefile/fileprops.cpp b/tdeio/misc/tdefile/fileprops.cpp index df210fa4d..aa6590ef5 100644 --- a/tdeio/misc/tdefile/fileprops.cpp +++ b/tdeio/misc/tdefile/fileprops.cpp @@ -25,7 +25,7 @@ #include <tdeapplication.h> #include <tdecmdlineargs.h> #include <tdefilemetainfo.h> -#include <klocale.h> +#include <tdelocale.h> #include <kpropertiesdialog.h> #include "fileprops.h" diff --git a/tdeio/misc/tdemailservice.cpp b/tdeio/misc/tdemailservice.cpp index 2d256c5c9..23066d633 100644 --- a/tdeio/misc/tdemailservice.cpp +++ b/tdeio/misc/tdemailservice.cpp @@ -17,7 +17,7 @@ */ #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> static const TDECmdLineOptions options[] = diff --git a/tdeio/misc/tdesendbugmail/main.cpp b/tdeio/misc/tdesendbugmail/main.cpp index aaffd3b65..32465039d 100644 --- a/tdeio/misc/tdesendbugmail/main.cpp +++ b/tdeio/misc/tdesendbugmail/main.cpp @@ -9,8 +9,8 @@ #include <tqtextstream.h> #include <tdeapplication.h> -#include <kemailsettings.h> -#include <klocale.h> +#include <tdeemailsettings.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> #include <tdeaboutdata.h> #include <kdebug.h> diff --git a/tdeio/misc/tdetelnetservice.cpp b/tdeio/misc/tdetelnetservice.cpp index 99260d8d0..bf175bdc9 100644 --- a/tdeio/misc/tdetelnetservice.cpp +++ b/tdeio/misc/tdetelnetservice.cpp @@ -22,10 +22,10 @@ // $Id$ #include <tdeapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdecmdlineargs.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprocess.h> #include <ksimpleconfig.h> diff --git a/tdeio/misc/tdewalletd/tdewalletd.cpp b/tdeio/misc/tdewalletd/tdewalletd.cpp index 364197b72..126f0ce2b 100644 --- a/tdeio/misc/tdewalletd/tdewalletd.cpp +++ b/tdeio/misc/tdewalletd/tdewalletd.cpp @@ -32,9 +32,9 @@ #include <tdeconfig.h> #include <kdebug.h> #include <kdirwatch.h> -#include <kglobal.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdeglobal.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kpassdlg.h> #include <kstandarddirs.h> #include <tdewalletentry.h> diff --git a/tdeio/misc/tdewalletd/tdewalletwizard.ui b/tdeio/misc/tdewalletd/tdewalletwizard.ui index aa3a1c09d..c31062c2a 100644 --- a/tdeio/misc/tdewalletd/tdewalletwizard.ui +++ b/tdeio/misc/tdewalletd/tdewalletwizard.ui @@ -531,7 +531,7 @@ </tabstops> <includes> <include location="global" impldecl="in declaration">tqcheckbox.h</include> - <include location="global" impldecl="in implementation">klocale.h</include> + <include location="global" impldecl="in implementation">tdelocale.h</include> <include location="local" impldecl="in implementation">tdewalletwizard.ui.h</include> </includes> <Q_SLOTS> diff --git a/tdeio/misc/uiserver.cpp b/tdeio/misc/uiserver.cpp index 107b57c64..c23628eae 100644 --- a/tdeio/misc/uiserver.cpp +++ b/tdeio/misc/uiserver.cpp @@ -31,12 +31,12 @@ #include <kuniqueapplication.h> #include <tdeaboutdata.h> #include <tdecmdlineargs.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <dcopclient.h> #include <kstatusbar.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdesu/client.h> #include <twin.h> #include <kdialog.h> diff --git a/tdeio/tdefile/CMakeLists.txt b/tdeio/tdefile/CMakeLists.txt index a69cad536..ed0350999 100644 --- a/tdeio/tdefile/CMakeLists.txt +++ b/tdeio/tdefile/CMakeLists.txt @@ -31,7 +31,7 @@ include_directories( install( FILES tdefiledialog.h kencodingfiledialog.h - kdiroperator.h tdefileview.h tdefilefiltercombo.h + tdediroperator.h tdefileview.h tdefilefiltercombo.h tdefiledetailview.h kcombiview.h kdiskfreesp.h tdefileiconview.h tderecentdocument.h kurlrequester.h tdefilepreview.h tdefile.h @@ -56,7 +56,7 @@ set( target tdefile ) set( ${target}_SRCS tdefilefiltercombo.cpp tdefileview.cpp tdefileiconview.cpp - tderecentdocument.cpp tdefiledialog.cpp kdiroperator.cpp + tderecentdocument.cpp tdefiledialog.cpp tdediroperator.cpp tdefiledetailview.cpp kcombiview.cpp kurlrequester.cpp tdefilepreview.cpp kurlcombobox.cpp kurlrequesterdlg.cpp kopenwith.cpp kpropertiesdialog.cpp kicondialog.cpp diff --git a/tdeio/tdefile/ChangeLog b/tdeio/tdefile/ChangeLog index ccfb45ab5..229f9f2f8 100644 --- a/tdeio/tdefile/ChangeLog +++ b/tdeio/tdefile/ChangeLog @@ -1,6 +1,6 @@ Sat Feb 26 00:26:55 2000 Carsten Pfeiffer <pfeiffer@kde.org> - * kdiroperator.cpp: + * tdediroperator.cpp: lottsa changes, e.g. action handling more clear now. fixed completed item not clearning the previous selection @@ -17,7 +17,7 @@ Sat Feb 26 00:26:55 2000 Carsten Pfeiffer <pfeiffer@kde.org> Sun Feb 20 01:50:44 2000 Carsten Pfeiffer <pfeiffer@kde.org> - * kdiroperator.*, tdefiledialog.* (saveConfig): + * tdediroperator.*, tdefiledialog.* (saveConfig): implemented loading, saving and applying configuration * tdefiledialog.cpp (setURL): @@ -37,7 +37,7 @@ Thu Feb 17 19:09:54 2000 Carsten Pfeiffer <pfeiffer@kde.org> Added KDirComboBox and replaced the directory combobox with it. It even does something now :) Items need to be indented tho. - * tdefilereader.cpp, kdiroperator.{cpp,h}: + * tdefilereader.cpp, tdediroperator.{cpp,h}: fixed showHidden default Tue Feb 15 14:21:41 2000 Carsten Pfeiffer <pfeiffer@kde.org> @@ -60,7 +60,7 @@ Tue Feb 15 14:21:41 2000 Carsten Pfeiffer <pfeiffer@kde.org> added static methods for multiselection added getOpenURL(), getOpenURLs and getSaveURL() - * kdiroperator.cpp (setSorting): + * tdediroperator.cpp (setSorting): added setSorting() and sorting() to keep sorting when switching views a few cosmetic and TDEAction changes @@ -86,7 +86,7 @@ Fri Feb 11 12:17:59 2000 Carsten Pfeiffer <pfeiffer@kde.org> Thu Feb 10 17:06:36 2000 Carsten Pfeiffer <pfeiffer@kde.org> - * kdiroperator.cpp (connectView): + * tdediroperator.cpp (connectView): - Now that TDEToggleAction is fixed, I can commit the new stuff: Offer Actions for all the common functionality, i.e. sorting, setting the view, home(), cdUp(), back, forward, etc. @@ -107,7 +107,7 @@ Thu Feb 10 17:06:36 2000 Carsten Pfeiffer <pfeiffer@kde.org> Thu Feb 10 12:59:29 2000 Carsten Pfeiffer <pfeiffer@kde.org> - * kdiroperator.cpp (insertNewFiles): + * tdediroperator.cpp (insertNewFiles): aahhh, finally fixed that infinite loop in KFileView::mergeLists clear the view before calling view->addItemList( currentContents ); @@ -173,7 +173,7 @@ Sat Jan 29 15:33:37 2000 Carsten Pfeiffer <pfeiffer@kde.org> * tdefileviewitem.cpp: - added time_t mTime() to enable sorting by modification time - * kdiroperator.cpp: + * tdediroperator.cpp: - offer sorting options in popupmenu - use checkAccess before creating directories. I guess this will again change when the new kio will be used, tho. diff --git a/tdeio/tdefile/Makefile.am b/tdeio/tdefile/Makefile.am index 4e6b76ce1..857e843c5 100644 --- a/tdeio/tdefile/Makefile.am +++ b/tdeio/tdefile/Makefile.am @@ -27,7 +27,7 @@ METASOURCES = AUTO #SUBDIRS = . acl_prop_page include_HEADERS = tdefiledialog.h kencodingfiledialog.h\ - kdiroperator.h tdefileview.h tdefilefiltercombo.h \ + tdediroperator.h tdefileview.h tdefilefiltercombo.h \ tdefiledetailview.h kcombiview.h kdiskfreesp.h \ tdefileiconview.h tderecentdocument.h \ kurlrequester.h tdefilepreview.h tdefile.h \ @@ -44,7 +44,7 @@ noinst_HEADERS = config-tdefile.h tderecentdirs.h kmetaprops.h \ libtdefile_la_SOURCES = \ tdefilefiltercombo.cpp \ tdefileview.cpp tdefileiconview.cpp \ - tderecentdocument.cpp tdefiledialog.cpp kdiroperator.cpp \ + tderecentdocument.cpp tdefiledialog.cpp tdediroperator.cpp \ tdefiledetailview.cpp kcombiview.cpp kurlrequester.cpp \ tdefilepreview.cpp kurlcombobox.cpp kurlrequesterdlg.cpp \ kopenwith.cpp kpropertiesdialog.cpp kicondialog.cpp kdirsize.cpp \ diff --git a/tdeio/tdefile/kacleditwidget.cpp b/tdeio/tdefile/kacleditwidget.cpp index 01eb8bcb8..7e8e3dae2 100644 --- a/tdeio/tdefile/kacleditwidget.cpp +++ b/tdeio/tdefile/kacleditwidget.cpp @@ -38,7 +38,7 @@ #include <tqwidgetstack.h> #include <tqheader.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdefileitem.h> #include <kdebug.h> #include <kdialog.h> diff --git a/tdeio/tdefile/kcombiview.cpp b/tdeio/tdefile/kcombiview.cpp index 13830ab01..4c4f0cb06 100644 --- a/tdeio/tdefile/kcombiview.cpp +++ b/tdeio/tdefile/kcombiview.cpp @@ -35,7 +35,7 @@ #include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tqvaluelist.h> diff --git a/tdeio/tdefile/kcombiview.h b/tdeio/tdefile/kcombiview.h index 995b80ffc..af3680571 100644 --- a/tdeio/tdefile/kcombiview.h +++ b/tdeio/tdefile/kcombiview.h @@ -23,7 +23,7 @@ #define _KCOMBIVIEW_H #include <tqsplitter.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdefile.h> #include <tdefileview.h> diff --git a/tdeio/tdefile/kcustommenueditor.cpp b/tdeio/tdefile/kcustommenueditor.cpp index 65455aef0..b59108071 100644 --- a/tdeio/tdefile/kcustommenueditor.cpp +++ b/tdeio/tdefile/kcustommenueditor.cpp @@ -24,8 +24,8 @@ #include <tqdir.h> #include <kbuttonbox.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kiconloader.h> #include <tdelistview.h> #include <kservice.h> diff --git a/tdeio/tdefile/kdiroperator.cpp b/tdeio/tdefile/kdiroperator.cpp index 1ae03daec..dc44aa8ba 100644 --- a/tdeio/tdefile/kdiroperator.cpp +++ b/tdeio/tdefile/kdiroperator.cpp @@ -38,8 +38,8 @@ #include <kdialogbase.h> #include <kdirlister.h> #include <kinputdialog.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tdepopupmenu.h> #include <kprogress.h> #include <kstdaction.h> @@ -55,7 +55,7 @@ #include "config-tdefile.h" #include "kcombiview.h" -#include "kdiroperator.h" +#include "tdediroperator.h" #include "tdefiledetailview.h" #include "tdefileiconview.h" #include "tdefilepreview.h" @@ -1737,4 +1737,4 @@ TQString KDirOperator::viewConfigGroup() const void KDirOperator::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } -#include "kdiroperator.moc" +#include "tdediroperator.moc" diff --git a/tdeio/tdefile/kdirselectdialog.cpp b/tdeio/tdefile/kdirselectdialog.cpp index 39959229d..5027f631c 100644 --- a/tdeio/tdefile/kdirselectdialog.cpp +++ b/tdeio/tdefile/kdirselectdialog.cpp @@ -29,9 +29,9 @@ #include <tdeconfig.h> #include <tdefiledialog.h> #include <tdefilespeedbar.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprotocolinfo.h> #include <tderecentdirs.h> #include <kshell.h> @@ -41,7 +41,7 @@ #include <kinputdialog.h> #include <tdeio/netaccess.h> #include <tdeio/renamedlg.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include "tdefiletreeview.h" #include "kdirselectdialog.h" diff --git a/tdeio/tdefile/kdirsize.cpp b/tdeio/tdefile/kdirsize.cpp index c2ea4079a..b2d48b4bf 100644 --- a/tdeio/tdefile/kdirsize.cpp +++ b/tdeio/tdefile/kdirsize.cpp @@ -19,7 +19,7 @@ #include "kdirsize.h" #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tqapplication.h> #include <tqtimer.h> #include <config-tdefile.h> diff --git a/tdeio/tdefile/kencodingfiledialog.cpp b/tdeio/tdefile/kencodingfiledialog.cpp index a49210642..d2d588a4e 100644 --- a/tdeio/tdefile/kencodingfiledialog.cpp +++ b/tdeio/tdefile/kencodingfiledialog.cpp @@ -24,11 +24,11 @@ #include "kencodingfiledialog.h" #include <kcombobox.h> #include <tdetoolbar.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kcharsets.h> #include <tqtextcodec.h> -#include <kdiroperator.h> +#include <tdediroperator.h> #include <tderecentdocument.h> struct KEncodingFileDialogPrivate diff --git a/tdeio/tdefile/kicondialog.cpp b/tdeio/tdefile/kicondialog.cpp index 9d7975e2b..154f9e89d 100644 --- a/tdeio/tdefile/kicondialog.cpp +++ b/tdeio/tdefile/kicondialog.cpp @@ -20,8 +20,8 @@ #include <kiconviewsearchline.h> #include <tdeapplication.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kiconloader.h> #include <kprogress.h> diff --git a/tdeio/tdefile/kimagefilepreview.cpp b/tdeio/tdefile/kimagefilepreview.cpp index a1ce7d6b3..f96be72fc 100644 --- a/tdeio/tdefile/kimagefilepreview.cpp +++ b/tdeio/tdefile/kimagefilepreview.cpp @@ -16,12 +16,12 @@ #include <tdeapplication.h> #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> #include <kpushbutton.h> #include <kstandarddirs.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdefiledialog.h> #include <tdefileitem.h> #include <tdeio/previewjob.h> diff --git a/tdeio/tdefile/kmetaprops.cpp b/tdeio/tdefile/kmetaprops.cpp index ce6201177..21c75e0ce 100644 --- a/tdeio/tdefile/kmetaprops.cpp +++ b/tdeio/tdefile/kmetaprops.cpp @@ -23,9 +23,9 @@ #include <kdebug.h> #include <tdefilemetainfowidget.h> #include <tdefilemetainfo.h> -#include <kglobal.h> -#include <kglobalsettings.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> +#include <tdelocale.h> #include <kprotocolinfo.h> #include <tqvalidator.h> diff --git a/tdeio/tdefile/knotifydialog.cpp b/tdeio/tdefile/knotifydialog.cpp index f23ac78e4..8397a5e74 100644 --- a/tdeio/tdefile/knotifydialog.cpp +++ b/tdeio/tdefile/knotifydialog.cpp @@ -29,8 +29,8 @@ #include <kiconloader.h> #include <kicontheme.h> #include <klineedit.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <knotifyclient.h> #include <knotifydialog.h> #include <kstandarddirs.h> diff --git a/tdeio/tdefile/knotifydialog.h b/tdeio/tdefile/knotifydialog.h index f31815e34..c8b5b21ac 100644 --- a/tdeio/tdefile/knotifydialog.h +++ b/tdeio/tdefile/knotifydialog.h @@ -22,7 +22,7 @@ #include <tdelistview.h> #include <kdialogbase.h> #include <kinstance.h> -#include <kglobal.h> +#include <tdeglobal.h> #include "knotifywidgetbase.h" diff --git a/tdeio/tdefile/kopenwith.cpp b/tdeio/tdefile/kopenwith.cpp index 5a855de21..5db8b79d9 100644 --- a/tdeio/tdefile/kopenwith.cpp +++ b/tdeio/tdefile/kopenwith.cpp @@ -39,9 +39,9 @@ #include <kcombobox.h> #include <kdesktopfile.h> #include <kdialog.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <klineedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kmimemagic.h> #include <krun.h> diff --git a/tdeio/tdefile/kpreviewprops.cpp b/tdeio/tdefile/kpreviewprops.cpp index a053d5627..c45330893 100644 --- a/tdeio/tdefile/kpreviewprops.cpp +++ b/tdeio/tdefile/kpreviewprops.cpp @@ -22,8 +22,8 @@ #include <tqlayout.h> #include <tdefilemetapreview.h> -#include <kglobalsettings.h> -#include <klocale.h> +#include <tdeglobalsettings.h> +#include <tdelocale.h> class KPreviewPropsPlugin::KPreviewPropsPluginPrivate { diff --git a/tdeio/tdefile/kpropertiesdialog.cpp b/tdeio/tdefile/kpropertiesdialog.cpp index 389115a3c..87d3926b3 100644 --- a/tdeio/tdefile/kpropertiesdialog.cpp +++ b/tdeio/tdefile/kpropertiesdialog.cpp @@ -96,9 +96,9 @@ extern "C" { #include <kicondialog.h> #include <kurl.h> #include <kurlrequester.h> -#include <klocale.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdelocale.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kstandarddirs.h> #include <tdeio/job.h> #include <tdeio/chmodjob.h> @@ -109,7 +109,7 @@ extern "C" { #include <kmimetype.h> #include <kmountpoint.h> #include <kiconloader.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kservice.h> #include <kcompletion.h> #include <klineedit.h> diff --git a/tdeio/tdefile/kurlbar.cpp b/tdeio/tdefile/kurlbar.cpp index 46b096c2b..2aa79353f 100644 --- a/tdeio/tdefile/kurlbar.cpp +++ b/tdeio/tdefile/kurlbar.cpp @@ -33,12 +33,12 @@ #include <tdeaboutdata.h> #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kicondialog.h> #include <kiconloader.h> #include <kinstance.h> #include <klineedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <kmimetype.h> #include <kprotocolinfo.h> #include <kstringhandler.h> diff --git a/tdeio/tdefile/kurlcombobox.cpp b/tdeio/tdefile/kurlcombobox.cpp index 150e64b34..66fe8efb8 100644 --- a/tdeio/tdefile/kurlcombobox.cpp +++ b/tdeio/tdefile/kurlcombobox.cpp @@ -20,9 +20,9 @@ #include <tqlistbox.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kmimetype.h> #include <kurlcombobox.h> diff --git a/tdeio/tdefile/kurlrequester.cpp b/tdeio/tdefile/kurlrequester.cpp index 9a76a69a6..7ecfd543d 100644 --- a/tdeio/tdefile/kurlrequester.cpp +++ b/tdeio/tdefile/kurlrequester.cpp @@ -30,10 +30,10 @@ #include <kdialog.h> #include <kdirselectdialog.h> #include <tdefiledialog.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> #include <klineedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <kurlcompletion.h> #include <kurldrag.h> #include <kprotocolinfo.h> diff --git a/tdeio/tdefile/kurlrequesterdlg.cpp b/tdeio/tdefile/kurlrequesterdlg.cpp index d1e9ec109..1a040a656 100644 --- a/tdeio/tdefile/kurlrequesterdlg.cpp +++ b/tdeio/tdefile/kurlrequesterdlg.cpp @@ -28,10 +28,10 @@ #include <tdeaccel.h> #include <tdefiledialog.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> #include <klineedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <tderecentdocument.h> #include <kurl.h> #include <kurlrequester.h> diff --git a/tdeio/tdefile/tdefiledetailview.cpp b/tdeio/tdefile/tdefiledetailview.cpp index b3c44250e..e267bdb60 100644 --- a/tdeio/tdefile/tdefiledetailview.cpp +++ b/tdeio/tdefile/tdefiledetailview.cpp @@ -27,11 +27,11 @@ #include <tdeapplication.h> #include <tdefileitem.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kiconloader.h> #include <kicontheme.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kurldrag.h> diff --git a/tdeio/tdefile/tdefiledialog.cpp b/tdeio/tdefile/tdefiledialog.cpp index 8db764724..03bc17757 100644 --- a/tdeio/tdefile/tdefiledialog.cpp +++ b/tdeio/tdefile/tdefiledialog.cpp @@ -50,16 +50,16 @@ #include <tdecompletionbox.h> #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kiconloader.h> #include <kimageio.h> #include <tdeio/job.h> #include <tdeio/netaccess.h> #include <tdeio/scheduler.h> #include <tdeio/kservicetypefactory.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kmimetype.h> #include <tdepopupmenu.h> #include <kprotocolinfo.h> @@ -83,7 +83,7 @@ #include <tdefileview.h> #include <tderecentdocument.h> #include <tdefilefiltercombo.h> -#include <kdiroperator.h> +#include <tdediroperator.h> #include <kimagefilepreview.h> #include <tdefilespeedbar.h> diff --git a/tdeio/tdefile/tdefilefiltercombo.cpp b/tdeio/tdefile/tdefilefiltercombo.cpp index cd7bd54d3..ed41f8f82 100644 --- a/tdeio/tdefile/tdefilefiltercombo.cpp +++ b/tdeio/tdefile/tdefilefiltercombo.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kstaticdeleter.h> #include <config-tdefile.h> diff --git a/tdeio/tdefile/tdefileiconview.cpp b/tdeio/tdefile/tdefileiconview.cpp index 131485273..92bbeba41 100644 --- a/tdeio/tdefile/tdefileiconview.cpp +++ b/tdeio/tdefile/tdefileiconview.cpp @@ -31,10 +31,10 @@ #include <tdeaction.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdefileitem.h> #include <kiconeffect.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kurldrag.h> #include <tdeio/previewjob.h> diff --git a/tdeio/tdefile/tdefilemetainfowidget.cpp b/tdeio/tdefile/tdefilemetainfowidget.cpp index dea9ea353..50fef856b 100644 --- a/tdeio/tdefile/tdefilemetainfowidget.cpp +++ b/tdeio/tdefile/tdefilemetainfowidget.cpp @@ -21,7 +21,7 @@ #include "tdefilemetainfowidget.h" #include <keditcl.h> -#include <klocale.h> +#include <tdelocale.h> #include <knuminput.h> #include <kcombobox.h> #include <klineedit.h> diff --git a/tdeio/tdefile/tdefilepreview.cpp b/tdeio/tdefile/tdefilepreview.cpp index 57543ea8c..acec61475 100644 --- a/tdeio/tdefile/tdefilepreview.cpp +++ b/tdeio/tdefile/tdefilepreview.cpp @@ -22,7 +22,7 @@ #include <tdeaction.h> #include <tdefilepreview.h> #include <tdefilepreview.moc> -#include <klocale.h> +#include <tdelocale.h> #include <tqlabel.h> diff --git a/tdeio/tdefile/tdefilesharedlg.cpp b/tdeio/tdefile/tdefilesharedlg.cpp index 6204fa6bb..a2fb01c2c 100644 --- a/tdeio/tdefile/tdefilesharedlg.cpp +++ b/tdeio/tdefile/tdefilesharedlg.cpp @@ -27,8 +27,8 @@ #include <tqlineedit.h> #include <kprocess.h> #include <kprocio.h> -#include <klocale.h> -#include <kglobalsettings.h> +#include <tdelocale.h> +#include <tdeglobalsettings.h> #include <kstandarddirs.h> #include <kdebug.h> #include <stdio.h> @@ -39,7 +39,7 @@ #include <tqpushbutton.h> #include <tdeapplication.h> #include <ksimpleconfig.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> class KFileSharePropsPlugin::Private { diff --git a/tdeio/tdefile/tdefilespeedbar.cpp b/tdeio/tdefile/tdefilespeedbar.cpp index defcb2157..6f3365a5f 100644 --- a/tdeio/tdefile/tdefilespeedbar.cpp +++ b/tdeio/tdefile/tdefilespeedbar.cpp @@ -25,9 +25,9 @@ #include <tqtextstream.h> #include <tdeconfig.h> -#include <kglobal.h> -#include <kglobalsettings.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> +#include <tdelocale.h> #include <kprotocolinfo.h> #include <kstandarddirs.h> #include <kurl.h> diff --git a/tdeio/tdefile/tdefiletreeview.cpp b/tdeio/tdefile/tdefiletreeview.cpp index 6138b3863..cb7432423 100644 --- a/tdeio/tdefile/tdefiletreeview.cpp +++ b/tdeio/tdefile/tdefiletreeview.cpp @@ -22,7 +22,7 @@ #include <tqtimer.h> #include <kdebug.h> #include <kdirnotify_stub.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdefileitem.h> #include <tdefileview.h> #include <kmimetype.h> diff --git a/tdeio/tdefile/tdefileview.cpp b/tdeio/tdefile/tdefileview.cpp index 63c973723..f171975d8 100644 --- a/tdeio/tdefile/tdefileview.cpp +++ b/tdeio/tdefile/tdefileview.cpp @@ -25,8 +25,8 @@ #include <tdeaction.h> #include <tdeapplication.h> #include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include "config-tdefile.h" diff --git a/tdeio/tdefile/tderecentdirs.cpp b/tdeio/tdefile/tderecentdirs.cpp index 12c2b6477..0548261dd 100644 --- a/tdeio/tdefile/tderecentdirs.cpp +++ b/tdeio/tdefile/tderecentdirs.cpp @@ -28,7 +28,7 @@ #include <tderecentdirs.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #define MAX_DIR_HISTORY 3 diff --git a/tdeio/tdefile/tests/kcustommenueditortest.cpp b/tdeio/tdefile/tests/kcustommenueditortest.cpp index 3d95b6c9f..9e2189406 100644 --- a/tdeio/tdefile/tests/kcustommenueditortest.cpp +++ b/tdeio/tdefile/tests/kcustommenueditortest.cpp @@ -1,6 +1,6 @@ #include "kcustommenueditor.h" #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> int main(int argc, char** argv) diff --git a/tdeio/tdefile/tests/kdirselectdialogtest.cpp b/tdeio/tdefile/tests/kdirselectdialogtest.cpp index 0c2209d31..c1178c3bc 100644 --- a/tdeio/tdefile/tests/kdirselectdialogtest.cpp +++ b/tdeio/tdefile/tests/kdirselectdialogtest.cpp @@ -1,6 +1,6 @@ #include <tdeapplication.h> #include <kdirselectdialog.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kurl.h> int main( int argc, char **argv ) diff --git a/tdeio/tdefile/tests/kfdtest.cpp b/tdeio/tdefile/tests/kfdtest.cpp index baf82725f..ce7127d9e 100644 --- a/tdeio/tdefile/tests/kfdtest.cpp +++ b/tdeio/tdefile/tests/kfdtest.cpp @@ -3,7 +3,7 @@ #include <tqstringlist.h> #include <tdefiledialog.h> #include <tdeapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tqtimer.h> KFDTest::KFDTest( const TQString& startDir, TQObject *parent, const char *name ) diff --git a/tdeio/tdefile/tests/kfstest.cpp b/tdeio/tdefile/tests/kfstest.cpp index c57e3678e..ada8d825e 100644 --- a/tdeio/tdefile/tests/kfstest.cpp +++ b/tdeio/tdefile/tests/kfstest.cpp @@ -30,12 +30,12 @@ #include <tdefiledialog.h> #include <tdefileiconview.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeconfig.h> #include <tdeapplication.h> #include <kurl.h> #include <kurlbar.h> -#include <kdiroperator.h> +#include <tdediroperator.h> #include <tdefile.h> #include <kdebug.h> #include <kicondialog.h> diff --git a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp index 529d12dda..9ff0199dc 100644 --- a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp +++ b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp @@ -19,7 +19,7 @@ #include <tqdir.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> #include <tdemainwindow.h> #include <tdeapplication.h> diff --git a/tdeio/tdeio/CMakeLists.txt b/tdeio/tdeio/CMakeLists.txt index 8aaf395b6..e2b96ebb1 100644 --- a/tdeio/tdeio/CMakeLists.txt +++ b/tdeio/tdeio/CMakeLists.txt @@ -41,8 +41,8 @@ install( FILES kurlcompletion.h kshellcompletion.h tdefileitem.h tdefileshare.h ksambashare.h knfsshare.h kdirlister.h kservicegroup.h kimageio.h kdirnotify.h kdirnotify_stub.h - kurlpixmapprovider.h kprotocolinfo.h kprotocolmanager.h - kfilterbase.h kfilterdev.h kemailsettings.h kscan.h + kurlpixmapprovider.h kprotocolinfo.h tdeprotocolmanager.h + kfilterbase.h kfilterdev.h tdeemailsettings.h kscan.h kdatatool.h karchive.h tdefilefilter.h tdefilemetainfo.h renamedlgplugin.h kmimetyperesolver.h kdcopservicestarter.h kremoteencoding.h kmimetypechooser.h @@ -71,7 +71,7 @@ install( FILES set( target tdeiocore ) set( ${target}_SRCS - authinfo.cpp kshred.cpp kprotocolmanager.cpp slave.cpp + authinfo.cpp kshred.cpp tdeprotocolmanager.cpp slave.cpp slaveinterface.cpp observer.stub sessiondata.cpp scheduler.cpp connection.cpp job.cpp global.cpp slaveconfig.cpp kurlpixmapprovider.cpp netaccess.cpp @@ -79,7 +79,7 @@ set( ${target}_SRCS slavebase.cpp passdlg.cpp forwardingslavebase.cpp progressbase.cpp defaultprogress.cpp statusbarprogress.cpp kdirnotify.cpp kdirnotify.skel kdirnotify_stub.cpp - observer.cpp ../misc/uiserver.stub observer.skel kemailsettings.cpp + observer.cpp ../misc/uiserver.stub observer.skel tdeemailsettings.cpp kprotocolinfo.cpp renamedlg.cpp skipdlg.cpp kremoteencoding.cpp kmimetypechooser.cpp ) diff --git a/tdeio/tdeio/Makefile.am b/tdeio/tdeio/Makefile.am index f0766f5c8..587cfe511 100644 --- a/tdeio/tdeio/Makefile.am +++ b/tdeio/tdeio/Makefile.am @@ -53,8 +53,8 @@ include_HEADERS = \ kshellcompletion.h tdefileitem.h tdefileshare.h ksambashare.h knfsshare.h \ kdirlister.h kservicegroup.h \ kimageio.h kdirnotify.h kdirnotify_stub.h \ - kurlpixmapprovider.h kprotocolinfo.h kprotocolmanager.h \ - kfilterbase.h kfilterdev.h kemailsettings.h kscan.h kdatatool.h \ + kurlpixmapprovider.h kprotocolinfo.h tdeprotocolmanager.h \ + kfilterbase.h kfilterdev.h tdeemailsettings.h kscan.h kdatatool.h \ karchive.h tdefilefilter.h tdefilemetainfo.h renamedlgplugin.h \ kmimetyperesolver.h kdcopservicestarter.h kremoteencoding.h \ kmimetypechooser.h @@ -67,7 +67,7 @@ include_HEADERS += kacl.h libtdeiocore_la_SOURCES = authinfo.cpp \ kshred.cpp \ - kprotocolmanager.cpp \ + tdeprotocolmanager.cpp \ slave.cpp slaveinterface.cpp observer.stub \ sessiondata.cpp scheduler.cpp \ connection.cpp \ @@ -81,7 +81,7 @@ libtdeiocore_la_SOURCES = authinfo.cpp \ statusbarprogress.cpp \ kdirnotify.cpp kdirnotify.skel kdirnotify_stub.cpp \ observer.cpp uiserver.stub observer.skel \ - kemailsettings.cpp \ + tdeemailsettings.cpp \ kprotocolinfo.cpp \ renamedlg.cpp skipdlg.cpp kremoteencoding.cpp \ kmimetypechooser.cpp diff --git a/tdeio/tdeio/chmodjob.cpp b/tdeio/tdeio/chmodjob.cpp index 434466d77..24a5c247d 100644 --- a/tdeio/tdeio/chmodjob.cpp +++ b/tdeio/tdeio/chmodjob.cpp @@ -29,9 +29,9 @@ #include <tqtimer.h> #include <tqfile.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include "tdeio/job.h" #include "tdeio/chmodjob.h" diff --git a/tdeio/tdeio/dataslave.cpp b/tdeio/tdeio/dataslave.cpp index 528368ba5..a5b6bdf69 100644 --- a/tdeio/tdeio/dataslave.cpp +++ b/tdeio/tdeio/dataslave.cpp @@ -23,7 +23,7 @@ #include "dataslave.h" #include "dataprotocol.h" -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tqtimer.h> diff --git a/tdeio/tdeio/defaultprogress.cpp b/tdeio/tdeio/defaultprogress.cpp index 4293e752e..5db9c5a0c 100644 --- a/tdeio/tdeio/defaultprogress.cpp +++ b/tdeio/tdeio/defaultprogress.cpp @@ -26,8 +26,8 @@ #include <kdebug.h> #include <kdialog.h> #include <kstringhandler.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kprocess.h> #include <kpushbutton.h> diff --git a/tdeio/tdeio/global.cpp b/tdeio/tdeio/global.cpp index e4bfec5f6..8dce8a5f4 100644 --- a/tdeio/tdeio/global.cpp +++ b/tdeio/tdeio/global.cpp @@ -33,9 +33,9 @@ #include "tdeio/job.h" #include <kdebug.h> -#include <klocale.h> -#include <kglobal.h> -#include <kprotocolmanager.h> +#include <tdelocale.h> +#include <tdeglobal.h> +#include <tdeprotocolmanager.h> #include <kde_file.h> #ifdef HAVE_VOLMGT diff --git a/tdeio/tdeio/job.cpp b/tdeio/tdeio/job.cpp index a4e731451..7f8b9bda3 100644 --- a/tdeio/tdeio/job.cpp +++ b/tdeio/tdeio/job.cpp @@ -42,12 +42,12 @@ extern "C" { #include <tqfile.h> #include <tdeapplication.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <ksimpleconfig.h> #include <kdebug.h> #include <kdialog.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kdatastream.h> #include <tdemainwindow.h> #include <kde_file.h> @@ -60,14 +60,14 @@ extern "C" { #include "kdirwatch.h" #include "kmimemagic.h" #include "kprotocolinfo.h" -#include "kprotocolmanager.h" +#include "tdeprotocolmanager.h" #include "tdeio/observer.h" #include "kssl/ksslcsessioncache.h" #include <kdirnotify_stub.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <dcopclient.h> #ifdef Q_OS_UNIX diff --git a/tdeio/tdeio/kdcopservicestarter.cpp b/tdeio/tdeio/kdcopservicestarter.cpp index c859cce2b..8a7a67632 100644 --- a/tdeio/tdeio/kdcopservicestarter.cpp +++ b/tdeio/tdeio/kdcopservicestarter.cpp @@ -22,7 +22,7 @@ #include "kservice.h" #include <kstaticdeleter.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <dcopclient.h> static KStaticDeleter<KDCOPServiceStarter> dss_sd; diff --git a/tdeio/tdeio/kdirlister.cpp b/tdeio/tdeio/kdirlister.cpp index 669766ab5..b0027588d 100644 --- a/tdeio/tdeio/kdirlister.cpp +++ b/tdeio/tdeio/kdirlister.cpp @@ -28,11 +28,11 @@ #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeio/job.h> -#include <kmessagebox.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdemessagebox.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kstaticdeleter.h> #include <kprotocolinfo.h> diff --git a/tdeio/tdeio/kdirwatch.cpp b/tdeio/tdeio/kdirwatch.cpp index 63c89b9d7..01b4e0876 100644 --- a/tdeio/tdeio/kdirwatch.cpp +++ b/tdeio/tdeio/kdirwatch.cpp @@ -57,7 +57,7 @@ #include <tdeapplication.h> #include <kdebug.h> #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstaticdeleter.h> #include <kde_file.h> diff --git a/tdeio/tdeio/kemailsettings.cpp b/tdeio/tdeio/kemailsettings.cpp index 296455253..bd46d8708 100644 --- a/tdeio/tdeio/kemailsettings.cpp +++ b/tdeio/tdeio/kemailsettings.cpp @@ -26,10 +26,10 @@ * $Id$ */ -#include "kemailsettings.h" +#include "tdeemailsettings.h" #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> class KEMailSettingsPrivate { diff --git a/tdeio/tdeio/kimageio.cpp b/tdeio/tdeio/kimageio.cpp index f9de08376..d3768d297 100644 --- a/tdeio/tdeio/kimageio.cpp +++ b/tdeio/tdeio/kimageio.cpp @@ -20,9 +20,9 @@ #include <ltdl.h> #include "kimageio.h" #include "kimageiofactory.h" -#include <klocale.h> +#include <tdelocale.h> #include <klibloader.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kmimetype.h> #include <tdesycocaentry.h> #include <tdesycoca.h> diff --git a/tdeio/tdeio/kmessageboxwrapper.h b/tdeio/tdeio/kmessageboxwrapper.h index c55060549..524eafa74 100644 --- a/tdeio/tdeio/kmessageboxwrapper.h +++ b/tdeio/tdeio/kmessageboxwrapper.h @@ -18,7 +18,7 @@ #ifndef KMESSAGEBOXWRAPPER_H #define KMESSAGEBOXWRAPPER_H -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeapplication.h> #include <kdebug.h> diff --git a/tdeio/tdeio/kmimetype.cpp b/tdeio/tdeio/kmimetype.cpp index 8129b31f9..636c04eea 100644 --- a/tdeio/tdeio/kmimetype.cpp +++ b/tdeio/tdeio/kmimetype.cpp @@ -52,7 +52,7 @@ #include <kdesktopfile.h> #include <kdirwatch.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> #include <kurl.h> diff --git a/tdeio/tdeio/kmimetypechooser.cpp b/tdeio/tdeio/kmimetypechooser.cpp index 95dfada9c..ffc9a4c78 100644 --- a/tdeio/tdeio/kmimetypechooser.cpp +++ b/tdeio/tdeio/kmimetypechooser.cpp @@ -21,7 +21,7 @@ #include <tdeconfig.h> #include <kiconloader.h> #include <tdelistview.h> -#include <klocale.h> +#include <tdelocale.h> #include <kmimetype.h> #include <kprocess.h> #include <krun.h> diff --git a/tdeio/tdeio/kprotocolinfo.cpp b/tdeio/tdeio/kprotocolinfo.cpp index 9523b70cb..bf11060e4 100644 --- a/tdeio/tdeio/kprotocolinfo.cpp +++ b/tdeio/tdeio/kprotocolinfo.cpp @@ -24,7 +24,7 @@ #include "kprotocolinfo.h" #include "kprotocolinfofactory.h" -#include "kprotocolmanager.h" +#include "tdeprotocolmanager.h" // Most of this class is implemented in tdecore/kprotocolinfo_tdecore.cpp // This file only contains a few static class-functions that depend on diff --git a/tdeio/tdeio/kprotocolmanager.cpp b/tdeio/tdeio/kprotocolmanager.cpp index 7ed06376b..65ad393a3 100644 --- a/tdeio/tdeio/kprotocolmanager.cpp +++ b/tdeio/tdeio/kprotocolmanager.cpp @@ -23,8 +23,8 @@ #include <dcopref.h> #include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kstandarddirs.h> #include <klibloader.h> @@ -34,7 +34,7 @@ #include <tdeio/ioslave_defaults.h> #include <tdeio/http_slave_defaults.h> -#include "kprotocolmanager.h" +#include "tdeprotocolmanager.h" class KProtocolManagerPrivate diff --git a/tdeio/tdeio/krun.cpp b/tdeio/tdeio/krun.cpp index 8547802d6..d92e3ca11 100644 --- a/tdeio/tdeio/krun.cpp +++ b/tdeio/tdeio/krun.cpp @@ -44,7 +44,7 @@ #include <kurl.h> #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprotocolinfo.h> #include <kstandarddirs.h> #include <kprocess.h> @@ -55,7 +55,7 @@ #include <tqdatetime.h> #include <tqregexp.h> #include <kdesktopfile.h> -#include <kstartupinfo.h> +#include <tdestartupinfo.h> #include <kmacroexpander.h> #include <kshell.h> #include <kde_file.h> diff --git a/tdeio/tdeio/krun.h b/tdeio/tdeio/krun.h index 40fd36416..6e5604f7a 100644 --- a/tdeio/tdeio/krun.h +++ b/tdeio/tdeio/krun.h @@ -28,7 +28,7 @@ #include <tqtimer.h> #include <tqstring.h> #include <kurl.h> -#include <kstartupinfo.h> +#include <tdestartupinfo.h> class TDEProcess; class KService; diff --git a/tdeio/tdeio/kscan.cpp b/tdeio/tdeio/kscan.cpp index 7b00f08a9..b49459771 100644 --- a/tdeio/tdeio/kscan.cpp +++ b/tdeio/tdeio/kscan.cpp @@ -19,7 +19,7 @@ #include <tqfile.h> -#include <klocale.h> +#include <tdelocale.h> #include <ktrader.h> #include "kscan.h" diff --git a/tdeio/tdeio/kservice.cpp b/tdeio/tdeio/kservice.cpp index 13be78bea..c9a6fdae2 100644 --- a/tdeio/tdeio/kservice.cpp +++ b/tdeio/tdeio/kservice.cpp @@ -40,9 +40,9 @@ #include <tdeapplication.h> #include <kdebug.h> #include <kdesktopfile.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfigbase.h> #include <kstandarddirs.h> #include <dcopclient.h> diff --git a/tdeio/tdeio/kservicefactory.cpp b/tdeio/tdeio/kservicefactory.cpp index f4646fa75..abd6ec61e 100644 --- a/tdeio/tdeio/kservicefactory.cpp +++ b/tdeio/tdeio/kservicefactory.cpp @@ -24,9 +24,9 @@ #include <tqstring.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kstaticdeleter.h> diff --git a/tdeio/tdeio/kservicegroup.cpp b/tdeio/tdeio/kservicegroup.cpp index 2e27c99b0..4cb3b8dac 100644 --- a/tdeio/tdeio/kservicegroup.cpp +++ b/tdeio/tdeio/kservicegroup.cpp @@ -19,9 +19,9 @@ #include <tqdir.h> #include <kiconloader.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <ksortablevaluelist.h> diff --git a/tdeio/tdeio/kservicegroupfactory.cpp b/tdeio/tdeio/kservicegroupfactory.cpp index 56ec0c07f..3caf9c027 100644 --- a/tdeio/tdeio/kservicegroupfactory.cpp +++ b/tdeio/tdeio/kservicegroupfactory.cpp @@ -24,9 +24,9 @@ #include <tqstring.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> KServiceGroupFactory::KServiceGroupFactory() diff --git a/tdeio/tdeio/kshred.cpp b/tdeio/tdeio/kshred.cpp index 470f9a03e..0bc01c20a 100644 --- a/tdeio/tdeio/kshred.cpp +++ b/tdeio/tdeio/kshred.cpp @@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "kshred.h" #include <time.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <stdlib.h> #include <tdeapplication.h> diff --git a/tdeio/tdeio/ktar.cpp b/tdeio/tdeio/ktar.cpp index 9bde2873a..cb5bba1fa 100644 --- a/tdeio/tdeio/ktar.cpp +++ b/tdeio/tdeio/ktar.cpp @@ -30,7 +30,7 @@ #include <tqfile.h> #include <kdebug.h> #include <kmimetype.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kfilterdev.h> #include <kfilterbase.h> diff --git a/tdeio/tdeio/kurlcompletion.cpp b/tdeio/tdeio/kurlcompletion.cpp index e9ce26908..441d453ac 100644 --- a/tdeio/tdeio/kurlcompletion.cpp +++ b/tdeio/tdeio/kurlcompletion.cpp @@ -47,8 +47,8 @@ #include <tdeio/job.h> #include <kprotocolinfo.h> #include <tdeconfig.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kde_file.h> #include <sys/types.h> diff --git a/tdeio/tdeio/kuserprofile.cpp b/tdeio/tdeio/kuserprofile.cpp index 124f7f8f8..a9bdc40c1 100644 --- a/tdeio/tdeio/kuserprofile.cpp +++ b/tdeio/tdeio/kuserprofile.cpp @@ -23,7 +23,7 @@ #include <tdeconfig.h> #include <tdeapplication.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <kstaticdeleter.h> diff --git a/tdeio/tdeio/netaccess.cpp b/tdeio/tdeio/netaccess.cpp index dd3a1bdc8..cbab6684e 100644 --- a/tdeio/tdeio/netaccess.cpp +++ b/tdeio/tdeio/netaccess.cpp @@ -34,8 +34,8 @@ #include <tqmetaobject.h> #include <tdeapplication.h> -#include <klocale.h> -#include <ktempfile.h> +#include <tdelocale.h> +#include <tdetempfile.h> #include <kdebug.h> #include <kurl.h> #include <tdeio/job.h> diff --git a/tdeio/tdeio/observer.cpp b/tdeio/tdeio/observer.cpp index dfd847b04..2309c2142 100644 --- a/tdeio/tdeio/observer.cpp +++ b/tdeio/tdeio/observer.cpp @@ -34,12 +34,12 @@ #include "passdlg.h" #include "slavebase.h" #include "observer_stub.h" -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <ksslinfodlg.h> #include <ksslcertdlg.h> #include <ksslcertificate.h> #include <ksslcertchain.h> -#include <klocale.h> +#include <tdelocale.h> using namespace TDEIO; diff --git a/tdeio/tdeio/passdlg.cpp b/tdeio/tdeio/passdlg.cpp index 942d16c64..91fba050d 100644 --- a/tdeio/tdeio/passdlg.cpp +++ b/tdeio/tdeio/passdlg.cpp @@ -30,7 +30,7 @@ #include <tdeconfig.h> #include <kiconloader.h> #include <klineedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> using namespace TDEIO; diff --git a/tdeio/tdeio/paste.cpp b/tdeio/tdeio/paste.cpp index fd24f9a0d..42fff5ba2 100644 --- a/tdeio/tdeio/paste.cpp +++ b/tdeio/tdeio/paste.cpp @@ -24,16 +24,16 @@ #include "tdeio/netaccess.h" #include "tdeio/observer.h" #include "tdeio/renamedlg.h" -#include "tdeio/kprotocolmanager.h" +#include "tdeio/tdeprotocolmanager.h" #include <kurl.h> #include <kurldrag.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kinputdialog.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kmimetype.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <tqapplication.h> #include <tqclipboard.h> diff --git a/tdeio/tdeio/pastedialog.cpp b/tdeio/tdeio/pastedialog.cpp index 0252baff1..d95cc7e88 100644 --- a/tdeio/tdeio/pastedialog.cpp +++ b/tdeio/tdeio/pastedialog.cpp @@ -20,7 +20,7 @@ #include <klineedit.h> #include <kmimetype.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqlayout.h> #include <tqlabel.h> diff --git a/tdeio/tdeio/previewjob.cpp b/tdeio/tdeio/previewjob.cpp index c51ba154d..5e3148619 100644 --- a/tdeio/tdeio/previewjob.cpp +++ b/tdeio/tdeio/previewjob.cpp @@ -43,10 +43,10 @@ #include <kdatastream.h> // Do not remove, needed for correct bool serialization #include <tdefileitem.h> #include <tdeapplication.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <ktrader.h> #include <kmdcodec.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <tdeio/kservice.h> diff --git a/tdeio/tdeio/renamedlg.cpp b/tdeio/tdeio/renamedlg.cpp index 06b12d129..715f73c42 100644 --- a/tdeio/tdeio/renamedlg.cpp +++ b/tdeio/tdeio/renamedlg.cpp @@ -30,15 +30,15 @@ #include <tqlineedit.h> #include <tqdir.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kpushbutton.h> #include <tdeapplication.h> #include <tdeio/global.h> #include <ktrader.h> #include <klibloader.h> #include <kdialog.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kdebug.h> #include <kurl.h> #include <kmimetype.h> diff --git a/tdeio/tdeio/scheduler.cpp b/tdeio/tdeio/scheduler.cpp index 01bcde298..3935a91cf 100644 --- a/tdeio/tdeio/scheduler.cpp +++ b/tdeio/tdeio/scheduler.cpp @@ -28,8 +28,8 @@ #include <dcopclient.h> #include <kdebug.h> -#include <kglobal.h> -#include <kprotocolmanager.h> +#include <tdeglobal.h> +#include <tdeprotocolmanager.h> #include <kprotocolinfo.h> #include <assert.h> #include <kstaticdeleter.h> diff --git a/tdeio/tdeio/sessiondata.cpp b/tdeio/tdeio/sessiondata.cpp index 99c6a26f3..4e4dd14ac 100644 --- a/tdeio/tdeio/sessiondata.cpp +++ b/tdeio/tdeio/sessiondata.cpp @@ -23,11 +23,11 @@ #include <kdebug.h> #include <tdeconfig.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kcharsets.h> #include <dcopclient.h> -#include <kprotocolmanager.h> +#include <tdeprotocolmanager.h> #include <kstandarddirs.h> #include <tdesu/client.h> diff --git a/tdeio/tdeio/skipdlg.cpp b/tdeio/tdeio/skipdlg.cpp index 6cd924136..5871bbd09 100644 --- a/tdeio/tdeio/skipdlg.cpp +++ b/tdeio/tdeio/skipdlg.cpp @@ -27,7 +27,7 @@ #include <tqlabel.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <kurl.h> #include <kpushbutton.h> #include <kstdguiitem.h> diff --git a/tdeio/tdeio/slave.cpp b/tdeio/tdeio/slave.cpp index e66a719df..b4a7c8f2a 100644 --- a/tdeio/tdeio/slave.cpp +++ b/tdeio/tdeio/slave.cpp @@ -35,11 +35,11 @@ #include <dcopclient.h> #include <kdebug.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <tdeapplication.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <ksock.h> #include <kprocess.h> #include <klibloader.h> @@ -48,7 +48,7 @@ #include "tdeio/slave.h" #include "tdeio/kservice.h" #include <tdeio/global.h> -#include <kprotocolmanager.h> +#include <tdeprotocolmanager.h> #include <kprotocolinfo.h> #ifdef HAVE_PATHS_H diff --git a/tdeio/tdeio/slavebase.cpp b/tdeio/tdeio/slavebase.cpp index 29a8e0c48..76bbc232d 100644 --- a/tdeio/tdeio/slavebase.cpp +++ b/tdeio/tdeio/slavebase.cpp @@ -48,7 +48,7 @@ #include <ksock.h> #include <kcrash.h> #include <tdesu/client.h> -#include <klocale.h> +#include <tdelocale.h> #include <ksocks.h> #include "kremoteencoding.h" diff --git a/tdeio/tdeio/slaveconfig.cpp b/tdeio/tdeio/slaveconfig.cpp index e81146e76..af1b7b793 100644 --- a/tdeio/tdeio/slaveconfig.cpp +++ b/tdeio/tdeio/slaveconfig.cpp @@ -27,7 +27,7 @@ #include <tdeconfig.h> #include <kstaticdeleter.h> #include <kprotocolinfo.h> -#include <kprotocolmanager.h> +#include <tdeprotocolmanager.h> #include "slaveconfig.h" diff --git a/tdeio/tdeio/statusbarprogress.cpp b/tdeio/tdeio/statusbarprogress.cpp index e0497e391..d7ef698c4 100644 --- a/tdeio/tdeio/statusbarprogress.cpp +++ b/tdeio/tdeio/statusbarprogress.cpp @@ -23,7 +23,7 @@ #include <tqlabel.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kprogress.h> diff --git a/tdeio/tdeio/tcpslavebase.cpp b/tdeio/tdeio/tcpslavebase.cpp index 2a4aff68e..a0d9c86cb 100644 --- a/tdeio/tdeio/tcpslavebase.cpp +++ b/tdeio/tdeio/tcpslavebase.cpp @@ -43,19 +43,19 @@ #include <kdebug.h> #include <ksslall.h> #include <ksslcertdlg.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #ifndef Q_WS_WIN //temporary #include <kresolver.h> #endif -#include <klocale.h> +#include <tdelocale.h> #include <dcopclient.h> #include <tqcstring.h> #include <tqdatastream.h> #include <tdeapplication.h> -#include <kprotocolmanager.h> +#include <tdeprotocolmanager.h> #include <kde_file.h> #include "tdeio/tcpslavebase.h" diff --git a/tdeio/tdeio/tdefilefilter.cpp b/tdeio/tdeio/tdefilefilter.cpp index 310b86221..c1663c2e8 100644 --- a/tdeio/tdeio/tdefilefilter.cpp +++ b/tdeio/tdeio/tdefilefilter.cpp @@ -21,7 +21,7 @@ #include <tqregexp.h> #include <tdefileitem.h> -#include <kglobal.h> +#include <tdeglobal.h> #include "tdefilefilter.h" diff --git a/tdeio/tdeio/tdefileitem.cpp b/tdeio/tdeio/tdefileitem.cpp index 3d09e6877..378cd5f0a 100644 --- a/tdeio/tdeio/tdefileitem.cpp +++ b/tdeio/tdeio/tdefileitem.cpp @@ -41,11 +41,11 @@ #include <tdefilemetainfo.h> #include <ksambashare.h> #include <knfsshare.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kiconloader.h> #include <klargefile.h> -#include <klocale.h> +#include <tdelocale.h> #include <kmimetype.h> #include <krun.h> diff --git a/tdeio/tdeio/tdefilemetainfo.cpp b/tdeio/tdeio/tdefilemetainfo.cpp index 796a48305..c1389695d 100644 --- a/tdeio/tdeio/tdefilemetainfo.cpp +++ b/tdeio/tdeio/tdefilemetainfo.cpp @@ -32,7 +32,7 @@ #include <kdebug.h> #include <kmimetype.h> #include <kdatastream.h> // needed for serialization of bool -#include <klocale.h> +#include <tdelocale.h> #include <tdeio/global.h> #include "tdefilemetainfo.h" diff --git a/tdeio/tdeio/tdefileshare.cpp b/tdeio/tdeio/tdefileshare.cpp index 16e281c16..dc3f8c05a 100644 --- a/tdeio/tdeio/tdefileshare.cpp +++ b/tdeio/tdeio/tdefileshare.cpp @@ -23,7 +23,7 @@ #include <tqregexp.h> #include <kprocess.h> #include <kprocio.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstaticdeleter.h> #include <kstandarddirs.h> #include <kdebug.h> diff --git a/tdeio/tdeioexec/main.cpp b/tdeio/tdeioexec/main.cpp index eb615344b..f6324afa5 100644 --- a/tdeio/tdeioexec/main.cpp +++ b/tdeio/tdeioexec/main.cpp @@ -29,16 +29,16 @@ #include <tdeapplication.h> #include <kstandarddirs.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeio/job.h> #include <krun.h> #include <tdeio/netaccess.h> #include <kprocess.h> #include <kservice.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> #include <tdeaboutdata.h> -#include <kstartupinfo.h> +#include <tdestartupinfo.h> #include <kshell.h> #include <kde_file.h> diff --git a/tdeio/tests/kiopassdlgtest.cpp b/tdeio/tests/kiopassdlgtest.cpp index 3dd4d7294..ba429e67a 100644 --- a/tdeio/tests/kiopassdlgtest.cpp +++ b/tdeio/tests/kiopassdlgtest.cpp @@ -1,7 +1,7 @@ #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaboutdata.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdecmdlineargs.h> #include "passdlg.h" diff --git a/tdeio/tests/kpropsdlgtest.cpp b/tdeio/tests/kpropsdlgtest.cpp index 638a60ec2..527077eb0 100644 --- a/tdeio/tests/kpropsdlgtest.cpp +++ b/tdeio/tests/kpropsdlgtest.cpp @@ -1,5 +1,5 @@ #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaboutdata.h> #include <kpropertiesdialog.h> #include <tdecmdlineargs.h> diff --git a/tdeio/tests/kprotocolinfotest.cpp b/tdeio/tests/kprotocolinfotest.cpp index 646249678..9b5242d65 100644 --- a/tdeio/tests/kprotocolinfotest.cpp +++ b/tdeio/tests/kprotocolinfotest.cpp @@ -17,9 +17,9 @@ */ #include <kprotocolinfo.h> -#include <kprotocolmanager.h> +#include <tdeprotocolmanager.h> #include <tdeapplication.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdecmdlineargs.h> #include <tdeaboutdata.h> #include <kdebug.h> diff --git a/tdeio/tests/tdeioslavetest.cpp b/tdeio/tests/tdeioslavetest.cpp index ecc5e4af5..3cc22d8e2 100644 --- a/tdeio/tests/tdeioslavetest.cpp +++ b/tdeio/tests/tdeioslavetest.cpp @@ -17,7 +17,7 @@ #include <tdeapplication.h> #include <tdecmdlineargs.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kurl.h> #include <kstatusbar.h> #include <tdeio/job.h> diff --git a/tdeioslave/file/file.cc b/tdeioslave/file/file.cc index 477db8754..1caeaef3e 100644 --- a/tdeioslave/file/file.cc +++ b/tdeioslave/file/file.cc @@ -75,8 +75,8 @@ #include <kurl.h> #include <kinstance.h> #include <ksimpleconfig.h> -#include <ktempfile.h> -#include <klocale.h> +#include <tdetempfile.h> +#include <tdelocale.h> #include <tqfile.h> #include <tqstrlist.h> #include "file.h" @@ -93,7 +93,7 @@ #include <kstandarddirs.h> #include <tdeio/ioslave_defaults.h> #include <klargefile.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kmimetype.h> using namespace TDEIO; diff --git a/tdeioslave/ftp/ftp.cc b/tdeioslave/ftp/ftp.cc index 5b582d376..cf358ce39 100644 --- a/tdeioslave/ftp/ftp.cc +++ b/tdeioslave/ftp/ftp.cc @@ -53,7 +53,7 @@ #include <tqdir.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kinstance.h> #include <kmimemagic.h> #include <kmimetype.h> diff --git a/tdeioslave/http/http.cc b/tdeioslave/http/http.cc index 539cc4dc5..a492221d5 100644 --- a/tdeioslave/http/http.cc +++ b/tdeioslave/http/http.cc @@ -51,7 +51,7 @@ #include <kidna.h> #include <ksocks.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kextsock.h> #include <kservice.h> diff --git a/tdeioslave/http/http_cache_cleaner.cpp b/tdeioslave/http/http_cache_cleaner.cpp index af9ede123..aaf94d25a 100644 --- a/tdeioslave/http/http_cache_cleaner.cpp +++ b/tdeioslave/http/http_cache_cleaner.cpp @@ -33,12 +33,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <tqptrlist.h> #include <kinstance.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <dcopclient.h> -#include <kprotocolmanager.h> +#include <tdeprotocolmanager.h> #include <unistd.h> diff --git a/tdeioslave/http/kcookiejar/kcookiewin.cpp b/tdeioslave/http/kcookiejar/kcookiewin.cpp index 3b845a104..faa9cdc65 100644 --- a/tdeioslave/http/kcookiejar/kcookiewin.cpp +++ b/tdeioslave/http/kcookiejar/kcookiewin.cpp @@ -58,8 +58,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <kidna.h> #include <twin.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kurllabel.h> #include <klineedit.h> #include <kiconloader.h> diff --git a/tdeioslave/http/kcookiejar/main.cpp b/tdeioslave/http/kcookiejar/main.cpp index 59d912524..414afb41f 100644 --- a/tdeioslave/http/kcookiejar/main.cpp +++ b/tdeioslave/http/kcookiejar/main.cpp @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <dcopclient.h> #include <tdecmdlineargs.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> static const char description[] = diff --git a/tdeioslave/metainfo/metainfo.cpp b/tdeioslave/metainfo/metainfo.cpp index 54f7acc3a..389a9182e 100644 --- a/tdeioslave/metainfo/metainfo.cpp +++ b/tdeioslave/metainfo/metainfo.cpp @@ -24,7 +24,7 @@ #include <kmimetype.h> #include <kdebug.h> #include <tdefilemetainfo.h> -#include <klocale.h> +#include <tdelocale.h> #include <stdlib.h> #include "metainfo.h" diff --git a/tdelfeditor/tdelfeditor.cpp b/tdelfeditor/tdelfeditor.cpp index 99af949ed..1db2a3d8b 100644 --- a/tdelfeditor/tdelfeditor.cpp +++ b/tdelfeditor/tdelfeditor.cpp @@ -42,7 +42,7 @@ extern "C" { #include <tqstringlist.h> #include <tqfileinfo.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeaboutdata.h> #include <tdecmdlineargs.h> #include <kiconloader.h> diff --git a/tdemdi/tdemdi/dockcontainer.cpp b/tdemdi/tdemdi/dockcontainer.cpp index 88bfa020d..be7c00929 100644 --- a/tdemdi/tdemdi/dockcontainer.cpp +++ b/tdemdi/tdemdi/dockcontainer.cpp @@ -29,13 +29,13 @@ #include <tqtimer.h> #include <tqtooltip.h> #include <tdemultitabbar.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kdebug.h> #include <kiconloader.h> #include <tdeapplication.h> #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> //TODO: Well, this is already defined in tdeui/kdockwidget.cpp static const char* const tdemdi_not_close_xpm[]={ diff --git a/tdemdi/tdemdi/guiclient.cpp b/tdemdi/tdemdi/guiclient.cpp index 255150289..9201df7b3 100644 --- a/tdemdi/tdemdi/guiclient.cpp +++ b/tdemdi/tdemdi/guiclient.cpp @@ -25,7 +25,7 @@ #include <tdeapplication.h> #include <tdeconfig.h> #include <tdetoolbar.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaction.h> #include <tqstring.h> #include <kdebug.h> diff --git a/tdemdi/tdemdi/mainwindow.cpp b/tdemdi/tdemdi/mainwindow.cpp index 4d477fc9c..411d11771 100644 --- a/tdemdi/tdemdi/mainwindow.cpp +++ b/tdemdi/tdemdi/mainwindow.cpp @@ -51,12 +51,12 @@ #include <tqpopupmenu.h> #include <tqmenubar.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdeapplication.h> #include <kdebug.h> #include <tdeversion.h> #include <tqtabwidget.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include "dockcontainer.h" diff --git a/tdemdi/tdemdi/mainwindow.h b/tdemdi/tdemdi/mainwindow.h index e8ae6e9fc..0c333a151 100644 --- a/tdemdi/tdemdi/mainwindow.h +++ b/tdemdi/tdemdi/mainwindow.h @@ -43,7 +43,7 @@ #define _KMDI_MAINWINDOW_H_ #include <tdeparts/dockmainwindow.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdepopupmenu.h> #include <tqptrlist.h> diff --git a/tdemdi/tdemdichildarea.cpp b/tdemdi/tdemdichildarea.cpp index 9370bbbe7..29b0b3d2d 100644 --- a/tdemdi/tdemdichildarea.cpp +++ b/tdemdi/tdemdichildarea.cpp @@ -32,8 +32,8 @@ #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <math.h> #include <tqpopupmenu.h> diff --git a/tdemdi/tdemdichildfrm.cpp b/tdemdi/tdemdichildfrm.cpp index cbc4f4b29..40ced6ffb 100644 --- a/tdemdi/tdemdichildfrm.cpp +++ b/tdemdi/tdemdichildfrm.cpp @@ -45,7 +45,7 @@ #include <tqnamespace.h> #include <tqimage.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> ////////////////////////////////////////////////////////////////////////////// diff --git a/tdemdi/tdemdichildfrmcaption.cpp b/tdemdi/tdemdichildfrmcaption.cpp index cc1a4a187..e8e91ea94 100644 --- a/tdemdi/tdemdichildfrmcaption.cpp +++ b/tdemdi/tdemdichildfrmcaption.cpp @@ -38,7 +38,7 @@ #include "tdemdichildfrm.h" #include "tdemdichildarea.h" #include "tdemdimainfrm.h" -#include <klocale.h> +#include <tdelocale.h> #include <iostream> #ifdef Q_WS_WIN diff --git a/tdemdi/tdemdichildview.cpp b/tdemdi/tdemdichildview.cpp index 1c3f521f7..4d0aa4166 100644 --- a/tdemdi/tdemdichildview.cpp +++ b/tdemdi/tdemdichildview.cpp @@ -39,7 +39,7 @@ #include "tdemdichildfrm.h" #include "tdemdidefines.h" #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqiconset.h> //============ KMdiChildView ============// diff --git a/tdemdi/tdemdidockcontainer.cpp b/tdemdi/tdemdidockcontainer.cpp index ba0ba0de0..d6771b597 100644 --- a/tdemdi/tdemdidockcontainer.cpp +++ b/tdemdi/tdemdidockcontainer.cpp @@ -28,13 +28,13 @@ #include <tqtimer.h> #include <tqtooltip.h> #include <tdemultitabbar.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kdebug.h> #include <kiconloader.h> #include <tdeapplication.h> #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> //TODO: Well, this is already defined in tdeui/kdockwidget.cpp static const char* const tdemdi_not_close_xpm[] = diff --git a/tdemdi/tdemdiguiclient.cpp b/tdemdi/tdemdiguiclient.cpp index 1c43b8039..0a66ea6ff 100644 --- a/tdemdi/tdemdiguiclient.cpp +++ b/tdemdi/tdemdiguiclient.cpp @@ -25,7 +25,7 @@ #include <tdeconfig.h> #include <tdetoolbar.h> #include <tdemainwindow.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaction.h> #include <tqstring.h> #include <assert.h> diff --git a/tdemdi/tdemdimainfrm.cpp b/tdemdi/tdemdimainfrm.cpp index 3c9f7c442..f21cc384b 100644 --- a/tdemdi/tdemdimainfrm.cpp +++ b/tdemdi/tdemdimainfrm.cpp @@ -43,12 +43,12 @@ #include <tqpopupmenu.h> #include <tqmenubar.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdeapplication.h> #include <kdebug.h> #include <tdeversion.h> #include <tqtabwidget.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdestdaccel.h> #include <kiconloader.h> diff --git a/tdemdi/tdemdimainfrm.h b/tdemdi/tdemdimainfrm.h index 720324ad5..c73fa5af1 100644 --- a/tdemdi/tdemdimainfrm.h +++ b/tdemdi/tdemdimainfrm.h @@ -32,7 +32,7 @@ #define _KMDIMAINFRM_H_ #include <tdeparts/dockmainwindow.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdepopupmenu.h> #include <tqptrlist.h> diff --git a/tdeparts/browserextension.cpp b/tdeparts/browserextension.cpp index 630e4cb5a..85bfa4a94 100644 --- a/tdeparts/browserextension.cpp +++ b/tdeparts/browserextension.cpp @@ -29,8 +29,8 @@ #include <tqstylesheet.h> #include <kdebug.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kstaticdeleter.h> #include <kurifilter.h> #include <assert.h> diff --git a/tdeparts/browserrun.cpp b/tdeparts/browserrun.cpp index 34f4c21c9..3abd01524 100644 --- a/tdeparts/browserrun.cpp +++ b/tdeparts/browserrun.cpp @@ -17,15 +17,15 @@ */ #include "browserrun.h" -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdefiledialog.h> #include <tdeio/job.h> #include <tdeio/scheduler.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprocess.h> #include <kstringhandler.h> #include <kuserprofile.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <kdebug.h> #include <kstandarddirs.h> #include <assert.h> diff --git a/tdeparts/factory.cpp b/tdeparts/factory.cpp index a3985fd05..485bd9a36 100644 --- a/tdeparts/factory.cpp +++ b/tdeparts/factory.cpp @@ -23,8 +23,8 @@ #include <tqwidget.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kinstance.h> #include <assert.h> diff --git a/tdeparts/part.cpp b/tdeparts/part.cpp index 9372adc08..954fc83d5 100644 --- a/tdeparts/part.cpp +++ b/tdeparts/part.cpp @@ -33,9 +33,9 @@ #include <tqfileinfo.h> #include <kinstance.h> -#include <klocale.h> -#include <ktempfile.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdetempfile.h> +#include <tdemessagebox.h> #include <tdeio/job.h> #include <kstandarddirs.h> #include <tdefiledialog.h> diff --git a/tdeparts/partmanager.cpp b/tdeparts/partmanager.cpp index 1af0f1ee3..0f6f59561 100644 --- a/tdeparts/partmanager.cpp +++ b/tdeparts/partmanager.cpp @@ -22,7 +22,7 @@ #include "partmanager.h" #include <tdeparts/event.h> #include <tdeparts/part.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <tqapplication.h> diff --git a/tdeparts/plugin.cpp b/tdeparts/plugin.cpp index e1469ad1c..378db4a27 100644 --- a/tdeparts/plugin.cpp +++ b/tdeparts/plugin.cpp @@ -34,7 +34,7 @@ #include <kstandarddirs.h> #include <kdebug.h> #include <kxmlguifactory.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <ksimpleconfig.h> diff --git a/tdeparts/tests/example.cpp b/tdeparts/tests/example.cpp index 403fda062..c8fb77b29 100644 --- a/tdeparts/tests/example.cpp +++ b/tdeparts/tests/example.cpp @@ -10,9 +10,9 @@ #include <kiconloader.h> #include <kstandarddirs.h> #include <tdeapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeaction.h> -#include <klocale.h> +#include <tdelocale.h> Shell::Shell() { diff --git a/tdeparts/tests/ghostview.cpp b/tdeparts/tests/ghostview.cpp index 72b165e65..d83ec8f41 100644 --- a/tdeparts/tests/ghostview.cpp +++ b/tdeparts/tests/ghostview.cpp @@ -2,9 +2,9 @@ #include <kstandarddirs.h> #include <tdeapplication.h> #include <tdeaction.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdefiledialog.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdecmdlineargs.h> #include <klibloader.h> diff --git a/tdeparts/tests/normalktm.cpp b/tdeparts/tests/normalktm.cpp index 664d6c7ec..92e46254e 100644 --- a/tdeparts/tests/normalktm.cpp +++ b/tdeparts/tests/normalktm.cpp @@ -10,11 +10,11 @@ #include <kiconloader.h> #include <kstandarddirs.h> #include <tdeapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeaction.h> -#include <klocale.h> +#include <tdelocale.h> -#include <kmenubar.h> +#include <tdemenubar.h> Shell::Shell() { diff --git a/tdeparts/tests/notepad.cpp b/tdeparts/tests/notepad.cpp index 81ff2c1f2..ad81b91b3 100644 --- a/tdeparts/tests/notepad.cpp +++ b/tdeparts/tests/notepad.cpp @@ -12,7 +12,7 @@ #include <tdeapplication.h> #include <kdebug.h> #include <tdeaction.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstatusbar.h> #include <kstandarddirs.h> diff --git a/tdeparts/tests/parts.cpp b/tdeparts/tests/parts.cpp index 408e73280..ebfd9c9f1 100644 --- a/tdeparts/tests/parts.cpp +++ b/tdeparts/tests/parts.cpp @@ -14,9 +14,9 @@ #include <kiconloader.h> #include <tdeapplication.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeaction.h> -#include <klocale.h> +#include <tdelocale.h> Part1::Part1( TQObject *parent, TQWidget * parentWidget ) : KParts::ReadOnlyPart( parent, "Part1" ) diff --git a/tdeparts/tests/plugin_spellcheck.cpp b/tdeparts/tests/plugin_spellcheck.cpp index 73d5b7986..d7cf06eac 100644 --- a/tdeparts/tests/plugin_spellcheck.cpp +++ b/tdeparts/tests/plugin_spellcheck.cpp @@ -3,8 +3,8 @@ #include "plugin_spellcheck.h" #include <tdeaction.h> #include <kgenericfactory.h> -#include <kmessagebox.h> -#include <klocale.h> +#include <tdemessagebox.h> +#include <tdelocale.h> #include <kdebug.h> PluginSpellCheck::PluginSpellCheck( TQObject* parent, const char* name, diff --git a/tdeprint/cups/cupsaddsmb2.cpp b/tdeprint/cups/cupsaddsmb2.cpp index 685ce6e7e..256f5ee23 100644 --- a/tdeprint/cups/cupsaddsmb2.cpp +++ b/tdeprint/cups/cupsaddsmb2.cpp @@ -26,8 +26,8 @@ #include <tqlabel.h> #include <tqlayout.h> #include <tqlineedit.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tqmessagebox.h> #include <tqfile.h> #include <tdeio/passdlg.h> diff --git a/tdeprint/cups/cupsdconf2/addressdialog.cpp b/tdeprint/cups/cupsdconf2/addressdialog.cpp index fab6a6fba..83b4d0813 100644 --- a/tdeprint/cups/cupsdconf2/addressdialog.cpp +++ b/tdeprint/cups/cupsdconf2/addressdialog.cpp @@ -24,7 +24,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> AddressDialog::AddressDialog(TQWidget *parent, const char *name) : KDialogBase(Swallow, i18n("ACL Address"), Ok|Cancel, Ok, parent, name, true, true) diff --git a/tdeprint/cups/cupsdconf2/browsedialog.cpp b/tdeprint/cups/cupsdconf2/browsedialog.cpp index b337eb883..3268c72bc 100644 --- a/tdeprint/cups/cupsdconf2/browsedialog.cpp +++ b/tdeprint/cups/cupsdconf2/browsedialog.cpp @@ -28,7 +28,7 @@ #include <tqwhatsthis.h> #include <tqregexp.h> -#include <klocale.h> +#include <tdelocale.h> BrowseDialog::BrowseDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, TQString::null, Ok|Cancel, Ok, true) diff --git a/tdeprint/cups/cupsdconf2/cupsdbrowsingpage.cpp b/tdeprint/cups/cupsdconf2/cupsdbrowsingpage.cpp index 4b056cdb0..e66048b73 100644 --- a/tdeprint/cups/cupsdconf2/cupsdbrowsingpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdbrowsingpage.cpp @@ -28,7 +28,7 @@ #include <tqcombobox.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <knuminput.h> CupsdBrowsingPage::CupsdBrowsingPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdcomment.cpp b/tdeprint/cups/cupsdconf2/cupsdcomment.cpp index d17c8bd0c..8a788cad3 100644 --- a/tdeprint/cups/cupsdconf2/cupsdcomment.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdcomment.cpp @@ -21,7 +21,7 @@ #include <tqfile.h> #include <tqregexp.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> TQString Comment::comment() diff --git a/tdeprint/cups/cupsdconf2/cupsdconf.cpp b/tdeprint/cups/cupsdconf2/cupsdconf.cpp index 102ead1c8..2c5610411 100644 --- a/tdeprint/cups/cupsdconf2/cupsdconf.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdconf.cpp @@ -22,7 +22,7 @@ #include <tqfile.h> #include <tqregexp.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tdeconfig.h> diff --git a/tdeprint/cups/cupsdconf2/cupsddialog.cpp b/tdeprint/cups/cupsdconf2/cupsddialog.cpp index c9b219112..22a3b2d54 100644 --- a/tdeprint/cups/cupsdconf2/cupsddialog.cpp +++ b/tdeprint/cups/cupsdconf2/cupsddialog.cpp @@ -33,11 +33,11 @@ #include <tqdir.h> #include <tqvbox.h> -#include <kmessagebox.h> -#include <klocale.h> +#include <tdemessagebox.h> +#include <tdelocale.h> #include <tqfile.h> #include <tqfileinfo.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> #include <tqstringlist.h> #include <tqwhatsthis.h> diff --git a/tdeprint/cups/cupsdconf2/cupsddirpage.cpp b/tdeprint/cups/cupsdconf2/cupsddirpage.cpp index 268465a76..282657255 100644 --- a/tdeprint/cups/cupsdconf2/cupsddirpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsddirpage.cpp @@ -26,7 +26,7 @@ #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> CupsdDirPage::CupsdDirPage(TQWidget *parent, const char *name) : CupsdPage(parent, name) diff --git a/tdeprint/cups/cupsdconf2/cupsdfilterpage.cpp b/tdeprint/cups/cupsdconf2/cupsdfilterpage.cpp index 79c8a9401..e9cb1a0ad 100644 --- a/tdeprint/cups/cupsdconf2/cupsdfilterpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdfilterpage.cpp @@ -27,7 +27,7 @@ #include <tqwhatsthis.h> #include <tqcombobox.h> -#include <klocale.h> +#include <tdelocale.h> #include <knuminput.h> CupsdFilterPage::CupsdFilterPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdjobspage.cpp b/tdeprint/cups/cupsdconf2/cupsdjobspage.cpp index f12f82f1e..49fdecc7c 100644 --- a/tdeprint/cups/cupsdconf2/cupsdjobspage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdjobspage.cpp @@ -25,7 +25,7 @@ #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <knuminput.h> CupsdJobsPage::CupsdJobsPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdlogpage.cpp b/tdeprint/cups/cupsdconf2/cupsdlogpage.cpp index 00972e368..22128b39c 100644 --- a/tdeprint/cups/cupsdconf2/cupsdlogpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdlogpage.cpp @@ -27,7 +27,7 @@ #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdefiledialog.h> CupsdLogPage::CupsdLogPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdnetworkpage.cpp b/tdeprint/cups/cupsdconf2/cupsdnetworkpage.cpp index 9edca5868..e939c151f 100644 --- a/tdeprint/cups/cupsdconf2/cupsdnetworkpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdnetworkpage.cpp @@ -29,7 +29,7 @@ #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <knuminput.h> CupsdNetworkPage::CupsdNetworkPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdsecuritypage.cpp b/tdeprint/cups/cupsdconf2/cupsdsecuritypage.cpp index d11851c60..6d6061264 100644 --- a/tdeprint/cups/cupsdconf2/cupsdsecuritypage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdsecuritypage.cpp @@ -28,9 +28,9 @@ #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> CupsdSecurityPage::CupsdSecurityPage(TQWidget *parent, const char *name) : CupsdPage(parent, name) diff --git a/tdeprint/cups/cupsdconf2/cupsdserverpage.cpp b/tdeprint/cups/cupsdconf2/cupsdserverpage.cpp index cfd731430..e89356af9 100644 --- a/tdeprint/cups/cupsdconf2/cupsdserverpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdserverpage.cpp @@ -27,7 +27,7 @@ #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> int findComboItem(TQComboBox *cb, const TQString& str) { diff --git a/tdeprint/cups/cupsdconf2/cupsdsplash.cpp b/tdeprint/cups/cupsdconf2/cupsdsplash.cpp index a058299f0..c28329e67 100644 --- a/tdeprint/cups/cupsdconf2/cupsdsplash.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdsplash.cpp @@ -22,7 +22,7 @@ #include <tqlabel.h> #include <tqpixmap.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> CupsdSplash::CupsdSplash(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/editlist.cpp b/tdeprint/cups/cupsdconf2/editlist.cpp index 3e3fa80e2..936dee212 100644 --- a/tdeprint/cups/cupsdconf2/editlist.cpp +++ b/tdeprint/cups/cupsdconf2/editlist.cpp @@ -22,7 +22,7 @@ #include <tdelistbox.h> #include <kpushbutton.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kguiitem.h> diff --git a/tdeprint/cups/cupsdconf2/locationdialog.cpp b/tdeprint/cups/cupsdconf2/locationdialog.cpp index 3896f7845..0754ae573 100644 --- a/tdeprint/cups/cupsdconf2/locationdialog.cpp +++ b/tdeprint/cups/cupsdconf2/locationdialog.cpp @@ -29,7 +29,7 @@ #include <tqpushbutton.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> LocationDialog::LocationDialog(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/main.cpp b/tdeprint/cups/cupsdconf2/main.cpp index abc81477c..78b0e1edf 100644 --- a/tdeprint/cups/cupsdconf2/main.cpp +++ b/tdeprint/cups/cupsdconf2/main.cpp @@ -20,7 +20,7 @@ #include "cupsddialog.h" #include <tqfile.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdecmdlineargs.h> #include <tdeapplication.h> diff --git a/tdeprint/cups/cupsdconf2/portdialog.cpp b/tdeprint/cups/cupsdconf2/portdialog.cpp index 18cade9fc..f758d5d1e 100644 --- a/tdeprint/cups/cupsdconf2/portdialog.cpp +++ b/tdeprint/cups/cupsdconf2/portdialog.cpp @@ -28,7 +28,7 @@ #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> PortDialog::PortDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, TQString::null, Ok|Cancel, Ok, true) diff --git a/tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp b/tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp index 628e8d40c..0992e2935 100644 --- a/tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp +++ b/tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp @@ -23,7 +23,7 @@ #include <tqheader.h> #include <tqpushbutton.h> #include <tdelistview.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdefiledialog.h> #include <kiconloader.h> diff --git a/tdeprint/cups/cupsdconf2/sizewidget.cpp b/tdeprint/cups/cupsdconf2/sizewidget.cpp index 742702e48..eaa39152f 100644 --- a/tdeprint/cups/cupsdconf2/sizewidget.cpp +++ b/tdeprint/cups/cupsdconf2/sizewidget.cpp @@ -23,7 +23,7 @@ #include <tqspinbox.h> #include <tqlayout.h> #include <tqregexp.h> -#include <klocale.h> +#include <tdelocale.h> SizeWidget::SizeWidget( TQWidget *parent, const char *name ) : TQWidget( parent, name ) diff --git a/tdeprint/cups/cupsinfos.cpp b/tdeprint/cups/cupsinfos.cpp index 330429583..f6d392bd9 100644 --- a/tdeprint/cups/cupsinfos.cpp +++ b/tdeprint/cups/cupsinfos.cpp @@ -24,7 +24,7 @@ #include <tdeio/passdlg.h> #include <tdeio/authinfo.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <tdeapplication.h> #include <dcopclient.h> diff --git a/tdeprint/cups/ippreportdlg.cpp b/tdeprint/cups/ippreportdlg.cpp index 1e07789ac..ed56804bc 100644 --- a/tdeprint/cups/ippreportdlg.cpp +++ b/tdeprint/cups/ippreportdlg.cpp @@ -21,9 +21,9 @@ #include "ipprequest.h" #include "kprinter.h" -#include <klocale.h> +#include <tdelocale.h> #include <kguiitem.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kdebug.h> #include <ktextedit.h> #include <tqsimplerichtext.h> diff --git a/tdeprint/cups/ipprequest.cpp b/tdeprint/cups/ipprequest.cpp index 4edaefb58..ebbefefe9 100644 --- a/tdeprint/cups/ipprequest.cpp +++ b/tdeprint/cups/ipprequest.cpp @@ -24,8 +24,8 @@ #include <string> #include <cups/language.h> #include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tqdatetime.h> #include <tqregexp.h> #include <cups/cups.h> diff --git a/tdeprint/cups/kmconfigcups.cpp b/tdeprint/cups/kmconfigcups.cpp index 1b0ccdaea..6bc9ec155 100644 --- a/tdeprint/cups/kmconfigcups.cpp +++ b/tdeprint/cups/kmconfigcups.cpp @@ -20,7 +20,7 @@ #include "kmconfigcups.h" #include "kmcupsconfigwidget.h" -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kdialog.h> diff --git a/tdeprint/cups/kmconfigcupsdir.cpp b/tdeprint/cups/kmconfigcupsdir.cpp index 6f16f5dfa..10a455226 100644 --- a/tdeprint/cups/kmconfigcupsdir.cpp +++ b/tdeprint/cups/kmconfigcupsdir.cpp @@ -21,7 +21,7 @@ #include <tqcheckbox.h> #include <kurlrequester.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdialog.h> #include <tdeconfig.h> #include <tqgroupbox.h> diff --git a/tdeprint/cups/kmcupsconfigwidget.cpp b/tdeprint/cups/kmcupsconfigwidget.cpp index a62583b1b..f93c1a4b3 100644 --- a/tdeprint/cups/kmcupsconfigwidget.cpp +++ b/tdeprint/cups/kmcupsconfigwidget.cpp @@ -28,7 +28,7 @@ #include <tqpushbutton.h> #include <tqvalidator.h> -#include <klocale.h> +#include <tdelocale.h> #include <kcursor.h> #include <tdeconfig.h> #include <kstringhandler.h> diff --git a/tdeprint/cups/kmcupsfactory.cpp b/tdeprint/cups/kmcupsfactory.cpp index 47384eab6..f42bc449e 100644 --- a/tdeprint/cups/kmcupsfactory.cpp +++ b/tdeprint/cups/kmcupsfactory.cpp @@ -22,7 +22,7 @@ #include "kmcupsuimanager.h" #include "kcupsprinterimpl.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <kgenericfactory.h> typedef K_TYPELIST_4( KMCupsManager, KMCupsJobManager, KMCupsUiManager, KCupsPrinterImpl ) Products; diff --git a/tdeprint/cups/kmcupsjobmanager.cpp b/tdeprint/cups/kmcupsjobmanager.cpp index b7284d1ad..fa208e551 100644 --- a/tdeprint/cups/kmcupsjobmanager.cpp +++ b/tdeprint/cups/kmcupsjobmanager.cpp @@ -32,7 +32,7 @@ #include "kpcopiespage.h" #include "kptagspage.h" -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kurl.h> diff --git a/tdeprint/cups/kmcupsmanager.cpp b/tdeprint/cups/kmcupsmanager.cpp index cd472eefa..eaf5070b8 100644 --- a/tdeprint/cups/kmcupsmanager.cpp +++ b/tdeprint/cups/kmcupsmanager.cpp @@ -42,12 +42,12 @@ #include <kdebug.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kstandarddirs.h> #include <tdesocketbase.h> #include <klibloader.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeaction.h> #include <kdialogbase.h> #include <kextendedsocket.h> diff --git a/tdeprint/cups/kmcupsuimanager.cpp b/tdeprint/cups/kmcupsuimanager.cpp index 60e683b84..03b85bb0a 100644 --- a/tdeprint/cups/kmcupsuimanager.cpp +++ b/tdeprint/cups/kmcupsuimanager.cpp @@ -55,10 +55,10 @@ #include <tqlistview.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tdeaction.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include "config.h" diff --git a/tdeprint/cups/kmpropbanners.cpp b/tdeprint/cups/kmpropbanners.cpp index 22098cdff..602af7f6d 100644 --- a/tdeprint/cups/kmpropbanners.cpp +++ b/tdeprint/cups/kmpropbanners.cpp @@ -24,7 +24,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KMPropBanners::KMPropBanners(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/cups/kmpropquota.cpp b/tdeprint/cups/kmpropquota.cpp index 9df6cbcb2..773e667e9 100644 --- a/tdeprint/cups/kmpropquota.cpp +++ b/tdeprint/cups/kmpropquota.cpp @@ -23,7 +23,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> // some forward declarations (see kmwquota.cpp) const char* unitKeyword(int); diff --git a/tdeprint/cups/kmpropusers.cpp b/tdeprint/cups/kmpropusers.cpp index 0f67205b0..2a2147aed 100644 --- a/tdeprint/cups/kmpropusers.cpp +++ b/tdeprint/cups/kmpropusers.cpp @@ -23,7 +23,7 @@ #include <tqtextview.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KMPropUsers::KMPropUsers(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/cups/kmwbanners.cpp b/tdeprint/cups/kmwbanners.cpp index c221f69d7..86f1347fb 100644 --- a/tdeprint/cups/kmwbanners.cpp +++ b/tdeprint/cups/kmwbanners.cpp @@ -27,7 +27,7 @@ #include <tqlabel.h> #include <tqlayout.h> #include <tqmap.h> -#include <klocale.h> +#include <tdelocale.h> TQStringList defaultBanners() { diff --git a/tdeprint/cups/kmwfax.cpp b/tdeprint/cups/kmwfax.cpp index 05b1b2cfa..15d4f8180 100644 --- a/tdeprint/cups/kmwfax.cpp +++ b/tdeprint/cups/kmwfax.cpp @@ -26,7 +26,7 @@ #include <tqlabel.h> #include <tqlayout.h> #include <tdelistbox.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kurl.h> diff --git a/tdeprint/cups/kmwipp.cpp b/tdeprint/cups/kmwipp.cpp index cb9dedd6c..a8ec8d425 100644 --- a/tdeprint/cups/kmwipp.cpp +++ b/tdeprint/cups/kmwipp.cpp @@ -23,7 +23,7 @@ #include <tqlabel.h> #include <tqlineedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqvalidator.h> #include <cups/http.h> diff --git a/tdeprint/cups/kmwippprinter.cpp b/tdeprint/cups/kmwippprinter.cpp index e80478f61..f7a4f0593 100644 --- a/tdeprint/cups/kmwippprinter.cpp +++ b/tdeprint/cups/kmwippprinter.cpp @@ -29,12 +29,12 @@ #include <kpushbutton.h> #include <tqlineedit.h> #include <tqlabel.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tqtextview.h> #include <tqlayout.h> #include <tqregexp.h> #include <kseparator.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kguiitem.h> #include <kurl.h> diff --git a/tdeprint/cups/kmwippselect.cpp b/tdeprint/cups/kmwippselect.cpp index c3f48ad27..237d74fd1 100644 --- a/tdeprint/cups/kmwippselect.cpp +++ b/tdeprint/cups/kmwippselect.cpp @@ -25,7 +25,7 @@ #include <tdelistbox.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kiconloader.h> diff --git a/tdeprint/cups/kmwother.cpp b/tdeprint/cups/kmwother.cpp index 4e640d536..497fa03c3 100644 --- a/tdeprint/cups/kmwother.cpp +++ b/tdeprint/cups/kmwother.cpp @@ -29,7 +29,7 @@ #include <tqheader.h> #include <tqdict.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdelistview.h> #include <kiconloader.h> #include <kdebug.h> diff --git a/tdeprint/cups/kmwquota.cpp b/tdeprint/cups/kmwquota.cpp index 67245fb20..5085913d0 100644 --- a/tdeprint/cups/kmwquota.cpp +++ b/tdeprint/cups/kmwquota.cpp @@ -27,7 +27,7 @@ #include <tqlabel.h> #include <tqcombobox.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #ifdef HAVE_LIMITS_H #include <limits.h> diff --git a/tdeprint/cups/kmwusers.cpp b/tdeprint/cups/kmwusers.cpp index 714f6f4d4..eed7c08af 100644 --- a/tdeprint/cups/kmwusers.cpp +++ b/tdeprint/cups/kmwusers.cpp @@ -26,7 +26,7 @@ #include <tqlabel.h> #include <tqlayout.h> #include <tqcombobox.h> -#include <klocale.h> +#include <tdelocale.h> #include <keditlistbox.h> KMWUsers::KMWUsers(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/kphpgl2page.cpp b/tdeprint/cups/kphpgl2page.cpp index 67ad61aec..f804b249d 100644 --- a/tdeprint/cups/kphpgl2page.cpp +++ b/tdeprint/cups/kphpgl2page.cpp @@ -23,7 +23,7 @@ #include <tqgroupbox.h> #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <knuminput.h> KPHpgl2Page::KPHpgl2Page(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/kpimagepage.cpp b/tdeprint/cups/kpimagepage.cpp index 669bab190..8d23fe3e0 100644 --- a/tdeprint/cups/kpimagepage.cpp +++ b/tdeprint/cups/kpimagepage.cpp @@ -32,7 +32,7 @@ #include <tqlabel.h> #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <knuminput.h> #include <kseparator.h> #include <kstandarddirs.h> diff --git a/tdeprint/cups/kpschedulepage.cpp b/tdeprint/cups/kpschedulepage.cpp index f778139dc..d7f13c8a4 100644 --- a/tdeprint/cups/kpschedulepage.cpp +++ b/tdeprint/cups/kpschedulepage.cpp @@ -27,7 +27,7 @@ #include <tqdatetime.h> #include <tqlineedit.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <kseparator.h> #include <knuminput.h> diff --git a/tdeprint/cups/kptagspage.cpp b/tdeprint/cups/kptagspage.cpp index a5d465683..db134d9ba 100644 --- a/tdeprint/cups/kptagspage.cpp +++ b/tdeprint/cups/kptagspage.cpp @@ -26,7 +26,7 @@ #include <tqregexp.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> KPTagsPage::KPTagsPage(bool ro, TQWidget *parent, const char *name) : KPrintDialogPage(parent, name) diff --git a/tdeprint/cups/kptextpage.cpp b/tdeprint/cups/kptextpage.cpp index eb8bc3553..955434da4 100644 --- a/tdeprint/cups/kptextpage.cpp +++ b/tdeprint/cups/kptextpage.cpp @@ -29,7 +29,7 @@ #include <tqradiobutton.h> #include <tqwhatsthis.h> #include <knuminput.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kseparator.h> #include <kdebug.h> diff --git a/tdeprint/driver.cpp b/tdeprint/driver.cpp index abc468f7a..6afc75d0f 100644 --- a/tdeprint/driver.cpp +++ b/tdeprint/driver.cpp @@ -23,7 +23,7 @@ #include <tqfile.h> #include <tqstringlist.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <stdlib.h> #include <math.h> diff --git a/tdeprint/driverview.cpp b/tdeprint/driverview.cpp index 02c7be610..fece6c40c 100644 --- a/tdeprint/driverview.cpp +++ b/tdeprint/driverview.cpp @@ -27,7 +27,7 @@ #include <tqheader.h> #include <tqlayout.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> DrListView::DrListView(TQWidget *parent, const char *name) : TDEListView(parent,name) diff --git a/tdeprint/droptionview.cpp b/tdeprint/droptionview.cpp index 1ec954251..77a910b0c 100644 --- a/tdeprint/droptionview.cpp +++ b/tdeprint/droptionview.cpp @@ -34,7 +34,7 @@ #include <kcursor.h> #include <kdialog.h> -#include <klocale.h> +#include <tdelocale.h> OptionBaseView::OptionBaseView(TQWidget *parent, const char *name) : TQWidget(parent,name) diff --git a/tdeprint/ext/kextprinterimpl.cpp b/tdeprint/ext/kextprinterimpl.cpp index 8959aa3e8..7923ea729 100644 --- a/tdeprint/ext/kextprinterimpl.cpp +++ b/tdeprint/ext/kextprinterimpl.cpp @@ -23,7 +23,7 @@ #include <tqfile.h> #include <kstandarddirs.h> #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> KExtPrinterImpl::KExtPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/) : KPrinterImpl(parent,name) diff --git a/tdeprint/ext/kmextmanager.cpp b/tdeprint/ext/kmextmanager.cpp index 598dd6648..abc832d6f 100644 --- a/tdeprint/ext/kmextmanager.cpp +++ b/tdeprint/ext/kmextmanager.cpp @@ -20,7 +20,7 @@ #include "kmextmanager.h" #include "kmprinter.h" -#include <klocale.h> +#include <tdelocale.h> KMExtManager::KMExtManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMManager(parent,name) diff --git a/tdeprint/ext/kmextuimanager.cpp b/tdeprint/ext/kmextuimanager.cpp index 2fa200848..ee1c4e186 100644 --- a/tdeprint/ext/kmextuimanager.cpp +++ b/tdeprint/ext/kmextuimanager.cpp @@ -21,7 +21,7 @@ #include "kpqtpage.h" #include "kprinterpropertydialog.h" -#include <klocale.h> +#include <tdelocale.h> KMExtUiManager::KMExtUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMUiManager(parent,name) diff --git a/tdeprint/foomatic/kfoomaticprinterimpl.cpp b/tdeprint/foomatic/kfoomaticprinterimpl.cpp index aacf6be8d..dd694b31b 100644 --- a/tdeprint/foomatic/kfoomaticprinterimpl.cpp +++ b/tdeprint/foomatic/kfoomaticprinterimpl.cpp @@ -21,7 +21,7 @@ #include "kprinter.h" #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> KFoomaticPrinterImpl::KFoomaticPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/) : KPrinterImpl(parent,name) diff --git a/tdeprint/foomatic/kmfoomaticmanager.cpp b/tdeprint/foomatic/kmfoomaticmanager.cpp index 19e8401d8..e1e741003 100644 --- a/tdeprint/foomatic/kmfoomaticmanager.cpp +++ b/tdeprint/foomatic/kmfoomaticmanager.cpp @@ -22,7 +22,7 @@ #include "driver.h" #include <tqdom.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kprocess.h> diff --git a/tdeprint/foomatic2loader.cpp b/tdeprint/foomatic2loader.cpp index 6add13378..0d0637c90 100644 --- a/tdeprint/foomatic2loader.cpp +++ b/tdeprint/foomatic2loader.cpp @@ -24,7 +24,7 @@ #include <tqregexp.h> #include <tqbuffer.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> void tdeprint_foomatic2scanner_init( TQIODevice* ); void tdeprint_foomatic2scanner_terminate(); diff --git a/tdeprint/kmfactory.cpp b/tdeprint/kmfactory.cpp index 09a2cf45a..16ec56c32 100644 --- a/tdeprint/kmfactory.cpp +++ b/tdeprint/kmfactory.cpp @@ -36,8 +36,8 @@ #include <kstandarddirs.h> #include <kiconloader.h> #include <kdebug.h> -#include <kmessagebox.h> -#include <klocale.h> +#include <tdemessagebox.h> +#include <tdelocale.h> #include <ksimpleconfig.h> #include <kstaticdeleter.h> #include <tdeapplication.h> diff --git a/tdeprint/kmjob.cpp b/tdeprint/kmjob.cpp index 7ff1efb95..2b42506f5 100644 --- a/tdeprint/kmjob.cpp +++ b/tdeprint/kmjob.cpp @@ -19,7 +19,7 @@ #include "kmjob.h" -#include <klocale.h> +#include <tdelocale.h> KMJob::KMJob() : KMObject() diff --git a/tdeprint/kmmanager.cpp b/tdeprint/kmmanager.cpp index ca9b1036f..d43239fd7 100644 --- a/tdeprint/kmmanager.cpp +++ b/tdeprint/kmmanager.cpp @@ -30,7 +30,7 @@ #include <tqfile.h> #include <kstandarddirs.h> #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tdeapplication.h> #include <klibloader.h> diff --git a/tdeprint/kmprinter.cpp b/tdeprint/kmprinter.cpp index 22fc9d970..c7676e382 100644 --- a/tdeprint/kmprinter.cpp +++ b/tdeprint/kmprinter.cpp @@ -21,7 +21,7 @@ #include "kprinter.h" #include "driver.h" -#include <klocale.h> +#include <tdelocale.h> #include <tdefiledialog.h> KMPrinter::KMPrinter() diff --git a/tdeprint/kmspecialmanager.cpp b/tdeprint/kmspecialmanager.cpp index 84e120e77..910de4931 100644 --- a/tdeprint/kmspecialmanager.cpp +++ b/tdeprint/kmspecialmanager.cpp @@ -26,9 +26,9 @@ #include <tqfile.h> #include <kstandarddirs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <ksimpleconfig.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <unistd.h> diff --git a/tdeprint/kmuimanager.cpp b/tdeprint/kmuimanager.cpp index 962653dd2..4dd6966d3 100644 --- a/tdeprint/kmuimanager.cpp +++ b/tdeprint/kmuimanager.cpp @@ -36,7 +36,7 @@ #include "kxmlcommand.h" #include "kpposterpage.h" -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> KMUiManager::KMUiManager(TQObject *parent, const char *name) diff --git a/tdeprint/kmvirtualmanager.cpp b/tdeprint/kmvirtualmanager.cpp index b13637904..dabad3093 100644 --- a/tdeprint/kmvirtualmanager.cpp +++ b/tdeprint/kmvirtualmanager.cpp @@ -28,11 +28,11 @@ #include <tqtextstream.h> #include <tqdir.h> #include <tqfileinfo.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <kurl.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <unistd.h> diff --git a/tdeprint/kpcopiespage.cpp b/tdeprint/kpcopiespage.cpp index d804cc9f2..10eb6e204 100644 --- a/tdeprint/kpcopiespage.cpp +++ b/tdeprint/kpcopiespage.cpp @@ -35,7 +35,7 @@ #include <tqlayout.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kseparator.h> diff --git a/tdeprint/kpdriverpage.cpp b/tdeprint/kpdriverpage.cpp index 18cfeb207..2bea47bc8 100644 --- a/tdeprint/kpdriverpage.cpp +++ b/tdeprint/kpdriverpage.cpp @@ -22,7 +22,7 @@ #include "driver.h" #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KPDriverPage::KPDriverPage(KMPrinter *p, DrMain *d, TQWidget *parent, const char *name) : KPrintDialogPage(p,d,parent,name) diff --git a/tdeprint/kpfileselectpage.cpp b/tdeprint/kpfileselectpage.cpp index 6847ade2b..8b20386bd 100644 --- a/tdeprint/kpfileselectpage.cpp +++ b/tdeprint/kpfileselectpage.cpp @@ -24,7 +24,7 @@ #include <tqstringlist.h> #include <tqregexp.h> #include <tqheader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> KPFileSelectPage::KPFileSelectPage(TQWidget *parent, const char *name) diff --git a/tdeprint/kpfilterpage.cpp b/tdeprint/kpfilterpage.cpp index 4704abb15..6f46085ee 100644 --- a/tdeprint/kpfilterpage.cpp +++ b/tdeprint/kpfilterpage.cpp @@ -27,9 +27,9 @@ #include <tqlayout.h> #include <tqwhatsthis.h> #include <tdelistview.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kactivelabel.h> #include <kdebug.h> #include <tdeapplication.h> diff --git a/tdeprint/kpgeneralpage.cpp b/tdeprint/kpgeneralpage.cpp index ea1ec61e3..821290704 100644 --- a/tdeprint/kpgeneralpage.cpp +++ b/tdeprint/kpgeneralpage.cpp @@ -34,7 +34,7 @@ #include <kdebug.h> #include <kdialog.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> // Some ID's #define ORIENT_PORTRAIT_ID 0 diff --git a/tdeprint/kpmarginpage.cpp b/tdeprint/kpmarginpage.cpp index ab70211c8..78b9ca6ef 100644 --- a/tdeprint/kpmarginpage.cpp +++ b/tdeprint/kpmarginpage.cpp @@ -31,9 +31,9 @@ #include <tqpaintdevicemetrics.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> KPMarginPage::KPMarginPage(KPrinter *prt, DrMain *driver, TQWidget *parent, const char *name) : KPrintDialogPage(0, driver, parent, name) diff --git a/tdeprint/kpposterpage.cpp b/tdeprint/kpposterpage.cpp index f719e251b..9c0a42501 100644 --- a/tdeprint/kpposterpage.cpp +++ b/tdeprint/kpposterpage.cpp @@ -31,7 +31,7 @@ #include <tqlineedit.h> #include <tqwhatsthis.h> #include <kpushbutton.h> -#include <klocale.h> +#include <tdelocale.h> #include <knuminput.h> #include <kiconloader.h> diff --git a/tdeprint/kpqtpage.cpp b/tdeprint/kpqtpage.cpp index 11b5a6574..c0ca5656e 100644 --- a/tdeprint/kpqtpage.cpp +++ b/tdeprint/kpqtpage.cpp @@ -32,7 +32,7 @@ #include <tqwhatsthis.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #define ORIENT_PORTRAIT_ID 0 diff --git a/tdeprint/kprintaction.cpp b/tdeprint/kprintaction.cpp index cc94fe3c8..4a4aac597 100644 --- a/tdeprint/kprintaction.cpp +++ b/tdeprint/kprintaction.cpp @@ -23,7 +23,7 @@ #include <tdeprint/kmmanager.h> #include <kiconloader.h> #include <tdepopupmenu.h> -#include <klocale.h> +#include <tdelocale.h> class KPrintAction::KPrintActionPrivate { diff --git a/tdeprint/kprintdialog.cpp b/tdeprint/kprintdialog.cpp index 312146855..d881971ff 100644 --- a/tdeprint/kprintdialog.cpp +++ b/tdeprint/kprintdialog.cpp @@ -46,18 +46,18 @@ #include <tqvbox.h> #include <tqlayout.h> #include <tqregexp.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tqdir.h> #include <tqtooltip.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <tdefiledialog.h> #include <kurlrequester.h> #include <klineedit.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <kguiitem.h> #include <kstdguiitem.h> diff --git a/tdeprint/kprinter.cpp b/tdeprint/kprinter.cpp index 95cfc1733..4b9a1c98f 100644 --- a/tdeprint/kprinter.cpp +++ b/tdeprint/kprinter.cpp @@ -35,15 +35,15 @@ #include <tqguardedptr.h> #include <tdeapplication.h> #include <kstandarddirs.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <krun.h> #include <knotifyclient.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprocess.h> #include <klibloader.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> static void dumpOptions(const TQMap<TQString,TQString>& opts); static void reportError(KPrinter*); diff --git a/tdeprint/kprinterimpl.cpp b/tdeprint/kprinterimpl.cpp index ac79220f5..edd380009 100644 --- a/tdeprint/kprinterimpl.cpp +++ b/tdeprint/kprinterimpl.cpp @@ -32,14 +32,14 @@ #include <tqfile.h> #include <tqregexp.h> #include <kinputdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <dcopclient.h> #include <tdeapplication.h> #include <kstandarddirs.h> #include <kdatastream.h> #include <kdebug.h> #include <kmimemagic.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kprocess.h> #include <tdeconfig.h> diff --git a/tdeprint/kprinterpropertydialog.cpp b/tdeprint/kprinterpropertydialog.cpp index 1128a7d3a..c120ba843 100644 --- a/tdeprint/kprinterpropertydialog.cpp +++ b/tdeprint/kprinterpropertydialog.cpp @@ -25,9 +25,9 @@ #include "kmprinter.h" #include "driver.h" -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tqtabwidget.h> -#include <klocale.h> +#include <tdelocale.h> #include <kpushbutton.h> #include <kguiitem.h> diff --git a/tdeprint/kprintpreview.cpp b/tdeprint/kprintpreview.cpp index 0311f543d..623a7f934 100644 --- a/tdeprint/kprintpreview.cpp +++ b/tdeprint/kprintpreview.cpp @@ -34,8 +34,8 @@ #include <krun.h> #include <tdeapplication.h> #include <kstandarddirs.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kdebug.h> #include <tdeconfig.h> #include <tdetoolbar.h> diff --git a/tdeprint/kprintprocess.cpp b/tdeprint/kprintprocess.cpp index ec93fcce6..89ef5e2ca 100644 --- a/tdeprint/kprintprocess.cpp +++ b/tdeprint/kprintprocess.cpp @@ -19,7 +19,7 @@ #include "kprintprocess.h" #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqfile.h> KPrintProcess::KPrintProcess() diff --git a/tdeprint/kxmlcommand.cpp b/tdeprint/kxmlcommand.cpp index f2dcb99ce..2d5712674 100644 --- a/tdeprint/kxmlcommand.cpp +++ b/tdeprint/kxmlcommand.cpp @@ -30,13 +30,13 @@ #include <tqmap.h> #include <tqvaluelist.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> #include <ksimpleconfig.h> #include <kdialogbase.h> #include <kdebug.h> #include <kprocess.h> #include <klibloader.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> static void setOptionText(DrBase *opt, const TQString& s) { diff --git a/tdeprint/lpd/klpdprinterimpl.cpp b/tdeprint/lpd/klpdprinterimpl.cpp index e81b3a8cd..3647f0b38 100644 --- a/tdeprint/lpd/klpdprinterimpl.cpp +++ b/tdeprint/lpd/klpdprinterimpl.cpp @@ -22,7 +22,7 @@ #include <tqfile.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> KLpdPrinterImpl::KLpdPrinterImpl(TQObject *parent, const char *name) : KPrinterImpl(parent,name) diff --git a/tdeprint/lpd/kmlpdmanager.cpp b/tdeprint/lpd/kmlpdmanager.cpp index 23c0422d0..e72733f89 100644 --- a/tdeprint/lpd/kmlpdmanager.cpp +++ b/tdeprint/lpd/kmlpdmanager.cpp @@ -32,7 +32,7 @@ #include <tqmap.h> #include <tqregexp.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <tdeconfig.h> #include <kprocess.h> diff --git a/tdeprint/lpd/kmlpduimanager.cpp b/tdeprint/lpd/kmlpduimanager.cpp index fad3fcd58..173c03b2b 100644 --- a/tdeprint/lpd/kmlpduimanager.cpp +++ b/tdeprint/lpd/kmlpduimanager.cpp @@ -27,7 +27,7 @@ #include "kmpropdriver.h" #include <tqfile.h> -#include <klocale.h> +#include <tdelocale.h> KMLpdUiManager::KMLpdUiManager(TQObject *parent, const char *name) : KMUiManager(parent,name) diff --git a/tdeprint/lpd/lpdtools.cpp b/tdeprint/lpd/lpdtools.cpp index 5131b33f3..54f19c405 100644 --- a/tdeprint/lpd/lpdtools.cpp +++ b/tdeprint/lpd/lpdtools.cpp @@ -22,7 +22,7 @@ #include "kmprinter.h" #include <tqfile.h> -#include <klocale.h> +#include <tdelocale.h> static const char *pt_pagesize[] = { "ledger", I18N_NOOP("Ledger"), diff --git a/tdeprint/lpdunix/klpdunixprinterimpl.cpp b/tdeprint/lpdunix/klpdunixprinterimpl.cpp index 4237bda59..e628a1c41 100644 --- a/tdeprint/lpdunix/klpdunixprinterimpl.cpp +++ b/tdeprint/lpdunix/klpdunixprinterimpl.cpp @@ -22,7 +22,7 @@ #include <tqfile.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> #include <kmacroexpander.h> KLpdUnixPrinterImpl::KLpdUnixPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/) diff --git a/tdeprint/lpdunix/kmlpdunixmanager.cpp b/tdeprint/lpdunix/kmlpdunixmanager.cpp index 232a49eb0..7a291f6df 100644 --- a/tdeprint/lpdunix/kmlpdunixmanager.cpp +++ b/tdeprint/lpdunix/kmlpdunixmanager.cpp @@ -26,7 +26,7 @@ #include <tqfileinfo.h> #include <tqtextstream.h> #include <tqregexp.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <kdebug.h> diff --git a/tdeprint/lpdunix/kmlpdunixuimanager.cpp b/tdeprint/lpdunix/kmlpdunixuimanager.cpp index 686dfecbb..b7f059f1a 100644 --- a/tdeprint/lpdunix/kmlpdunixuimanager.cpp +++ b/tdeprint/lpdunix/kmlpdunixuimanager.cpp @@ -21,7 +21,7 @@ #include "kpqtpage.h" #include "kprinterpropertydialog.h" -#include <klocale.h> +#include <tdelocale.h> KMLpdUnixUiManager::KMLpdUnixUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMUiManager(parent,name) diff --git a/tdeprint/lpr/apshandler.cpp b/tdeprint/lpr/apshandler.cpp index 3d144644a..acb0e0c2d 100644 --- a/tdeprint/lpr/apshandler.cpp +++ b/tdeprint/lpr/apshandler.cpp @@ -31,7 +31,7 @@ #include <tqtextstream.h> #include <tqvaluestack.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <sys/types.h> diff --git a/tdeprint/lpr/editentrydialog.cpp b/tdeprint/lpr/editentrydialog.cpp index 3977f12f8..9a8f9caa2 100644 --- a/tdeprint/lpr/editentrydialog.cpp +++ b/tdeprint/lpr/editentrydialog.cpp @@ -28,7 +28,7 @@ #include <tdelistview.h> #include <tqlayout.h> #include <tqwidgetstack.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> EditEntryDialog::EditEntryDialog(PrintcapEntry *entry, TQWidget *parent, const char *name) diff --git a/tdeprint/lpr/kmconfiglpr.cpp b/tdeprint/lpr/kmconfiglpr.cpp index 8a6988188..fed1dd17d 100644 --- a/tdeprint/lpr/kmconfiglpr.cpp +++ b/tdeprint/lpr/kmconfiglpr.cpp @@ -24,7 +24,7 @@ #include <tqlabel.h> #include <tqlayout.h> #include <tqgroupbox.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> KMConfigLpr::KMConfigLpr(TQWidget *parent, const char *name) diff --git a/tdeprint/lpr/kmlprjobmanager.cpp b/tdeprint/lpr/kmlprjobmanager.cpp index 851663664..0738d17c1 100644 --- a/tdeprint/lpr/kmlprjobmanager.cpp +++ b/tdeprint/lpr/kmlprjobmanager.cpp @@ -25,7 +25,7 @@ #include "lprsettings.h" #include <tqptrlist.h> -#include <klocale.h> +#include <tdelocale.h> KMLprJobManager::KMLprJobManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMJobManager(parent, name) diff --git a/tdeprint/lpr/kmlprmanager.cpp b/tdeprint/lpr/kmlprmanager.cpp index 157105e60..046f082f7 100644 --- a/tdeprint/lpr/kmlprmanager.cpp +++ b/tdeprint/lpr/kmlprmanager.cpp @@ -30,13 +30,13 @@ #include <tqfileinfo.h> #include <tqptrlist.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <kdebug.h> #include <kprinter.h> #include <kprocess.h> #include <tdeaction.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <klibloader.h> #include <stdlib.h> diff --git a/tdeprint/lpr/kmlpruimanager.cpp b/tdeprint/lpr/kmlpruimanager.cpp index 655309e0c..b7d23bb42 100644 --- a/tdeprint/lpr/kmlpruimanager.cpp +++ b/tdeprint/lpr/kmlpruimanager.cpp @@ -29,7 +29,7 @@ #include "kmwbackend.h" #include "kmconfiglpr.h" -#include <klocale.h> +#include <tdelocale.h> KMLprUiManager::KMLprUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMUiManager(parent,name) diff --git a/tdeprint/lpr/lpchelper.cpp b/tdeprint/lpr/lpchelper.cpp index f72901865..b366537e5 100644 --- a/tdeprint/lpr/lpchelper.cpp +++ b/tdeprint/lpr/lpchelper.cpp @@ -26,7 +26,7 @@ #include <tqtextstream.h> #include <tqregexp.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprocess.h> #include <stdlib.h> diff --git a/tdeprint/lpr/lprhandler.cpp b/tdeprint/lpr/lprhandler.cpp index fcb838bb9..767b55382 100644 --- a/tdeprint/lpr/lprhandler.cpp +++ b/tdeprint/lpr/lprhandler.cpp @@ -27,7 +27,7 @@ #include <tqfile.h> #include <tqtextstream.h> #include <tqvaluestack.h> -#include <klocale.h> +#include <tdelocale.h> #include <unistd.h> diff --git a/tdeprint/lpr/lprngtoolhandler.cpp b/tdeprint/lpr/lprngtoolhandler.cpp index d3e283123..960f5adb8 100644 --- a/tdeprint/lpr/lprngtoolhandler.cpp +++ b/tdeprint/lpr/lprngtoolhandler.cpp @@ -28,7 +28,7 @@ #include <tqfile.h> #include <tqtextstream.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kstandarddirs.h> diff --git a/tdeprint/lpr/matichandler.cpp b/tdeprint/lpr/matichandler.cpp index e1242c5fc..826867cd2 100644 --- a/tdeprint/lpr/matichandler.cpp +++ b/tdeprint/lpr/matichandler.cpp @@ -29,7 +29,7 @@ #include "util.h" #include "foomatic2loader.h" -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <tdeapplication.h> #include <kdebug.h> diff --git a/tdeprint/management/kaddprinterwizard.cpp b/tdeprint/management/kaddprinterwizard.cpp index 256b85011..466c75853 100644 --- a/tdeprint/management/kaddprinterwizard.cpp +++ b/tdeprint/management/kaddprinterwizard.cpp @@ -1,9 +1,9 @@ #include "kmmanager.h" #include <tdecmdlineargs.h> #include <tdeapplication.h> -#include <kmessagebox.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdemessagebox.h> +#include <tdelocale.h> +#include <tdeglobal.h> static TDECmdLineOptions options[] = { diff --git a/tdeprint/management/kmconfigcommand.cpp b/tdeprint/management/kmconfigcommand.cpp index 32fb7db11..4cf33998f 100644 --- a/tdeprint/management/kmconfigcommand.cpp +++ b/tdeprint/management/kmconfigcommand.cpp @@ -24,7 +24,7 @@ #include <tqgroupbox.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdialog.h> KMConfigCommand::KMConfigCommand(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmconfigdialog.cpp b/tdeprint/management/kmconfigdialog.cpp index 6f0e76e19..50eabe9b1 100644 --- a/tdeprint/management/kmconfigdialog.cpp +++ b/tdeprint/management/kmconfigdialog.cpp @@ -30,7 +30,7 @@ #include "kmconfigjobs.h" #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <tdeconfig.h> diff --git a/tdeprint/management/kmconfigfilter.cpp b/tdeprint/management/kmconfigfilter.cpp index 21cbc418e..b7be0a1e6 100644 --- a/tdeprint/management/kmconfigfilter.cpp +++ b/tdeprint/management/kmconfigfilter.cpp @@ -28,7 +28,7 @@ #include <tqlabel.h> #include <tqapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kiconloader.h> #include <tdelistbox.h> diff --git a/tdeprint/management/kmconfigfonts.cpp b/tdeprint/management/kmconfigfonts.cpp index 54ebdb87c..890a42045 100644 --- a/tdeprint/management/kmconfigfonts.cpp +++ b/tdeprint/management/kmconfigfonts.cpp @@ -28,7 +28,7 @@ #include <tqsettings.h> #include <tqwhatsthis.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kiconloader.h> #include <kurlrequester.h> diff --git a/tdeprint/management/kmconfiggeneral.cpp b/tdeprint/management/kmconfiggeneral.cpp index b7c0a1522..635667cec 100644 --- a/tdeprint/management/kmconfiggeneral.cpp +++ b/tdeprint/management/kmconfiggeneral.cpp @@ -26,13 +26,13 @@ #include <tqwhatsthis.h> #include <kpushbutton.h> -#include <klocale.h> +#include <tdelocale.h> #include <kurlrequester.h> #include <krun.h> #include <kmimemagic.h> #include <tdeconfig.h> #include <knuminput.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kcursor.h> #include <klineedit.h> #include <kguiitem.h> diff --git a/tdeprint/management/kmconfigjobs.cpp b/tdeprint/management/kmconfigjobs.cpp index 667b40381..c31e525be 100644 --- a/tdeprint/management/kmconfigjobs.cpp +++ b/tdeprint/management/kmconfigjobs.cpp @@ -23,7 +23,7 @@ #include <tqlayout.h> #include <knuminput.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kdialog.h> diff --git a/tdeprint/management/kmconfigpreview.cpp b/tdeprint/management/kmconfigpreview.cpp index 3d084f735..2fdcbcb4b 100644 --- a/tdeprint/management/kmconfigpreview.cpp +++ b/tdeprint/management/kmconfigpreview.cpp @@ -24,7 +24,7 @@ #include <tqgroupbox.h> #include <tqlabel.h> -#include <klocale.h> +#include <tdelocale.h> #include <kurlrequester.h> #include <tdeconfig.h> #include <kdialog.h> diff --git a/tdeprint/management/kmdbcreator.cpp b/tdeprint/management/kmdbcreator.cpp index 2297d4034..6154ebea2 100644 --- a/tdeprint/management/kmdbcreator.cpp +++ b/tdeprint/management/kmdbcreator.cpp @@ -24,7 +24,7 @@ #include <tqprogressdialog.h> #include <tqfileinfo.h> #include <tqdir.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> #include <kstandarddirs.h> #include <kdebug.h> diff --git a/tdeprint/management/kmdriverdb.cpp b/tdeprint/management/kmdriverdb.cpp index 9eb28cf87..5a172281b 100644 --- a/tdeprint/management/kmdriverdb.cpp +++ b/tdeprint/management/kmdriverdb.cpp @@ -29,7 +29,7 @@ #include <tqfileinfo.h> #include <kstandarddirs.h> #include <tdeapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> KMDriverDB* KMDriverDB::m_self = 0; diff --git a/tdeprint/management/kmdriverdbwidget.cpp b/tdeprint/management/kmdriverdbwidget.cpp index 42d573e71..50297bdca 100644 --- a/tdeprint/management/kmdriverdbwidget.cpp +++ b/tdeprint/management/kmdriverdbwidget.cpp @@ -28,12 +28,12 @@ #include <tqcheckbox.h> #include <kcursor.h> #include <tqapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tqlayout.h> #include <tqlabel.h> #include <tqstrlist.h> -#include <klocale.h> +#include <tdelocale.h> #include <kcursor.h> #include <tdefiledialog.h> #include <kguiitem.h> diff --git a/tdeprint/management/kmdriverdialog.cpp b/tdeprint/management/kmdriverdialog.cpp index ef37e333c..c43017cc7 100644 --- a/tdeprint/management/kmdriverdialog.cpp +++ b/tdeprint/management/kmdriverdialog.cpp @@ -20,8 +20,8 @@ #include "kmdriverdialog.h" #include "driverview.h" -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> KMDriverDialog::KMDriverDialog(TQWidget *parent, const char *name) : KDialogBase(KDialogBase::Swallow,i18n("Configure"),KDialogBase::Ok|KDialogBase::Cancel,KDialogBase::Ok,parent,name,true,false) diff --git a/tdeprint/management/kminfopage.cpp b/tdeprint/management/kminfopage.cpp index 9987ccb4c..bae2b6ad6 100644 --- a/tdeprint/management/kminfopage.cpp +++ b/tdeprint/management/kminfopage.cpp @@ -23,7 +23,7 @@ #include <tqpixmap.h> #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kseparator.h> diff --git a/tdeprint/management/kminstancepage.cpp b/tdeprint/management/kminstancepage.cpp index 8c263bb48..0cadf3dba 100644 --- a/tdeprint/management/kminstancepage.cpp +++ b/tdeprint/management/kminstancepage.cpp @@ -30,10 +30,10 @@ #include <tqregexp.h> #include <tqwhatsthis.h> #include <tqpushbutton.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kinputdialog.h> #include <tdelistbox.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kstandarddirs.h> #include <kdebug.h> diff --git a/tdeprint/management/kmjobviewer.cpp b/tdeprint/management/kmjobviewer.cpp index 741e69378..98e9595f9 100644 --- a/tdeprint/management/kmjobviewer.cpp +++ b/tdeprint/management/kmjobviewer.cpp @@ -33,15 +33,15 @@ #include <tdelistview.h> #include <kstatusbar.h> #include <tqpopupmenu.h> -#include <kmessagebox.h> -#include <klocale.h> +#include <tdemessagebox.h> +#include <tdelocale.h> #include <tdepopupmenu.h> #include <tdeaction.h> #include <kstdaction.h> #include <kiconloader.h> #include <tdeapplication.h> #include <kcursor.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <kdebug.h> #include <twin.h> #include <tdeio/netaccess.h> diff --git a/tdeprint/management/kmlistview.cpp b/tdeprint/management/kmlistview.cpp index 10741d7fe..806cc0d9f 100644 --- a/tdeprint/management/kmlistview.cpp +++ b/tdeprint/management/kmlistview.cpp @@ -23,7 +23,7 @@ #include <tqheader.h> #include <tqpainter.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kcursor.h> diff --git a/tdeprint/management/kmmainview.cpp b/tdeprint/management/kmmainview.cpp index 5e68f3726..4aba92dad 100644 --- a/tdeprint/management/kmmainview.cpp +++ b/tdeprint/management/kmmainview.cpp @@ -36,15 +36,15 @@ #include "messagewindow.h" #include <tqdockarea.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tqtimer.h> #include <tqcombobox.h> #include <tqlabel.h> #include <tqlayout.h> #include <tqpopupmenu.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeaction.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <tdetoolbar.h> #include <tdetoolbarbutton.h> diff --git a/tdeprint/management/kmpages.cpp b/tdeprint/management/kmpages.cpp index 4f0f1f4f7..d0c413966 100644 --- a/tdeprint/management/kmpages.cpp +++ b/tdeprint/management/kmpages.cpp @@ -23,7 +23,7 @@ #include "kmpropertypage.h" #include "kminstancepage.h" -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kdialog.h> diff --git a/tdeprint/management/kmprinterview.cpp b/tdeprint/management/kmprinterview.cpp index 6d7edb707..d311f75c3 100644 --- a/tdeprint/management/kmprinterview.cpp +++ b/tdeprint/management/kmprinterview.cpp @@ -27,7 +27,7 @@ #include <tqlayout.h> #include <tqpopupmenu.h> #include <tdeaction.h> -#include <klocale.h> +#include <tdelocale.h> KMPrinterView::KMPrinterView(TQWidget *parent, const char *name) : TQWidgetStack(parent,name), m_type(KMPrinterView::Icons) diff --git a/tdeprint/management/kmpropbackend.cpp b/tdeprint/management/kmpropbackend.cpp index 98004d2ed..00aac2b40 100644 --- a/tdeprint/management/kmpropbackend.cpp +++ b/tdeprint/management/kmpropbackend.cpp @@ -23,7 +23,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KMPropBackend::KMPropBackend(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/management/kmpropcontainer.cpp b/tdeprint/management/kmpropcontainer.cpp index 9c7808199..c94838098 100644 --- a/tdeprint/management/kmpropcontainer.cpp +++ b/tdeprint/management/kmpropcontainer.cpp @@ -22,7 +22,7 @@ #include <kpushbutton.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kseparator.h> #include <kguiitem.h> diff --git a/tdeprint/management/kmpropdriver.cpp b/tdeprint/management/kmpropdriver.cpp index 55daf0ed5..6f20494fc 100644 --- a/tdeprint/management/kmpropdriver.cpp +++ b/tdeprint/management/kmpropdriver.cpp @@ -23,7 +23,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KMPropDriver::KMPropDriver(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/management/kmpropgeneral.cpp b/tdeprint/management/kmpropgeneral.cpp index c55603da9..6b24b0466 100644 --- a/tdeprint/management/kmpropgeneral.cpp +++ b/tdeprint/management/kmpropgeneral.cpp @@ -25,7 +25,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KMPropGeneral::KMPropGeneral(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/management/kmpropmembers.cpp b/tdeprint/management/kmpropmembers.cpp index 26671eed8..7fc4155a0 100644 --- a/tdeprint/management/kmpropmembers.cpp +++ b/tdeprint/management/kmpropmembers.cpp @@ -23,7 +23,7 @@ #include <tqtextview.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KMPropMembers::KMPropMembers(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/management/kmpropwidget.cpp b/tdeprint/management/kmpropwidget.cpp index ae8b03cbf..50c1a75e8 100644 --- a/tdeprint/management/kmpropwidget.cpp +++ b/tdeprint/management/kmpropwidget.cpp @@ -23,8 +23,8 @@ #include "kmmanager.h" #include "kmtimer.h" -#include <kmessagebox.h> -#include <klocale.h> +#include <tdemessagebox.h> +#include <tdelocale.h> KMPropWidget::KMPropWidget(TQWidget *parent, const char *name) : TQWidget(parent,name) diff --git a/tdeprint/management/kmspecialprinterdlg.cpp b/tdeprint/management/kmspecialprinterdlg.cpp index 2d2a245c7..7c4c0173d 100644 --- a/tdeprint/management/kmspecialprinterdlg.cpp +++ b/tdeprint/management/kmspecialprinterdlg.cpp @@ -34,8 +34,8 @@ #include <tqlayout.h> #include <tqwhatsthis.h> #include <tqgroupbox.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kicondialog.h> #include <tdefiledialog.h> #include <kseparator.h> diff --git a/tdeprint/management/kmwbackend.cpp b/tdeprint/management/kmwbackend.cpp index 6fd8cf2dc..b2e8fdcd4 100644 --- a/tdeprint/management/kmwbackend.cpp +++ b/tdeprint/management/kmwbackend.cpp @@ -28,7 +28,7 @@ #include <tqwhatsthis.h> #include <kcursor.h> -#include <klocale.h> +#include <tdelocale.h> #include <kseparator.h> #include <kdialog.h> #include <kdebug.h> diff --git a/tdeprint/management/kmwclass.cpp b/tdeprint/management/kmwclass.cpp index aee060e5f..e04467632 100644 --- a/tdeprint/management/kmwclass.cpp +++ b/tdeprint/management/kmwclass.cpp @@ -27,7 +27,7 @@ #include <tqlabel.h> #include <tqtoolbutton.h> #include <tdelistbox.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> KMWClass::KMWClass(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwdriver.cpp b/tdeprint/management/kmwdriver.cpp index 58793c192..9876c0420 100644 --- a/tdeprint/management/kmwdriver.cpp +++ b/tdeprint/management/kmwdriver.cpp @@ -24,7 +24,7 @@ #include "kmdriverdb.h" #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KMWDriver::KMWDriver(TQWidget *parent, const char *name) : KMWizardPage(parent,name) diff --git a/tdeprint/management/kmwdriverselect.cpp b/tdeprint/management/kmwdriverselect.cpp index f60dcface..cc52f1015 100644 --- a/tdeprint/management/kmwdriverselect.cpp +++ b/tdeprint/management/kmwdriverselect.cpp @@ -27,8 +27,8 @@ #include <tqlayout.h> #include <kpushbutton.h> #include <tdelistbox.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> KMWDriverSelect::KMWDriverSelect(TQWidget *parent, const char *name) : KMWizardPage(parent,name) diff --git a/tdeprint/management/kmwdrivertest.cpp b/tdeprint/management/kmwdrivertest.cpp index cb46a45a0..73871988a 100644 --- a/tdeprint/management/kmwdrivertest.cpp +++ b/tdeprint/management/kmwdrivertest.cpp @@ -28,9 +28,9 @@ #include <tqlabel.h> #include <kpushbutton.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kguiitem.h> #include <tdeio/netaccess.h> diff --git a/tdeprint/management/kmwend.cpp b/tdeprint/management/kmwend.cpp index 2881b4ea0..4ad564cf6 100644 --- a/tdeprint/management/kmwend.cpp +++ b/tdeprint/management/kmwend.cpp @@ -23,7 +23,7 @@ #include "util.h" #include <tqtextview.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqlayout.h> KMWEnd::KMWEnd(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwfile.cpp b/tdeprint/management/kmwfile.cpp index f3b54dcdc..58a61e8e4 100644 --- a/tdeprint/management/kmwfile.cpp +++ b/tdeprint/management/kmwfile.cpp @@ -25,7 +25,7 @@ #include <tqlayout.h> #include <kurlrequester.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdefiledialog.h> KMWFile::KMWFile(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwinfopage.cpp b/tdeprint/management/kmwinfopage.cpp index fd9e92697..175ff7e74 100644 --- a/tdeprint/management/kmwinfopage.cpp +++ b/tdeprint/management/kmwinfopage.cpp @@ -22,7 +22,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kactivelabel.h> KMWInfoPage::KMWInfoPage(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwizard.cpp b/tdeprint/management/kmwizard.cpp index 5bb86967a..bc894c478 100644 --- a/tdeprint/management/kmwizard.cpp +++ b/tdeprint/management/kmwizard.cpp @@ -26,9 +26,9 @@ #include <kpushbutton.h> #include <tqlabel.h> #include <tqwidgetstack.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kseparator.h> #include <tdeapplication.h> diff --git a/tdeprint/management/kmwlocal.cpp b/tdeprint/management/kmwlocal.cpp index ea79563ec..424e40100 100644 --- a/tdeprint/management/kmwlocal.cpp +++ b/tdeprint/management/kmwlocal.cpp @@ -23,13 +23,13 @@ #include "kmfactory.h" #include "kmmanager.h" -#include <klocale.h> +#include <tdelocale.h> #include <tqlayout.h> #include <tqlineedit.h> #include <tqlabel.h> #include <tqheader.h> #include <tdelistview.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kiconloader.h> KMWLocal::KMWLocal(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwlpd.cpp b/tdeprint/management/kmwlpd.cpp index 352a075c5..3c4794ad1 100644 --- a/tdeprint/management/kmwlpd.cpp +++ b/tdeprint/management/kmwlpd.cpp @@ -23,11 +23,11 @@ #include "kmprinter.h" #include <kurl.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqlabel.h> #include <kdebug.h> #include <tqlineedit.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kextsock.h> static bool checkLpdQueue(const char *host, const char *queue); diff --git a/tdeprint/management/kmwname.cpp b/tdeprint/management/kmwname.cpp index fe567f7bb..e8378371a 100644 --- a/tdeprint/management/kmwname.cpp +++ b/tdeprint/management/kmwname.cpp @@ -23,8 +23,8 @@ #include <tqlabel.h> #include <tqlineedit.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tqregexp.h> KMWName::KMWName(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwpassword.cpp b/tdeprint/management/kmwpassword.cpp index 8490a179c..3cd71aadd 100644 --- a/tdeprint/management/kmwpassword.cpp +++ b/tdeprint/management/kmwpassword.cpp @@ -26,7 +26,7 @@ #include <tqvbuttongroup.h> #include <tqradiobutton.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kcursor.h> #include <stdlib.h> diff --git a/tdeprint/management/kmwsmb.cpp b/tdeprint/management/kmwsmb.cpp index e76240cf8..836a7fb15 100644 --- a/tdeprint/management/kmwsmb.cpp +++ b/tdeprint/management/kmwsmb.cpp @@ -23,7 +23,7 @@ #include "kmprinter.h" #include "util.h" -#include <klocale.h> +#include <tdelocale.h> #include <kpushbutton.h> #include <tqlayout.h> #include <tqlineedit.h> diff --git a/tdeprint/management/kmwsocket.cpp b/tdeprint/management/kmwsocket.cpp index 6b8f4aae9..a3fb71b3d 100644 --- a/tdeprint/management/kmwsocket.cpp +++ b/tdeprint/management/kmwsocket.cpp @@ -26,9 +26,9 @@ #include <tqheader.h> #include <tqlineedit.h> #include <tqlabel.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kseparator.h> diff --git a/tdeprint/management/kmwsocketutil.cpp b/tdeprint/management/kmwsocketutil.cpp index a4f23959a..02b0a6b69 100644 --- a/tdeprint/management/kmwsocketutil.cpp +++ b/tdeprint/management/kmwsocketutil.cpp @@ -27,13 +27,13 @@ #include <tqlabel.h> #include <tqcombobox.h> #include <tqpushbutton.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tqlayout.h> #include <tqregexp.h> #include <knumvalidator.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <kextsock.h> #include <kdebug.h> diff --git a/tdeprint/management/kxmlcommanddlg.cpp b/tdeprint/management/kxmlcommanddlg.cpp index 2080149d9..9b165e432 100644 --- a/tdeprint/management/kxmlcommanddlg.cpp +++ b/tdeprint/management/kxmlcommanddlg.cpp @@ -38,13 +38,13 @@ #include <tqapplication.h> #include <tdelistview.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kdialogbase.h> #include <kseparator.h> #include <tdelistbox.h> #include <kmimetype.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeapplication.h> #include <kdebug.h> #include <kguiitem.h> diff --git a/tdeprint/management/kxmlcommandselector.cpp b/tdeprint/management/kxmlcommandselector.cpp index 67627fb53..08722cf6e 100644 --- a/tdeprint/management/kxmlcommandselector.cpp +++ b/tdeprint/management/kxmlcommandselector.cpp @@ -30,9 +30,9 @@ #include <tqtooltip.h> #include <tqlineedit.h> #include <kinputdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdefiledialog.h> #include <kseparator.h> #include <kguiitem.h> diff --git a/tdeprint/management/networkscanner.cpp b/tdeprint/management/networkscanner.cpp index 1943f9354..ee4e7dbc7 100644 --- a/tdeprint/management/networkscanner.cpp +++ b/tdeprint/management/networkscanner.cpp @@ -30,9 +30,9 @@ #include <tqlineedit.h> #include <tqregexp.h> #include <tqsocket.h> -#include <klocale.h> +#include <tdelocale.h> #include <kextendedsocket.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <knumvalidator.h> #include <kdebug.h> #include <unistd.h> diff --git a/tdeprint/management/smbview.cpp b/tdeprint/management/smbview.cpp index 10ac359f9..f5977bfb0 100644 --- a/tdeprint/management/smbview.cpp +++ b/tdeprint/management/smbview.cpp @@ -20,14 +20,14 @@ #include "smbview.h" #include <kprocess.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <tqheader.h> #include <tqapplication.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kcursor.h> #include <tqfile.h> diff --git a/tdeprint/management/tdeprint_management_module.cpp b/tdeprint/management/tdeprint_management_module.cpp index d15ef791f..89d315c0f 100644 --- a/tdeprint/management/tdeprint_management_module.cpp +++ b/tdeprint/management/tdeprint_management_module.cpp @@ -26,9 +26,9 @@ #include "kmprinter.h" #include "kmmainview.h" -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kdialogbase.h> -#include <klocale.h> +#include <tdelocale.h> extern "C" { diff --git a/tdeprint/marginpreview.cpp b/tdeprint/marginpreview.cpp index 2a5e21e59..45f70b7f1 100644 --- a/tdeprint/marginpreview.cpp +++ b/tdeprint/marginpreview.cpp @@ -19,7 +19,7 @@ #include "marginpreview.h" -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tqpainter.h> #include <kcursor.h> diff --git a/tdeprint/marginwidget.cpp b/tdeprint/marginwidget.cpp index 3ec1872f2..c483be123 100644 --- a/tdeprint/marginwidget.cpp +++ b/tdeprint/marginwidget.cpp @@ -27,8 +27,8 @@ #include <tqlayout.h> #include <tqlabel.h> #include <tqwhatsthis.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> MarginWidget::MarginWidget(TQWidget *parent, const char* name, bool allowMetricUnit) : TQWidget(parent, name), m_default(4, 0), m_pagesize( 2 ) diff --git a/tdeprint/plugincombobox.cpp b/tdeprint/plugincombobox.cpp index 9ccfc8074..b2a686f6e 100644 --- a/tdeprint/plugincombobox.cpp +++ b/tdeprint/plugincombobox.cpp @@ -24,7 +24,7 @@ #include <tqcombobox.h> #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqwhatsthis.h> PluginComboBox::PluginComboBox(TQWidget *parent, const char *name) diff --git a/tdeprint/posterpreview.cpp b/tdeprint/posterpreview.cpp index b76c0181a..0839af3d7 100644 --- a/tdeprint/posterpreview.cpp +++ b/tdeprint/posterpreview.cpp @@ -25,9 +25,9 @@ #include <tqtimer.h> #include <tqpixmap.h> #include <kprinter.h> -#include <klocale.h> +#include <tdelocale.h> #include <kcursor.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> PosterPreview::PosterPreview( TQWidget *parent, const char *name ) : TQFrame( parent, name ) diff --git a/tdeprint/ppdloader.cpp b/tdeprint/ppdloader.cpp index dcf272b0a..b829e2e17 100644 --- a/tdeprint/ppdloader.cpp +++ b/tdeprint/ppdloader.cpp @@ -23,7 +23,7 @@ #include <kfilterdev.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqfile.h> #include <math.h> diff --git a/tdeprint/printerfilter.cpp b/tdeprint/printerfilter.cpp index d1889dd1c..4fc362350 100644 --- a/tdeprint/printerfilter.cpp +++ b/tdeprint/printerfilter.cpp @@ -22,7 +22,7 @@ #include "kmfactory.h" #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> PrinterFilter::PrinterFilter(TQObject *parent, const char *name) diff --git a/tdeprint/rlpr/kmconfigproxy.cpp b/tdeprint/rlpr/kmconfigproxy.cpp index 78513dad3..d41adcdee 100644 --- a/tdeprint/rlpr/kmconfigproxy.cpp +++ b/tdeprint/rlpr/kmconfigproxy.cpp @@ -21,7 +21,7 @@ #include "kmproxywidget.h" #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KMConfigProxy::KMConfigProxy(TQWidget *parent) : KMConfigPage(parent,"Proxy") diff --git a/tdeprint/rlpr/kmproprlpr.cpp b/tdeprint/rlpr/kmproprlpr.cpp index 62fe97827..08713a784 100644 --- a/tdeprint/rlpr/kmproprlpr.cpp +++ b/tdeprint/rlpr/kmproprlpr.cpp @@ -23,7 +23,7 @@ #include <tqlabel.h> #include <tqlayout.h> -#include <klocale.h> +#include <tdelocale.h> KMPropRlpr::KMPropRlpr(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/rlpr/kmproxywidget.cpp b/tdeprint/rlpr/kmproxywidget.cpp index a2a3e6a85..870da43c4 100644 --- a/tdeprint/rlpr/kmproxywidget.cpp +++ b/tdeprint/rlpr/kmproxywidget.cpp @@ -24,7 +24,7 @@ #include <tqcheckbox.h> #include <tqlayout.h> #include <tqvalidator.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kcursor.h> diff --git a/tdeprint/rlpr/kmrlprmanager.cpp b/tdeprint/rlpr/kmrlprmanager.cpp index c6704ed09..7b8ceac2d 100644 --- a/tdeprint/rlpr/kmrlprmanager.cpp +++ b/tdeprint/rlpr/kmrlprmanager.cpp @@ -26,7 +26,7 @@ #include <tqmap.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> KMRlprManager::KMRlprManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMManager(parent,name) diff --git a/tdeprint/rlpr/kmrlpruimanager.cpp b/tdeprint/rlpr/kmrlpruimanager.cpp index 9bae2cdc4..fa6383962 100644 --- a/tdeprint/rlpr/kmrlpruimanager.cpp +++ b/tdeprint/rlpr/kmrlpruimanager.cpp @@ -26,7 +26,7 @@ #include "kmproprlpr.h" #include "kmconfigproxy.h" -#include <klocale.h> +#include <tdelocale.h> KMRlprUiManager::KMRlprUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMUiManager(parent,name) diff --git a/tdeprint/rlpr/kmwrlpr.cpp b/tdeprint/rlpr/kmwrlpr.cpp index 79682b91a..056cba1f0 100644 --- a/tdeprint/rlpr/kmwrlpr.cpp +++ b/tdeprint/rlpr/kmwrlpr.cpp @@ -29,7 +29,7 @@ #include <tqlineedit.h> #include <tqheader.h> #include <tdelistview.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> static TQListViewItem* rlpr_findChild(TQListViewItem *c, const TQString& txt) diff --git a/tdeprint/rlpr/krlprprinterimpl.cpp b/tdeprint/rlpr/krlprprinterimpl.cpp index 8ca1c6569..4ef5ebe1e 100644 --- a/tdeprint/rlpr/krlprprinterimpl.cpp +++ b/tdeprint/rlpr/krlprprinterimpl.cpp @@ -26,7 +26,7 @@ #include <tqfile.h> #include <kstandarddirs.h> #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> KRlprPrinterImpl::KRlprPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/) : KPrinterImpl(parent,name) diff --git a/tdeprint/tdefilelist.cpp b/tdeprint/tdefilelist.cpp index 19ffb481b..bf2fb3d12 100644 --- a/tdeprint/tdefilelist.cpp +++ b/tdeprint/tdefilelist.cpp @@ -29,7 +29,7 @@ #include <tdeio/netaccess.h> #include <kurldrag.h> #include <tdefiledialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <tdelistview.h> #include <krun.h> diff --git a/tdeprint/tdeprintd.cpp b/tdeprint/tdeprintd.cpp index 5080cc40c..9b7b6c955 100644 --- a/tdeprint/tdeprintd.cpp +++ b/tdeprint/tdeprintd.cpp @@ -21,9 +21,9 @@ #include "kprintprocess.h" #include <tqfile.h> -#include <klocale.h> +#include <tdelocale.h> #include <knotifyclient.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kdebug.h> #include <dcopclient.h> #include <tdeio/passdlg.h> diff --git a/tdeprint/tests/helpwindow.cpp b/tdeprint/tests/helpwindow.cpp index 11cf22fd2..54d160c73 100644 --- a/tdeprint/tests/helpwindow.cpp +++ b/tdeprint/tests/helpwindow.cpp @@ -13,7 +13,7 @@ #include <tqstatusbar.h> #include <tqpixmap.h> #include <tqpopupmenu.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdetoolbar.h> #include <kstatusbar.h> #include <tqtoolbutton.h> diff --git a/tdeprint/tools/escputil/escpwidget.cpp b/tdeprint/tools/escputil/escpwidget.cpp index de54f2de1..9afff64ac 100644 --- a/tdeprint/tools/escputil/escpwidget.cpp +++ b/tdeprint/tools/escputil/escpwidget.cpp @@ -25,8 +25,8 @@ #include <tqcheckbox.h> #include <tqaccel.h> #include <kdemacros.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kstandarddirs.h> #include <kiconloader.h> #include <kdialogbase.h> diff --git a/tdeprint/util.h b/tdeprint/util.h index dafcdaa90..75811aee6 100644 --- a/tdeprint/util.h +++ b/tdeprint/util.h @@ -23,7 +23,7 @@ #include "kprinter.h" #include <tqstring.h> #include <kurl.h> -#include <klocale.h> +#include <tdelocale.h> KURL smbToUrl(const TQString& work, const TQString& server, const TQString& printer); void urlToSmb(const KURL& url, TQString& work, TQString& server, TQString& printer); diff --git a/tderandr/ktimerdialog.cpp b/tderandr/ktimerdialog.cpp index 0be416be7..eba497372 100644 --- a/tderandr/ktimerdialog.cpp +++ b/tderandr/ktimerdialog.cpp @@ -29,7 +29,7 @@ #include <twin.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include "ktimerdialog.h" diff --git a/tderandr/libtderandr.cc b/tderandr/libtderandr.cc index 976b156ac..fe9461715 100644 --- a/tderandr/libtderandr.cc +++ b/tderandr/libtderandr.cc @@ -26,8 +26,8 @@ #include <tqtimer.h> #include <tqstringlist.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tdeapplication.h> #include <stdlib.h> diff --git a/tderandr/randr.cpp b/tderandr/randr.cpp index 68bfc2e68..59fd0e8ae 100644 --- a/tderandr/randr.cpp +++ b/tderandr/randr.cpp @@ -22,8 +22,8 @@ #include <tqtimer.h> #include <kdebug.h> -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <tdeapplication.h> #include <kiconloader.h> #include <dcopclient.h> diff --git a/tderesources/configdialog.cpp b/tderesources/configdialog.cpp index b6d29dcd3..4eb528835 100644 --- a/tderesources/configdialog.cpp +++ b/tderesources/configdialog.cpp @@ -21,9 +21,9 @@ Boston, MA 02110-1301, USA. */ -#include <klocale.h> +#include <tdelocale.h> #include <klineedit.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tqgroupbox.h> #include <tqlabel.h> diff --git a/tderesources/configpage.cpp b/tderesources/configpage.cpp index e70332c71..8378707e6 100644 --- a/tderesources/configpage.cpp +++ b/tderesources/configpage.cpp @@ -28,8 +28,8 @@ #include <tdeapplication.h> #include <kcombobox.h> #include <kdebug.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> #include <kurlrequester.h> diff --git a/tderesources/factory.cpp b/tderesources/factory.cpp index 09140e7b7..eea2d3673 100644 --- a/tderesources/factory.cpp +++ b/tderesources/factory.cpp @@ -22,7 +22,7 @@ */ #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <ksimpleconfig.h> #include <kstandarddirs.h> #include <kstaticdeleter.h> diff --git a/tderesources/kcmtderesources.cpp b/tderesources/kcmtderesources.cpp index 1b779fabd..c3d5ae09e 100644 --- a/tderesources/kcmtderesources.cpp +++ b/tderesources/kcmtderesources.cpp @@ -23,7 +23,7 @@ #include <tdeaboutdata.h> #include <kgenericfactory.h> -#include <klocale.h> +#include <tdelocale.h> #include "configpage.h" diff --git a/tderesources/resource.cpp b/tderesources/resource.cpp index 41c08767e..e6fc4ebbd 100644 --- a/tderesources/resource.cpp +++ b/tderesources/resource.cpp @@ -24,7 +24,7 @@ #include <kdebug.h> #include <tdeapplication.h> #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> #include "resource.h" using namespace KRES; diff --git a/tderesources/selectdialog.cpp b/tderesources/selectdialog.cpp index c50bd36fd..c8009ae47 100644 --- a/tderesources/selectdialog.cpp +++ b/tderesources/selectdialog.cpp @@ -23,8 +23,8 @@ #include <kbuttonbox.h> #include <tdelistbox.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tqgroupbox.h> #include <tqlayout.h> diff --git a/tdersync/rsyncconfigdialog.cpp b/tdersync/rsyncconfigdialog.cpp index 78df9e335..675044140 100644 --- a/tdersync/rsyncconfigdialog.cpp +++ b/tdersync/rsyncconfigdialog.cpp @@ -71,13 +71,13 @@ #include <tqbuttongroup.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kinstance.h> #include <twin.h> #include <tdeaction.h> #include <tdepopupmenu.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kiconloader.h> #include <kprogressbox.h> #include <kpassdlg.h> diff --git a/tdersync/tdersync.h b/tdersync/tdersync.h index a4908fe63..b57c350a4 100644 --- a/tdersync/tdersync.h +++ b/tdersync/tdersync.h @@ -49,14 +49,14 @@ #include <tqtimer.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kinstance.h> #include <twin.h> #include <kurl.h> #include <tdeaction.h> #include <tdepopupmenu.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kiconloader.h> #include <kprogressbox.h> #include <kpassdlg.h> diff --git a/tdespell2/settings.cpp b/tdespell2/settings.cpp index 57535b85c..a23fb062f 100644 --- a/tdespell2/settings.cpp +++ b/tdespell2/settings.cpp @@ -23,8 +23,8 @@ #include "broker.h" -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kdebug.h> diff --git a/tdespell2/ui/configdialog.cpp b/tdespell2/ui/configdialog.cpp index 56e39ca2b..288d62a29 100644 --- a/tdespell2/ui/configdialog.cpp +++ b/tdespell2/ui/configdialog.cpp @@ -21,7 +21,7 @@ #include "configdialog.h" #include "configwidget.h" -#include <klocale.h> +#include <tdelocale.h> #include <tqvbox.h> diff --git a/tdespell2/ui/configwidget.cpp b/tdespell2/ui/configwidget.cpp index 6d98955ae..2317f7307 100644 --- a/tdespell2/ui/configwidget.cpp +++ b/tdespell2/ui/configwidget.cpp @@ -26,7 +26,7 @@ #include <keditlistbox.h> #include <kcombobox.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqcheckbox.h> #include <tqlayout.h> diff --git a/tdespell2/ui/dialog.cpp b/tdespell2/ui/dialog.cpp index a0ff36c01..0c45f3cd1 100644 --- a/tdespell2/ui/dialog.cpp +++ b/tdespell2/ui/dialog.cpp @@ -28,7 +28,7 @@ #include "settings.h" #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <tqlistview.h> diff --git a/tdesu/ssh.cpp b/tdesu/ssh.cpp index f45b38e7e..c23ca459b 100644 --- a/tdesu/ssh.cpp +++ b/tdesu/ssh.cpp @@ -32,7 +32,7 @@ #include <tqcstring.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include "ssh.h" diff --git a/tdesu/su.cpp b/tdesu/su.cpp index d75970dd8..e29288ab9 100644 --- a/tdesu/su.cpp +++ b/tdesu/su.cpp @@ -35,7 +35,7 @@ #include <tdeconfig.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include "su.h" diff --git a/tdeui/CMakeLists.txt b/tdeui/CMakeLists.txt index 85d2fc9b4..8cff8df1c 100644 --- a/tdeui/CMakeLists.txt +++ b/tdeui/CMakeLists.txt @@ -43,7 +43,7 @@ install( FILES kcolordialog.h tdeselect.h kdatepik.h kdatepicker.h kdatetbl.h tdefontdialog.h tdepopupmenu.h tdefontrequester.h ktabctl.h kstatusbar.h - tdemainwindow.h tdemainwindowiface.h tdetoolbar.h kmenubar.h + tdemainwindow.h tdemainwindowiface.h tdetoolbar.h tdemenubar.h knuminput.h kseparator.h klineedit.h krestrictedline.h kcolorbutton.h kcolorbtn.h ksystemtray.h kdockwindow.h kbuttonbox.h @@ -54,7 +54,7 @@ install( FILES kcharselect.h kcolordrag.h qxembed.h knumvalidator.h kdialog.h kdialogbase.h kjanuswidget.h tdeaboutdialog.h - kauthicon.h kmessagebox.h ksharedpixmap.h + kauthicon.h tdemessagebox.h ksharedpixmap.h kdualcolorbtn.h kdualcolorbutton.h tdetoolbarbutton.h tdetoolbarradiogroup.h ktextbrowser.h tdeaction.h tdeactioncollection.h tdeactionclasses.h khelpmenu.h kswitchlanguagedialog.h @@ -103,7 +103,7 @@ set( ${target}_SRCS qxembed.cpp ksharedpixmap.cpp kpixmapio.cpp tdepopupmenu.cpp tdetoolbar.cpp tdeaction.cpp kstdaction.cpp tdeactioncollection.cpp tdeactionclasses.cpp - kurllabel.cpp kmenubar.cpp kinputdialog.cpp + kurllabel.cpp tdemenubar.cpp kinputdialog.cpp knuminput.cpp klineedit.cpp tdelistview.cpp kprogress.cpp kprogressbox.cpp kcolordialog.cpp tdeselect.cpp kdatepicker.cpp kdatetbl.cpp tdefontrequester.cpp tdefontdialog.cpp ktabctl.cpp @@ -118,7 +118,7 @@ set( ${target}_SRCS kcharselect.cpp kcolordrag.cpp knumvalidator.cpp kdialog.cpp kdialogbase.cpp kjanuswidget.cpp tdeaboutdialog.cpp - kauthicon.cpp kmessagebox.cpp kdualcolorbutton.cpp + kauthicon.cpp tdemessagebox.cpp kdualcolorbutton.cpp tdetoolbarradiogroup.cpp tdetoolbarbutton.cpp ktextbrowser.cpp khelpmenu.cpp kswitchlanguagedialog.cpp kcmenumngr.cpp kpanelmenu.cpp diff --git a/tdeui/MAINTAINERS b/tdeui/MAINTAINERS index f4e2165fb..2caa911a2 100644 --- a/tdeui/MAINTAINERS +++ b/tdeui/MAINTAINERS @@ -54,8 +54,8 @@ tdelistbox.cpp tdelistview.cpp tdemainwindow.cpp tdemainwindowiface.cpp -kmenubar.cpp -kmessagebox.cpp Waldo Bastian <bastian@kde.org> +tdemenubar.cpp +tdemessagebox.cpp Waldo Bastian <bastian@kde.org> knuminput.cpp Dirk Mueller <mueller@kde.org> knumvalidator.cpp kpanelapplet.cpp diff --git a/tdeui/Makefile.am b/tdeui/Makefile.am index 26a9423cd..eac8cde0e 100644 --- a/tdeui/Makefile.am +++ b/tdeui/Makefile.am @@ -40,7 +40,7 @@ include_HEADERS = kprogressbox.h kprogress.h kcolordlg.h \ kcolordialog.h tdeselect.h \ kdatepik.h kdatepicker.h kdatetbl.h tdefontdialog.h tdepopupmenu.h \ tdefontrequester.h ktabctl.h kstatusbar.h \ - tdemainwindow.h tdemainwindowiface.h tdetoolbar.h kmenubar.h \ + tdemainwindow.h tdemainwindowiface.h tdetoolbar.h tdemenubar.h \ knuminput.h kseparator.h klineedit.h \ krestrictedline.h kcolorbutton.h kcolorbtn.h \ ksystemtray.h kdockwindow.h kbuttonbox.h \ @@ -51,7 +51,7 @@ include_HEADERS = kprogressbox.h kprogress.h kcolordlg.h \ kcharselect.h kcolordrag.h qxembed.h \ knumvalidator.h kdialog.h kdialogbase.h \ kjanuswidget.h tdeaboutdialog.h \ - kauthicon.h kmessagebox.h ksharedpixmap.h \ + kauthicon.h tdemessagebox.h ksharedpixmap.h \ kdualcolorbtn.h kdualcolorbutton.h tdetoolbarbutton.h \ tdetoolbarradiogroup.h ktextbrowser.h \ tdeaction.h tdeactioncollection.h tdeactionclasses.h khelpmenu.h kswitchlanguagedialog.h \ @@ -84,7 +84,7 @@ libtdeui_la_SOURCES = \ qxembed.cpp ksharedpixmap.cpp kpixmapio.cpp \ tdepopupmenu.cpp tdetoolbar.cpp tdeaction.cpp kstdaction.cpp \ tdeactioncollection.cpp tdeactionclasses.cpp \ - kurllabel.cpp kmenubar.cpp kinputdialog.cpp \ + kurllabel.cpp tdemenubar.cpp kinputdialog.cpp \ knuminput.cpp klineedit.cpp tdelistview.cpp kprogress.cpp \ kprogressbox.cpp kcolordialog.cpp tdeselect.cpp kdatepicker.cpp \ kdatetbl.cpp tdefontrequester.cpp tdefontdialog.cpp ktabctl.cpp \ @@ -99,7 +99,7 @@ libtdeui_la_SOURCES = \ kcharselect.cpp kcolordrag.cpp \ knumvalidator.cpp kdialog.cpp kdialogbase.cpp \ kjanuswidget.cpp tdeaboutdialog.cpp \ - kauthicon.cpp kmessagebox.cpp kdualcolorbutton.cpp \ + kauthicon.cpp tdemessagebox.cpp kdualcolorbutton.cpp \ tdetoolbarradiogroup.cpp tdetoolbarbutton.cpp \ ktextbrowser.cpp khelpmenu.cpp kswitchlanguagedialog.cpp \ kcmenumngr.cpp kpanelmenu.cpp \ diff --git a/tdeui/kauthicon.cpp b/tdeui/kauthicon.cpp index d4c18a114..d45217d9b 100644 --- a/tdeui/kauthicon.cpp +++ b/tdeui/kauthicon.cpp @@ -25,7 +25,7 @@ #include <tqlabel.h> #include <tqtimer.h> -#include <klocale.h> +#include <tdelocale.h> #include "kauthicon.h" diff --git a/tdeui/kbugreport.cpp b/tdeui/kbugreport.cpp index 91c6aa66c..3e49e112c 100644 --- a/tdeui/kbugreport.cpp +++ b/tdeui/kbugreport.cpp @@ -31,8 +31,8 @@ #include <tdeconfig.h> #include <kdebug.h> #include <klineedit.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kprocess.h> #include <kstandarddirs.h> #include <kstdguiitem.h> @@ -50,7 +50,7 @@ #include "kdepackages.h" #include <kcombobox.h> #include <config.h> -#include <ktempfile.h> +#include <tdetempfile.h> #include <tqtextstream.h> #include <tqfile.h> diff --git a/tdeui/kbuttonbox.cpp b/tdeui/kbuttonbox.cpp index 6351c512d..faa26e95e 100644 --- a/tdeui/kbuttonbox.cpp +++ b/tdeui/kbuttonbox.cpp @@ -50,7 +50,7 @@ */ #include "kbuttonbox.moc" -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kguiitem.h> #include <kpushbutton.h> #include <tqptrlist.h> diff --git a/tdeui/kcharselect.cpp b/tdeui/kcharselect.cpp index a623b3efa..5561e5883 100644 --- a/tdeui/kcharselect.cpp +++ b/tdeui/kcharselect.cpp @@ -40,7 +40,7 @@ #include <kdebug.h> #include <kdialog.h> #include <klineedit.h> -#include <klocale.h> +#include <tdelocale.h> class KCharSelect::KCharSelectPrivate { diff --git a/tdeui/kcmenumngr.cpp b/tdeui/kcmenumngr.cpp index b0f261890..60e250575 100644 --- a/tdeui/kcmenumngr.cpp +++ b/tdeui/kcmenumngr.cpp @@ -21,7 +21,7 @@ #include <tqwidget.h> #include <tqpopupmenu.h> #include "kcmenumngr.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "tdeconfig.h" #include "tdeshortcut.h" diff --git a/tdeui/kcolorbutton.cpp b/tdeui/kcolorbutton.cpp index 993530497..5a42406a0 100644 --- a/tdeui/kcolorbutton.cpp +++ b/tdeui/kcolorbutton.cpp @@ -25,7 +25,7 @@ #include <tqapplication.h> #include <tqclipboard.h> #include <tqstyle.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdestdaccel.h> #include "kcolordialog.h" #include "kcolorbutton.h" diff --git a/tdeui/kcolorcombo.cpp b/tdeui/kcolorcombo.cpp index 7e9353cf4..87d5de32a 100644 --- a/tdeui/kcolorcombo.cpp +++ b/tdeui/kcolorcombo.cpp @@ -46,12 +46,12 @@ #include <tdeapplication.h> #include <tdeconfig.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kiconloader.h> #include <tdelistbox.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kseparator.h> #include <kpalette.h> #include <kimageeffect.h> diff --git a/tdeui/kcolordialog.cpp b/tdeui/kcolordialog.cpp index 29292f960..458fb50a8 100644 --- a/tdeui/kcolordialog.cpp +++ b/tdeui/kcolordialog.cpp @@ -47,13 +47,13 @@ #include <tdeapplication.h> #include <tdeconfig.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kiconloader.h> #include <klineedit.h> #include <tdelistbox.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kseparator.h> #include <kpalette.h> #include <kimageeffect.h> diff --git a/tdeui/kcombobox.cpp b/tdeui/kcombobox.cpp index 3ddb4390b..cfef5fd5b 100644 --- a/tdeui/kcombobox.cpp +++ b/tdeui/kcombobox.cpp @@ -31,7 +31,7 @@ #include <kicontheme.h> #include <tdelistviewsearchline.h> #include <klineedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <knotifyclient.h> #include <kpixmapprovider.h> #include <tdestdaccel.h> diff --git a/tdeui/kcommand.cpp b/tdeui/kcommand.cpp index e039a03ca..994d1262e 100644 --- a/tdeui/kcommand.cpp +++ b/tdeui/kcommand.cpp @@ -23,7 +23,7 @@ #include <tdestdaccel.h> #include <kstdaction.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdepopupmenu.h> KCommand::~KCommand() diff --git a/tdeui/kcursor.cpp b/tdeui/kcursor.cpp index 3cc224f4a..17f523d86 100644 --- a/tdeui/kcursor.cpp +++ b/tdeui/kcursor.cpp @@ -30,7 +30,7 @@ #include <tqtimer.h> #include <tqwidget.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <tqscrollview.h> diff --git a/tdeui/kdatepicker.cpp b/tdeui/kdatepicker.cpp index 98d72030d..99f1ce4af 100644 --- a/tdeui/kdatepicker.cpp +++ b/tdeui/kdatepicker.cpp @@ -32,10 +32,10 @@ #include <tqtimer.h> #include "kdatepicker.h" -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeapplication.h> #include <kdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <tdetoolbar.h> #include <klineedit.h> diff --git a/tdeui/kdatetbl.cpp b/tdeui/kdatetbl.cpp index 542f89f08..56edf9a5c 100644 --- a/tdeui/kdatetbl.cpp +++ b/tdeui/kdatetbl.cpp @@ -33,11 +33,11 @@ // dateSelected(TQDate) #include <tdeconfig.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <tdeapplication.h> #include <tdeaccel.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <knotifyclient.h> #include <kcalendarsystem.h> diff --git a/tdeui/kdatewidget.cpp b/tdeui/kdatewidget.cpp index 2f240a256..e9185a9c1 100644 --- a/tdeui/kdatewidget.cpp +++ b/tdeui/kdatewidget.cpp @@ -23,8 +23,8 @@ #include <tqlineedit.h> #include "knuminput.h" -#include "kglobal.h" -#include "klocale.h" +#include "tdeglobal.h" +#include "tdelocale.h" #include "kcalendarsystem.h" //#include "kdatepicker.h" #include "kdialog.h" diff --git a/tdeui/kdialog.cpp b/tdeui/kdialog.cpp index f6b2b8b56..86f7f7476 100644 --- a/tdeui/kdialog.cpp +++ b/tdeui/kdialog.cpp @@ -25,8 +25,8 @@ #include <kdebug.h> #include <kstaticdeleter.h> #include <kiconloader.h> -#include <kglobalsettings.h> -#include <klocale.h> +#include <tdeglobalsettings.h> +#include <tdelocale.h> #include <tqlayout.h> #include <tqobjectlist.h> diff --git a/tdeui/kdialogbase.cpp b/tdeui/kdialogbase.cpp index 6656d6803..890f79179 100644 --- a/tdeui/kdialogbase.cpp +++ b/tdeui/kdialogbase.cpp @@ -34,11 +34,11 @@ #include <tqfocusdata.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kiconloader.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kseparator.h> #include <kurllabel.h> #include <kdebug.h> diff --git a/tdeui/kdockwidget.cpp b/tdeui/kdockwidget.cpp index a761f43c6..bf99c6801 100644 --- a/tdeui/kdockwidget.cpp +++ b/tdeui/kdockwidget.cpp @@ -34,13 +34,13 @@ #ifndef NO_KDE2 #include <tdeconfig.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <tdetoolbar.h> #include <tdepopupmenu.h> #include <twin.h> #include <kdebug.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include "config.h" #ifdef Q_WS_X11 diff --git a/tdeui/kdualcolorbutton.cpp b/tdeui/kdualcolorbutton.cpp index f0cd5cae1..532e4aaaa 100644 --- a/tdeui/kdualcolorbutton.cpp +++ b/tdeui/kdualcolorbutton.cpp @@ -21,7 +21,7 @@ #include "kcolordrag.h" #include "dcolorarrow.xbm" #include "dcolorreset.xpm" -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tqpainter.h> #include <tqbitmap.h> #include <tqdrawutil.h> diff --git a/tdeui/keditcl1.cpp b/tdeui/keditcl1.cpp index 37cee99fb..a550a7af1 100644 --- a/tdeui/keditcl1.cpp +++ b/tdeui/keditcl1.cpp @@ -29,8 +29,8 @@ #include <kdebug.h> #include <kcmenumngr.h> #include <tdefontdialog.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tdestdaccel.h> #include <kurldrag.h> diff --git a/tdeui/keditcl2.cpp b/tdeui/keditcl2.cpp index a7db92555..4749a471f 100644 --- a/tdeui/keditcl2.cpp +++ b/tdeui/keditcl2.cpp @@ -34,9 +34,9 @@ #include <tdeapplication.h> #include <kcombobox.h> #include <knuminput.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <knotifyclient.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdebug.h> #include <kiconloader.h> diff --git a/tdeui/keditlistbox.cpp b/tdeui/keditlistbox.cpp index 1a31bbaa4..6f22b091a 100644 --- a/tdeui/keditlistbox.cpp +++ b/tdeui/keditlistbox.cpp @@ -30,7 +30,7 @@ #include <kdebug.h> #include <kdialog.h> #include <klineedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> #include <knotifyclient.h> diff --git a/tdeui/kedittoolbar.cpp b/tdeui/kedittoolbar.cpp index e1abdc875..639b22926 100644 --- a/tdeui/kedittoolbar.cpp +++ b/tdeui/kedittoolbar.cpp @@ -33,11 +33,11 @@ #include <tdeaction.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> #include <kicontheme.h> #include <kiconloader.h> #include <kinstance.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kxmlguifactory.h> #include <kseparator.h> #include <tdeconfig.h> diff --git a/tdeui/kguiitem.h b/tdeui/kguiitem.h index bb1233de3..538275f3d 100644 --- a/tdeui/kguiitem.h +++ b/tdeui/kguiitem.h @@ -27,7 +27,7 @@ #include <tqpixmap.h> #include <tqvaluelist.h> #include <kicontheme.h> -#include <kglobal.h> +#include <tdeglobal.h> /** * @short An abstract class for GUI data such as ToolTip and Icon. diff --git a/tdeui/khelpmenu.cpp b/tdeui/khelpmenu.cpp index 41fa063c2..08755b860 100644 --- a/tdeui/khelpmenu.cpp +++ b/tdeui/khelpmenu.cpp @@ -36,8 +36,8 @@ #include <kdialogbase.h> #include <khelpmenu.h> #include <kiconloader.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tdepopupmenu.h> #include <tdestdaccel.h> #include <kstdaction.h> diff --git a/tdeui/kiconview.cpp b/tdeui/kiconview.cpp index bcf9550b4..7273cbe13 100644 --- a/tdeui/kiconview.cpp +++ b/tdeui/kiconview.cpp @@ -27,8 +27,8 @@ #include "kwordwrap.h" #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <tdeapplication.h> #include <kipc.h> diff --git a/tdeui/kiconviewsearchline.cpp b/tdeui/kiconviewsearchline.cpp index 33df94a6a..7082fc910 100644 --- a/tdeui/kiconviewsearchline.cpp +++ b/tdeui/kiconviewsearchline.cpp @@ -27,7 +27,7 @@ #include "kiconviewsearchline.h" #include <tqiconview.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqtimer.h> #include <kdebug.h> diff --git a/tdeui/kjanuswidget.cpp b/tdeui/kjanuswidget.cpp index e9dd9df85..c3a8838e9 100644 --- a/tdeui/kjanuswidget.cpp +++ b/tdeui/kjanuswidget.cpp @@ -35,9 +35,9 @@ #include <tdeapplication.h> #include <kdialog.h> // Access to some static members -#include <klocale.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdelocale.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kseparator.h> #include <kdebug.h> #include "kjanuswidget.h" diff --git a/tdeui/kkeybutton.cpp b/tdeui/kkeybutton.cpp index 24191aa45..9b530b751 100644 --- a/tdeui/kkeybutton.cpp +++ b/tdeui/kkeybutton.cpp @@ -27,7 +27,7 @@ #include <tdeapplication.h> #include <kdebug.h> #include <kglobalaccel.h> -#include <klocale.h> +#include <tdelocale.h> #include "config.h" #ifdef Q_WS_X11 diff --git a/tdeui/kkeydialog.cpp b/tdeui/kkeydialog.cpp index 7faad35c4..35fe0e45f 100644 --- a/tdeui/kkeydialog.cpp +++ b/tdeui/kkeydialog.cpp @@ -42,12 +42,12 @@ #include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kglobalaccel.h> #include <kiconloader.h> #include <tdelistviewsearchline.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tdeshortcut.h> #include <tdeshortcutlist.h> #include <kxmlguifactory.h> diff --git a/tdeui/klineedit.cpp b/tdeui/klineedit.cpp index a1c05aaab..588746ec1 100644 --- a/tdeui/klineedit.cpp +++ b/tdeui/klineedit.cpp @@ -32,7 +32,7 @@ #include <tdeconfig.h> #include <tqtooltip.h> #include <kcursor.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdestdaccel.h> #include <tdepopupmenu.h> #include <kdebug.h> diff --git a/tdeui/klineeditdlg.cpp b/tdeui/klineeditdlg.cpp index ca4fd8266..8fc0a9a4f 100644 --- a/tdeui/klineeditdlg.cpp +++ b/tdeui/klineeditdlg.cpp @@ -27,7 +27,7 @@ #include <tqfiledialog.h> #include <kbuttonbox.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> #include <klineedit.h> #include <kstdguiitem.h> diff --git a/tdeui/kmenubar.cpp b/tdeui/kmenubar.cpp index 71158370b..0a5fe0188 100644 --- a/tdeui/kmenubar.cpp +++ b/tdeui/kmenubar.cpp @@ -33,10 +33,10 @@ #include <tqtimer.h> #include <tdeconfig.h> -#include <kglobalsettings.h> -#include <kmenubar.h> +#include <tdeglobalsettings.h> +#include <tdemenubar.h> #include <tdeapplication.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <kmanagerselection.h> @@ -568,4 +568,4 @@ void KMenuBar::drawContents( TQPainter* p ) void KMenuBar::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } -#include "kmenubar.moc" +#include "tdemenubar.moc" diff --git a/tdeui/kmessagebox.cpp b/tdeui/kmessagebox.cpp index 5684c6484..3208e94d8 100644 --- a/tdeui/kmessagebox.cpp +++ b/tdeui/kmessagebox.cpp @@ -37,13 +37,13 @@ #include <kdialogbase.h> #include <kguiitem.h> #include <tdelistbox.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <knotifyclient.h> #include <kstdguiitem.h> #include <kactivelabel.h> #include <kiconloader.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #ifdef Q_WS_X11 #include <X11/Xlib.h> diff --git a/tdeui/knuminput.cpp b/tdeui/knuminput.cpp index f6c3d9dd7..40f87da29 100644 --- a/tdeui/knuminput.cpp +++ b/tdeui/knuminput.cpp @@ -44,8 +44,8 @@ #include <tqspinbox.h> #include <tqstyle.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kdebug.h> #include "kdialog.h" diff --git a/tdeui/knumvalidator.cpp b/tdeui/knumvalidator.cpp index ce5c66842..6cf486ad1 100644 --- a/tdeui/knumvalidator.cpp +++ b/tdeui/knumvalidator.cpp @@ -26,8 +26,8 @@ #include <tqstring.h> #include "knumvalidator.h" -#include <klocale.h> -#include <kglobal.h> +#include <tdelocale.h> +#include <tdeglobal.h> #include <kdebug.h> /////////////////////////////////////////////////////////////// diff --git a/tdeui/kpanelmenu.cpp b/tdeui/kpanelmenu.cpp index 184e83422..287208b66 100644 --- a/tdeui/kpanelmenu.cpp +++ b/tdeui/kpanelmenu.cpp @@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <tqtimer.h> diff --git a/tdeui/kpassdlg.cpp b/tdeui/kpassdlg.cpp index 302b4e679..64904c581 100644 --- a/tdeui/kpassdlg.cpp +++ b/tdeui/kpassdlg.cpp @@ -34,12 +34,12 @@ #include <tqptrdict.h> #include <tqtimer.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <tdeaboutdialog.h> #include <tdeconfig.h> #include <kstandarddirs.h> diff --git a/tdeui/kpassivepopup.cpp b/tdeui/kpassivepopup.cpp index 8892ce153..ba3459b45 100644 --- a/tdeui/kpassivepopup.cpp +++ b/tdeui/kpassivepopup.cpp @@ -22,7 +22,7 @@ #include <kdialog.h> #include <kpixmap.h> #include <kpixmapeffect.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include "config.h" #ifdef Q_WS_X11 diff --git a/tdeui/kpixmapio.cpp b/tdeui/kpixmapio.cpp index 7ce3a1be2..02054aad3 100644 --- a/tdeui/kpixmapio.cpp +++ b/tdeui/kpixmapio.cpp @@ -18,7 +18,7 @@ #include <tqcolor.h> #include <tqglobal.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <kdebug.h> diff --git a/tdeui/kpixmapregionselectordialog.cpp b/tdeui/kpixmapregionselectordialog.cpp index c394af0f3..8228cd2f1 100644 --- a/tdeui/kpixmapregionselectordialog.cpp +++ b/tdeui/kpixmapregionselectordialog.cpp @@ -21,7 +21,7 @@ #include <kdialogbase.h> #include <tqdialog.h> #include <tqdesktopwidget.h> -#include <klocale.h> +#include <tdelocale.h> #include <kdialog.h> KPixmapRegionSelectorDialog::KPixmapRegionSelectorDialog(TQWidget *parent, diff --git a/tdeui/kpixmapregionselectorwidget.cpp b/tdeui/kpixmapregionselectorwidget.cpp index bd82cae72..21ac875db 100644 --- a/tdeui/kpixmapregionselectorwidget.cpp +++ b/tdeui/kpixmapregionselectorwidget.cpp @@ -30,7 +30,7 @@ #include <tqlayout.h> #include <kimageeffect.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdepopupmenu.h> #include <tdeaction.h> #include <stdlib.h> diff --git a/tdeui/kprogress.cpp b/tdeui/kprogress.cpp index 3f0186e3d..8fb050a11 100644 --- a/tdeui/kprogress.cpp +++ b/tdeui/kprogress.cpp @@ -35,7 +35,7 @@ #include "kprogress.h" #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <twin.h> KProgress::KProgress(TQWidget *parent, const char *name, WFlags f) diff --git a/tdeui/kprogressbox.cpp b/tdeui/kprogressbox.cpp index 6dda25a33..2472207f4 100644 --- a/tdeui/kprogressbox.cpp +++ b/tdeui/kprogressbox.cpp @@ -38,7 +38,7 @@ #include "kprogressbox.h" #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <twin.h> struct KProgressBoxDialog::KProgressBoxDialogPrivate diff --git a/tdeui/kpushbutton.cpp b/tdeui/kpushbutton.cpp index e92fe8583..6f994dbe3 100644 --- a/tdeui/kpushbutton.cpp +++ b/tdeui/kpushbutton.cpp @@ -25,9 +25,9 @@ #include "config.h" -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kipc.h> #include <tdeapplication.h> diff --git a/tdeui/ksconfig.cpp b/tdeui/ksconfig.cpp index d27ae07ca..a9958dea9 100644 --- a/tdeui/ksconfig.cpp +++ b/tdeui/ksconfig.cpp @@ -30,9 +30,9 @@ #include <kdebug.h> #include <kdialog.h> #include <tdefiledialog.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <klineedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <kpushbutton.h> #include <kstdguiitem.h> diff --git a/tdeui/kscrollview.cpp b/tdeui/kscrollview.cpp index 997de84b3..40cbb8ee4 100644 --- a/tdeui/kscrollview.cpp +++ b/tdeui/kscrollview.cpp @@ -25,7 +25,7 @@ #include "kscrollview.h" #include <kdebug.h> #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> struct KScrollView::KScrollViewPrivate { KScrollViewPrivate() : dx(0), dy(0), ddx(0), ddy(0), rdx(0), rdy(0), scrolling(false) {} diff --git a/tdeui/ksplashscreen.cpp b/tdeui/ksplashscreen.cpp index a45a579bb..82234bd94 100644 --- a/tdeui/ksplashscreen.cpp +++ b/tdeui/ksplashscreen.cpp @@ -18,8 +18,8 @@ */ #include <tdeconfig.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <tqpixmap.h> diff --git a/tdeui/kstatusbar.cpp b/tdeui/kstatusbar.cpp index 134d7f1a5..daa22f46b 100644 --- a/tdeui/kstatusbar.cpp +++ b/tdeui/kstatusbar.cpp @@ -21,7 +21,7 @@ #include <kdebug.h> #include <kstatusbar.h> #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> KStatusBarLabel::KStatusBarLabel( const TQString& text, int _id, diff --git a/tdeui/kstdaction.cpp b/tdeui/kstdaction.cpp index 8dd874a9d..652534601 100644 --- a/tdeui/kstdaction.cpp +++ b/tdeui/kstdaction.cpp @@ -25,9 +25,9 @@ #include <tdeaction.h> #include <tdeapplication.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdestdaccel.h> #include <tdemainwindow.h> #include "kstdaction_p.h" diff --git a/tdeui/kstdaction_p.h b/tdeui/kstdaction_p.h index a5449d8e7..4a8fee92e 100644 --- a/tdeui/kstdaction_p.h +++ b/tdeui/kstdaction_p.h @@ -19,7 +19,7 @@ #ifndef _KSTDACTION_PRIVATE_H_ #define _KSTDACTION_PRIVATE_H_ -#include <klocale.h> +#include <tdelocale.h> #include <tdestdaccel.h> namespace KStdAction diff --git a/tdeui/kstdguiitem.cpp b/tdeui/kstdguiitem.cpp index 78f3fd6f6..80bf54bce 100644 --- a/tdeui/kstdguiitem.cpp +++ b/tdeui/kstdguiitem.cpp @@ -19,7 +19,7 @@ #include "kstdguiitem.h" #include <kguiitem.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> KGuiItem KStdGuiItem::guiItem ( StdItem ui_enum ) diff --git a/tdeui/kswitchlanguagedialog.cpp b/tdeui/kswitchlanguagedialog.cpp index c9bb7552a..c82ffb83d 100644 --- a/tdeui/kswitchlanguagedialog.cpp +++ b/tdeui/kswitchlanguagedialog.cpp @@ -28,8 +28,8 @@ #include <klanguagebutton.h> #include <tdeconfig.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kdebug.h> #include <kpushbutton.h> diff --git a/tdeui/ksyntaxhighlighter.cpp b/tdeui/ksyntaxhighlighter.cpp index ba938382b..f7627621c 100644 --- a/tdeui/ksyntaxhighlighter.cpp +++ b/tdeui/ksyntaxhighlighter.cpp @@ -26,10 +26,10 @@ #include <tqsyntaxhighlighter.h> #include <tqtimer.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdespell.h> #include <tdeapplication.h> diff --git a/tdeui/ksystemtray.cpp b/tdeui/ksystemtray.cpp index fcd0389da..5004d4bf1 100644 --- a/tdeui/ksystemtray.cpp +++ b/tdeui/ksystemtray.cpp @@ -20,12 +20,12 @@ #include "config.h" #include "tdeaction.h" -#include "kmessagebox.h" +#include "tdemessagebox.h" #include "tdeshortcut.h" #include "ksystemtray.h" #include "tdepopupmenu.h" #include "tdeapplication.h" -#include "klocale.h" +#include "tdelocale.h" #include "tdeaboutdata.h" #ifdef Q_WS_X11 diff --git a/tdeui/ksystemtray.h b/tdeui/ksystemtray.h index 711515985..f7e81c9b1 100644 --- a/tdeui/ksystemtray.h +++ b/tdeui/ksystemtray.h @@ -18,7 +18,7 @@ #ifndef KSYSTEMTRAY_H #define KSYSTEMTRAY_H -#include <kglobal.h> +#include <tdeglobal.h> #include <tqlabel.h> class TDEActionCollection; diff --git a/tdeui/ktabbar.cpp b/tdeui/ktabbar.cpp index 2e2fbe301..911162f14 100644 --- a/tdeui/ktabbar.cpp +++ b/tdeui/ktabbar.cpp @@ -26,9 +26,9 @@ #include <tqpushbutton.h> #include <tqtooltip.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include "ktabbar.h" #include "ktabwidget.h" diff --git a/tdeui/ktextbrowser.cpp b/tdeui/ktextbrowser.cpp index b17e38067..a4b716db7 100644 --- a/tdeui/ktextbrowser.cpp +++ b/tdeui/ktextbrowser.cpp @@ -20,7 +20,7 @@ #include <tqpopupmenu.h> #include <tdeapplication.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <ktextbrowser.h> #include <kcursor.h> #include <kurl.h> diff --git a/tdeui/ktextedit.cpp b/tdeui/ktextedit.cpp index fb0e607fa..445540099 100644 --- a/tdeui/ktextedit.cpp +++ b/tdeui/ktextedit.cpp @@ -26,10 +26,10 @@ #include <ksyntaxhighlighter.h> #include <tdespell.h> #include <kcursor.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdestdaccel.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> class KTextEdit::KTextEditPrivate { diff --git a/tdeui/ktimezonewidget.cpp b/tdeui/ktimezonewidget.cpp index c7046231f..f6488847f 100644 --- a/tdeui/ktimezonewidget.cpp +++ b/tdeui/ktimezonewidget.cpp @@ -21,7 +21,7 @@ #include <kdebug.h> #include <tdefile.h> #include <tdelistview.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <ktimezones.h> #include <ktimezonewidget.h> diff --git a/tdeui/ktip.cpp b/tdeui/ktip.cpp index 44f710fb9..b3e7d832b 100644 --- a/tdeui/ktip.cpp +++ b/tdeui/ktip.cpp @@ -37,16 +37,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kpushbutton.h> #include <kseparator.h> #include <kstandarddirs.h> #include <kstdguiitem.h> #include <ktextbrowser.h> #include <kiconeffect.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #ifdef Q_WS_X11 #include <twin.h> diff --git a/tdeui/kurllabel.cpp b/tdeui/kurllabel.cpp index 0a95a2c70..749b4f5b5 100644 --- a/tdeui/kurllabel.cpp +++ b/tdeui/kurllabel.cpp @@ -27,7 +27,7 @@ #include <tqapplication.h> #include <kcursor.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include "kurllabel.h" diff --git a/tdeui/kwhatsthismanager.cpp b/tdeui/kwhatsthismanager.cpp index bcf48438c..46643f6f0 100644 --- a/tdeui/kwhatsthismanager.cpp +++ b/tdeui/kwhatsthismanager.cpp @@ -21,7 +21,7 @@ #include <tqvariant.h> #include <kdebug.h> #include <tqtextedit.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> KWhatsThisManager *KWhatsThisManager::s_instance = 0; diff --git a/tdeui/kwizard.cpp b/tdeui/kwizard.cpp index 0e378dbf2..b8fa1e88a 100644 --- a/tdeui/kwizard.cpp +++ b/tdeui/kwizard.cpp @@ -22,8 +22,8 @@ #include <tqpushbutton.h> #include <kiconloader.h> -#include <klocale.h> -#include <kglobalsettings.h> +#include <tdelocale.h> +#include <tdeglobalsettings.h> #include <kstdguiitem.h> #include "kwizard.h" diff --git a/tdeui/kxmlguibuilder.cpp b/tdeui/kxmlguibuilder.cpp index 6fd472ad5..ff4083779 100644 --- a/tdeui/kxmlguibuilder.cpp +++ b/tdeui/kxmlguibuilder.cpp @@ -20,14 +20,14 @@ #include "tdeapplication.h" #include "kxmlguibuilder.h" -#include "kmenubar.h" +#include "tdemenubar.h" #include "tdepopupmenu.h" #include "tdetoolbar.h" #include "kstatusbar.h" #include "tdemainwindow.h" #include "tdeaction.h" -#include "kglobalsettings.h" -#include <klocale.h> +#include "tdeglobalsettings.h" +#include <tdelocale.h> #include <kiconloader.h> #include <kdebug.h> #include <tqobjectlist.h> diff --git a/tdeui/kxmlguifactory.cpp b/tdeui/kxmlguifactory.cpp index 0a2aae41d..87015bfd5 100644 --- a/tdeui/kxmlguifactory.cpp +++ b/tdeui/kxmlguifactory.cpp @@ -35,7 +35,7 @@ #include <tdeaction.h> #include <kdebug.h> #include <kinstance.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeshortcut.h> #include <kstandarddirs.h> #include <kkeydialog.h> diff --git a/tdeui/kxmlguifactory_p.cpp b/tdeui/kxmlguifactory_p.cpp index ffe9ffab1..699f9579d 100644 --- a/tdeui/kxmlguifactory_p.cpp +++ b/tdeui/kxmlguifactory_p.cpp @@ -23,7 +23,7 @@ #include <tqwidget.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kdebug.h> #include <assert.h> diff --git a/tdeui/tdeaboutapplication.cpp b/tdeui/tdeaboutapplication.cpp index 08ee46450..ef9efb181 100644 --- a/tdeui/tdeaboutapplication.cpp +++ b/tdeui/tdeaboutapplication.cpp @@ -27,8 +27,8 @@ #include <kaboutdialog_private.h> #include <tdeaboutdata.h> #include <tdeapplication.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kurllabel.h> #include <kactivelabel.h> #include "ktextedit.h" diff --git a/tdeui/tdeaboutdialog.cpp b/tdeui/tdeaboutdialog.cpp index b46c0b959..895247161 100644 --- a/tdeui/tdeaboutdialog.cpp +++ b/tdeui/tdeaboutdialog.cpp @@ -32,9 +32,9 @@ #include <tqtabbar.h> #include <tdeapplication.h> -#include <kglobal.h> -#include <kglobalsettings.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> +#include <tdelocale.h> #include <ktextbrowser.h> #include <kurllabel.h> #include <tdeaboutdialog.h> diff --git a/tdeui/tdeabouttde.cpp b/tdeui/tdeabouttde.cpp index 0e7078af4..d5f45c85a 100644 --- a/tdeui/tdeabouttde.cpp +++ b/tdeui/tdeabouttde.cpp @@ -22,7 +22,7 @@ // I (espen) prefer that header files are included alphabetically #include <tdeabouttde.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> diff --git a/tdeui/tdeaction.cpp b/tdeui/tdeaction.cpp index d817a5ba4..6f29ab848 100644 --- a/tdeui/tdeaction.cpp +++ b/tdeui/tdeaction.cpp @@ -37,7 +37,7 @@ #include <kdebug.h> #include <kguiitem.h> #include <tdemainwindow.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdepopupmenu.h> #include <tdetoolbar.h> #include <tdetoolbarbutton.h> diff --git a/tdeui/tdeactionclasses.cpp b/tdeui/tdeactionclasses.cpp index 1fc963887..4b589f166 100644 --- a/tdeui/tdeactionclasses.cpp +++ b/tdeui/tdeactionclasses.cpp @@ -47,9 +47,9 @@ #include <kdebug.h> #include <tdefontcombo.h> #include <tdefontdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdemainwindow.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdepopupmenu.h> #include <tdetoolbar.h> #include <tdetoolbarbutton.h> diff --git a/tdeui/tdeactionselector.cpp b/tdeui/tdeactionselector.cpp index 3ef22a45f..c3c7329b8 100644 --- a/tdeui/tdeactionselector.cpp +++ b/tdeui/tdeactionselector.cpp @@ -19,7 +19,7 @@ #include "tdeactionselector.h" -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kdialog.h> // for spacingHint() #include <kdebug.h> diff --git a/tdeui/tdecmodule.cpp b/tdeui/tdecmodule.cpp index 4e6ce943f..c6b7d3726 100644 --- a/tdeui/tdecmodule.cpp +++ b/tdeui/tdecmodule.cpp @@ -27,9 +27,9 @@ #include <tdeconfigskeleton.h> #include <tdeconfigdialogmanager.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kinstance.h> -#include <klocale.h> +#include <tdelocale.h> #include "tdecmodule.h" #include "tdecmodule.moc" diff --git a/tdeui/tdecompletionbox.cpp b/tdeui/tdecompletionbox.cpp index 53a8c71fb..96c9c1794 100644 --- a/tdeui/tdecompletionbox.cpp +++ b/tdeui/tdecompletionbox.cpp @@ -29,7 +29,7 @@ #include <kdebug.h> #include <tdeconfig.h> #include <knotifyclient.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include "tdecompletionbox.h" diff --git a/tdeui/tdeconfigdialog.cpp b/tdeui/tdeconfigdialog.cpp index c8e848fa3..df43defc5 100644 --- a/tdeui/tdeconfigdialog.cpp +++ b/tdeui/tdeconfigdialog.cpp @@ -23,7 +23,7 @@ #include <tdeconfigskeleton.h> #include <tdeconfigdialogmanager.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <kdebug.h> diff --git a/tdeui/tdefontcombo.cpp b/tdeui/tdefontcombo.cpp index fc9ae830b..cb250385f 100644 --- a/tdeui/tdefontcombo.cpp +++ b/tdeui/tdefontcombo.cpp @@ -24,7 +24,7 @@ #include <kcharsets.h> #include <tdeconfig.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdefontdialog.h> #include "tdefontcombo.h" diff --git a/tdeui/tdefontdialog.cpp b/tdeui/tdefontdialog.cpp index 15c687e13..75f4599e0 100644 --- a/tdeui/tdefontdialog.cpp +++ b/tdeui/tdefontdialog.cpp @@ -45,11 +45,11 @@ #include <kcharsets.h> #include <tdeconfig.h> #include <kdialog.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <tqlineedit.h> #include <tdelistbox.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <kdebug.h> #include <knuminput.h> diff --git a/tdeui/tdefontrequester.cpp b/tdeui/tdefontrequester.cpp index 64eba5701..459938d12 100644 --- a/tdeui/tdefontrequester.cpp +++ b/tdeui/tdefontrequester.cpp @@ -26,7 +26,7 @@ #include <tqwhatsthis.h> #include <tdefontdialog.h> -#include <klocale.h> +#include <tdelocale.h> TDEFontRequester::TDEFontRequester( TQWidget *parent, const char *name, bool onlyFixed ) : TQWidget( parent, name ), diff --git a/tdeui/tdelistbox.cpp b/tdeui/tdelistbox.cpp index 9f7c23688..0e4c5d520 100644 --- a/tdeui/tdelistbox.cpp +++ b/tdeui/tdelistbox.cpp @@ -19,7 +19,7 @@ #include <tqtimer.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <kcursor.h> #include <tdeapplication.h> #include <kipc.h> diff --git a/tdeui/tdelistview.cpp b/tdeui/tdelistview.cpp index 020f18679..4750a7138 100644 --- a/tdeui/tdelistview.cpp +++ b/tdeui/tdelistview.cpp @@ -27,7 +27,7 @@ #include <tqstyle.h> #include <tqpainter.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdeconfig.h> #include <kcursor.h> #include <tdeapplication.h> diff --git a/tdeui/tdelistviewsearchline.cpp b/tdeui/tdelistviewsearchline.cpp index 20d78add2..b74b4d1c1 100644 --- a/tdeui/tdelistviewsearchline.cpp +++ b/tdeui/tdelistviewsearchline.cpp @@ -23,7 +23,7 @@ #include <tdetoolbar.h> #include <tdetoolbarbutton.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqapplication.h> #include <tqtimer.h> diff --git a/tdeui/tdemainwindow.cpp b/tdeui/tdemainwindow.cpp index 01b6a09e0..ba9c51556 100644 --- a/tdeui/tdemainwindow.cpp +++ b/tdeui/tdemainwindow.cpp @@ -40,13 +40,13 @@ #include <tdeconfig.h> #include <kdebug.h> #include <khelpmenu.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <kstatusbar.h> #include <twin.h> #include <kedittoolbar.h> #include <tdemainwindow.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstandarddirs.h> #include <kstaticdeleter.h> #if defined Q_WS_X11 diff --git a/tdeui/tdeshortcutdialog.cpp b/tdeui/tdeshortcutdialog.cpp index fe3593b7e..35a7706c7 100644 --- a/tdeui/tdeshortcutdialog.cpp +++ b/tdeui/tdeshortcutdialog.cpp @@ -55,10 +55,10 @@ #include <tdeapplication.h> #include <tdeconfig.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> #include <kkeynative.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstdguiitem.h> #include <kpushbutton.h> diff --git a/tdeui/tdespell.cpp b/tdeui/tdespell.cpp index 629013121..031011f0a 100644 --- a/tdeui/tdespell.cpp +++ b/tdeui/tdespell.cpp @@ -38,9 +38,9 @@ #include <tqtimer.h> #include <tdeapplication.h> -#include <kmessagebox.h> +#include <tdemessagebox.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include "tdespell.h" #include "tdespelldlg.h" #include <twin.h> diff --git a/tdeui/tdespelldlg.cpp b/tdeui/tdespelldlg.cpp index 280ddf861..9e8206505 100644 --- a/tdeui/tdespelldlg.cpp +++ b/tdeui/tdespelldlg.cpp @@ -25,7 +25,7 @@ #include <tqlayout.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdelistbox.h> #include <kcombobox.h> #include <tdelistview.h> diff --git a/tdeui/tdetoolbar.cpp b/tdeui/tdetoolbar.cpp index a095f1493..a3ced3a19 100644 --- a/tdeui/tdetoolbar.cpp +++ b/tdeui/tdetoolbar.cpp @@ -46,11 +46,11 @@ #include <tdemainwindow.h> #include <klineedit.h> #include <kseparator.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeapplication.h> #include <tdeaction.h> #include <kstdaction.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <kiconloader.h> #include <kcombobox.h> diff --git a/tdeui/tdetoolbar.h b/tdeui/tdetoolbar.h index 37e22c9bb..857673f28 100644 --- a/tdeui/tdetoolbar.h +++ b/tdeui/tdetoolbar.h @@ -33,7 +33,7 @@ #include <tqframe.h> #include <tqiconset.h> -#include <kglobal.h> +#include <tdeglobal.h> class TQDomElement; class TQSize; diff --git a/tdeui/tdetoolbarbutton.cpp b/tdeui/tdetoolbarbutton.cpp index 608c31a32..abf23ffc7 100644 --- a/tdeui/tdetoolbarbutton.cpp +++ b/tdeui/tdetoolbarbutton.cpp @@ -40,8 +40,8 @@ #include <tdeapplication.h> #include <kdebug.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kiconeffect.h> #include <kiconloader.h> diff --git a/tdeui/tdetoolbarbutton.h b/tdeui/tdetoolbarbutton.h index 49e906e6e..c73c1145a 100644 --- a/tdeui/tdetoolbarbutton.h +++ b/tdeui/tdetoolbarbutton.h @@ -27,7 +27,7 @@ #include <tqtoolbutton.h> #include <tqintdict.h> #include <tqstring.h> -#include <kglobal.h> +#include <tdeglobal.h> class TDEToolBar; class TDEToolBarButtonPrivate; diff --git a/tdeui/tdetoolbarhandler.cpp b/tdeui/tdetoolbarhandler.cpp index 4242a119e..da621fadd 100644 --- a/tdeui/tdetoolbarhandler.cpp +++ b/tdeui/tdetoolbarhandler.cpp @@ -22,7 +22,7 @@ #include <tdeapplication.h> #include <tdetoolbar.h> #include <tdemainwindow.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdeaction.h> #include <assert.h> diff --git a/tdeui/tests/itemcontainertest.cpp b/tdeui/tests/itemcontainertest.cpp index c96d6a4eb..c3b6d1ddc 100644 --- a/tdeui/tests/itemcontainertest.cpp +++ b/tdeui/tests/itemcontainertest.cpp @@ -17,7 +17,7 @@ #include <tqlabel.h> #include <tdeapplication.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <tdeconfig.h> #include <kiconview.h> #include <tdelistview.h> diff --git a/tdeui/tests/kaboutdialogtest.cpp b/tdeui/tests/kaboutdialogtest.cpp index c3be2de25..e0680b52f 100644 --- a/tdeui/tests/kaboutdialogtest.cpp +++ b/tdeui/tests/kaboutdialogtest.cpp @@ -12,7 +12,7 @@ // #include <kimgio.h> #include <tqimage.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> int main(int argc, char** argv) { diff --git a/tdeui/tests/kcharselecttest.cpp b/tdeui/tests/kcharselecttest.cpp index ccd6cd10a..5ee4ee381 100644 --- a/tdeui/tests/kcharselecttest.cpp +++ b/tdeui/tests/kcharselecttest.cpp @@ -1,5 +1,5 @@ #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include "kcharselect.h" int main (int argc,char **argv) diff --git a/tdeui/tests/kcolordlgtest.cpp b/tdeui/tests/kcolordlgtest.cpp index f45df0de7..dbe39484c 100644 --- a/tdeui/tests/kcolordlgtest.cpp +++ b/tdeui/tests/kcolordlgtest.cpp @@ -20,7 +20,7 @@ #include <tdeapplication.h> #include "kcolordialog.h" #include <tdeconfig.h> -#include <klocale.h> +#include <tdelocale.h> int main( int argc, char *argv[] ) { diff --git a/tdeui/tests/kcomboboxtest.cpp b/tdeui/tests/kcomboboxtest.cpp index 225c80c0f..d2b59a4c2 100644 --- a/tdeui/tests/kcomboboxtest.cpp +++ b/tdeui/tests/kcomboboxtest.cpp @@ -9,7 +9,7 @@ #include <tdeapplication.h> #include <kdebug.h> #include <kdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <kiconloader.h> #include <ksimpleconfig.h> diff --git a/tdeui/tests/kcompletiontest.cpp b/tdeui/tests/kcompletiontest.cpp index 12e3835dc..261534465 100644 --- a/tdeui/tests/kcompletiontest.cpp +++ b/tdeui/tests/kcompletiontest.cpp @@ -1,4 +1,4 @@ -#include <klocale.h> +#include <tdelocale.h> /**************************************************************************** ** Form implementation generated from reading ui file './kcompletiontest.ui' ** diff --git a/tdeui/tests/kdatepicktest.cpp b/tdeui/tests/kdatepicktest.cpp index abcfeb24a..8bdab90a4 100644 --- a/tdeui/tests/kdatepicktest.cpp +++ b/tdeui/tests/kdatepicktest.cpp @@ -1,7 +1,7 @@ #include "kdatepicker.h" #include <tqlineedit.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> int main(int argc, char** argv) { diff --git a/tdeui/tests/kdatetimewidgettest.cpp b/tdeui/tests/kdatetimewidgettest.cpp index 721f86492..f94a2a9f7 100644 --- a/tdeui/tests/kdatetimewidgettest.cpp +++ b/tdeui/tests/kdatetimewidgettest.cpp @@ -1,6 +1,6 @@ #include "kdatetimewidget.h" #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> int main(int argc, char** argv) { diff --git a/tdeui/tests/kdatewidgettest.cpp b/tdeui/tests/kdatewidgettest.cpp index 11fb243f3..22340b4c9 100644 --- a/tdeui/tests/kdatewidgettest.cpp +++ b/tdeui/tests/kdatewidgettest.cpp @@ -1,7 +1,7 @@ #include "kdatewidget.h" #include <tqlineedit.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> int main(int argc, char** argv) { diff --git a/tdeui/tests/kdockwidgettest.cpp b/tdeui/tests/kdockwidgettest.cpp index 683d42acd..aacac19a0 100644 --- a/tdeui/tests/kdockwidgettest.cpp +++ b/tdeui/tests/kdockwidgettest.cpp @@ -18,7 +18,7 @@ #include <tdeapplication.h> #include <kiconloader.h> #include <kstatusbar.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdetoolbar.h> #include <tqvbox.h> diff --git a/tdeui/tests/kdualcolortest.cpp b/tdeui/tests/kdualcolortest.cpp index e52d6e671..512bfc610 100644 --- a/tdeui/tests/kdualcolortest.cpp +++ b/tdeui/tests/kdualcolortest.cpp @@ -1,7 +1,7 @@ #include "kdualcolortest.h" #include <kdualcolorbutton.h> #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> #include <tqlayout.h> #include <tqpalette.h> diff --git a/tdeui/tests/klineedittest.cpp b/tdeui/tests/klineedittest.cpp index 793988968..20e9b6ca8 100644 --- a/tdeui/tests/klineedittest.cpp +++ b/tdeui/tests/klineedittest.cpp @@ -9,9 +9,9 @@ #include <tdeapplication.h> #include <kdebug.h> #include <kdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <klineedit.h> -#include <kglobalsettings.h> +#include <tdeglobalsettings.h> #include <tdecompletionbox.h> #include "klineedittest.h" diff --git a/tdeui/tests/kmessageboxtest.cpp b/tdeui/tests/kmessageboxtest.cpp index ce333edee..2a56a7ead 100644 --- a/tdeui/tests/kmessageboxtest.cpp +++ b/tdeui/tests/kmessageboxtest.cpp @@ -1,4 +1,4 @@ -#include "kmessagebox.h" +#include "tdemessagebox.h" #include <tqdialog.h> #include <tqlayout.h> @@ -10,7 +10,7 @@ #include <kstatusbar.h> #include <tdeapplication.h> -#include <kglobal.h> +#include <tdeglobal.h> class ExampleWidget : public QLabel { diff --git a/tdeui/tests/kstatusbartest.cpp b/tdeui/tests/kstatusbartest.cpp index 82c03e271..0a8c6d10c 100644 --- a/tdeui/tests/kstatusbartest.cpp +++ b/tdeui/tests/kstatusbartest.cpp @@ -12,7 +12,7 @@ #include "kstatusbar.h" #include <tdeapplication.h> #include <tdemainwindow.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include "kstatusbartest.h" testWindow::testWindow (TQWidget *, const char *name) diff --git a/tdeui/tests/kstatusbartest.h b/tdeui/tests/kstatusbartest.h index 34dd6df81..712f24352 100644 --- a/tdeui/tests/kstatusbartest.h +++ b/tdeui/tests/kstatusbartest.h @@ -1,7 +1,7 @@ #ifndef test_kstatusbar_h #define test_kstatusbar_h -#include <kmenubar.h> +#include <tdemenubar.h> #include <tqpopupmenu.h> #include <kstatusbar.h> #include <tdemainwindow.h> diff --git a/tdeui/tests/ktimewidgettest.cpp b/tdeui/tests/ktimewidgettest.cpp index bbff45648..731dc3219 100644 --- a/tdeui/tests/ktimewidgettest.cpp +++ b/tdeui/tests/ktimewidgettest.cpp @@ -1,6 +1,6 @@ #include "ktimewidget.h" #include <tdeapplication.h> -#include <klocale.h> +#include <tdelocale.h> int main(int argc, char** argv) { diff --git a/tdeui/tests/tdemainwindowtest.cpp b/tdeui/tests/tdemainwindowtest.cpp index c8ace159e..b19818d4c 100644 --- a/tdeui/tests/tdemainwindowtest.cpp +++ b/tdeui/tests/tdemainwindowtest.cpp @@ -3,7 +3,7 @@ #include <tdeapplication.h> #include <kstatusbar.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include "tdemainwindowtest.h" diff --git a/tdeui/tests/twindowtest.cpp b/tdeui/tests/twindowtest.cpp index 3823ab46f..77e01d289 100644 --- a/tdeui/tests/twindowtest.cpp +++ b/tdeui/tests/twindowtest.cpp @@ -13,14 +13,14 @@ #include <kcombobox.h> #include <khelpmenu.h> #include <tdecmdlineargs.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <tdetoolbarradiogroup.h> #include <kiconloader.h> #include <tdepopupmenu.h> #include <tqmultilineedit.h> #include "twindowtest.h" -#include <kglobal.h> +#include <tdeglobal.h> //#include <dclock.h> diff --git a/tdeui/tests/twindowtest.h b/tdeui/tests/twindowtest.h index 83a0d75bf..d1d9d460e 100644 --- a/tdeui/tests/twindowtest.h +++ b/tdeui/tests/twindowtest.h @@ -4,7 +4,7 @@ #include <tqpopupmenu.h> #include <tqtimer.h> #include <tqprogressbar.h> -#include <kmenubar.h> +#include <tdemenubar.h> #include <kstatusbar.h> #include <tdetoolbar.h> #include <tdemainwindow.h> diff --git a/tdeui/twindowlistmenu.cpp b/tdeui/twindowlistmenu.cpp index 7ca8fda3f..bc2df2f66 100644 --- a/tdeui/twindowlistmenu.cpp +++ b/tdeui/twindowlistmenu.cpp @@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include <twin.h> #include <twinmodule.h> -#include <klocale.h> +#include <tdelocale.h> #include <kstringhandler.h> #include <netwm.h> diff --git a/tdeunittest/modrunner.cpp b/tdeunittest/modrunner.cpp index 4caa2d609..350778f6c 100644 --- a/tdeunittest/modrunner.cpp +++ b/tdeunittest/modrunner.cpp @@ -24,11 +24,11 @@ */ #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kinstance.h> #include <tdeaboutdata.h> #include <tdecmdlineargs.h> -#include <klocale.h> +#include <tdelocale.h> #include "runner.h" diff --git a/tdeunittest/runner.cpp b/tdeunittest/runner.cpp index 6a961fecd..c63b6ed6c 100644 --- a/tdeunittest/runner.cpp +++ b/tdeunittest/runner.cpp @@ -35,7 +35,7 @@ using namespace std; #include <kdebug.h> #include <klibloader.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include "runner.h" diff --git a/tdeunittest/tester.h b/tdeunittest/tester.h index 332381ec8..b0ce3e685 100644 --- a/tdeunittest/tester.h +++ b/tdeunittest/tester.h @@ -138,7 +138,7 @@ SampleTest - 1 test passed, 1 test failed * #include <tdeapplication.h> * #include <tdecmdlineargs.h> * #include <tdecmdlineargs.h> - * #include <klocale.h> + * #include <tdelocale.h> * #include <tdeunittest/runnergui.h> * * static const char description[] = I18N_NOOP("SampleTests"); diff --git a/tdeutils/kcmultidialog.cpp b/tdeutils/kcmultidialog.cpp index 9bb067ca0..6a074040b 100644 --- a/tdeutils/kcmultidialog.cpp +++ b/tdeutils/kcmultidialog.cpp @@ -31,8 +31,8 @@ #include <kdebug.h> #include <kiconloader.h> #include <klibloader.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kprocess.h> #include <krun.h> #include <kstdguiitem.h> diff --git a/tdeutils/kcmultidialog.h b/tdeutils/kcmultidialog.h index 46dde98fb..ca6d2d6c7 100644 --- a/tdeutils/kcmultidialog.h +++ b/tdeutils/kcmultidialog.h @@ -26,7 +26,7 @@ #include <tqptrdict.h> #include <kdialogbase.h> -#include <klocale.h> +#include <tdelocale.h> #include <kservice.h> class TDECModuleProxy; diff --git a/tdeutils/kfind.cpp b/tdeutils/kfind.cpp index 99ef317b6..74fb46e9a 100644 --- a/tdeutils/kfind.cpp +++ b/tdeutils/kfind.cpp @@ -22,8 +22,8 @@ #include "kfind.h" #include "kfinddialog.h" #include <tdeapplication.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tqlabel.h> #include <tqregexp.h> #include <tqstylesheet.h> diff --git a/tdeutils/kfinddialog.cpp b/tdeutils/kfinddialog.cpp index d9a5284e1..718fdca2f 100644 --- a/tdeutils/kfinddialog.cpp +++ b/tdeutils/kfinddialog.cpp @@ -29,8 +29,8 @@ #include <tqregexp.h> #include <kcombobox.h> #include <kdebug.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <assert.h> #include <tqwhatsthis.h> diff --git a/tdeutils/kplugininfo.cpp b/tdeutils/kplugininfo.cpp index cb93b2600..9ea0eb2bc 100644 --- a/tdeutils/kplugininfo.cpp +++ b/tdeutils/kplugininfo.cpp @@ -22,7 +22,7 @@ #include <ktrader.h> #include <kdebug.h> #include <tdeconfigbase.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <kdesktopfile.h> #include <kservice.h> diff --git a/tdeutils/kpluginselector.cpp b/tdeutils/kpluginselector.cpp index 5747df7c4..9fe08b027 100644 --- a/tdeutils/kpluginselector.cpp +++ b/tdeutils/kpluginselector.cpp @@ -35,12 +35,12 @@ #include <tqcstring.h> #include <kdebug.h> -#include <klocale.h> +#include <tdelocale.h> #include <tdelistview.h> #include <ksimpleconfig.h> #include <kdialog.h> -#include <kglobal.h> -#include <kglobalsettings.h> +#include <tdeglobal.h> +#include <tdeglobalsettings.h> #include <kstandarddirs.h> #include <ktabctl.h> #include <tdecmoduleinfo.h> diff --git a/tdeutils/kreplace.cpp b/tdeutils/kreplace.cpp index 0aad733da..98e3ce93c 100644 --- a/tdeutils/kreplace.cpp +++ b/tdeutils/kreplace.cpp @@ -22,8 +22,8 @@ #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include "kreplace.h" #include "kreplacedialog.h" #include <tqregexp.h> diff --git a/tdeutils/kreplacedialog.cpp b/tdeutils/kreplacedialog.cpp index 88c006b4d..d8e74af44 100644 --- a/tdeutils/kreplacedialog.cpp +++ b/tdeutils/kreplacedialog.cpp @@ -26,8 +26,8 @@ #include <tqlayout.h> #include <tqregexp.h> #include <kcombobox.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kdebug.h> /** diff --git a/tdeutils/ksettings/componentsdialog.cpp b/tdeutils/ksettings/componentsdialog.cpp index 50ad97a03..f60613bce 100644 --- a/tdeutils/ksettings/componentsdialog.cpp +++ b/tdeutils/ksettings/componentsdialog.cpp @@ -18,7 +18,7 @@ */ #include "ksettings/componentsdialog.h" -#include <klocale.h> +#include <tdelocale.h> #include <tqlayout.h> #include <tdelistview.h> #include <tqlabel.h> diff --git a/tdeutils/ksettings/dialog.cpp b/tdeutils/ksettings/dialog.cpp index 49918b5e7..e74b9ac48 100644 --- a/tdeutils/ksettings/dialog.cpp +++ b/tdeutils/ksettings/dialog.cpp @@ -21,7 +21,7 @@ #include <kcmultidialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <kservicegroup.h> #include <kdebug.h> #include <ktrader.h> diff --git a/tdeutils/tdecmodulecontainer.cpp b/tdeutils/tdecmodulecontainer.cpp index c379a9857..004ceb78a 100644 --- a/tdeutils/tdecmodulecontainer.cpp +++ b/tdeutils/tdecmodulecontainer.cpp @@ -30,7 +30,7 @@ #include <tdecmoduleproxy.h> #include <kdebug.h> #include <kdialog.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kiconloader.h> #include <kpushbutton.h> #include <kservice.h> diff --git a/tdeutils/tdecmoduleinfo.cpp b/tdeutils/tdecmoduleinfo.cpp index 3a7fdfd63..4869bb1ef 100644 --- a/tdeutils/tdecmoduleinfo.cpp +++ b/tdeutils/tdecmoduleinfo.cpp @@ -25,9 +25,9 @@ #include <kdesktopfile.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> -#include <klocale.h> +#include <tdelocale.h> #include "tdecmoduleinfo.h" diff --git a/tdeutils/tdecmoduleloader.cpp b/tdeutils/tdecmoduleloader.cpp index 73f92379f..ced28ae7a 100644 --- a/tdeutils/tdecmoduleloader.cpp +++ b/tdeutils/tdecmoduleloader.cpp @@ -27,8 +27,8 @@ #include <tdeapplication.h> #include <kdebug.h> -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <tdeparts/componentfactory.h> #include "tdecmoduleloader.h" diff --git a/tdeutils/tdecmoduleproxy.cpp b/tdeutils/tdecmoduleproxy.cpp index 2d3150935..eeac43b02 100644 --- a/tdeutils/tdecmoduleproxy.cpp +++ b/tdeutils/tdecmoduleproxy.cpp @@ -42,7 +42,7 @@ #include <tdecmoduleloader.h> #include <kdebug.h> #include <kdialog.h> -#include <klocale.h> +#include <tdelocale.h> #include <kprocess.h> #include <kservice.h> #include <kstandarddirs.h> diff --git a/tdewallet/backend/tdewalletbackend.cc b/tdewallet/backend/tdewalletbackend.cc index 9871b9d7b..17fecae0c 100644 --- a/tdewallet/backend/tdewalletbackend.cc +++ b/tdewallet/backend/tdewalletbackend.cc @@ -23,8 +23,8 @@ #include <stdlib.h> #include <kdebug.h> -#include <kglobal.h> -#include <klocale.h> +#include <tdeglobal.h> +#include <tdelocale.h> #include <kmdcodec.h> #include <ksavefile.h> #include <kstandarddirs.h> diff --git a/tdewallet/tests/tdewalletasync.cpp b/tdewallet/tests/tdewalletasync.cpp index 7668b90a7..75d475b97 100644 --- a/tdewallet/tests/tdewalletasync.cpp +++ b/tdewallet/tests/tdewalletasync.cpp @@ -5,7 +5,7 @@ #include <tdeapplication.h> #include <tdecmdlineargs.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <dcopclient.h> #include <tdewallet.h> diff --git a/tdewallet/tests/tdewalletboth.cpp b/tdewallet/tests/tdewalletboth.cpp index a5ba26711..efeeebc98 100644 --- a/tdewallet/tests/tdewalletboth.cpp +++ b/tdewallet/tests/tdewalletboth.cpp @@ -5,7 +5,7 @@ #include <tdeapplication.h> #include <tdecmdlineargs.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <dcopclient.h> #include <tdewallet.h> diff --git a/tdewallet/tests/tdewalletsync.cpp b/tdewallet/tests/tdewalletsync.cpp index 4774e289e..9ee39e4d4 100644 --- a/tdewallet/tests/tdewalletsync.cpp +++ b/tdewallet/tests/tdewalletsync.cpp @@ -5,7 +5,7 @@ #include <tdeapplication.h> #include <tdecmdlineargs.h> #include <kdebug.h> -#include <kglobal.h> +#include <tdeglobal.h> #include <kstandarddirs.h> #include <dcopclient.h> #include <tdewallet.h> diff --git a/win/pro_files/kabc/kabc.pro b/win/pro_files/kabc/kabc.pro index 7e38e3c7d..b3eae05b4 100644 --- a/win/pro_files/kabc/kabc.pro +++ b/win/pro_files/kabc/kabc.pro @@ -8,8 +8,8 @@ LIBS += $$KDELIBDESTDIR\tdecore$$KDELIB_SUFFIX $$KDELIBDESTDIR\tdeui$$KDELIB_SUF $$KDELIBDESTDIR\tderesources$$KDELIB_SUFFIX $$KDELIBDESTDIR\dcop$$KDELIB_SUFFIX \ $$KDELIBDESTDIR\kio$$KDELIB_SUFFIX $$KDELIBDESTDIR\kvcard$$KDELIB_SUFFIX -INCLUDEPATH += $(KDELIBS)/kabc/vcard/include $(KDELIBS)/kabc/vcard/include/generated \ - $(KDELIBS)/kabc/vcardparser +INCLUDEPATH += $(KDELIBS)/tdeabc/vcard/include $(KDELIBS)/tdeabc/vcard/include/generated \ + $(KDELIBS)/tdeabc/vcardparser system( bash kmoc ) system( bash kdcopidl ) diff --git a/win/pro_files/kabc/vcard/vcard.pro b/win/pro_files/kabc/vcard/vcard.pro index 8dedc015e..e2de8e6d7 100644 --- a/win/pro_files/kabc/vcard/vcard.pro +++ b/win/pro_files/kabc/vcard/vcard.pro @@ -7,8 +7,8 @@ DEFINES += MAKE_KVCARD_LIB LIBS += $$KDELIBDESTDIR\tdecore$$KDELIB_SUFFIX -INCLUDEPATH += $(KDELIBS)/kabc/vcard/include $(KDELIBS)/kabc/vcard/include/generated \ - $(KDELIBS)/kabc/vcardparser +INCLUDEPATH += $(KDELIBS)/tdeabc/vcard/include $(KDELIBS)/tdeabc/vcard/include/generated \ + $(KDELIBS)/tdeabc/vcardparser system( bash kmoc ) system( bash kdcopidl ) diff --git a/win/pro_files/kio/kio.pro b/win/pro_files/kio/kio.pro index da790d7d1..dc16d76b8 100644 --- a/win/pro_files/kio/kio.pro +++ b/win/pro_files/kio/kio.pro @@ -46,7 +46,7 @@ tdeio/kdcopservicestarter.cpp \ tdeio/kdirlister.cpp \ tdeio/kdirnotify.cpp \ tdeio/kdirwatch.cpp \ -tdeio/kemailsettings.cpp \ +tdeio/tdeemailsettings.cpp \ tdeio/tdefilefilter.cpp \ tdeio/tdefileitem.cpp \ tdeio/tdefilemetainfo.cpp \ @@ -59,7 +59,7 @@ tdeio/kmimetype.cpp \ tdeio/kmimetypechooser.cpp \ tdeio/knfsshare.cpp \ tdeio/kprotocolinfo.cpp \ -tdeio/kprotocolmanager.cpp \ +tdeio/tdeprotocolmanager.cpp \ tdeio/kremoteencoding.cpp \ tdeio/krun.cpp \ tdeio/ksambashare.cpp \ @@ -118,7 +118,7 @@ bookmarks/kbookmarkmenu.cc \ \ tdefile/kcombiview.cpp \ tdefile/kcustommenueditor.cpp \ -tdefile/kdiroperator.cpp \ +tdefile/tdediroperator.cpp \ tdefile/kdirselectdialog.cpp \ tdefile/kdirsize.cpp \ tdefile/kdiskfreesp.cpp \ diff --git a/win/pro_files/tdecore/tdecore.pro b/win/pro_files/tdecore/tdecore.pro index 7e564a250..fbc415726 100644 --- a/win/pro_files/tdecore/tdecore.pro +++ b/win/pro_files/tdecore/tdecore.pro @@ -49,9 +49,9 @@ kstandarddirs.cpp \ tdeconfig.cpp \ tdeconfigdialogmanager.cpp \ kcharsets.cpp \ -kglobal.cpp \ +tdeglobal.cpp \ kdebug.cpp \ -ktempfile.cpp \ +tdetempfile.cpp \ ktempdir.cpp \ ksavefile.cpp \ tdeconfigbackend.cpp \ @@ -70,11 +70,11 @@ tdeshortcutmenu.cpp \ tdeshortcutlist.cpp \ kinstance.cpp \ tdeversion.cpp \ -klocale.cpp \ +tdelocale.cpp \ kicontheme.cpp \ kiconloader.cpp \ kiconeffect.cpp \ -kglobalsettings.cpp \ +tdeglobalsettings.cpp \ kckey.cpp \ kglobalaccel.cpp \ kglobalaccel_win.cpp \ @@ -120,7 +120,7 @@ kqiodevicegzip_p.cpp #network/tdesocketdevice.cpp \ #network/ksockssocketdevice.cpp -#kstartupinfo.cpp \ +#tdestartupinfo.cpp \ #todo: kextsock.cpp \ #todo: ksock.cpp \ #todo: ksocks.cpp \ diff --git a/win/pro_files/tdeui/tdeui.pro b/win/pro_files/tdeui/tdeui.pro index b5a506f8b..aa1065c7d 100644 --- a/win/pro_files/tdeui/tdeui.pro +++ b/win/pro_files/tdeui/tdeui.pro @@ -71,7 +71,7 @@ tdelistview.cpp \ tdelistviewsearchline.cpp \ tdemainwindowiface.cpp \ tdemainwindow.cpp \ -kmenubar.cpp \ +tdemenubar.cpp \ knuminput.cpp \ knumvalidator.cpp \ kpanelapplet.cpp \ @@ -132,7 +132,7 @@ exists( kmessagebox_win.cpp ) { SOURCES += kmessagebox_win.cpp } !exists( kmessagebox_win.cpp ) { - SOURCES += kmessagebox.cpp + SOURCES += tdemessagebox.cpp } # generated: diff --git a/win/tools/build_tdelibs_dbg b/win/tools/build_tdelibs_dbg index 3fcfe0c20..79f3b0f32 100644 --- a/win/tools/build_tdelibs_dbg +++ b/win/tools/build_tdelibs_dbg @@ -48,7 +48,7 @@ tdecore \ tdeui \ kio \ tderesources \ -kabc/vcard \ +tdeabc/vcard \ kabc \ tdeutils \ tdeparts \ diff --git a/win/tools/build_tdelibs_rel b/win/tools/build_tdelibs_rel index 399dcadda..2fe77ef36 100644 --- a/win/tools/build_tdelibs_rel +++ b/win/tools/build_tdelibs_rel @@ -48,7 +48,7 @@ tdeui \ kstyles/thinkeramik/widget-engine \ kio \ tderesources \ -kabc/vcard \ +tdeabc/vcard \ kabc \ tdeutils \ tdeparts \ -- cgit v1.2.3