• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeioslave/http
 

tdeioslave/http

main.cpp

00001 /*
00002 This file is part of KDE
00003 
00004   Copyright (C) 1998-2000 Waldo Bastian (bastian@kde.org)
00005 
00006 Permission is hereby granted, free of charge, to any person obtaining a copy
00007 of this software and associated documentation files (the "Software"), to deal
00008 in the Software without restriction, including without limitation the rights
00009 to use, copy, modify, merge, publish, distribute, and/or sell
00010 copies of the Software, and to permit persons to whom the Software is
00011 furnished to do so, subject to the following conditions:
00012 
00013 The above copyright notice and this permission notice shall be included in
00014 all copies or substantial portions of the Software.
00015 
00016 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
00019 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
00020 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00021 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00022 */
00023 
00024 #include <dcopclient.h>
00025 #include <tdecmdlineargs.h>
00026 #include <tdelocale.h>
00027 #include <tdeapplication.h>
00028 
00029 static const char description[] =
00030     I18N_NOOP("HTTP Cookie Daemon");
00031 
00032 static const char version[] = "1.0";
00033 
00034 static const TDECmdLineOptions options[] =
00035 {
00036  { "shutdown", I18N_NOOP("Shut down cookie jar"), 0 },
00037  { "remove <domain>", I18N_NOOP("Remove cookies for domain"), 0 },
00038  { "remove-all", I18N_NOOP("Remove all cookies"), 0 },
00039  { "reload-config", I18N_NOOP("Reload configuration file"), 0 },
00040  TDECmdLineLastOption
00041 };
00042 
00043 extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
00044 {
00045    TDELocale::setMainCatalogue("tdelibs");
00046    TDECmdLineArgs::init(argc, argv, "kcookiejar", I18N_NOOP("HTTP cookie daemon"),
00047               description, version);
00048 
00049    TDECmdLineArgs::addCmdLineOptions( options );
00050 
00051    TDEInstance a("kcookiejar");
00052    
00053    kapp->dcopClient()->attach();
00054 
00055    TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
00056    TQCString replyType;
00057    TQByteArray replyData;
00058    if (args->isSet("remove-all"))
00059    {
00060       kapp->dcopClient()->call( "kded", "kcookiejar", "deleteAllCookies()", TQByteArray(), replyType, replyData);
00061    }
00062    if (args->isSet("remove"))
00063    {
00064       TQString domain = args->getOption("remove");
00065       TQByteArray params;
00066       TQDataStream stream(params, IO_WriteOnly);
00067       stream << domain;
00068       kapp->dcopClient()->call( "kded", "kcookiejar", "deleteCookiesFromDomain(TQString)", params, replyType, replyData);
00069    }
00070    if (args->isSet("shutdown"))
00071    {
00072       TQCString module = "kcookiejar";
00073       TQByteArray params;
00074       TQDataStream stream(params, IO_WriteOnly);
00075       stream << module;
00076       kapp->dcopClient()->call( "kded", "kded", "unloadModule(TQCString)", params, replyType, replyData);
00077    }
00078    else if(args->isSet("reload-config"))
00079    {
00080       kapp->dcopClient()->call( "kded", "kcookiejar", "reloadPolicy()", TQByteArray(), replyType, replyData);
00081    }
00082    else
00083    {
00084       TQCString module = "kcookiejar";
00085       TQByteArray params;
00086       TQDataStream stream(params, IO_WriteOnly);
00087       stream << module;
00088       kapp->dcopClient()->call( "kded", "kded", "loadModule(TQCString)", params, replyType, replyData);
00089    }
00090 
00091    return 0;
00092 }

tdeioslave/http

Skip menu "tdeioslave/http"
  • Main Page
  • Alphabetical List
  • Class List
  • File List

tdeioslave/http

Skip menu "tdeioslave/http"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeioslave/http by doxygen 1.7.1
This website is maintained by Timothy Pearson.