Although the feat Robilar's Gambit does say, "Anyone who strikes at you gains a +4 bonus on attack rolls and damage rolls against you," the feat's benefit ends with this sentence:
Resolve your attack of opportunity after your foe's attack (Player's Handbook II 82).
So in this case strikes at means attacks. Of course some controversy surrounds what an attack actually is,1 but an attack probably at least includes anything requiring an attack roll:
An attack roll represents your attempt to strike your opponent on your turn in a round. When you make an attack roll, you roll a d20 and add your attack bonus. (Other modifiers may also apply to this roll.) If your result equals or beats the target’s Armor Class, you hit and deal damage. (Player's Handbook 134)
This means, in addition to normal melee attacks, special attacks requiring attack rolls will be subject to the benefit of the feat Robilar's Gambit.2 Exactly when during a trip attempt or grapple attempt a defender's entitled to this attack of opportunity is up to the DM, however.
For instance, the DM may rule that a defender that employs the feat Robilar's Gambit makes an attack of opportunity against his foe's trip attempt after learning whether the foe's initial touch attack is a hit or a miss or the DM may rule that the defender makes that attack of opportunity after the opposed check to determine if the trip succeeds or fails.
Likewise, for instance, with a grapple—which is unclear as to how thoroughly it can be resolved—, I can imagine a DM initially allowing a defender that employs the feat Robilar's Gambit to make the granted attack of opportunity at the end of Step 2: Grab, and, later, the same DM, now frustrated by his monsters' too-quick deaths, ruling that the defender's attack of opportunity comes at the end of Step 3: Hold (which may render making the attack of opportunity impossible).
The feat Robilar's Gambit does extend to ranged attacks made against the creature possessing the feat. That is, foes making ranged attacks gain the +4 bonus on their attacks rolls (even though they may not be swinging) when the defender's employing the benefit of Robilar's Gambit, but unless such foes are also in squares the defender's threatens, this won't matter to the defender. However, if such a foe is foolish enough to make a ranged attack within the defender's threatened area while the defender employs the feat Robilar's Gambit, the typical foe provokes one attack of opportunity from the defender for making that ranged attack and provokes a second upon that ranged attack's resolution.
1 For example, the 2nd-level Sor/Wiz spell invisibility [illus] (PH 245) says it "ends if the subject attacks any creature" but most agree casting the 1st-level Sor/Wiz spell magic missile [evoc] (PH 251) at a foe ends the spell despite that spell not requiring an attack roll. However, the quickest controversy I found asked if counterspelling was attack enough to end invisibility, which is even weirder.
2 A generous DM may allow all special attacks to be subject to the benefit of Robilar's Gambit. The section is called, after all, Special Attacks.