Inheritance: KParts.ReadOnlyPart, IDisposable
Exemplo n.º 1
0
Arquivo: p5.cs Projeto: KDE/kimono
    public MainWindow(string name)
        : base((QWidget) null)
    {
        ObjectName = name;
        SetCaption("KDE Tutorial - p5");

        QMenu filemenu = new QMenu(KDE.I18n("&File"), this);
        filemenu.AddAction(KDE.I18n("&Quit"), KApplication.kApplication(), SLOT("quit()"));

        string about = KDE.I18n("p5 1.0\n\n" +
                 "(C) 1999-2002 Antonio Larrosa Jimenez\n" +
                 "[email protected]\t\[email protected]\n" +
                 "Malaga (Spain)\n\n" +
                 "Simple KDE Tutorial\n" +
                 "This tutorial comes with ABSOLUTELY NO WARRANTY\n" +
                 "This is free software, and you are welcome to redistribute it\n" +
                 "under certain conditions\n");
        QMenu helpmenu = HelpMenu(about);

        KMenuBar menu = MenuBar();
        menu.AddMenu(filemenu);
        menu.AddSeparator();
        menu.AddMenu(helpmenu);

        location = new QLineEdit();
        location.Text = "http://localhost";

        Connect( location , SIGNAL("returnPressed()"),
                    this, SLOT("changeLocation()") );

        QSplitter split = new QSplitter();
        split.OpaqueResize = true;

        QWidget widget = new QWidget(this);

        QVBoxLayout vbox = new QVBoxLayout(widget);
        vbox.AddWidget(location);
        vbox.AddWidget(split);

        QPushButton bookmark = new QPushButton(KDE.I18n("Add to Bookmarks"), split);

        Connect(bookmark, SIGNAL("clicked()"), this, SLOT("BookLocation()"));

        browser = new KHTMLPart(split);
        browser.OpenUrl(new KUrl(location.Text));

        Connect( browser.BrowserExtension(),
                 SIGNAL("openUrlRequest(KUrl, KParts::OpenUrlArguments)"),
                 this, SLOT("OpenUrlRequest(KUrl, KParts::OpenUrlArguments)") );

        SetCentralWidget(widget);
    }
Exemplo n.º 2
0
Arquivo: p9.cs Projeto: KDE/kimono
    public Browser(string name)
        : base((QWidget) null)
    {
        ObjectName = name;
        SetCaption("KDE Tutorial - p9");

        QMenu filemenu = new QMenu(KDE.I18n("&File"), this);

        KAction setDefaultPageAction = new KAction(this);
        setDefaultPageAction.Text = KDE.I18n("&Set default page");
        ActionCollection().AddAction("set_default_page", setDefaultPageAction);
        Connect(	setDefaultPageAction, SIGNAL("triggered(bool)"),
                    this, SLOT("FileSetDefaultPage()") );

        addBookmarkAction = KStandardAction.AddBookmark(this, SLOT("BookLocation()"), ActionCollection());
        backAction = KStandardAction.Back(this, SLOT("GotoPreviousPage()"), ActionCollection());
        backAction.Enabled = false;
        quitAction = KStandardAction.Quit(KApplication.kApplication(), SLOT("quit()"), ActionCollection());

        string about = KDE.I18n("p9 1.0\n\n" +
                 "(C) 1999-2002 Antonio Larrosa Jimenez\n" +
                 "[email protected]\t\[email protected]\n" +
                 "Malaga (Spain)\n\n" +
                 "Simple KDE Tutorial\n" +
                 "This tutorial comes with ABSOLUTELY NO WARRANTY\n" +
                 "This is free software, and you are welcome to redistribute it\n" +
                 "under certain conditions\n");
        QMenu helpmenu = HelpMenu(about);

        KMenuBar menu = MenuBar();
        menu.AddMenu(filemenu);
        menu.AddSeparator();
        menu.AddMenu(helpmenu);

        ToolBar().AddAction(quitAction);
        ToolBar().AddAction(addBookmarkAction);
        ToolBar().AddAction(backAction);
        StandardToolBarMenuEnabled = true;

        location = new QLineEdit();
        config = new KConfigGroup(KGlobal.Config(), "Settings");
        location.Text = config.ReadEntry("defaultPage", "http://localhost");

        Connect(location, SIGNAL("returnPressed()"), this, SLOT("ChangeLocation()"));

        QSplitter split = new QSplitter();
        split.OpaqueResize = true;

        QWidget widget = new QWidget(this);

        QVBoxLayout vbox = new QVBoxLayout(widget);
        vbox.AddWidget(location);
        vbox.AddWidget(split);

        browser = new KHTMLPart(split);
        browser.OpenUrl(new KUrl(location.Text));

        Connect( browser.BrowserExtension(),
                 SIGNAL("openUrlRequest(KUrl, KParts::OpenUrlArguments)"),
                 this, SLOT("OpenUrlRequest(KUrl, KParts::OpenUrlArguments)") );

        SetCentralWidget(widget);
        SetupGUI();
    }
Exemplo n.º 3
0
 /// <remarks>
 ///  Constructs a new KHTMLPart.
 ///  This constructor is useful if you wish to subclass KHTMLView.
 ///  If the <code>view</code> passed  as first argument to the constructor was built with a
 ///  null KHTMLPart pointer, then the newly created KHTMLPart will be assigned as the view's part.
 ///  Therefore, you might either initialize the view as part of the initialization list of
 ///  your derived KHTMLPart class constructor:
 ///  <pre>
 ///    MyKHTMLPart(), ...
 ///  </pre>
 ///  Or separately build the KHTMLView beforehand:
 ///  <pre>
 ///    KHTMLView  v = KHTMLView( null, parentWidget());
 ///    KHTMLPart  p = KHTMLPart( v ); // p will be assigned to v, so that v.Part() == p
 ///  </pre>
 ///    </remarks>		<short>    Constructs a new KHTMLPart.</short>
 public KHTMLPart(KHTMLView view, QObject parent, KHTMLPart.GUIProfile prof)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KHTMLPart##$", "KHTMLPart(KHTMLView*, QObject*, KHTMLPart::GUIProfile)", typeof(void), typeof(KHTMLView), view, typeof(QObject), parent, typeof(KHTMLPart.GUIProfile), prof);
 }
Exemplo n.º 4
0
 /// <remarks>
 ///  Shows or hides the suppressed popup indicator
 ///    </remarks>		<short>    Shows or hides the suppressed popup indicator    </short>
 public void SetSuppressedPopupIndicator(bool enable, KHTMLPart originPart)
 {
     interceptor.Invoke("setSuppressedPopupIndicator$#", "setSuppressedPopupIndicator(bool, KHTMLPart*)", typeof(void), typeof(bool), enable, typeof(KHTMLPart), originPart);
 }
Exemplo n.º 5
0
 /// <remarks>
 ///  Determine if signal should be emitted before, instead or never when a
 ///  submitForm() happens.
 ///  ### KDE5 remove me
 ///    </remarks>		<short>    Determine if signal should be emitted before, instead or never when a  submitForm() happens.</short>
 public void SetFormNotification(KHTMLPart.FormNotification fn)
 {
     interceptor.Invoke("setFormNotification$", "setFormNotification(KHTMLPart::FormNotification)", typeof(void), typeof(KHTMLPart.FormNotification), fn);
 }
Exemplo n.º 6
0
 /// <remarks>
 ///  Sets the caret display policy when the view is not focused.
 ///  Whenever the caret is in use, this property determines how the
 ///  caret should be displayed when the document view is not focused.
 ///  The default policy is CaretInvisible.
 /// <param> name="policy" new display policy
 ///    </param></remarks>		<short>    Sets the caret display policy when the view is not focused.</short>
 public void SetCaretDisplayPolicyNonFocused(KHTMLPart.CaretDisplayPolicy policy)
 {
     interceptor.Invoke("setCaretDisplayPolicyNonFocused$", "setCaretDisplayPolicyNonFocused(KHTMLPart::CaretDisplayPolicy)", typeof(void), typeof(KHTMLPart.CaretDisplayPolicy), policy);
 }
Exemplo n.º 7
0
 /// <remarks>
 ///  Constructs a KHTMLView.
 ///      </remarks>		<short>    Constructs a KHTMLView.</short>
 public KHTMLView(KHTMLPart part, QWidget parent)
     : this((Type) null)
 {
     CreateProxy();
     interceptor.Invoke("KHTMLView##", "KHTMLView(KHTMLPart*, QWidget*)", typeof(void), typeof(KHTMLPart), part, typeof(QWidget), parent);
 }