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

tdeioslave/http

  • tdeioslave
  • http
  • kcookiejar
main.cpp
1 /*
2 This file is part of KDE
3 
4  Copyright (C) 1998-2000 Waldo Bastian (bastian@kde.org)
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 */
23 
24 #include <dcopclient.h>
25 #include <tdecmdlineargs.h>
26 #include <tdelocale.h>
27 #include <tdeapplication.h>
28 
29 static const char description[] =
30  I18N_NOOP("HTTP Cookie Daemon");
31 
32 static const char version[] = "1.0";
33 
34 static const TDECmdLineOptions options[] =
35 {
36  { "shutdown", I18N_NOOP("Shut down cookie jar"), 0 },
37  { "remove <domain>", I18N_NOOP("Remove cookies for domain"), 0 },
38  { "remove-all", I18N_NOOP("Remove all cookies"), 0 },
39  { "reload-config", I18N_NOOP("Reload configuration file"), 0 },
40  TDECmdLineLastOption
41 };
42 
43 extern "C" KDE_EXPORT int kdemain(int argc, char *argv[])
44 {
45  TDELocale::setMainCatalogue("tdelibs");
46  TDECmdLineArgs::init(argc, argv, "kcookiejar", I18N_NOOP("HTTP cookie daemon"),
47  description, version);
48 
49  TDECmdLineArgs::addCmdLineOptions( options );
50 
51  TDEInstance a("kcookiejar");
52 
53  kapp->dcopClient()->attach();
54 
55  TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs();
56  TQCString replyType;
57  TQByteArray replyData;
58  if (args->isSet("remove-all"))
59  {
60  kapp->dcopClient()->call( "kded", "kcookiejar", "deleteAllCookies()", TQByteArray(), replyType, replyData);
61  }
62  if (args->isSet("remove"))
63  {
64  TQString domain = args->getOption("remove");
65  TQByteArray params;
66  TQDataStream stream(params, IO_WriteOnly);
67  stream << domain;
68  kapp->dcopClient()->call( "kded", "kcookiejar", "deleteCookiesFromDomain(TQString)", params, replyType, replyData);
69  }
70  if (args->isSet("shutdown"))
71  {
72  TQCString module = "kcookiejar";
73  TQByteArray params;
74  TQDataStream stream(params, IO_WriteOnly);
75  stream << module;
76  kapp->dcopClient()->call( "kded", "kded", "unloadModule(TQCString)", params, replyType, replyData);
77  }
78  else if(args->isSet("reload-config"))
79  {
80  kapp->dcopClient()->call( "kded", "kcookiejar", "reloadPolicy()", TQByteArray(), replyType, replyData);
81  }
82  else
83  {
84  TQCString module = "kcookiejar";
85  TQByteArray params;
86  TQDataStream stream(params, IO_WriteOnly);
87  stream << module;
88  kapp->dcopClient()->call( "kded", "kded", "loadModule(TQCString)", params, replyType, replyData);
89  }
90 
91  return 0;
92 }

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
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeioslave/http by doxygen 1.8.8
This website is maintained by Timothy Pearson.