• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • arts
 

arts

  • arts
  • kde
kiotest.cc
1 #include <stdio.h>
2 #include <kmedia2.h>
3 #include <kcmdlineargs.h>
4 #include <connect.h>
5 #include <klocale.h>
6 #include <kapplication.h>
7 #include <kaboutdata.h>
8 #include "qiomanager.h"
9 #include "artskde.h"
10 
11 using namespace std;
12 using namespace Arts;
13 
14 
15 static KCmdLineOptions options[] =
16 {
17  { "+[URL]", I18N_NOOP("URL to open"), 0 },
18  KCmdLineLastOption
19 };
20 
21 int main(int argc, char **argv)
22 {
23  KAboutData aboutData( "kiotest", I18N_NOOP("KIOTest"), I18N_NOOP("0.1"), "", KAboutData::License_GPL, "");
24 
25  KCmdLineArgs::init(argc,argv,&aboutData);
26  KCmdLineArgs::addCmdLineOptions(options);
27  KApplication app;
28  QIOManager qiomanager;
29  Dispatcher dispatcher(&qiomanager);
30  KIOInputStream stream;
31  StdoutWriter writer;
32 
33  KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
34 
35  if(args->count())
36  {
37  if(!stream.openURL(args->arg(0)))
38  {
39  printf("can't open url");
40  exit(1);
41  }
42  }
43  else
44  exit(1);
45 
46  args->clear();
47 
48  connect(stream, writer);
49 
50  writer.start();
51  stream.start();
52 
53  app.exec();
54 }
KApplication
KCmdLineArgs::arg
const char * arg(int n) const
KCmdLineArgs
KCmdLineArgs::parsedArgs
static KCmdLineArgs * parsedArgs(const char *id=0)
std
klocale.h
KCmdLineOptions
I18N_NOOP
#define I18N_NOOP(x)
Arts
Definition: kartsdispatcher.h:29
KAboutData
KCmdLineArgs::count
int count() const
KCmdLineArgs::init
static void init(int _argc, char **_argv, const char *_appname, const char *programName, const char *_description, const char *_version, bool noKApp=false)
KCmdLineArgs::addCmdLineOptions
static void addCmdLineOptions(const KCmdLineOptions *options, const char *name=0, const char *id=0, const char *afterId=0)
KCmdLineArgs::clear
void clear()

arts

Skip menu "arts"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

arts

Skip menu "arts"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for arts by doxygen 1.8.13
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |