Mozilla

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Does xpcom can fire an event??

    8 answers - 587 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    huazilin wrote:
    I happened a difficult question.I have created a xpcom with the vc.The
    xpcom must fire an event to notify some status has been changed .Then
    the webpage can make some decisionBut how to fire an event ,just like
    activex have a fireevent mechanism.
    Can some one help me ?
    Thank you very much!
    What type of event are you talking about? DM Events to a web page?
    PL_Events? Please give some example of what you're trying to do.
    / Jonas
    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.1 | | 714 bytes | |

    Jonas Sicking

    What type of event are you talking about? DM Events to a web page?
    PL_Events? Please give some example of what you're trying to do.

    / Jonas

    First, Thanks your reply!
    Not DM Events.In the C++ XPCom ,I have defined some status,just
    like something has begined ,the status is 1,something is busy,then the
    status is 2,.When the status has changed,I want to notify the
    HTML or let javascript code check the changes immediately,then the
    webpage can make some changes along with it.
    What should I do,and how?Can you give me some example? Thank you
    very much!

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.2 | | 847 bytes | |

    Not DM Events.In the C++ XPCom ,I have defined some status,just
    like something has begined ,the status is 1,something is busy,then the
    status is 2,.When the status has changed,I want to notify the
    HTML or let javascript code check the changes immediately,then the
    webpage can make some changes along with it.

    If you want to notify a web page that something has change then it
    sounds like DM events is what you want to use. The issue is just how to
    get hold of the web page that you want to notify of the change. do
    you want to notify all pages that the user currently has open?

    How are you using xpcom? Are you embedding gecko in your product, or are
    you writing some sort of extension to firefox?

    / Jonas

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.3 | | 650 bytes | |

    But, Can I define event by myself? How to define?All the DM event
    types which I have known don't meet my request.
    And I also don't know how to fire an user defined event in the c++
    xpcom.

    The xpcom I have implemented is a webcall component ,which now can
    work,it can make call to somebody.But If the other side is busy now ,
    then I need to konw.My xpcom can receive the message the other side is
    busy . But How do I notify to the web page which used the xpcom?

    In other words , I write a plugin for the firefox.

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.4 | | 622 bytes | |

    huazilin wrote:
    But, Can I define event by myself? How to define?All the DM event
    types which I have known don't meet my request.
    And I also don't know how to fire an user defined event in the c++
    xpcom.

    You can define your own events easily. Just do something like
    evt = document.createEvent("Event");
    evt.initEvent("serviceFailed", true, true);
    document.dispatchEvent(evt);

    (the above is written in javascript, but the exact same methods are
    available in C++).

    / Jonas

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.5 | | 290 bytes | |

    Jonas Sicking wrote:
    You can define your own events easily. Just do something like
    You could even define your own event class. For example, XMLHttpRequest
    does that:
    #2028
    or
    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.6 | | 355 bytes | |

    Maybe My English is so poor ,then I havn't express clearly!
    If you have write some xpcom based gecko-sdk in c++, and you can send
    me a demo implemented the event mechanism,I am appreciate you very
    much.I have spended so much time on this thing.

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.7 | | 1738 bytes | |

    Thank you for your kindness.But your advice can't help ,May be I can't
    understand what you say.

    I have write a xpcom,but the xpcom is based on the win32 api and C
    All the thing havn't been down in the bottom model.Now I want to use
    the xpcom in the firefox.Now the xpcom can work,but I can't let my
    xpcom fire the event.That means I don't have event mechanism.

    The test code is following:(js)

    var cookie_value=0;
    var statuschanged=false;

    function change()
    {

    ("UniversalXPConnect");
    ();
    if(statuschanged)
    {
    ();
    alert(cookie_value);

    }

    }

    function DoInit() {
    try {

    ("UniversalXPConnect");
    const cid = "@contactID;1";

    SipWebCall = Components.classes[cid].createInstance();

    SipWebCall =
    SipWebCall.QueryInterface();

    } catch (err) {
    alert(err);
    return;
    }
    SipWebCall.SetProxyServer('admin.com');
    SipWebCall.SetUserId('num','password');
    window.setInterval(change,1000);

    }
    function MyComponentTestGo()
    {

    ("UniversalXPConnect");

    SipWebCall.MakeCallTo('num','licence');

    }

    function HandUp()
    {

    ("UniversalXPConnect");

    SipWebCall.DropCall();
    }

    //Note: When my xpcom register , makecallto or dropcall,all the actions
    with return some status.
    //That means the "cookie_value" is changed when something has happened.
    //Now I check the status one time per 1s,What I want to do is when the
    status is changed .It can notify me but not let me to check it.

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org
  • No.8 | | 499 bytes | |

    huazilin wrote:
    But, Can I define event by myself? How to define?All the DM event
    types which I have known don't meet my request.
    And I also don't know how to fire an user defined event in the c++
    xpcom.

    Since your webpage seemingly has XPConnect privileges, maybe it can
    register itself as an observer via nsIService, then you can use
    it to broadcast various topics.

    dev-tech-xpcom mailing list
    dev-tech-xpcom (AT) lists (DOT) mozilla.org

Re: Does xpcom can fire an event??


max 4000 letters.
Your nickname that display:
In order to stop the spam: 9 + 8 =
QUESTION ON "Mozilla"

EMSDN.COM