~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to languages/cpp/app_templates/opienet/simplemodule.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2010-05-05 07:21:55 UTC
  • mfrom: (1.2.3 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100505072155-h78lx19pu04sbhtn
Tags: 4:4.0.0-2
* Upload to unstable (Closes: #579947, #481832).
* Acknowledge obsolete NMU fixes (Closes: #562410, #546961).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <qwidget.h>
2
 
 
3
 
#include <interfaces/interfaceinformationimp.h>
4
 
 
5
 
#include "%{APPNAMELC}iface.h"
6
 
#include "%{APPNAMELC}module.h"
7
 
 
8
 
%{APPNAME}Module::%{APPNAME}Module() {
9
 
    Interface* iface = new %{APPNAME}Interface( 0 );
10
 
    iface->setHardwareName( "vpn" );
11
 
    iface->setInterfaceName( "Test VPN" );
12
 
    m_interfaces.append( iface );
13
 
 
14
 
//  If we set up VPN via pptp
15
 
//  and networksettins was closed and now opened
16
 
//  we need to hide the ppp device behind us
17
 
//  One can do  this by calling setHandledInterfaceNames
18
 
//    setHandledInterfaceNames();
19
 
}
20
 
 
21
 
%{APPNAME}Module::~%{APPNAME}Module() {
22
 
    m_interfaces.setAutoDelete( true );
23
 
    m_interfaces.clear();
24
 
}
25
 
 
26
 
 
27
 
/*
28
 
 * We're a VPN module
29
 
 */
30
 
bool %{APPNAME}Module::isOwner(  Interface* iface ) {
31
 
 /* check if it is our device */
32
 
    return  m_interfaces.find(  iface ) != -1;
33
 
}
34
 
 
35
 
QWidget*  %{APPNAME}Module::configure( Interface* ) {
36
 
/* We don't have any Config for now */
37
 
    return 0l;
38
 
}
39
 
 
40
 
QWidget* %{APPNAME}Module::information(  Interface* iface ) {
41
 
    return  new InterfaceInformationImp(0, "Interface info", iface );
42
 
}
43
 
 
44
 
QList<Interface> %{APPNAME}Module::getInterfaces() {
45
 
    return m_interfaces;
46
 
}
47
 
 
48
 
void %{APPNAME}Module::possibleNewInterfaces( QMap<QString, QString>& map) {
49
 
    map.insert( QObject::tr("VPN PPTP"),
50
 
                QObject::tr("Add new Point to Point Tunnel Protocol connection" ) );
51
 
}
52
 
 
53
 
 
54
 
Interface* %{APPNAME}Module::addNewInterface( const QString& ) {
55
 
 /* check the str if we support more interfaces */
56
 
/*
57
 
    Interface* iface = new %{APPNAME}Interface( 0 );
58
 
    iface->setModuleOwner( this );
59
 
    return iface;*/
60
 
 
61
 
// if we would support saving interfaces we could add
62
 
// them here
63
 
 
64
 
    return 0;
65
 
}
66
 
 
67
 
 
68
 
bool %{APPNAME}Module::remove( Interface* ) {
69
 
/* we do not support removing our interface */
70
 
    return false;
71
 
}